HTTP2: Update to nghttp2 lib 0.5.0
authorAlexis La Goutte <alexis.lagoutte@gmail.com>
Fri, 18 Jul 2014 19:30:59 +0000 (21:30 +0200)
committerEvan Huus <eapache@gmail.com>
Sat, 19 Jul 2014 00:55:08 +0000 (00:55 +0000)
Change-Id: Ia63c066e482f633ef5096f2341d74de749422102
Reviewed-on: https://code.wireshark.org/review/3104
Reviewed-by: Evan Huus <eapache@gmail.com>
epan/nghttp2/nghttp2.h
epan/nghttp2/nghttp2_buf.c
epan/nghttp2/nghttp2_buf.h
epan/nghttp2/nghttp2_hd.c
epan/nghttp2/nghttp2ver.h

index 0e0166529f9cbb53b3c884364ac78b13739718cb..1ddcc8ed9ca282d240773541da0b0deaf2c45d17 100644 (file)
@@ -35,7 +35,7 @@ extern "C" {
 #include <stdint.h>
 #include <sys/types.h>
 
-#include "nghttp2ver.h"
+#include <nghttp2ver.h>
 
 /**
  * @macro
@@ -346,10 +346,6 @@ typedef enum {
   NGHTTP2_ERR_CALLBACK_FAILURE = -902
 } nghttp2_error;
 
-typedef enum {
-  NGHTTP2_MSG_MORE
-} nghttp2_io_flag;
-
 /**
  * @enum
  *
@@ -518,6 +514,8 @@ typedef enum {
    */
   NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE = 0x04
 } nghttp2_settings_id;
+/* Note: If we add SETTINGS, update the capacity of
+   NGHTTP2_INBOUND_NUM_IV as well */
 
 /**
  * @macro
index dcaa4695144dfe2826735e2f0e82803259da1b91..af4af4b292eba20be54720b9a36176d4b1c5e10a 100644 (file)
@@ -236,8 +236,8 @@ ssize_t nghttp2_bufs_len(nghttp2_bufs *bufs)
 
 static ssize_t bufs_avail(nghttp2_bufs *bufs)
 {
-  return (ssize_t)(nghttp2_buf_avail(&bufs->cur->buf) +
-    (bufs->chunk_length - bufs->offset) * (bufs->max_chunk - bufs->chunk_used));
+  return (ssize_t)nghttp2_buf_avail(&bufs->cur->buf) +
+    (bufs->chunk_length - bufs->offset) * (bufs->max_chunk - bufs->chunk_used);
 }
 
 static int bufs_alloc_chain(nghttp2_bufs *bufs)
@@ -474,3 +474,4 @@ int nghttp2_bufs_next_present(nghttp2_bufs *bufs)
 
   return chain && nghttp2_buf_len(&chain->buf);
 }
+
index cba68790f96d3b3e895083da853c81ea997677f4..1097ae6a995417cdec3b1fc9b74391316fd5128c 100644 (file)
@@ -368,4 +368,4 @@ int nghttp2_bufs_next_present(nghttp2_bufs *bufs);
  */
 ssize_t nghttp2_bufs_len(nghttp2_bufs *bufs);
 
-#endif /* NGHTTP2_BUF_H */
\ No newline at end of file
+#endif /* NGHTTP2_BUF_H */
index 75410c73fb76c0ea356f105d2ffbc06827966552..097203730446a6001d7749398e3a329da619f80a 100644 (file)
@@ -133,12 +133,6 @@ static uint32_t hash(const uint8_t *s, size_t n)
   return h;
 }
 
-typedef struct {
-  nghttp2_nv *nva;
-  size_t nvacap;
-  size_t nvlen;
-} nghttp2_nva_out;
-
 int nghttp2_hd_entry_init(nghttp2_hd_entry *ent, uint8_t flags,
                           uint8_t *name, size_t namelen,
                           uint8_t *value, size_t valuelen)
@@ -1334,6 +1328,8 @@ int nghttp2_hd_deflate_new(nghttp2_hd_deflater **deflater_ptr,
   rv =  nghttp2_hd_deflate_init2(deflater, deflate_hd_table_bufsize_max);
 
   if(rv != 0) {
+    free(deflater);
+
     return rv;
   }
 
@@ -2015,7 +2011,7 @@ ssize_t nghttp2_hd_inflate_hd(nghttp2_hd_inflater *inflater,
 
     goto fail;
   }
-  return (ssize_t)(in - first);
+  return in - first;
 
  fail:
   DEBUGF(fprintf(stderr, "inflatehd: error return %zd\n", rv));
@@ -2045,6 +2041,8 @@ int nghttp2_hd_inflate_new(nghttp2_hd_inflater **inflater_ptr)
   rv = nghttp2_hd_inflate_init(inflater);
 
   if(rv != 0) {
+    free(inflater);
+
     return rv;
   }
 
index 0fe2d12caa06ae6c573fc2c94cbf73e40e3a550a..2218d9015773b84b6ecba69629e09137b91b0e3e 100644 (file)
@@ -29,7 +29,7 @@
  * @macro
  * Version number of the nghttp2 library release
  */
-#define NGHTTP2_VERSION "0.4.2-DEV"
+#define NGHTTP2_VERSION "0.5.0"
 
 /**
  * @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 0x000402
+#define NGHTTP2_VERSION_NUM 0x000500
 
 #endif /* NGHTTP2VER_H */