nghttpx: Log error in INFO level when frame cannot be sent

This commit is contained in:
Tatsuhiro Tsujikawa 2015-01-21 22:49:00 +09:00
parent f302f1a830
commit 41e72064e0
3 changed files with 17 additions and 11 deletions

View File

@ -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<Http2Session *>(user_data);
SSLOG(WARN, http2session) << "Failed to send control frame type="
<< static_cast<uint32_t>(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<uint32_t>(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

View File

@ -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<Http2Upstream *>(user_data);
ULOG(WARN, upstream) << "Failed to send control frame type="
<< static_cast<uint32_t>(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<uint32_t>(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 &&

View File

@ -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<SpdyUpstream *>(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.