From 41e72064e04e7bcb437e810ed01978b66d7de71e Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 21 Jan 2015 22:49:00 +0900 Subject: [PATCH] nghttpx: Log error in INFO level when frame cannot be sent --- src/shrpx_http2_session.cc | 10 ++++++---- src/shrpx_http2_upstream.cc | 10 ++++++---- src/shrpx_spdy_upstream.cc | 8 +++++--- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/shrpx_http2_session.cc b/src/shrpx_http2_session.cc index f35b31fe..2c7f108f 100644 --- a/src/shrpx_http2_session.cc +++ b/src/shrpx_http2_session.cc @@ -1142,10 +1142,12 @@ int on_frame_not_send_callback(nghttp2_session *session, const nghttp2_frame *frame, int lib_error_code, void *user_data) { auto http2session = static_cast(user_data); - SSLOG(WARN, http2session) << "Failed to send control frame type=" - << static_cast(frame->hd.type) - << "lib_error_code=" << lib_error_code << ":" - << nghttp2_strerror(lib_error_code); + if (LOG_ENABLED(INFO)) { + SSLOG(INFO, http2session) << "Failed to send control frame type=" + << static_cast(frame->hd.type) + << "lib_error_code=" << lib_error_code << ":" + << nghttp2_strerror(lib_error_code); + } if (frame->hd.type == NGHTTP2_HEADERS && frame->headers.cat == NGHTTP2_HCAT_REQUEST) { // To avoid stream hanging around, flag Downstream::MSG_RESET and diff --git a/src/shrpx_http2_upstream.cc b/src/shrpx_http2_upstream.cc index f89f502a..ac1d5b61 100644 --- a/src/shrpx_http2_upstream.cc +++ b/src/shrpx_http2_upstream.cc @@ -553,10 +553,12 @@ int on_frame_not_send_callback(nghttp2_session *session, const nghttp2_frame *frame, int lib_error_code, void *user_data) { auto upstream = static_cast(user_data); - ULOG(WARN, upstream) << "Failed to send control frame type=" - << static_cast(frame->hd.type) - << ", lib_error_code=" << lib_error_code << ":" - << nghttp2_strerror(lib_error_code); + if (LOG_ENABLED(INFO)) { + ULOG(INFO, upstream) << "Failed to send control frame type=" + << static_cast(frame->hd.type) + << ", lib_error_code=" << lib_error_code << ":" + << nghttp2_strerror(lib_error_code); + } if (frame->hd.type == NGHTTP2_HEADERS && frame->headers.cat == NGHTTP2_HCAT_RESPONSE && lib_error_code != NGHTTP2_ERR_STREAM_CLOSED && diff --git a/src/shrpx_spdy_upstream.cc b/src/shrpx_spdy_upstream.cc index ccad60d3..bca926e3 100644 --- a/src/shrpx_spdy_upstream.cc +++ b/src/shrpx_spdy_upstream.cc @@ -343,9 +343,11 @@ void on_ctrl_not_send_callback(spdylay_session *session, spdylay_frame_type type, spdylay_frame *frame, int error_code, void *user_data) { auto upstream = static_cast(user_data); - ULOG(WARN, upstream) << "Failed to send control frame type=" << type - << ", error_code=" << error_code << ":" - << spdylay_strerror(error_code); + if (LOG_ENABLED(INFO)) { + ULOG(INFO, upstream) << "Failed to send control frame type=" << type + << ", error_code=" << error_code << ":" + << spdylay_strerror(error_code); + } if (type == SPDYLAY_SYN_REPLY && error_code != SPDYLAY_ERR_STREAM_CLOSED && error_code != SPDYLAY_ERR_STREAM_CLOSING) { // To avoid stream hanging around, issue RST_STREAM.