Make const members which deserves it.

This commit is contained in:
Dusan Cervenka (nxa14949) 2018-09-14 14:48:58 +02:00
parent a1ea1696be
commit ba9f03d72d
3 changed files with 8 additions and 9 deletions

View File

@ -1747,8 +1747,8 @@ typedef int (*nghttp2_on_header_callback)(nghttp2_session *session,
*/
typedef int (*nghttp2_on_header_callback2)(nghttp2_session *session,
const nghttp2_frame *frame,
nghttp2_rcbuf *name,
nghttp2_rcbuf *value, uint8_t flags,
const nghttp2_rcbuf *name,
const nghttp2_rcbuf *value, uint8_t flags,
void *user_data);
/**
@ -1815,8 +1815,8 @@ typedef int (*nghttp2_on_invalid_header_callback)(
* :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`.
*/
typedef int (*nghttp2_on_invalid_header_callback2)(
nghttp2_session *session, const nghttp2_frame *frame, nghttp2_rcbuf *name,
nghttp2_rcbuf *value, uint8_t flags, void *user_data);
nghttp2_session *session, const nghttp2_frame *frame, const nghttp2_rcbuf *name,
const nghttp2_rcbuf *value, uint8_t flags, void *user_data);
/**
* @functypedef

View File

@ -1290,8 +1290,7 @@ nghttp2_hd_nv nghttp2_hd_table_get(nghttp2_hd_context *context, size_t idx) {
->nv;
} else {
const nghttp2_hd_static_entry *ent = &static_table[idx];
nghttp2_hd_nv nv = {(nghttp2_rcbuf *)&ent->name,
(nghttp2_rcbuf *)&ent->value, ent->token,
nghttp2_hd_nv nv = {&ent->name, &ent->value, ent->token,
NGHTTP2_NV_FLAG_NONE};
return nv;
}

View File

@ -119,10 +119,10 @@ typedef struct nghttp2_hd_entry nghttp2_hd_entry;
typedef struct {
/* The buffer containing header field name. NULL-termination is
guaranteed. */
nghttp2_rcbuf *name;
const nghttp2_rcbuf *name;
/* The buffer containing header field value. NULL-termination is
guaranteed. */
nghttp2_rcbuf *value;
const nghttp2_rcbuf *value;
/* nghttp2_token value for name. It could be -1 if we have no token
for that header field name. */
int32_t token;
@ -236,7 +236,7 @@ struct nghttp2_hd_inflater {
nghttp2_rcbuf *namercbuf, *valuercbuf;
/* Pointer to the name/value pair which are used in the current
header emission. */
nghttp2_rcbuf *nv_name_keep, *nv_value_keep;
const nghttp2_rcbuf *nv_name_keep, *nv_value_keep;
/* The number of bytes to read */
size_t left;
/* The index in indexed repr or indexed name */