diff --git a/.gitignore b/.gitignore index 0b21771..a550965 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ # emacs backup file *~ +out64/ +out32/ +inst.bat # autotools *.la diff --git a/lib/includes/nghttp3/nghttp3.h b/lib/includes/nghttp3/nghttp3.h index bba5588..a28b0ec 100644 --- a/lib/includes/nghttp3/nghttp3.h +++ b/lib/includes/nghttp3/nghttp3.h @@ -1826,6 +1826,13 @@ typedef struct nghttp3_settings { * v1.13.0. */ nghttp3_qpack_indexing_strat qpack_indexing_strat; + + // Setting 0x2b603742ULL 1.14.0 + uint64_t enable_web_transport; + + // Setting 0xffd277ULL 1.14.0 + uint64_t enable_webtransport_datagrams; + } nghttp3_settings; /** diff --git a/lib/nghttp3_conn.c b/lib/nghttp3_conn.c index b124162..0afccea 100644 --- a/lib/nghttp3_conn.c +++ b/lib/nghttp3_conn.c @@ -1944,6 +1944,17 @@ int nghttp3_conn_on_settings_entry_received(nghttp3_conn *conn, nghttp3_qpack_encoder_set_max_dtable_capacity(&conn->qenc, (size_t)ent->value); break; + + + case NGHTTP3_SETTINGS_ENABLE_WEBTRANSPORT: { + dest->enable_web_transport = ent->value; + break; + } + case NGHTTP3_SETTINGS_ENABLE_WEBTRANSPORT_DATAGRAM: { + dest->enable_webtransport_datagrams = ent->value; + break; + } + case NGHTTP3_SETTINGS_ID_QPACK_BLOCKED_STREAMS: if (dest->qpack_blocked_streams != 0) { return NGHTTP3_ERR_H3_SETTINGS_ERROR; diff --git a/lib/nghttp3_frame.h b/lib/nghttp3_frame.h index cca7ed0..35be1d7 100644 --- a/lib/nghttp3_frame.h +++ b/lib/nghttp3_frame.h @@ -75,6 +75,9 @@ typedef struct nghttp3_frame_headers { #define NGHTTP3_H2_SETTINGS_ID_INITIAL_WINDOW_SIZE 0x4 #define NGHTTP3_H2_SETTINGS_ID_MAX_FRAME_SIZE 0x5 +#define NGHTTP3_SETTINGS_ENABLE_WEBTRANSPORT 0x2b603742ULL +#define NGHTTP3_SETTINGS_ENABLE_WEBTRANSPORT_DATAGRAM 0xffd277ULL + typedef struct nghttp3_settings_entry { uint64_t id; uint64_t value; diff --git a/lib/nghttp3_stream.c b/lib/nghttp3_stream.c index 82aee81..384450f 100644 --- a/lib/nghttp3_stream.c +++ b/lib/nghttp3_stream.c @@ -385,6 +385,22 @@ int nghttp3_stream_write_settings(nghttp3_stream *stream, ++fr.settings.niv; } + if (local_settings->enable_web_transport) { + iv[fr.settings.niv] = (nghttp3_settings_entry){ + .id = NGHTTP3_SETTINGS_ENABLE_WEBTRANSPORT, + .value = 1, + }; + ++fr.settings.niv; + } + + if (local_settings->enable_webtransport_datagrams) { + iv[fr.settings.niv] = (nghttp3_settings_entry){ + .id = NGHTTP3_SETTINGS_ENABLE_WEBTRANSPORT_DATAGRAM, + .value = 1, + }; + ++fr.settings.niv; + } + len = nghttp3_frame_write_settings_len(&payloadlen, &fr.settings); rv = nghttp3_stream_ensure_chunk(stream, len);