rwebtransport 0.2.3 → 0.2.5

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.
Files changed (96) hide show
  1. package/Cargo.lock +153 -226
  2. package/Cargo.toml +5 -5
  3. package/README.md +4 -4
  4. package/crates/echo-server/src/bin/gen-test-cert.rs +1 -1
  5. package/crates/native/Cargo.toml +1 -1
  6. package/crates/native/src/config.rs +13 -1
  7. package/crates/native/src/driver.rs +249 -91
  8. package/crates/native/src/lib.rs +9 -10
  9. package/crates/native/src/parser_memory.rs +1 -0
  10. package/crates/native/src/server.rs +197 -182
  11. package/crates/native/src/session.rs +329 -177
  12. package/crates/native/src/test_support.rs +2 -2
  13. package/crates/wtcore/src/h3.rs +166 -10
  14. package/dist/index.js +92 -45
  15. package/dist/index.js.map +2 -2
  16. package/dist/index.mjs +92 -45
  17. package/dist/index.mjs.map +2 -2
  18. package/dist/native.d.ts +9 -4
  19. package/package.json +14 -11
  20. package/prebuilds/darwin-arm64/rwebtransport.node +0 -0
  21. package/prebuilds/linux-arm64/rwebtransport.node +0 -0
  22. package/prebuilds/linux-x64/rwebtransport.node +0 -0
  23. package/prebuilds/win32-x64/rwebtransport.node +0 -0
  24. package/scripts/build-linux-prebuilt.sh +46 -0
  25. package/scripts/build.js +10 -3
  26. package/vendor/quiche/AGENTS.md +10 -0
  27. package/vendor/quiche/Cargo.lock +239 -248
  28. package/vendor/quiche/Cargo.toml +23 -10
  29. package/vendor/quiche/examples/Makefile +4 -4
  30. package/vendor/quiche/examples/client.rs +10 -28
  31. package/vendor/quiche/examples/http3-client.rs +20 -34
  32. package/vendor/quiche/examples/http3-server.rs +47 -78
  33. package/vendor/quiche/examples/server.rs +19 -49
  34. package/vendor/quiche/include/quiche.h +35 -4
  35. package/vendor/quiche/src/build.rs +17 -0
  36. package/vendor/quiche/src/cid.rs +129 -61
  37. package/vendor/quiche/src/crypto/boringssl.rs +98 -86
  38. package/vendor/quiche/src/crypto/mod.rs +64 -77
  39. package/vendor/quiche/src/dgram.rs +2 -3
  40. package/vendor/quiche/src/error.rs +22 -20
  41. package/vendor/quiche/src/ffi.rs +558 -280
  42. package/vendor/quiche/src/flowcontrol.rs +0 -7
  43. package/vendor/quiche/src/frame.rs +134 -135
  44. package/vendor/quiche/src/h3/ffi.rs +73 -60
  45. package/vendor/quiche/src/h3/frame.rs +70 -90
  46. package/vendor/quiche/src/h3/mod.rs +1024 -593
  47. package/vendor/quiche/src/h3/qpack/decoder.rs +248 -34
  48. package/vendor/quiche/src/h3/qpack/dynamic_table.rs +859 -0
  49. package/vendor/quiche/src/h3/qpack/encoder.rs +14 -17
  50. package/vendor/quiche/src/h3/qpack/mod.rs +48 -0
  51. package/vendor/quiche/src/h3/qpack/static_table.rs +86 -73
  52. package/vendor/quiche/src/h3/stream.rs +1009 -194
  53. package/vendor/quiche/src/lib.rs +1346 -1195
  54. package/vendor/quiche/src/minmax.rs +2 -6
  55. package/vendor/quiche/src/packet.rs +420 -552
  56. package/vendor/quiche/src/path.rs +202 -72
  57. package/vendor/quiche/src/pmtud.rs +18 -16
  58. package/vendor/quiche/src/ranges.rs +184 -82
  59. package/vendor/quiche/src/recovery/AGENTS.md +5 -2
  60. package/vendor/quiche/src/recovery/bandwidth.rs +59 -40
  61. package/vendor/quiche/src/recovery/bytes_in_flight.rs +2 -2
  62. package/vendor/quiche/src/recovery/congestion/cubic.rs +38 -47
  63. package/vendor/quiche/src/recovery/congestion/delivery_rate.rs +54 -60
  64. package/vendor/quiche/src/recovery/congestion/hystart.rs +6 -10
  65. package/vendor/quiche/src/recovery/congestion/mod.rs +110 -42
  66. package/vendor/quiche/src/recovery/congestion/prr.rs +4 -1
  67. package/vendor/quiche/src/recovery/congestion/recovery.rs +91 -95
  68. package/vendor/quiche/src/recovery/congestion/reno.rs +17 -12
  69. package/vendor/quiche/src/recovery/congestion/test_sender.rs +8 -27
  70. package/vendor/quiche/src/recovery/gcongestion/bbr/bandwidth_sampler.rs +159 -247
  71. package/vendor/quiche/src/recovery/gcongestion/bbr/windowed_filter.rs +9 -14
  72. package/vendor/quiche/src/recovery/gcongestion/bbr2/drain.rs +18 -15
  73. package/vendor/quiche/src/recovery/gcongestion/bbr2/mode.rs +43 -28
  74. package/vendor/quiche/src/recovery/gcongestion/bbr2/network_model.rs +349 -76
  75. package/vendor/quiche/src/recovery/gcongestion/bbr2/probe_bw.rs +147 -195
  76. package/vendor/quiche/src/recovery/gcongestion/bbr2/probe_rtt.rs +29 -27
  77. package/vendor/quiche/src/recovery/gcongestion/bbr2/rtt_jump_detector/global_min.rs +180 -0
  78. package/vendor/quiche/src/recovery/gcongestion/bbr2/rtt_jump_detector/global_min_tests.rs +221 -0
  79. package/vendor/quiche/src/recovery/gcongestion/bbr2/rtt_jump_detector/hmm.rs +395 -0
  80. package/vendor/quiche/src/recovery/gcongestion/bbr2/rtt_jump_detector/hmm_tests.rs +473 -0
  81. package/vendor/quiche/src/recovery/gcongestion/bbr2/rtt_jump_detector/mod.rs +175 -0
  82. package/vendor/quiche/src/recovery/gcongestion/bbr2/startup.rs +33 -26
  83. package/vendor/quiche/src/recovery/gcongestion/bbr2.rs +107 -60
  84. package/vendor/quiche/src/recovery/gcongestion/mod.rs +64 -11
  85. package/vendor/quiche/src/recovery/gcongestion/pacer.rs +34 -25
  86. package/vendor/quiche/src/recovery/gcongestion/recovery.rs +81 -86
  87. package/vendor/quiche/src/recovery/mod.rs +414 -173
  88. package/vendor/quiche/src/recovery/rtt.rs +8 -5
  89. package/vendor/quiche/src/stream/mod.rs +864 -133
  90. package/vendor/quiche/src/stream/recv_buf.rs +471 -172
  91. package/vendor/quiche/src/stream/send_buf.rs +338 -81
  92. package/vendor/quiche/src/test_utils.rs +78 -64
  93. package/vendor/quiche/src/tests.rs +2559 -1335
  94. package/vendor/quiche/src/tls/boringssl.rs +60 -63
  95. package/vendor/quiche/src/tls/mod.rs +146 -193
  96. package/vendor/quiche/src/transport_params.rs +87 -103
@@ -106,6 +106,9 @@ pub enum Error {
106
106
  /// The peer sent more data in CRYPTO frames than we can buffer.
107
107
  CryptoBufferExceeded,
108
108
 
109
+ /// Buffered data or stream history exceeded a configured memory limit.
110
+ StreamMemoryLimit,
111
+
109
112
  /// The peer sent an ACK frame with an invalid range.
110
113
  InvalidAckRange,
111
114
 
@@ -124,32 +127,32 @@ pub enum Error {
124
127
  pub enum WireErrorCode {
125
128
  /// An endpoint uses this with CONNECTION_CLOSE to signal that the
126
129
  /// connection is being closed abruptly in the absence of any error.
127
- NoError = 0x0,
130
+ NoError = 0x0,
128
131
  /// The endpoint encountered an internal error and cannot continue with the
129
132
  /// connection.
130
- InternalError = 0x1,
133
+ InternalError = 0x1,
131
134
  /// The server refused to accept a new connection.
132
- ConnectionRefused = 0x2,
135
+ ConnectionRefused = 0x2,
133
136
  /// An endpoint received more data than it permitted in its advertised data
134
137
  /// limits; see Section 4.
135
- FlowControlError = 0x3,
138
+ FlowControlError = 0x3,
136
139
  /// An endpoint received a frame for a stream identifier that exceeded its
137
140
  /// advertised stream limit for the corresponding stream type.
138
- StreamLimitError = 0x4,
141
+ StreamLimitError = 0x4,
139
142
  /// An endpoint received a frame for a stream that was not in a state that
140
143
  /// permitted that frame.
141
- StreamStateError = 0x5,
144
+ StreamStateError = 0x5,
142
145
  /// (1) An endpoint received a STREAM frame containing data that exceeded
143
146
  /// the previously established final size, (2) an endpoint received a
144
147
  /// STREAM frame or a RESET_STREAM frame containing a final size that
145
148
  /// was lower than the size of stream data that was already received, or
146
149
  /// (3) an endpoint received a STREAM frame or a RESET_STREAM frame
147
150
  /// containing a different final size to the one already established.
148
- FinalSizeError = 0x6,
151
+ FinalSizeError = 0x6,
149
152
  /// An endpoint received a frame that was badly formatted -- for instance, a
150
153
  /// frame of an unknown type or an ACK frame that has more
151
154
  /// acknowledgment ranges than the remainder of the packet could carry.
152
- FrameEncodingError = 0x7,
155
+ FrameEncodingError = 0x7,
153
156
  /// An endpoint received transport parameters that were badly formatted,
154
157
  /// included an invalid value, omitted a mandatory transport parameter,
155
158
  /// included a forbidden transport parameter, or were otherwise in
@@ -160,25 +163,25 @@ pub enum WireErrorCode {
160
163
  ConnectionIdLimitError = 0x9,
161
164
  /// An endpoint detected an error with protocol compliance that was not
162
165
  /// covered by more specific error codes.
163
- ProtocolViolation = 0xa,
166
+ ProtocolViolation = 0xa,
164
167
  /// A server received a client Initial that contained an invalid Token
165
168
  /// field.
166
- InvalidToken = 0xb,
169
+ InvalidToken = 0xb,
167
170
  /// The application or application protocol caused the connection to be
168
171
  /// closed.
169
- ApplicationError = 0xc,
172
+ ApplicationError = 0xc,
170
173
  /// An endpoint has received more data in CRYPTO frames than it can buffer.
171
174
  CryptoBufferExceeded = 0xd,
172
175
  /// An endpoint detected errors in performing key updates.
173
- KeyUpdateError = 0xe,
176
+ KeyUpdateError = 0xe,
174
177
  /// An endpoint has reached the confidentiality or integrity limit for the
175
178
  /// AEAD algorithm used by the given connection.
176
- AeadLimitReached = 0xf,
179
+ AeadLimitReached = 0xf,
177
180
  /// An endpoint has determined that the network path is incapable of
178
181
  /// supporting QUIC. An endpoint is unlikely to receive a
179
182
  /// CONNECTION_CLOSE frame carrying this code except when the path does
180
183
  /// not support a large enough MTU.
181
- NoViablePath = 0x10,
184
+ NoViablePath = 0x10,
182
185
  }
183
186
 
184
187
  impl Error {
@@ -186,16 +189,14 @@ impl Error {
186
189
  match self {
187
190
  Error::Done => WireErrorCode::NoError as u64,
188
191
  Error::InvalidFrame => WireErrorCode::FrameEncodingError as u64,
189
- Error::InvalidStreamState(..) =>
190
- WireErrorCode::StreamStateError as u64,
191
- Error::InvalidTransportParam =>
192
- WireErrorCode::TransportParameterError as u64,
192
+ Error::InvalidStreamState(..) => WireErrorCode::StreamStateError as u64,
193
+ Error::InvalidTransportParam => WireErrorCode::TransportParameterError as u64,
193
194
  Error::FlowControl => WireErrorCode::FlowControlError as u64,
194
195
  Error::StreamLimit => WireErrorCode::StreamLimitError as u64,
195
196
  Error::IdLimit => WireErrorCode::ConnectionIdLimitError as u64,
196
197
  Error::FinalSize => WireErrorCode::FinalSizeError as u64,
197
- Error::CryptoBufferExceeded =>
198
- WireErrorCode::CryptoBufferExceeded as u64,
198
+ Error::CryptoBufferExceeded => WireErrorCode::CryptoBufferExceeded as u64,
199
+ Error::StreamMemoryLimit => WireErrorCode::InternalError as u64,
199
200
  Error::KeyUpdate => WireErrorCode::KeyUpdateError as u64,
200
201
  _ => WireErrorCode::ProtocolViolation as u64,
201
202
  }
@@ -227,6 +228,7 @@ impl Error {
227
228
  Error::InvalidAckRange => -21,
228
229
  Error::OptimisticAckDetected => -22,
229
230
  Error::InvalidDcidInitialization => -23,
231
+ Error::StreamMemoryLimit => -24,
230
232
  }
231
233
  }
232
234
  }