Skip to content

Commit 8524083

Browse files
Update constant naming to drafthttp2 12 (#396)
* Rename constants (spec change) * More spec changes
1 parent 9be7e9a commit 8524083

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

main/lib/http2/browser/browserparser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export class BrowserParser extends ParserBase {
220220
case ParserBase.WT_STREAMS_BLOCKED_BIDI:
221221
this.onStreamsBlockedBidi(readVarInt(bufferstate))
222222
break
223-
case ParserBase.CLOSE_WEBTRANSPORT_SESSION:
223+
case ParserBase.WT_CLOSE_SESSION:
224224
{
225225
const code = readUint32(bufferstate) || 0
226226
const decoder = new TextDecoder()
@@ -234,7 +234,7 @@ export class BrowserParser extends ParserBase {
234234
this.onCloseWebTransportSession({ code, reason })
235235
}
236236
break
237-
case ParserBase.DRAIN_WEBTRANSPORT_SESSION:
237+
case ParserBase.WT_DRAIN_SESSION:
238238
this.onDrain()
239239
break
240240
case ParserBase.DATAGRAM:

main/lib/http2/node/capsuleparser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export class Http2CapsuleParser extends ParserBaseHttp2 {
223223
case Http2CapsuleParser.WT_STREAMS_BLOCKED_BIDI:
224224
this.onStreamsBlockedBidi(readVarInt(bufferstate))
225225
break
226-
case Http2CapsuleParser.CLOSE_WEBTRANSPORT_SESSION:
226+
case Http2CapsuleParser.WT_CLOSE_SESSION:
227227
{
228228
const code = readUint32(bufferstate) || 0
229229
const decoder = new TextDecoder()
@@ -237,7 +237,7 @@ export class Http2CapsuleParser extends ParserBaseHttp2 {
237237
this.onCloseWebTransportSession({ code, reason })
238238
}
239239
break
240-
case Http2CapsuleParser.DRAIN_WEBTRANSPORT_SESSION:
240+
case Http2CapsuleParser.WT_DRAIN_SESSION:
241241
this.onDrain()
242242
break
243243
case Http2CapsuleParser.DATAGRAM:

main/lib/http2/node/client.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ export class Http2WebTransportClient {
8787
settings: {
8888
enableConnectProtocol: true,
8989
customSettings: {
90-
0x2b60: 1, // SETTINGS_WEBTRANSPORT_MAX_SESSIONS, TODO fix number
91-
0x2b61: this.initialSessionFlowControlWindow, // SETTINGS_WEBTRANSPORT_INITIAL_MAX_DATA
92-
0x2b62: this.initialStreamFlowControlWindow, // SETTINGS_WEBTRANSPORT_INITIAL_MAX_STREAM_DATA_UNI
93-
0x2b63: this.initialStreamFlowControlWindow, // SETTINGS_WEBTRANSPORT_INITIAL_MAX_STREAM_DATA_BIDI
94-
0x2b64: this.initialUnidirectionalStreams, // SETTINGS_WEBTRANSPORT_INITIAL_MAX_STREAMS_UNI
95-
0x2b65: this.initialBidirectionalStreams // SETTINGS_WEBTRANSPORT_INITIAL_MAX_STREAMS_BIDI
90+
0x2b60: 1, // SETTINGS_WT_MAX_SESSIONS, TODO fix number
91+
0x2b61: this.initialSessionFlowControlWindow, // SETTINGS_WT_INITIAL_MAX_DATA
92+
0x2b62: this.initialStreamFlowControlWindow, // SETTINGS_WT_INITIAL_MAX_STREAM_DATA_UNI
93+
0x2b63: this.initialStreamFlowControlWindow, // SETTINGS_WT_INITIAL_MAX_STREAM_DATA_BIDI
94+
0x2b64: this.initialUnidirectionalStreams, // SETTINGS_WT_INITIAL_MAX_STREAMS_UNI
95+
0x2b65: this.initialBidirectionalStreams // SETTINGS_WT_INITIAL_MAX_STREAMS_BIDI
9696
}
9797
},
9898
remoteCustomSettings: [0x2b60, 0x2b61, 0x2b62, 0x2b63, 0x2b64, 0x2b65],

main/lib/http2/node/server.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ export class Http2WebTransportServer {
5959
settings: {
6060
enableConnectProtocol: true,
6161
customSettings: {
62-
0x2b60: 1, // SETTINGS_WEBTRANSPORT_MAX_SESSIONS, TODO fix number
63-
0x2b61: this.initialSessionFlowControlWindow, // SETTINGS_WEBTRANSPORT_INITIAL_MAX_DATA
64-
0x2b62: this.initialStreamFlowControlWindow, // SETTINGS_WEBTRANSPORT_INITIAL_MAX_STREAM_DATA_UNI
65-
0x2b63: this.initialStreamFlowControlWindow, // SETTINGS_WEBTRANSPORT_INITIAL_MAX_STREAM_DATA_BIDI
66-
0x2b64: this.initialUnidirectionalStreams, // SETTINGS_WEBTRANSPORT_INITIAL_MAX_STREAMS_UNI
67-
0x2b65: this.initialBidirectionalStreams // SETTINGS_WEBTRANSPORT_INITIAL_MAX_STREAMS_BIDI
62+
0x2b60: 1, // SETTINGS_WT_MAX_SESSIONS, TODO fix number
63+
0x2b61: this.initialSessionFlowControlWindow, // SETTINGS_WT_INITIAL_MAX_DATA
64+
0x2b62: this.initialStreamFlowControlWindow, // SETTINGS_WT_INITIAL_MAX_STREAM_DATA_UNI
65+
0x2b63: this.initialStreamFlowControlWindow, // SETTINGS_WT_INITIAL_MAX_STREAM_DATA_BIDI
66+
0x2b64: this.initialUnidirectionalStreams, // SETTINGS_WT_INITIAL_MAX_STREAMS_UNI
67+
0x2b65: this.initialBidirectionalStreams // SETTINGS_WT_INITIAL_MAX_STREAMS_BIDI
6868
}
6969
},
7070
remoteCustomSettings: [0x2b60, 0x2b61, 0x2b62, 0x2b63, 0x2b64, 0x2b65]

main/lib/http2/node/websocketparser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ export class WebSocketParser extends ParserBaseHttp2 {
608608
case ParserBase.WT_STREAMS_BLOCKED_BIDI:
609609
this.onStreamsBlockedBidi(readVarInt(bufferstate))
610610
break
611-
case ParserBase.CLOSE_WEBTRANSPORT_SESSION:
611+
case ParserBase.WT_CLOSE_SESSION:
612612
{
613613
const code = readUint32(bufferstate) || 0
614614
const decoder = new TextDecoder()
@@ -622,7 +622,7 @@ export class WebSocketParser extends ParserBaseHttp2 {
622622
this.onCloseWebTransportSession({ code, reason })
623623
}
624624
break
625-
case ParserBase.DRAIN_WEBTRANSPORT_SESSION:
625+
case ParserBase.WT_DRAIN_SESSION:
626626
this.onDrain()
627627
break
628628
case ParserBase.DATAGRAM:

main/lib/http2/parserbase.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export class ParserBase {
3131
static WT_STREAM_DATA_BLOCKED = 0x190b4d42
3232
static WT_STREAMS_BLOCKED_UNIDI = 0x190b4d43
3333
static WT_STREAMS_BLOCKED_BIDI = 0x190b4d44
34-
static CLOSE_WEBTRANSPORT_SESSION = 0x2843
35-
static DRAIN_WEBTRANSPORT_SESSION = 0x78ae
34+
static WT_CLOSE_SESSION = 0x2843
35+
static WT_DRAIN_SESSION = 0x78ae
3636
static DATAGRAM = 0x00
3737

3838
/**
@@ -101,7 +101,7 @@ export class ParserBase {
101101
payload[2] = (code >> 8) & 0xff
102102
payload[3] = code & 0xff
103103
this.writeCapsule({
104-
type: ParserBase.CLOSE_WEBTRANSPORT_SESSION,
104+
type: ParserBase.WT_CLOSE_SESSION,
105105
headerVints: [],
106106
payload,
107107
end: () => {

0 commit comments

Comments
 (0)