提交 8986f1b9 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Fix missing brackets

上级 4cd365ec
...@@ -380,16 +380,10 @@ void TcpConnection::onUvWriteError(int error) ...@@ -380,16 +380,10 @@ void TcpConnection::onUvWriteError(int error)
if (this->isClosing) if (this->isClosing)
return; return;
if (error == UV_EPIPE || error == UV_ENOTCONN) if (error != UV_EPIPE && error != UV_ENOTCONN)
{
MS_WARN_DEV("write error, closing the connection: %s", uv_strerror(error));
}
else
{
MS_WARN_DEV("write error, closing the connection: %s", uv_strerror(error));
this->hasError = true; this->hasError = true;
}
MS_WARN_DEV("write error, closing the connection: %s", uv_strerror(error));
Close(); Close();
} }
...@@ -402,9 +396,13 @@ void TcpConnection::onUvShutdown(uv_shutdown_t* req, int status) ...@@ -402,9 +396,13 @@ void TcpConnection::onUvShutdown(uv_shutdown_t* req, int status)
delete req; delete req;
if (status == UV_EPIPE || status == UV_ENOTCONN || status == UV_ECANCELED) if (status == UV_EPIPE || status == UV_ENOTCONN || status == UV_ECANCELED)
{
MS_WARN_DEV("shutdown error: %s", uv_strerror(status)); MS_WARN_DEV("shutdown error: %s", uv_strerror(status));
}
else if (status) else if (status)
{
MS_WARN_DEV("shutdown error: %s", uv_strerror(status)); MS_WARN_DEV("shutdown error: %s", uv_strerror(status));
}
// Now do close the handle. // Now do close the handle.
uv_close((uv_handle_t*)this->uvHandle, (uv_close_cb)on_close); uv_close((uv_handle_t*)this->uvHandle, (uv_close_cb)on_close);
......
...@@ -173,6 +173,7 @@ void UnixStreamSocket::Write(const uint8_t* data, size_t len) ...@@ -173,6 +173,7 @@ void UnixStreamSocket::Write(const uint8_t* data, size_t len)
else if (written < 0) else if (written < 0)
{ {
MS_ERROR_STD("uv_try_write() failed, closing the socket: %s", uv_strerror(written)); MS_ERROR_STD("uv_try_write() failed, closing the socket: %s", uv_strerror(written));
Close(); Close();
return; return;
} }
...@@ -262,16 +263,10 @@ void UnixStreamSocket::onUvWriteError(int error) ...@@ -262,16 +263,10 @@ void UnixStreamSocket::onUvWriteError(int error)
if (this->isClosing) if (this->isClosing)
return; return;
if (error == UV_EPIPE || error == UV_ENOTCONN) if (error != UV_EPIPE && error != UV_ENOTCONN)
{
MS_ERROR_STD("write error, closing the pipe: %s", uv_strerror(error));
}
else
{
MS_ERROR_STD("write error, closing the pipe: %s", uv_strerror(error));
this->hasError = true; this->hasError = true;
}
MS_ERROR_STD("write error, closing the pipe: %s", uv_strerror(error));
Close(); Close();
} }
...@@ -284,9 +279,13 @@ void UnixStreamSocket::onUvShutdown(uv_shutdown_t* req, int status) ...@@ -284,9 +279,13 @@ void UnixStreamSocket::onUvShutdown(uv_shutdown_t* req, int status)
delete req; delete req;
if (status == UV_EPIPE || status == UV_ENOTCONN || status == UV_ECANCELED) if (status == UV_EPIPE || status == UV_ENOTCONN || status == UV_ECANCELED)
{
MS_ERROR_STD("shutdown error: %s", uv_strerror(status)); MS_ERROR_STD("shutdown error: %s", uv_strerror(status));
}
else if (status) else if (status)
{
MS_ERROR_STD("shutdown error: %s", uv_strerror(status)); MS_ERROR_STD("shutdown error: %s", uv_strerror(status));
}
// Now do close the handle. // Now do close the handle.
uv_close((uv_handle_t*)this->uvHandle, (uv_close_cb)on_close); uv_close((uv_handle_t*)this->uvHandle, (uv_close_cb)on_close);
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论