quic: split headers out from src/quic/stream.{h/cc} · nodejs/node@ae29cc9 · GitHub
Skip to content

Commit ae29cc9

Browse files
jasnelladuh95
authored andcommitted
quic: split headers out from src/quic/stream.{h/cc}
As part of the effort to get better separation between the generalized QUIC streams and HTTP/3 streams, separate out header handling from the C++ class. Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode PR-URL: #65863 Reviewed-By: Xuguang Mei <meixuguang@gmail.com> Reviewed-By: Tim Perry <pimterry@gmail.com>
1 parent 833c58d commit ae29cc9

11 files changed

Lines changed: 440 additions & 387 deletions

File tree

‎lib/internal/quic/quic.js‎

Lines changed: 41 additions & 13 deletions

‎lib/internal/quic/state.js‎

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,8 @@ const {
101101
IDX_STATE_STREAM_HAS_OUTBOUND,
102102
IDX_STATE_STREAM_HAS_READER,
103103
IDX_STATE_STREAM_WANTS_BLOCK,
104-
IDX_STATE_STREAM_WANTS_HEADERS,
105104
IDX_STATE_STREAM_WANTS_RESET,
106105
IDX_STATE_STREAM_WANTS_STOP_SENDING,
107-
IDX_STATE_STREAM_WANTS_TRAILERS,
108106
IDX_STATE_STREAM_RECEIVED_EARLY_DATA,
109107
IDX_STATE_STREAM_WRITE_DESIRED_SIZE,
110108
IDX_STATE_STREAM_BUDGET,
@@ -145,10 +143,8 @@ assert(IDX_STATE_STREAM_RESET !== undefined);
145143
assert(IDX_STATE_STREAM_HAS_OUTBOUND !== undefined);
146144
assert(IDX_STATE_STREAM_HAS_READER !== undefined);
147145
assert(IDX_STATE_STREAM_WANTS_BLOCK !== undefined);
148-
assert(IDX_STATE_STREAM_WANTS_HEADERS !== undefined);
149146
assert(IDX_STATE_STREAM_WANTS_RESET !== undefined);
150147
assert(IDX_STATE_STREAM_WANTS_STOP_SENDING !== undefined);
151-
assert(IDX_STATE_STREAM_WANTS_TRAILERS !== undefined);
152148
assert(IDX_STATE_STREAM_WRITE_DESIRED_SIZE !== undefined);
153149
assert(IDX_STATE_STREAM_RESET_CODE !== undefined);
154150

@@ -824,20 +820,6 @@ class QuicStreamState {
824820
DataViewPrototypeSetUint8(handle, this.#offset + IDX_STATE_STREAM_WANTS_BLOCK, val ? 1 : 0);
825821
}
826822

827-
/** @type {boolean} */
828-
get wantsHeaders() {
829-
const handle = this.#handle;
830-
if (handle === undefined) return undefined;
831-
return DataViewPrototypeGetUint8(handle, this.#offset + IDX_STATE_STREAM_WANTS_HEADERS) !== 0;
832-
}
833-
834-
/** @type {boolean} */
835-
set wantsHeaders(val) {
836-
const handle = this.#handle;
837-
if (handle === undefined) return;
838-
DataViewPrototypeSetUint8(handle, this.#offset + IDX_STATE_STREAM_WANTS_HEADERS, val ? 1 : 0);
839-
}
840-
841823
/** @type {boolean} */
842824
get wantsReset() {
843825
const handle = this.#handle;
@@ -870,20 +852,6 @@ class QuicStreamState {
870852
val ? 1 : 0);
871853
}
872854

873-
/** @type {boolean} */
874-
get wantsTrailers() {
875-
const handle = this.#handle;
876-
if (handle === undefined) return undefined;
877-
return DataViewPrototypeGetUint8(handle, this.#offset + IDX_STATE_STREAM_WANTS_TRAILERS) !== 0;
878-
}
879-
880-
/** @type {boolean} */
881-
set wantsTrailers(val) {
882-
const handle = this.#handle;
883-
if (handle === undefined) return;
884-
DataViewPrototypeSetUint8(handle, this.#offset + IDX_STATE_STREAM_WANTS_TRAILERS, val ? 1 : 0);
885-
}
886-
887855
/** @type {boolean} */
888856
get early() {
889857
const handle = this.#handle;
@@ -948,8 +916,6 @@ class QuicStreamState {
948916
wantsBlock,
949917
wantsReset,
950918
wantsStopSending,
951-
wantsHeaders,
952-
wantsTrailers,
953919
early,
954920
resetCode,
955921
writeDesiredSize,
@@ -969,8 +935,6 @@ class QuicStreamState {
969935
wantsBlock,
970936
wantsReset,
971937
wantsStopSending,
972-
wantsHeaders,
973-
wantsTrailers,
974938
early,
975939
resetCode: `${resetCode}`,
976940
writeDesiredSize,
@@ -1007,8 +971,6 @@ class QuicStreamState {
1007971
wantsBlock,
1008972
wantsReset,
1009973
wantsStopSending,
1010-
wantsHeaders,
1011-
wantsTrailers,
1012974
early,
1013975
resetCode,
1014976
writeDesiredSize,
@@ -1028,8 +990,6 @@ class QuicStreamState {
1028990
wantsBlock,
1029991
wantsReset,
1030992
wantsStopSending,
1031-
wantsHeaders,
1032-
wantsTrailers,
1033993
early,
1034994
resetCode,
1035995
writeDesiredSize,

‎src/quic/application.cc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Maybe<Session::Application_Options> Session::Application_Options::From(
117117

118118
// Ensure the advertised max_field_section_size in SETTINGS is at least
119119
// as large as max_header_length. Otherwise the peer would be told to
120-
// restrict headers to a smaller size than what CanAddHeader accepts.
120+
// restrict headers to a smaller size than what the HTTP/3 stream accepts.
121121
if (options.max_field_section_size < options.max_header_length) {
122122
options.max_field_section_size = options.max_header_length;
123123
}

‎src/quic/application.h‎

Lines changed: 22 additions & 8 deletions

0 commit comments

Comments
 (0)