diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2015-07-15 14:16:00 +0200 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2015-07-23 07:46:10 +0000 |
commit | bf3e1179d2f2c089074804f054d55a22dc3b1494 (patch) | |
tree | 4f06ca0afeaac58737ab62ad02ea0f83ed42e23b | |
parent | 4d6ef27b52022868fe368121081dddaa22782314 (diff) |
HTTP2: Update to libnghttp2 1.1.2
Update also the documentation after last change
Change-Id: Ie93e669b07c7a0c2b8febabe92c8503296b36998
Reviewed-on: https://code.wireshark.org/review/9746
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
-rw-r--r-- | epan/nghttp2/README.nghttp2 | 17 | ||||
-rw-r--r-- | epan/nghttp2/nghttp2.h | 66 | ||||
-rw-r--r-- | epan/nghttp2/nghttp2_hd.h | 2 | ||||
-rw-r--r-- | epan/nghttp2/nghttp2_helper.c | 4 | ||||
-rw-r--r-- | epan/nghttp2/nghttp2_helper.h | 2 | ||||
-rw-r--r-- | epan/nghttp2/nghttp2ver.h | 4 |
6 files changed, 63 insertions, 32 deletions
diff --git a/epan/nghttp2/README.nghttp2 b/epan/nghttp2/README.nghttp2 index ae238333dd..6fb82c1a2a 100644 --- a/epan/nghttp2/README.nghttp2 +++ b/epan/nghttp2/README.nghttp2 @@ -29,9 +29,22 @@ find . -name "nghttp2*" -type f -exec sed -i 's/"nghttp2_net.h"/<glib.h>/g' {} Fix c++-compat error and documentation (struct => typedef) error -in nghttp2/nghttp2_helper.h remove check for CONFIG.H - in nghttp2/nghttp2.h Add on the top #include <config.h> + +After +#define NGHTTP2_EXTERN + #endif /* !defined(WIN32) */ + +Add +/* + * When we're building this as part of Wireshark, we want to treat + * all these routines as internal to libwireshark. + */ + +#include "ws_symbol_export.h" + +#undef NGHTTP2_EXTERN +#define NGHTTP2_EXTERN WS_DLL_LOCAL diff --git a/epan/nghttp2/nghttp2.h b/epan/nghttp2/nghttp2.h index 25becb638b..61f2a01c7b 100644 --- a/epan/nghttp2/nghttp2.h +++ b/epan/nghttp2/nghttp2.h @@ -50,17 +50,6 @@ extern "C" { #include "nghttp2ver.h" -/* - * When we're building this as part of Wireshark, we want to treat - * all these routines as internal to libwireshark. - */ -#if 1 -#include "ws_symbol_export.h" - -#define NGHTTP2_EXTERN WS_DLL_LOCAL - -#else - #ifdef NGHTTP2_STATICLIB #define NGHTTP2_EXTERN #elif defined(WIN32) @@ -73,7 +62,16 @@ extern "C" { #define NGHTTP2_EXTERN #endif /* !defined(WIN32) */ -#endif /* 1 */ +/* + * When we're building this as part of Wireshark, we want to treat + * all these routines as internal to libwireshark. + */ + +#include "ws_symbol_export.h" + +#undef NGHTTP2_EXTERN +#define NGHTTP2_EXTERN WS_DLL_LOCAL + /** * @macro @@ -365,8 +363,10 @@ typedef enum { */ NGHTTP2_ERR_PUSH_DISABLED = -528, /** - * DATA frame for a given stream has been already submitted and has - * not been fully processed yet. + * DATA or HEADERS frame for a given stream has been already + * submitted and has not been fully processed yet. Application + * should wait for the transmission of the previously submitted + * frame before submitting another. */ NGHTTP2_ERR_DATA_EXIST = -529, /** @@ -1538,7 +1538,7 @@ typedef int (*nghttp2_on_begin_headers_callback)(nghttp2_session *session, * used, nghttp2 library does perform validation against the |name| * and the |value| using `nghttp2_check_header_name()` and * `nghttp2_check_header_value()`. In addition to this, nghttp2 - * performs vaidation based on HTTP Messaging rule, which is briefly + * performs validation based on HTTP Messaging rule, which is briefly * explained in :ref:`http-messaging` section. * * If the application uses `nghttp2_session_mem_recv()`, it can return @@ -3015,6 +3015,11 @@ NGHTTP2_EXTERN int32_t * Out of memory. * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` * The |stream_id| is 0. + * :enum:`NGHTTP2_ERR_DATA_EXIST` + * DATA or HEADERS has been already submitted and not fully + * processed yet. Normally, this does not happen, but when + * application wrongly calls `nghttp2_submit_response()` twice, + * this may happen. * * .. warning:: * @@ -3124,7 +3129,8 @@ NGHTTP2_EXTERN int nghttp2_submit_trailer(nghttp2_session *session, * * This function is low-level in a sense that the application code can * specify flags directly. For usual HTTP request, - * `nghttp2_submit_request()` is useful. + * `nghttp2_submit_request()` is useful. Likewise, for HTTP response, + * prefer `nghttp2_submit_response()`. * * This function returns newly assigned stream ID if it succeeds and * |stream_id| is -1. Otherwise, this function returns 0 if it @@ -3137,6 +3143,10 @@ NGHTTP2_EXTERN int nghttp2_submit_trailer(nghttp2_session *session, * reached. * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` * The |stream_id| is 0. + * :enum:`NGHTTP2_ERR_DATA_EXIST` + * DATA or HEADERS has been already submitted and not fully + * processed yet. This happens if stream denoted by |stream_id| + * is in reserved state. * * .. warning:: * @@ -3171,7 +3181,8 @@ NGHTTP2_EXTERN int32_t * :enum:`NGHTTP2_ERR_NOMEM` * Out of memory. * :enum:`NGHTTP2_ERR_DATA_EXIST` - * DATA has been already submitted and not fully processed yet. + * DATA or HEADERS has been already submitted and not fully + * processed yet. * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT` * The |stream_id| is 0. * :enum:`NGHTTP2_ERR_STREAM_CLOSED` @@ -3179,14 +3190,19 @@ NGHTTP2_EXTERN int32_t * * .. note:: * - * Currently, only one data is allowed for a stream at a time. - * Submitting data more than once before first data is finished - * results in :enum:`NGHTTP2_ERR_DATA_EXIST` error code. The - * earliest callback which tells that previous data is done is - * :type:`nghttp2_on_frame_send_callback`. In side that callback, - * new data can be submitted using `nghttp2_submit_data()`. Of - * course, all data except for last one must not have - * :enum:`NGHTTP2_FLAG_END_STREAM` flag set in |flags|. + * Currently, only one DATA or HEADERS is allowed for a stream at a + * time. Submitting these frames more than once before first DATA + * or HEADERS is finished results in :enum:`NGHTTP2_ERR_DATA_EXIST` + * error code. The earliest callback which tells that previous + * frame is done is :type:`nghttp2_on_frame_send_callback`. In side + * that callback, new data can be submitted using + * `nghttp2_submit_data()`. Of course, all data except for last one + * must not have :enum:`NGHTTP2_FLAG_END_STREAM` flag set in + * |flags|. This sounds a bit complicated, and we recommend to use + * `nghttp2_submit_request()` and `nghttp2_submit_response()` to + * avoid this cascading issue. The experience shows that for HTTP + * use, these two functions are enough to implement both client and + * server. */ NGHTTP2_EXTERN int nghttp2_submit_data(nghttp2_session *session, uint8_t flags, int32_t stream_id, diff --git a/epan/nghttp2/nghttp2_hd.h b/epan/nghttp2/nghttp2_hd.h index 8e0ac2ea19..07ea8af3ef 100644 --- a/epan/nghttp2/nghttp2_hd.h +++ b/epan/nghttp2/nghttp2_hd.h @@ -356,7 +356,7 @@ int nghttp2_hd_emit_newname_block(nghttp2_bufs *bufs, nghttp2_nv *nv, int nghttp2_hd_emit_table_size(nghttp2_bufs *bufs, size_t table_size); /* For unittesting purpose */ -nghttp2_hd_entry *nghttp2_hd_table_get(nghttp2_hd_context *context, +NGHTTP2_EXTERN nghttp2_hd_entry *nghttp2_hd_table_get(nghttp2_hd_context *context, size_t index); /* For unittesting purpose */ diff --git a/epan/nghttp2/nghttp2_helper.c b/epan/nghttp2/nghttp2_helper.c index 52979ea1f7..aeb2c962ff 100644 --- a/epan/nghttp2/nghttp2_helper.c +++ b/epan/nghttp2/nghttp2_helper.c @@ -292,7 +292,7 @@ const char *nghttp2_strerror(int error_code) { case NGHTTP2_ERR_PUSH_DISABLED: return "Server push is disabled by peer"; case NGHTTP2_ERR_DATA_EXIST: - return "DATA frame already exists"; + return "DATA or HEADERS frame has already been submitted for the stream"; case NGHTTP2_ERR_SESSION_CLOSING: return "The current session is closing"; case NGHTTP2_ERR_HTTP_HEADER: @@ -308,7 +308,7 @@ const char *nghttp2_strerror(int error_code) { case NGHTTP2_ERR_CALLBACK_FAILURE: return "The user callback function failed"; case NGHTTP2_ERR_BAD_CLIENT_MAGIC: - return "Received bad clinet magic byte string"; + return "Received bad client magic byte string"; default: return "Unknown error code"; } diff --git a/epan/nghttp2/nghttp2_helper.h b/epan/nghttp2/nghttp2_helper.h index 19595b0cf8..de2d8c0a14 100644 --- a/epan/nghttp2/nghttp2_helper.h +++ b/epan/nghttp2/nghttp2_helper.h @@ -25,7 +25,9 @@ #ifndef NGHTTP2_HELPER_H #define NGHTTP2_HELPER_H +#ifdef HAVE_CONFIG_H #include <config.h> +#endif /* HAVE_CONFIG_H */ #include <string.h> diff --git a/epan/nghttp2/nghttp2ver.h b/epan/nghttp2/nghttp2ver.h index 17a010e15a..0d12eb2e68 100644 --- a/epan/nghttp2/nghttp2ver.h +++ b/epan/nghttp2/nghttp2ver.h @@ -29,7 +29,7 @@ * @macro * Version number of the nghttp2 library release */ -#define NGHTTP2_VERSION "1.0.4" +#define NGHTTP2_VERSION "1.1.2" /** * @macro @@ -37,6 +37,6 @@ * release. This is a 24 bit number with 8 bits for major number, 8 bits * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. */ -#define NGHTTP2_VERSION_NUM 0x010004 +#define NGHTTP2_VERSION_NUM 0x010102 #endif /* NGHTTP2VER_H */ |