nghttpx: Log error in INFO level when frame cannot be sent
This commit is contained in:
parent
f302f1a830
commit
41e72064e0
|
@ -1142,10 +1142,12 @@ int on_frame_not_send_callback(nghttp2_session *session,
|
||||||
const nghttp2_frame *frame, int lib_error_code,
|
const nghttp2_frame *frame, int lib_error_code,
|
||||||
void *user_data) {
|
void *user_data) {
|
||||||
auto http2session = static_cast<Http2Session *>(user_data);
|
auto http2session = static_cast<Http2Session *>(user_data);
|
||||||
SSLOG(WARN, http2session) << "Failed to send control frame type="
|
if (LOG_ENABLED(INFO)) {
|
||||||
<< static_cast<uint32_t>(frame->hd.type)
|
SSLOG(INFO, http2session) << "Failed to send control frame type="
|
||||||
<< "lib_error_code=" << lib_error_code << ":"
|
<< static_cast<uint32_t>(frame->hd.type)
|
||||||
<< nghttp2_strerror(lib_error_code);
|
<< "lib_error_code=" << lib_error_code << ":"
|
||||||
|
<< nghttp2_strerror(lib_error_code);
|
||||||
|
}
|
||||||
if (frame->hd.type == NGHTTP2_HEADERS &&
|
if (frame->hd.type == NGHTTP2_HEADERS &&
|
||||||
frame->headers.cat == NGHTTP2_HCAT_REQUEST) {
|
frame->headers.cat == NGHTTP2_HCAT_REQUEST) {
|
||||||
// To avoid stream hanging around, flag Downstream::MSG_RESET and
|
// To avoid stream hanging around, flag Downstream::MSG_RESET and
|
||||||
|
|
|
@ -553,10 +553,12 @@ int on_frame_not_send_callback(nghttp2_session *session,
|
||||||
const nghttp2_frame *frame, int lib_error_code,
|
const nghttp2_frame *frame, int lib_error_code,
|
||||||
void *user_data) {
|
void *user_data) {
|
||||||
auto upstream = static_cast<Http2Upstream *>(user_data);
|
auto upstream = static_cast<Http2Upstream *>(user_data);
|
||||||
ULOG(WARN, upstream) << "Failed to send control frame type="
|
if (LOG_ENABLED(INFO)) {
|
||||||
<< static_cast<uint32_t>(frame->hd.type)
|
ULOG(INFO, upstream) << "Failed to send control frame type="
|
||||||
<< ", lib_error_code=" << lib_error_code << ":"
|
<< static_cast<uint32_t>(frame->hd.type)
|
||||||
<< nghttp2_strerror(lib_error_code);
|
<< ", lib_error_code=" << lib_error_code << ":"
|
||||||
|
<< nghttp2_strerror(lib_error_code);
|
||||||
|
}
|
||||||
if (frame->hd.type == NGHTTP2_HEADERS &&
|
if (frame->hd.type == NGHTTP2_HEADERS &&
|
||||||
frame->headers.cat == NGHTTP2_HCAT_RESPONSE &&
|
frame->headers.cat == NGHTTP2_HCAT_RESPONSE &&
|
||||||
lib_error_code != NGHTTP2_ERR_STREAM_CLOSED &&
|
lib_error_code != NGHTTP2_ERR_STREAM_CLOSED &&
|
||||||
|
|
|
@ -343,9 +343,11 @@ void on_ctrl_not_send_callback(spdylay_session *session,
|
||||||
spdylay_frame_type type, spdylay_frame *frame,
|
spdylay_frame_type type, spdylay_frame *frame,
|
||||||
int error_code, void *user_data) {
|
int error_code, void *user_data) {
|
||||||
auto upstream = static_cast<SpdyUpstream *>(user_data);
|
auto upstream = static_cast<SpdyUpstream *>(user_data);
|
||||||
ULOG(WARN, upstream) << "Failed to send control frame type=" << type
|
if (LOG_ENABLED(INFO)) {
|
||||||
<< ", error_code=" << error_code << ":"
|
ULOG(INFO, upstream) << "Failed to send control frame type=" << type
|
||||||
<< spdylay_strerror(error_code);
|
<< ", error_code=" << error_code << ":"
|
||||||
|
<< spdylay_strerror(error_code);
|
||||||
|
}
|
||||||
if (type == SPDYLAY_SYN_REPLY && error_code != SPDYLAY_ERR_STREAM_CLOSED &&
|
if (type == SPDYLAY_SYN_REPLY && error_code != SPDYLAY_ERR_STREAM_CLOSED &&
|
||||||
error_code != SPDYLAY_ERR_STREAM_CLOSING) {
|
error_code != SPDYLAY_ERR_STREAM_CLOSING) {
|
||||||
// To avoid stream hanging around, issue RST_STREAM.
|
// To avoid stream hanging around, issue RST_STREAM.
|
||||||
|
|
Loading…
Reference in New Issue