diff options
Diffstat (limited to 'epan/nghttp2/nghttp2_helper.c')
-rw-r--r-- | epan/nghttp2/nghttp2_helper.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/epan/nghttp2/nghttp2_helper.c b/epan/nghttp2/nghttp2_helper.c index c75e082424..feec30d0aa 100644 --- a/epan/nghttp2/nghttp2_helper.c +++ b/epan/nghttp2/nghttp2_helper.c @@ -51,21 +51,6 @@ uint32_t nghttp2_get_uint32(const uint8_t *data) { return g_ntohl(n); } -void *nghttp2_memdup(const void *src, size_t n, nghttp2_mem *mem) { - void *dest; - - if (n == 0) { - return NULL; - } - - dest = nghttp2_mem_malloc(mem, n); - if (dest == NULL) { - return NULL; - } - memcpy(dest, src, n); - return dest; -} - /* Generated by gendowncasetbl.py */ static const uint8_t DOWNCASE_TBL[] = { 0 /* NUL */, 1 /* SOH */, 2 /* STX */, 3 /* ETX */, @@ -230,7 +215,7 @@ int nghttp2_adjust_local_window_size(int32_t *local_window_size_ptr, int nghttp2_should_send_window_update(int32_t local_window_size, int32_t recv_window_size) { - return recv_window_size >= local_window_size / 2; + return recv_window_size > 0 && recv_window_size >= local_window_size / 2; } const char *nghttp2_strerror(int error_code) { @@ -309,6 +294,9 @@ const char *nghttp2_strerror(int error_code) { return "The user callback function failed"; case NGHTTP2_ERR_BAD_CLIENT_MAGIC: return "Received bad client magic byte string"; + case NGHTTP2_ERR_FLOODED: + return "Flooding was detected in this HTTP/2 session, and it must be " + "closed"; default: return "Unknown error code"; } |