From 98273b7db1df72a8f881c9c1eb4e7be6c481f7d1 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 9 Sep 2013 21:30:39 +0900 Subject: [PATCH] nghttp2_pack_settings_payload: Make iv const The reordering iv in the comment is no longer applied to the current code base, therefore it is removed and iv is made to const pointer. --- lib/includes/nghttp2/nghttp2.h | 15 ++++++++------- lib/nghttp2_frame.c | 2 +- lib/nghttp2_frame.h | 2 +- lib/nghttp2_submit.c | 3 ++- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h index 309359eb..a5ce70cb 100644 --- a/lib/includes/nghttp2/nghttp2.h +++ b/lib/includes/nghttp2/nghttp2.h @@ -1506,12 +1506,12 @@ int nghttp2_session_upgrade(nghttp2_session *session, /** * @function * - * Serializes the SETTINGS values |iv| in the |buf|. The size of the |buf| is - * specified by |buflen|. The number of entries in the |iv| array is given by - * |niv|. This function may reorder the pointers in |iv|. The required space - * in |buf| for the |niv| entries is ``8*niv`` bytes and if the given buffer - * is too small, an error is returned. This function is used mainly for - * creating a SETTINGS payload to be sent with the ``HTTP2-Settings`` header + * Serializes the SETTINGS values |iv| in the |buf|. The size of the + * |buf| is specified by |buflen|. The number of entries in the |iv| + * array is given by |niv|. The required space in |buf| for the |niv| + * entries is ``8*niv`` bytes and if the given buffer is too small, an + * error is returned. This function is used mainly for creating a + * SETTINGS payload to be sent with the ``HTTP2-Settings`` header * field in an HTTP Upgrade request. The data written in |buf| is NOT * base64url encoded and the application is responsible for encoding. * @@ -1526,7 +1526,8 @@ int nghttp2_session_upgrade(nghttp2_session *session, */ ssize_t nghttp2_pack_settings_payload(uint8_t *buf, size_t buflen, - nghttp2_settings_entry *iv, size_t niv); + const nghttp2_settings_entry *iv, + size_t niv); /** * @function diff --git a/lib/nghttp2_frame.c b/lib/nghttp2_frame.c index 737eb371..305174cf 100644 --- a/lib/nghttp2_frame.c +++ b/lib/nghttp2_frame.c @@ -356,7 +356,7 @@ ssize_t nghttp2_frame_pack_settings(uint8_t **buf_ptr, size_t *buflen_ptr, } size_t nghttp2_frame_pack_settings_payload(uint8_t *buf, - nghttp2_settings_entry *iv, + const nghttp2_settings_entry *iv, size_t niv) { size_t i; diff --git a/lib/nghttp2_frame.h b/lib/nghttp2_frame.h index 79a35a8c..22ca55d7 100644 --- a/lib/nghttp2_frame.h +++ b/lib/nghttp2_frame.h @@ -237,7 +237,7 @@ ssize_t nghttp2_frame_pack_settings(uint8_t **buf_ptr, size_t *buflen_ptr, * Returns the number of bytes written into the |buf|. */ size_t nghttp2_frame_pack_settings_payload(uint8_t *buf, - nghttp2_settings_entry *iv, + const nghttp2_settings_entry *iv, size_t niv); /* diff --git a/lib/nghttp2_submit.c b/lib/nghttp2_submit.c index 6bb952a2..56efcd33 100644 --- a/lib/nghttp2_submit.c +++ b/lib/nghttp2_submit.c @@ -349,7 +349,8 @@ int nghttp2_submit_data(nghttp2_session *session, uint8_t flags, ssize_t nghttp2_pack_settings_payload(uint8_t *buf, size_t buflen, - nghttp2_settings_entry *iv, size_t niv) + const nghttp2_settings_entry *iv, + size_t niv) { /* Assume that current flow_control_option is 0 (which means that flow control is enabled) */