Don't log EOF as error in HTTP/2
EOF occurs when HTTP/2 clients close connection after completing
requests (e.g., curl). This is normal for multiplexed connections. EOF
indicates graceful shutdown, not an error condition.
Change-Id: I3291b23c7784a2273f2de05afc71ddb57dd0c28a
Signed-off-by: Amy Chang <yahanc@nvidia.com>
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/http/http2_connection.hpp b/http/http2_connection.hpp
index 7b90ff3..65265e1 100644
--- a/http/http2_connection.hpp
+++ b/http/http2_connection.hpp
@@ -630,8 +630,13 @@
if (ec)
{
- BMCWEB_LOG_ERROR("{} Error while reading: {}", logPtr(this),
- ec.message());
+ // EOF is normal when client closes HTTP/2 connection
+ // Only log non-EOF errors
+ if (ec != boost::asio::error::eof)
+ {
+ BMCWEB_LOG_ERROR("{} Error while reading: {}", logPtr(this),
+ ec.message());
+ }
close();
BMCWEB_LOG_DEBUG("{} from read(1)", logPtr(this));
return;