Skip to content

Commit

Permalink
Dont log error in case of eof error for async_read
Browse files Browse the repository at this point in the history
async_read returns eof to indicate that the other side has closed the socket.
This is a way for other side to know that socket should be closed now. There
is no need to log since it is not an error condition
Closes-Bug: 1506795

Change-Id: Iee04f8ff2ac99cf66275b1f3bc58c749ed344021
(cherry picked from commit 7be4ae5)
  • Loading branch information
bansalnikhil authored and eonpatapon committed Apr 6, 2016
1 parent 8829dd0 commit 78a8ef3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/io/tcp_session.cc
Expand Up @@ -429,7 +429,7 @@ void TcpSession::AsyncReadHandler(
if (IsSocketErrorHard(error)) {
session->ReleaseBufferLocked(buffer);
// eof is returned when the peer closed the socket, no need to log err
if (error != error::eof) {
if (error != boost::asio::error::eof) {
TCP_SESSION_LOG_ERROR(session, TCP_DIR_IN,
"Read failed due to error " << error.value()
<< " : " << error.message());
Expand All @@ -445,7 +445,7 @@ void TcpSession::AsyncReadHandler(
if (IsSocketErrorHard(err)) {
session->ReleaseBufferLocked(buffer);
// eof is returned when the peer has closed the socket
if (error != error::eof) {
if (err != boost::asio::error::eof) {
TCP_SESSION_LOG_ERROR(session, TCP_DIR_IN,
"Read failed due to error " << err.value()
<< " : " << err.message());
Expand Down

0 comments on commit 78a8ef3

Please sign in to comment.