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
4 changes: 2 additions & 2 deletions deps/ngtcp2/nghttp3/lib/includes/nghttp3/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*
* Version number of the nghttp3 library release.
*/
#define NGHTTP3_VERSION "1.14.0"
#define NGHTTP3_VERSION "1.15.0"

/**
* @macro
Expand All @@ -41,6 +41,6 @@
* number, 8 bits for minor and 8 bits for patch. Version 1.2.3
* becomes 0x010203.
*/
#define NGHTTP3_VERSION_NUM 0x010e00
#define NGHTTP3_VERSION_NUM 0x010f00

#endif /* !defined(NGHTTP3_VERSION_H) */
54 changes: 28 additions & 26 deletions deps/ngtcp2/nghttp3/lib/nghttp3_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -2142,7 +2142,7 @@ nghttp3_stream *nghttp3_conn_find_stream(nghttp3_conn *conn,

int nghttp3_conn_bind_control_stream(nghttp3_conn *conn, int64_t stream_id) {
nghttp3_stream *stream;
nghttp3_frame_entry frent;
nghttp3_frame fr;
int rv;

assert(stream_id >= 0);
Expand All @@ -2168,23 +2168,25 @@ int nghttp3_conn_bind_control_stream(nghttp3_conn *conn, int64_t stream_id) {
return rv;
}

frent.fr.settings.type = NGHTTP3_FRAME_SETTINGS;
frent.aux.settings.local_settings = &conn->local.settings;
fr.settings = (nghttp3_frame_settings){
.type = NGHTTP3_FRAME_SETTINGS,
.local_settings = &conn->local.settings,
};

rv = nghttp3_stream_frq_add(stream, &frent);
rv = nghttp3_stream_frq_add(stream, &fr);
if (rv != 0) {
return rv;
}

if (conn->local.settings.origin_list) {
assert(conn->server);

frent.fr.origin = (nghttp3_frame_origin){
fr.origin = (nghttp3_frame_origin){
.type = NGHTTP3_FRAME_ORIGIN,
.origin_list = *conn->local.settings.origin_list,
};

rv = nghttp3_stream_frq_add(stream, &frent);
rv = nghttp3_stream_frq_add(stream, &fr);
if (rv != 0) {
return rv;
}
Expand Down Expand Up @@ -2414,32 +2416,32 @@ static int conn_submit_headers_data(nghttp3_conn *conn, nghttp3_stream *stream,
const nghttp3_data_reader *dr) {
int rv;
nghttp3_nv *nnva;
nghttp3_frame_entry frent;
nghttp3_frame fr;

rv = nghttp3_nva_copy(&nnva, nva, nvlen, conn->mem);
if (rv != 0) {
return rv;
}

frent.fr.headers = (nghttp3_frame_headers){
fr.headers = (nghttp3_frame_headers){
.type = NGHTTP3_FRAME_HEADERS,
.nva = nnva,
.nvlen = nvlen,
};

rv = nghttp3_stream_frq_add(stream, &frent);
rv = nghttp3_stream_frq_add(stream, &fr);
if (rv != 0) {
nghttp3_nva_del(nnva, conn->mem);
return rv;
}

if (dr) {
frent.fr.data = (nghttp3_frame_data){
fr.data = (nghttp3_frame_data){
.type = NGHTTP3_FRAME_DATA,
.dr = *dr,
};
frent.aux.data.dr = *dr;

rv = nghttp3_stream_frq_add(stream, &frent);
rv = nghttp3_stream_frq_add(stream, &fr);
if (rv != 0) {
return rv;
}
Expand Down Expand Up @@ -2493,7 +2495,6 @@ int nghttp3_conn_submit_request(nghttp3_conn *conn, int64_t stream_id,

assert(!conn->server);
assert(conn->tx.qenc);

assert(stream_id >= 0);
assert(stream_id <= (int64_t)NGHTTP3_MAX_VARINT);
assert(nghttp3_client_stream_bidi(stream_id));
Expand All @@ -2515,6 +2516,7 @@ int nghttp3_conn_submit_request(nghttp3_conn *conn, int64_t stream_id,
}
stream->rx.hstate = NGHTTP3_HTTP_STATE_RESP_INITIAL;
stream->user_data = stream_user_data;
stream->node.pri.inc = 1;

nghttp3_http_record_request_method(stream, nva, nvlen);

Expand Down Expand Up @@ -2585,51 +2587,51 @@ int nghttp3_conn_submit_trailers(nghttp3_conn *conn, int64_t stream_id,
}

int nghttp3_conn_submit_shutdown_notice(nghttp3_conn *conn) {
nghttp3_frame_entry frent;
nghttp3_frame fr;
int rv;

assert(conn->tx.ctrl);

frent.fr.goaway = (nghttp3_frame_goaway){
fr.goaway = (nghttp3_frame_goaway){
.type = NGHTTP3_FRAME_GOAWAY,
.id = conn->server ? NGHTTP3_SHUTDOWN_NOTICE_STREAM_ID
: NGHTTP3_SHUTDOWN_NOTICE_PUSH_ID,
};

assert(frent.fr.goaway.id <= conn->tx.goaway_id);
assert(fr.goaway.id <= conn->tx.goaway_id);

rv = nghttp3_stream_frq_add(conn->tx.ctrl, &frent);
rv = nghttp3_stream_frq_add(conn->tx.ctrl, &fr);
if (rv != 0) {
return rv;
}

conn->tx.goaway_id = frent.fr.goaway.id;
conn->tx.goaway_id = fr.goaway.id;
conn->flags |= NGHTTP3_CONN_FLAG_GOAWAY_QUEUED;

return 0;
}

int nghttp3_conn_shutdown(nghttp3_conn *conn) {
nghttp3_frame_entry frent;
nghttp3_frame fr;
int rv;

assert(conn->tx.ctrl);

frent.fr.goaway = (nghttp3_frame_goaway){
fr.goaway = (nghttp3_frame_goaway){
.type = NGHTTP3_FRAME_GOAWAY,
.id = conn->server ? nghttp3_min_int64((1ll << 62) - 4,
conn->rx.max_stream_id_bidi + 4)
: 0,
};

assert(frent.fr.goaway.id <= conn->tx.goaway_id);
assert(fr.goaway.id <= conn->tx.goaway_id);

rv = nghttp3_stream_frq_add(conn->tx.ctrl, &frent);
rv = nghttp3_stream_frq_add(conn->tx.ctrl, &fr);
if (rv != 0) {
return rv;
}

conn->tx.goaway_id = frent.fr.goaway.id;
conn->tx.goaway_id = fr.goaway.id;
conn->flags |=
NGHTTP3_CONN_FLAG_GOAWAY_QUEUED | NGHTTP3_CONN_FLAG_SHUTDOWN_COMMENCED;

Expand Down Expand Up @@ -2870,7 +2872,7 @@ int nghttp3_conn_set_client_stream_priority(nghttp3_conn *conn,
const uint8_t *data,
size_t datalen) {
nghttp3_stream *stream;
nghttp3_frame_entry frent;
nghttp3_frame fr;
uint8_t *buf = NULL;

assert(!conn->server);
Expand All @@ -2895,14 +2897,14 @@ int nghttp3_conn_set_client_stream_priority(nghttp3_conn *conn,
memcpy(buf, data, datalen);
}

frent.fr.priority_update = (nghttp3_frame_priority_update){
fr.priority_update = (nghttp3_frame_priority_update){
.type = NGHTTP3_FRAME_PRIORITY_UPDATE,
.pri_elem_id = stream_id,
.data = buf,
.datalen = datalen,
};

return nghttp3_stream_frq_add(conn->tx.ctrl, &frent);
return nghttp3_stream_frq_add(conn->tx.ctrl, &fr);
}

int nghttp3_conn_set_server_stream_priority_versioned(nghttp3_conn *conn,
Expand Down
6 changes: 6 additions & 0 deletions deps/ngtcp2/nghttp3/lib/nghttp3_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ typedef struct nghttp3_frame_hd {

typedef struct nghttp3_frame_data {
int64_t type;
/* dr is set when sending DATA frame. It is not used on
reception. */
nghttp3_data_reader dr;
} nghttp3_frame_data;

typedef struct nghttp3_frame_headers {
Expand Down Expand Up @@ -88,6 +91,9 @@ typedef struct nghttp3_frame_settings {
int64_t type;
size_t niv;
nghttp3_settings_entry *iv;
/* local_settings is set when sending SETTINGS frame. It is not
used on reception. */
const nghttp3_settings *local_settings;
} nghttp3_frame_settings;

typedef struct nghttp3_frame_goaway {
Expand Down
3 changes: 2 additions & 1 deletion deps/ngtcp2/nghttp3/lib/nghttp3_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ static int memieq(const void *a, const void *b, size_t n) {
return 1;
}

#define lstrieq(A, B, N) ((sizeof((A)) - 1) == (N) && memieq((A), (B), (N)))
#define lstrieq(A, B, N) \
(nghttp3_strlen_lit((A)) == (N) && memieq((A), (B), (N)))

static int64_t parse_uint(const uint8_t *s, size_t len) {
int64_t n = 0;
Expand Down
Loading
Loading