Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deps/nghttp2/lib/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ EXTRA_DEFS = @EXTRA_DEFS@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
HAVE_CXX20 = @HAVE_CXX20@
HAVE_CXX23 = @HAVE_CXX23@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Expand Down
2 changes: 1 addition & 1 deletion deps/nghttp2/lib/includes/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ EXTRA_DEFS = @EXTRA_DEFS@
FGREP = @FGREP@
FILECMD = @FILECMD@
GREP = @GREP@
HAVE_CXX20 = @HAVE_CXX20@
HAVE_CXX23 = @HAVE_CXX23@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Expand Down
14 changes: 7 additions & 7 deletions deps/nghttp2/lib/includes/nghttp2/nghttp2.h
Original file line number Diff line number Diff line change
Expand Up @@ -664,12 +664,12 @@ typedef enum {
* The ALTSVC frame, which is defined in `RFC 7383
* <https://tools.ietf.org/html/rfc7838#section-4>`_.
*/
NGHTTP2_ALTSVC = 0x0a,
NGHTTP2_ALTSVC = 0x0A,
/**
* The ORIGIN frame, which is defined by `RFC 8336
* <https://tools.ietf.org/html/rfc8336>`_.
*/
NGHTTP2_ORIGIN = 0x0c,
NGHTTP2_ORIGIN = 0x0C,
/**
* The PRIORITY_UPDATE frame, which is defined by :rfc:`9218`.
*/
Expand Down Expand Up @@ -756,7 +756,7 @@ typedef enum {
*
* .. warning::
*
* Deprecated. The initial max concurrent streams is 0xffffffffu.
* Deprecated. The initial max concurrent streams is 0xFFFFFFFFU.
*
* Default maximum number of incoming concurrent streams. Use
* `nghttp2_submit_settings()` with
Expand Down Expand Up @@ -818,19 +818,19 @@ typedef enum {
/**
* CONNECT_ERROR
*/
NGHTTP2_CONNECT_ERROR = 0x0a,
NGHTTP2_CONNECT_ERROR = 0x0A,
/**
* ENHANCE_YOUR_CALM
*/
NGHTTP2_ENHANCE_YOUR_CALM = 0x0b,
NGHTTP2_ENHANCE_YOUR_CALM = 0x0B,
/**
* INADEQUATE_SECURITY
*/
NGHTTP2_INADEQUATE_SECURITY = 0x0c,
NGHTTP2_INADEQUATE_SECURITY = 0x0C,
/**
* HTTP_1_1_REQUIRED
*/
NGHTTP2_HTTP_1_1_REQUIRED = 0x0d
NGHTTP2_HTTP_1_1_REQUIRED = 0x0D
} nghttp2_error_code;

/**
Expand Down
4 changes: 2 additions & 2 deletions deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
* @macro
* Version number of the nghttp2 library release
*/
#define NGHTTP2_VERSION "1.69.0"
#define NGHTTP2_VERSION "1.70.0"

/**
* @macro
* Numerical representation of the version number of the nghttp2 library
* 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 0x014500
#define NGHTTP2_VERSION_NUM 0x014600

#endif /* NGHTTP2VER_H */
47 changes: 19 additions & 28 deletions deps/nghttp2/lib/nghttp2_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,7 @@
#include "nghttp2_helper.h"
#include "nghttp2_debug.h"

void nghttp2_buf_init(nghttp2_buf *buf) {
buf->begin = NULL;
buf->end = NULL;
buf->pos = NULL;
buf->last = NULL;
buf->mark = NULL;
}
void nghttp2_buf_init(nghttp2_buf *buf) { *buf = (nghttp2_buf){0}; }

int nghttp2_buf_init2(nghttp2_buf *buf, size_t initial, nghttp2_mem *mem) {
nghttp2_buf_init(buf);
Expand Down Expand Up @@ -212,16 +206,15 @@ int nghttp2_bufs_wrap_init(nghttp2_bufs *bufs, uint8_t *begin, size_t len,

nghttp2_buf_wrap_init(&chain->buf, begin, len);

bufs->mem = mem;
bufs->offset = 0;

bufs->head = chain;
bufs->cur = bufs->head;

bufs->chunk_length = len;
bufs->chunk_used = 1;
bufs->max_chunk = 1;
bufs->chunk_keep = 1;
*bufs = (nghttp2_bufs){
.head = chain,
.cur = chain,
.mem = mem,
.chunk_length = len,
.max_chunk = 1,
.chunk_used = 1,
.chunk_keep = 1,
};

return 0;
}
Expand Down Expand Up @@ -251,17 +244,15 @@ int nghttp2_bufs_wrap_init2(nghttp2_bufs *bufs, const nghttp2_vec *vec,
dst_chain = &cur_chain->next;
}

bufs->mem = mem;
bufs->offset = 0;

bufs->head = head_chain;
bufs->cur = bufs->head;

/* We don't use chunk_length since no allocation is expected. */
bufs->chunk_length = 0;
bufs->chunk_used = veclen;
bufs->max_chunk = veclen;
bufs->chunk_keep = veclen;
*bufs = (nghttp2_bufs){
.head = head_chain,
.cur = head_chain,
.mem = mem,
/* We don't use chunk_length since no allocation is expected. */
.max_chunk = veclen,
.chunk_used = veclen,
.chunk_keep = veclen,
};

return 0;
}
Expand Down
6 changes: 4 additions & 2 deletions deps/nghttp2/lib/nghttp2_extpri.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ uint8_t nghttp2_extpri_to_uint8(const nghttp2_extpri *extpri) {
}

void nghttp2_extpri_from_uint8(nghttp2_extpri *extpri, uint8_t u8extpri) {
extpri->urgency = nghttp2_extpri_uint8_urgency(u8extpri);
extpri->inc = nghttp2_extpri_uint8_inc(u8extpri);
*extpri = (nghttp2_extpri){
.urgency = nghttp2_extpri_uint8_urgency(u8extpri),
.inc = nghttp2_extpri_uint8_inc(u8extpri),
};
}

int nghttp2_extpri_parse_priority(nghttp2_extpri *extpri, const uint8_t *value,
Expand Down
2 changes: 1 addition & 1 deletion deps/nghttp2/lib/nghttp2_extpri.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* NGHTTP2_EXTPRI_INC_MASK is a bit mask to retrieve incremental bit
* from a value produced by nghttp2_extpri_to_uint8.
*/
#define NGHTTP2_EXTPRI_INC_MASK (1 << 7)
#define NGHTTP2_EXTPRI_INC_MASK 0x80U

/*
* nghttp2_extpri_to_uint8 encodes |pri| into uint8_t variable.
Expand Down
81 changes: 42 additions & 39 deletions deps/nghttp2/lib/nghttp2_frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,22 @@ void nghttp2_frame_pack_frame_hd(uint8_t *buf, const nghttp2_frame_hd *hd) {
}

void nghttp2_frame_unpack_frame_hd(nghttp2_frame_hd *hd, const uint8_t *buf) {
hd->length = nghttp2_get_uint32(&buf[0]) >> 8;
hd->type = buf[3];
hd->flags = buf[4];
hd->stream_id = nghttp2_get_uint32(&buf[5]) & NGHTTP2_STREAM_ID_MASK;
hd->reserved = 0;
*hd = (nghttp2_frame_hd){
.length = nghttp2_get_uint32(&buf[0]) >> 8,
.stream_id = nghttp2_get_uint32(&buf[5]) & NGHTTP2_STREAM_ID_MASK,
.type = buf[3],
.flags = buf[4],
};
}

void nghttp2_frame_hd_init(nghttp2_frame_hd *hd, size_t length, uint8_t type,
uint8_t flags, int32_t stream_id) {
hd->length = length;
hd->type = type;
hd->flags = flags;
hd->stream_id = stream_id;
hd->reserved = 0;
*hd = (nghttp2_frame_hd){
.length = length,
.stream_id = stream_id,
.type = type,
.flags = flags,
};
}

void nghttp2_frame_headers_init(nghttp2_headers *frame, uint8_t flags,
Expand Down Expand Up @@ -199,16 +201,15 @@ void nghttp2_frame_extension_free(nghttp2_extension *frame) { (void)frame; }
void nghttp2_frame_altsvc_init(nghttp2_extension *frame, int32_t stream_id,
uint8_t *origin, size_t origin_len,
uint8_t *field_value, size_t field_value_len) {
nghttp2_ext_altsvc *altsvc;

nghttp2_frame_hd_init(&frame->hd, 2 + origin_len + field_value_len,
NGHTTP2_ALTSVC, NGHTTP2_FLAG_NONE, stream_id);

altsvc = frame->payload;
altsvc->origin = origin;
altsvc->origin_len = origin_len;
altsvc->field_value = field_value;
altsvc->field_value_len = field_value_len;
*(nghttp2_ext_altsvc *)frame->payload = (nghttp2_ext_altsvc){
.origin = origin,
.origin_len = origin_len,
.field_value = field_value,
.field_value_len = field_value_len,
};
}

void nghttp2_frame_altsvc_free(nghttp2_extension *frame, nghttp2_mem *mem) {
Expand All @@ -225,7 +226,6 @@ void nghttp2_frame_altsvc_free(nghttp2_extension *frame, nghttp2_mem *mem) {

void nghttp2_frame_origin_init(nghttp2_extension *frame,
nghttp2_origin_entry *ov, size_t nov) {
nghttp2_ext_origin *origin;
size_t payloadlen = 0;
size_t i;

Expand All @@ -236,9 +236,10 @@ void nghttp2_frame_origin_init(nghttp2_extension *frame,
nghttp2_frame_hd_init(&frame->hd, payloadlen, NGHTTP2_ORIGIN,
NGHTTP2_FLAG_NONE, 0);

origin = frame->payload;
origin->ov = ov;
origin->nov = nov;
*(nghttp2_ext_origin *)frame->payload = (nghttp2_ext_origin){
.ov = ov,
.nov = nov,
};
}

void nghttp2_frame_origin_free(nghttp2_extension *frame, nghttp2_mem *mem) {
Expand All @@ -256,15 +257,15 @@ void nghttp2_frame_origin_free(nghttp2_extension *frame, nghttp2_mem *mem) {
void nghttp2_frame_priority_update_init(nghttp2_extension *frame,
int32_t stream_id, uint8_t *field_value,
size_t field_value_len) {
nghttp2_ext_priority_update *priority_update;

nghttp2_frame_hd_init(&frame->hd, 4 + field_value_len,
NGHTTP2_PRIORITY_UPDATE, NGHTTP2_FLAG_NONE, 0);

priority_update = frame->payload;
priority_update->stream_id = stream_id;
priority_update->field_value = field_value;
priority_update->field_value_len = field_value_len;
*(nghttp2_ext_priority_update *)frame->payload =
(nghttp2_ext_priority_update){
.stream_id = stream_id,
.field_value = field_value,
.field_value_len = field_value_len,
};
}

void nghttp2_frame_priority_update_free(nghttp2_extension *frame,
Expand Down Expand Up @@ -517,8 +518,10 @@ void nghttp2_frame_unpack_settings_payload(nghttp2_settings *frame,

void nghttp2_frame_unpack_settings_entry(nghttp2_settings_entry *iv,
const uint8_t *payload) {
iv->settings_id = nghttp2_get_uint16(&payload[0]);
iv->value = nghttp2_get_uint32(&payload[2]);
*iv = (nghttp2_settings_entry){
.settings_id = nghttp2_get_uint16(&payload[0]),
.value = nghttp2_get_uint32(&payload[2]),
};
}

int nghttp2_frame_unpack_settings_payload2(nghttp2_settings_entry **iv_ptr,
Expand Down Expand Up @@ -752,10 +755,7 @@ void nghttp2_frame_unpack_altsvc_payload(nghttp2_extension *frame,
altsvc = frame->payload;

if (payloadlen == 0) {
altsvc->origin = NULL;
altsvc->origin_len = 0;
altsvc->field_value = NULL;
altsvc->field_value_len = 0;
*altsvc = (nghttp2_ext_altsvc){0};

return;
}
Expand Down Expand Up @@ -862,8 +862,7 @@ int nghttp2_frame_unpack_origin_payload(nghttp2_extension *frame,
}

if (nov == 0) {
origin->ov = NULL;
origin->nov = 0;
*origin = (nghttp2_ext_origin){0};

return 0;
}
Expand All @@ -875,8 +874,10 @@ int nghttp2_frame_unpack_origin_payload(nghttp2_extension *frame,
return NGHTTP2_ERR_NOMEM;
}

origin->ov = ov;
origin->nov = nov;
*origin = (nghttp2_ext_origin){
.nov = nov,
.ov = ov,
};

dst = (uint8_t *)ov + nov * sizeof(nghttp2_origin_entry);
p = payload;
Expand All @@ -887,8 +888,10 @@ int nghttp2_frame_unpack_origin_payload(nghttp2_extension *frame,
if (originlen == 0) {
continue;
}
ov->origin = dst;
ov->origin_len = originlen;
*ov = (nghttp2_origin_entry){
.origin = dst,
.origin_len = originlen,
};
dst = nghttp2_cpymem(dst, p, originlen);
*dst++ = '\0';
p += originlen;
Expand Down
Loading
Loading