src: Use nghttp2_error_callback2

This commit is contained in:
Tatsuhiro Tsujikawa 2017-11-19 16:47:39 +09:00
parent 43a2a70ae7
commit 194acb1f2c
5 changed files with 10 additions and 10 deletions

View File

@ -1749,7 +1749,7 @@ void fill_callback(nghttp2_session_callbacks *callbacks, const Config *config) {
nghttp2_session_callbacks_set_on_invalid_frame_recv_callback( nghttp2_session_callbacks_set_on_invalid_frame_recv_callback(
callbacks, verbose_on_invalid_frame_recv_callback); callbacks, verbose_on_invalid_frame_recv_callback);
nghttp2_session_callbacks_set_error_callback(callbacks, nghttp2_session_callbacks_set_error_callback2(callbacks,
verbose_error_callback); verbose_error_callback);
} }

View File

@ -425,8 +425,8 @@ int verbose_on_data_chunk_recv_callback(nghttp2_session *session, uint8_t flags,
return 0; return 0;
} }
int verbose_error_callback(nghttp2_session *session, const char *msg, int verbose_error_callback(nghttp2_session *session, int lib_error_code,
size_t len, void *user_data) { const char *msg, size_t len, void *user_data) {
print_timer(); print_timer();
fprintf(outfile, " [ERROR] %.*s\n", (int)len, msg); fprintf(outfile, " [ERROR] %.*s\n", (int)len, msg);
fflush(outfile); fflush(outfile);

View File

@ -60,8 +60,8 @@ int verbose_on_data_chunk_recv_callback(nghttp2_session *session, uint8_t flags,
int32_t stream_id, const uint8_t *data, int32_t stream_id, const uint8_t *data,
size_t len, void *user_data); size_t len, void *user_data);
int verbose_error_callback(nghttp2_session *session, const char *msg, int verbose_error_callback(nghttp2_session *session, int lib_error_code,
size_t len, void *user_data); const char *msg, size_t len, void *user_data);
// Returns difference between |a| and |b| in milliseconds, assuming // Returns difference between |a| and |b| in milliseconds, assuming
// |a| is more recent than |b|. // |a| is more recent than |b|.

View File

@ -2458,7 +2458,7 @@ int run(char **uris, int n) {
nghttp2_session_callbacks_set_on_invalid_frame_recv_callback( nghttp2_session_callbacks_set_on_invalid_frame_recv_callback(
callbacks, verbose_on_invalid_frame_recv_callback); callbacks, verbose_on_invalid_frame_recv_callback);
nghttp2_session_callbacks_set_error_callback(callbacks, nghttp2_session_callbacks_set_error_callback2(callbacks,
verbose_error_callback); verbose_error_callback);
} }

View File

@ -957,7 +957,7 @@ nghttp2_session_callbacks *create_http2_upstream_callbacks() {
} }
if (config->http2.upstream.debug.frame_debug) { if (config->http2.upstream.debug.frame_debug) {
nghttp2_session_callbacks_set_error_callback(callbacks, nghttp2_session_callbacks_set_error_callback2(callbacks,
verbose_error_callback); verbose_error_callback);
} }