@fails-components/webtransport-transport-http3-quiche 1.4.1 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CMakeLists.txt CHANGED
@@ -495,6 +495,8 @@ third_party/quiche/quiche/quic/core/frames/quic_connection_close_frame.cc
495
495
  third_party/quiche/quiche/quic/core/frames/quic_connection_close_frame.h
496
496
  third_party/quiche/quiche/quic/core/frames/quic_crypto_frame.cc
497
497
  third_party/quiche/quiche/quic/core/frames/quic_crypto_frame.h
498
+ third_party/quiche/quiche/quic/core/frames/quic_datagram_frame.cc
499
+ third_party/quiche/quiche/quic/core/frames/quic_datagram_frame.h
498
500
  third_party/quiche/quiche/quic/core/frames/quic_frame.cc
499
501
  third_party/quiche/quiche/quic/core/frames/quic_frame.h
500
502
  third_party/quiche/quiche/quic/core/frames/quic_goaway_frame.cc
@@ -506,8 +508,6 @@ third_party/quiche/quiche/quic/core/frames/quic_immediate_ack_frame.h
506
508
  third_party/quiche/quiche/quic/core/frames/quic_inlined_frame.h
507
509
  third_party/quiche/quiche/quic/core/frames/quic_max_streams_frame.cc
508
510
  third_party/quiche/quiche/quic/core/frames/quic_max_streams_frame.h
509
- third_party/quiche/quiche/quic/core/frames/quic_message_frame.cc
510
- third_party/quiche/quiche/quic/core/frames/quic_message_frame.h
511
511
  third_party/quiche/quiche/quic/core/frames/quic_mtu_discovery_frame.h
512
512
  third_party/quiche/quiche/quic/core/frames/quic_new_connection_id_frame.cc
513
513
  third_party/quiche/quiche/quic/core/frames/quic_new_connection_id_frame.h
@@ -1 +1 @@
1
- {"version":3,"file":"socket.d.ts","sourceRoot":"","sources":["../../lib/socket.js"],"names":[],"mappings":"AAkFA;IACE;;OAEG;IAEH,kBAHW,OAAO,4BAA4B,EAAE,oBAAoB,GAAC,SAAS,EAc7E;IAVC,0CAA0C;IAE1C,WAFW,OAAO,YAAY,EAAE,MAAM,CAEZ;IAE1B,UAAqB;IACrB,oBAAuB;IAgCzB,qBASC;IAlCD,+BAGC;IAPC,iBAAoB;IACpB,gBAAmB;IAQrB;;OAEG;IAEH,mDAHW,OAAO,SAAS,EAAE,mBAAmB,WAiB/C;CAYF"}
1
+ {"version":3,"file":"socket.d.ts","sourceRoot":"","sources":["../../lib/socket.js"],"names":[],"mappings":"AA4FA;IACE;;OAEG;IAEH,kBAHW,OAAO,4BAA4B,EAAE,oBAAoB,GAAC,SAAS,EAc7E;IAVC,0CAA0C;IAE1C,WAFW,OAAO,YAAY,EAAE,MAAM,CAEZ;IAE1B,UAAqB;IACrB,oBAAuB;IA+BzB,qBAQC;IAhCD,+BAGC;IAPC,iBAAoB;IACpB,gBAAmB;IAQrB;;OAEG;IAEH,mDAHW,OAAO,SAAS,EAAE,mBAAmB,WAgB/C;CAWF"}
package/lib/socket.js CHANGED
@@ -7,7 +7,17 @@ globalThis.FAILSsetTimeoutAlarm = (
7
7
  /** @type {{ fireJS: () => void; }} */ alarm,
8
8
  /** @type {number} */ delay
9
9
  ) => {
10
- return setTimeout(alarm.fireJS.bind(alarm), delay)
10
+ if (delay < 1) {
11
+ return { immediate: setImmediate(alarm.fireJS.bind(alarm)) }
12
+ }
13
+ return { timeout: setTimeout(alarm.fireJS.bind(alarm), delay) }
14
+ }
15
+
16
+ globalThis.FAILSclearTimeoutAlarm = (
17
+ /** @type {{ timeout: string | number | NodeJS.Timeout | undefined; immediate: NodeJS.Immediate | undefined; }} */ obj
18
+ ) => {
19
+ if (obj.timeout) clearTimeout(obj.timeout)
20
+ if (obj.immediate) clearImmediate(obj.immediate)
11
21
  }
12
22
 
13
23
  function convertToPem(/** @type {ArrayBuffer} */ cert) {
@@ -117,7 +127,6 @@ export class Http3WebTransportSocket {
117
127
  address,
118
128
  this.packetSendCB
119
129
  )
120
- // @ts-ignore
121
130
  const blocked = this.socketInt.getSendQueueCount() > 0
122
131
  this.blocked = this.blocked || blocked
123
132
  return blocked
@@ -126,7 +135,6 @@ export class Http3WebTransportSocket {
126
135
  packetSendCB() {
127
136
  if (
128
137
  !this.closed &&
129
- // @ts-ignore
130
138
  this.socketInt.getSendQueueCount() === 0 &&
131
139
  this.blocked
132
140
  ) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fails-components/webtransport-transport-http3-quiche",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "A component to add webtransport support (server and client) to node.js, transport using libquiche",
5
5
  "exports": {
6
6
  ".": {
@@ -8,7 +8,7 @@
8
8
  }
9
9
  },
10
10
  "engines": {
11
- "node": ">=16.5"
11
+ "node": ">=20"
12
12
  },
13
13
  "type": "module",
14
14
  "types": "./dist/lib/index.d.ts",
@@ -14,7 +14,7 @@
14
14
  namespace quic
15
15
  {
16
16
  Napi::FunctionReference NapiAlarmJS::FAILSsetTimeoutAlarm_;
17
- Napi::FunctionReference NapiAlarmJS::clearTimeout_;
17
+ Napi::FunctionReference NapiAlarmJS::FAILSclearTimeoutAlarm_;
18
18
 
19
19
  void NapiAlarmJS::fireJS(const Napi::CallbackInfo &info)
20
20
  {
@@ -57,9 +57,9 @@ namespace quic
57
57
  FAILSsetTimeoutAlarm_ = Napi::Persistent(Env().Global().Get("FAILSsetTimeoutAlarm").As<Napi::Function>());
58
58
  FAILSsetTimeoutAlarm_.SuppressDestruct();
59
59
  }
60
- if (clearTimeout_.IsEmpty()) {
61
- clearTimeout_ = Napi::Persistent(Env().Global().Get("clearTimeout").As<Napi::Function>());
62
- clearTimeout_.SuppressDestruct();
60
+ if (FAILSclearTimeoutAlarm_.IsEmpty()) {
61
+ FAILSclearTimeoutAlarm_ = Napi::Persistent(Env().Global().Get("FAILSclearTimeoutAlarm").As<Napi::Function>());
62
+ FAILSclearTimeoutAlarm_.SuppressDestruct();
63
63
  }
64
64
  }
65
65
 
@@ -86,7 +86,7 @@ namespace quic
86
86
  protected:
87
87
  NapiAlarm* alarm_; // unowned
88
88
  static Napi::FunctionReference FAILSsetTimeoutAlarm_;
89
- static Napi::FunctionReference clearTimeout_;
89
+ static Napi::FunctionReference FAILSclearTimeoutAlarm_;
90
90
  };
91
91
 
92
92
  class NapiAlarm : public QuicAlarm
@@ -103,7 +103,7 @@ namespace quic
103
103
  {
104
104
  if (timerset_)
105
105
  {
106
- NapiAlarmJS::clearTimeout_.Call({alarmref_.Value()});
106
+ NapiAlarmJS::FAILSclearTimeoutAlarm_.Call({alarmref_.Value()});
107
107
  alarmref_.Unref();
108
108
  timerset_ = false;
109
109
  }
@@ -148,7 +148,7 @@ namespace quic
148
148
  {
149
149
  if (timerset_)
150
150
  {
151
- NapiAlarmJS::clearTimeout_.Call({alarmref_.Value()});
151
+ NapiAlarmJS::FAILSclearTimeoutAlarm_.Call({alarmref_.Value()});
152
152
  alarmref_.Unref();
153
153
  timerset_ = false;
154
154
  }