aboutsummaryrefslogtreecommitdiffstats
path: root/epan/nghttp2
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2015-06-23 15:17:10 +0200
committerAnders Broman <a.broman58@gmail.com>2015-06-24 03:27:49 +0000
commitd0faa9adf8c82fb3e8751fdbff32d5f7203666c9 (patch)
tree25ae00098632cf887fffddbc782d58d1a341b6be /epan/nghttp2
parentae92a8347ee5682020be0d8b92134d79c5420809 (diff)
HTTP2: Update to libnghttp2 1.0.4
Change-Id: Ia92d183b7e7b5a604d75eee13b64b827ad0af903 Reviewed-on: https://code.wireshark.org/review/9054 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/nghttp2')
-rw-r--r--epan/nghttp2/README.nghttp22
-rw-r--r--epan/nghttp2/nghttp2.h24
-rw-r--r--epan/nghttp2/nghttp2_hd.c9
-rw-r--r--epan/nghttp2/nghttp2_helper.h2
-rw-r--r--epan/nghttp2/nghttp2ver.h4
5 files changed, 34 insertions, 7 deletions
diff --git a/epan/nghttp2/README.nghttp2 b/epan/nghttp2/README.nghttp2
index ae238333dd..68d0b2c620 100644
--- a/epan/nghttp2/README.nghttp2
+++ b/epan/nghttp2/README.nghttp2
@@ -29,8 +29,6 @@ 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
diff --git a/epan/nghttp2/nghttp2.h b/epan/nghttp2/nghttp2.h
index cf23cc97b7..6cf04a48b7 100644
--- a/epan/nghttp2/nghttp2.h
+++ b/epan/nghttp2/nghttp2.h
@@ -53,8 +53,12 @@ extern "C" {
#ifdef NGHTTP2_STATICLIB
#define NGHTTP2_EXTERN
#elif defined(WIN32)
+#ifdef BUILDING_NGHTTP2
#define NGHTTP2_EXTERN __declspec(dllexport)
-#else /* !defined(WIN32) */
+#else /* !BUILDING_NGHTTP2 */
+#define NGHTTP2_EXTERN __declspec(dllimport)
+#endif /* !BUILDING_NGHTTP2 */
+#else /* !defined(WIN32) */
#define NGHTTP2_EXTERN
#endif /* !defined(WIN32) */
@@ -1150,6 +1154,15 @@ typedef union {
*
* To set this callback to :type:`nghttp2_session_callbacks`, use
* `nghttp2_session_callbacks_set_send_callback()`.
+ *
+ * .. note::
+ *
+ * The |length| may be very small. If that is the case, and
+ * application disables Nagle algorithm (``TCP_NODELAY``), then just
+ * writing |data| to the network stack leads to very small packet,
+ * and it is very inefficient. An application should be responsible
+ * to buffer up small chunks of data as necessary to avoid this
+ * situation.
*/
typedef ssize_t (*nghttp2_send_callback)(nghttp2_session *session,
const uint8_t *data, size_t length,
@@ -2258,6 +2271,15 @@ NGHTTP2_EXTERN int nghttp2_session_send(nghttp2_session *session);
*
* :enum:`NGHTTP2_ERR_NOMEM`
* Out of memory.
+ *
+ * .. note::
+ *
+ * This function may produce very small byte string. If that is the
+ * case, and application disables Nagle algorithm (``TCP_NODELAY``),
+ * then writing this small chunk leads to very small packet, and it
+ * is very inefficient. An application should be responsible to
+ * buffer up small chunks of data as necessary to avoid this
+ * situation.
*/
NGHTTP2_EXTERN ssize_t nghttp2_session_mem_send(nghttp2_session *session,
const uint8_t **data_ptr);
diff --git a/epan/nghttp2/nghttp2_hd.c b/epan/nghttp2/nghttp2_hd.c
index 9dbc9ea98f..ff818fedd4 100644
--- a/epan/nghttp2/nghttp2_hd.c
+++ b/epan/nghttp2/nghttp2_hd.c
@@ -544,7 +544,8 @@ int nghttp2_hd_entry_init(nghttp2_hd_entry *ent, uint8_t flags, uint8_t *name,
return 0;
fail2:
- if (flags & NGHTTP2_HD_FLAG_NAME_ALLOC) {
+ if ((flags & NGHTTP2_HD_FLAG_NAME_ALLOC) &&
+ (flags & NGHTTP2_HD_FLAG_NAME_GIFT) == 0) {
nghttp2_mem_free(mem, ent->nv.name);
}
fail:
@@ -1894,7 +1895,11 @@ static int hd_inflate_commit_indname(nghttp2_hd_inflater *inflater,
return 0;
}
- nghttp2_mem_free(mem, nv.value);
+ if (inflater->index < NGHTTP2_STATIC_TABLE_LENGTH) {
+ nghttp2_mem_free(mem, nv.value);
+ } else {
+ nghttp2_mem_free(mem, nv.name);
+ }
return NGHTTP2_ERR_NOMEM;
}
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 09be018c1d..17a010e15a 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.0"
+#define NGHTTP2_VERSION "1.0.4"
/**
* @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 0x010000
+#define NGHTTP2_VERSION_NUM 0x010004
#endif /* NGHTTP2VER_H */