From 7be4ae50f70e58dd90c7a43dbcc433f54cd180ac Mon Sep 17 00:00:00 2001 From: Nikhil B Date: Fri, 12 Feb 2016 15:10:01 +0530 Subject: [PATCH] Dont log error in case of eof error for async_read 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 --- src/io/tcp_session.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/io/tcp_session.cc b/src/io/tcp_session.cc index bfaec7b0e6c..925092a800c 100644 --- a/src/io/tcp_session.cc +++ b/src/io/tcp_session.cc @@ -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()); @@ -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());