From 894783f57295aeeaece6fb8cb05fadc344aacadc Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 10 Aug 2014 00:18:41 +0900 Subject: [PATCH] Add note how to specify error code on NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE --- lib/includes/nghttp2/nghttp2.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h index abf76527..0031789b 100644 --- a/lib/includes/nghttp2/nghttp2.h +++ b/lib/includes/nghttp2/nghttp2.h @@ -660,9 +660,12 @@ typedef enum { * to outgoing queue, call `nghttp2_session_resume_data()`. In case * of error, there are 2 choices. Returning * :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` will close the stream - * by issuing RST_STREAM with :enum:`NGHTTP2_INTERNAL_ERROR`. - * Returning :enum:`NGHTTP2_ERR_CALLBACK_FAILURE` will signal the - * entire session failure. + * by issuing RST_STREAM with :enum:`NGHTTP2_INTERNAL_ERROR`. If a + * different error code is desirable, use + * `nghttp2_submit_rst_stream()` with a desired error code and then + * return :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. Returning + * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE` will signal the entire session + * failure. */ typedef ssize_t (*nghttp2_data_source_read_callback) (nghttp2_session *session, int32_t stream_id, @@ -1356,7 +1359,10 @@ typedef int (*nghttp2_on_begin_headers_callback) * Returning :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` will close * the stream by issuing RST_STREAM with * :enum:`NGHTTP2_INTERNAL_ERROR`. In this case, - * :type:`nghttp2_on_frame_recv_callback` will not be invoked. + * :type:`nghttp2_on_frame_recv_callback` will not be invoked. If a + * different error code is desirable, use + * `nghttp2_submit_rst_stream()` with a desired error code and then + * return :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. * * The implementation of this function must return 0 if it succeeds. * It may return :enum:`NGHTTP2_ERR_PAUSE` or