From 194acb1f2c838ba9ed8b75b3348120650491db6a Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 19 Nov 2017 16:47:39 +0900 Subject: [PATCH] src: Use nghttp2_error_callback2 --- src/HttpServer.cc | 4 ++-- src/app_helper.cc | 4 ++-- src/app_helper.h | 4 ++-- src/nghttp.cc | 4 ++-- src/shrpx_http2_upstream.cc | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 1bf2f585..55b3a727 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -1749,8 +1749,8 @@ void fill_callback(nghttp2_session_callbacks *callbacks, const Config *config) { nghttp2_session_callbacks_set_on_invalid_frame_recv_callback( callbacks, verbose_on_invalid_frame_recv_callback); - nghttp2_session_callbacks_set_error_callback(callbacks, - verbose_error_callback); + nghttp2_session_callbacks_set_error_callback2(callbacks, + verbose_error_callback); } nghttp2_session_callbacks_set_on_data_chunk_recv_callback( diff --git a/src/app_helper.cc b/src/app_helper.cc index a736d308..214a46f0 100644 --- a/src/app_helper.cc +++ b/src/app_helper.cc @@ -425,8 +425,8 @@ int verbose_on_data_chunk_recv_callback(nghttp2_session *session, uint8_t flags, return 0; } -int verbose_error_callback(nghttp2_session *session, const char *msg, - size_t len, void *user_data) { +int verbose_error_callback(nghttp2_session *session, int lib_error_code, + const char *msg, size_t len, void *user_data) { print_timer(); fprintf(outfile, " [ERROR] %.*s\n", (int)len, msg); fflush(outfile); diff --git a/src/app_helper.h b/src/app_helper.h index 263bb99c..2e1ef53c 100644 --- a/src/app_helper.h +++ b/src/app_helper.h @@ -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, size_t len, void *user_data); -int verbose_error_callback(nghttp2_session *session, const char *msg, - size_t len, void *user_data); +int verbose_error_callback(nghttp2_session *session, int lib_error_code, + const char *msg, size_t len, void *user_data); // Returns difference between |a| and |b| in milliseconds, assuming // |a| is more recent than |b|. diff --git a/src/nghttp.cc b/src/nghttp.cc index 47fc5127..514454c1 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -2458,8 +2458,8 @@ int run(char **uris, int n) { nghttp2_session_callbacks_set_on_invalid_frame_recv_callback( callbacks, verbose_on_invalid_frame_recv_callback); - nghttp2_session_callbacks_set_error_callback(callbacks, - verbose_error_callback); + nghttp2_session_callbacks_set_error_callback2(callbacks, + verbose_error_callback); } nghttp2_session_callbacks_set_on_data_chunk_recv_callback( diff --git a/src/shrpx_http2_upstream.cc b/src/shrpx_http2_upstream.cc index 78b5a887..9f08a64b 100644 --- a/src/shrpx_http2_upstream.cc +++ b/src/shrpx_http2_upstream.cc @@ -957,8 +957,8 @@ nghttp2_session_callbacks *create_http2_upstream_callbacks() { } if (config->http2.upstream.debug.frame_debug) { - nghttp2_session_callbacks_set_error_callback(callbacks, - verbose_error_callback); + nghttp2_session_callbacks_set_error_callback2(callbacks, + verbose_error_callback); } return callbacks;