From bd06f2cec32f7c7d266a5e77b12650e0315b2fb2 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 29 Jun 2014 23:43:14 +0900 Subject: [PATCH] Add const qualifier to nva parameter in nghttp2_hd_deflate_hd() --- lib/includes/nghttp2/nghttp2.h | 2 +- lib/nghttp2_hd.c | 14 +++++++------- lib/nghttp2_hd.h | 2 +- python/cnghttp2.pxd | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h index 9ec4f3c2..8c5a9746 100644 --- a/lib/includes/nghttp2/nghttp2.h +++ b/lib/includes/nghttp2/nghttp2.h @@ -2869,7 +2869,7 @@ int nghttp2_hd_deflate_change_table_size(nghttp2_hd_deflater *deflater, */ ssize_t nghttp2_hd_deflate_hd(nghttp2_hd_deflater *deflater, uint8_t *buf, size_t buflen, - nghttp2_nv *nva, size_t nvlen); + const nghttp2_nv *nva, size_t nvlen); /** * @function diff --git a/lib/nghttp2_hd.c b/lib/nghttp2_hd.c index 4b6dbdff..78e7207f 100644 --- a/lib/nghttp2_hd.c +++ b/lib/nghttp2_hd.c @@ -682,7 +682,7 @@ static uint8_t pack_first_byte(int inc_indexing, int no_index) } static int emit_indname_block(nghttp2_bufs *bufs, size_t idx, - nghttp2_nv *nv, + const nghttp2_nv *nv, int inc_indexing) { int rv; @@ -738,7 +738,7 @@ static int emit_indname_block(nghttp2_bufs *bufs, size_t idx, return 0; } -static int emit_newname_block(nghttp2_bufs *bufs, nghttp2_nv *nv, +static int emit_newname_block(nghttp2_bufs *bufs, const nghttp2_nv *nv, int inc_indexing) { int rv; @@ -804,7 +804,7 @@ static int emit_implicit(nghttp2_bufs *bufs, size_t idx) static nghttp2_hd_entry* add_hd_table_incremental(nghttp2_hd_context *context, nghttp2_bufs *bufs, - nghttp2_nv *nv, + const nghttp2_nv *nv, uint8_t entry_flags) { int rv; @@ -894,7 +894,7 @@ typedef struct { } search_result; static search_result search_hd_table(nghttp2_hd_context *context, - nghttp2_nv *nv) + const nghttp2_nv *nv) { search_result res = { -1, 0 }; size_t i; @@ -1040,7 +1040,7 @@ static int hd_deflate_should_indexing(nghttp2_hd_deflater *deflater, } static int deflate_nv(nghttp2_hd_deflater *deflater, - nghttp2_bufs *bufs, nghttp2_nv *nv) + nghttp2_bufs *bufs, const nghttp2_nv *nv) { int rv; nghttp2_hd_entry *ent; @@ -1196,7 +1196,7 @@ static int deflate_post_process_hd_entry(nghttp2_hd_entry *ent, int nghttp2_hd_deflate_hd_bufs(nghttp2_hd_deflater *deflater, nghttp2_bufs *bufs, - nghttp2_nv *nv, size_t nvlen) + const nghttp2_nv *nv, size_t nvlen) { size_t i; int rv = 0; @@ -1252,7 +1252,7 @@ int nghttp2_hd_deflate_hd_bufs(nghttp2_hd_deflater *deflater, ssize_t nghttp2_hd_deflate_hd(nghttp2_hd_deflater *deflater, uint8_t *buf, size_t buflen, - nghttp2_nv *nv, size_t nvlen) + const nghttp2_nv *nv, size_t nvlen) { nghttp2_bufs bufs; int rv; diff --git a/lib/nghttp2_hd.h b/lib/nghttp2_hd.h index 1781c597..68568149 100644 --- a/lib/nghttp2_hd.h +++ b/lib/nghttp2_hd.h @@ -262,7 +262,7 @@ void nghttp2_hd_deflate_free(nghttp2_hd_deflater *deflater); */ int nghttp2_hd_deflate_hd_bufs(nghttp2_hd_deflater *deflater, nghttp2_bufs *bufs, - nghttp2_nv *nva, size_t nvlen); + const nghttp2_nv *nva, size_t nvlen); /* * Initializes |inflater| for inflating name/values pairs. diff --git a/python/cnghttp2.pxd b/python/cnghttp2.pxd index 80559c8b..888fd495 100644 --- a/python/cnghttp2.pxd +++ b/python/cnghttp2.pxd @@ -309,7 +309,7 @@ cdef extern from 'nghttp2_hd.h': int nghttp2_hd_deflate_hd_bufs(nghttp2_hd_deflater *deflater, nghttp2_bufs *bufs, - nghttp2_nv *nva, size_t nvlen) + const nghttp2_nv *nva, size_t nvlen) nghttp2_hd_entry* nghttp2_hd_table_get(nghttp2_hd_context *context, size_t index)