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.
- package/Cargo.lock +153 -226
- package/Cargo.toml +5 -5
- package/README.md +4 -4
- package/crates/echo-server/src/bin/gen-test-cert.rs +1 -1
- package/crates/native/Cargo.toml +1 -1
- package/crates/native/src/config.rs +13 -1
- package/crates/native/src/driver.rs +249 -91
- package/crates/native/src/lib.rs +9 -10
- package/crates/native/src/parser_memory.rs +1 -0
- package/crates/native/src/server.rs +197 -182
- package/crates/native/src/session.rs +329 -177
- package/crates/native/src/test_support.rs +2 -2
- package/crates/wtcore/src/h3.rs +166 -10
- package/dist/index.js +92 -45
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +92 -45
- package/dist/index.mjs.map +2 -2
- package/dist/native.d.ts +9 -4
- package/package.json +14 -11
- package/prebuilds/darwin-arm64/rwebtransport.node +0 -0
- package/prebuilds/linux-arm64/rwebtransport.node +0 -0
- package/prebuilds/linux-x64/rwebtransport.node +0 -0
- package/prebuilds/win32-x64/rwebtransport.node +0 -0
- package/scripts/build-linux-prebuilt.sh +46 -0
- package/scripts/build.js +10 -3
- package/vendor/quiche/AGENTS.md +10 -0
- package/vendor/quiche/Cargo.lock +239 -248
- package/vendor/quiche/Cargo.toml +23 -10
- package/vendor/quiche/examples/Makefile +4 -4
- package/vendor/quiche/examples/client.rs +10 -28
- package/vendor/quiche/examples/http3-client.rs +20 -34
- package/vendor/quiche/examples/http3-server.rs +47 -78
- package/vendor/quiche/examples/server.rs +19 -49
- package/vendor/quiche/include/quiche.h +35 -4
- package/vendor/quiche/src/build.rs +17 -0
- package/vendor/quiche/src/cid.rs +129 -61
- package/vendor/quiche/src/crypto/boringssl.rs +98 -86
- package/vendor/quiche/src/crypto/mod.rs +64 -77
- package/vendor/quiche/src/dgram.rs +2 -3
- package/vendor/quiche/src/error.rs +22 -20
- package/vendor/quiche/src/ffi.rs +558 -280
- package/vendor/quiche/src/flowcontrol.rs +0 -7
- package/vendor/quiche/src/frame.rs +134 -135
- package/vendor/quiche/src/h3/ffi.rs +73 -60
- package/vendor/quiche/src/h3/frame.rs +70 -90
- package/vendor/quiche/src/h3/mod.rs +1024 -593
- package/vendor/quiche/src/h3/qpack/decoder.rs +248 -34
- package/vendor/quiche/src/h3/qpack/dynamic_table.rs +859 -0
- package/vendor/quiche/src/h3/qpack/encoder.rs +14 -17
- package/vendor/quiche/src/h3/qpack/mod.rs +48 -0
- package/vendor/quiche/src/h3/qpack/static_table.rs +86 -73
- package/vendor/quiche/src/h3/stream.rs +1009 -194
- package/vendor/quiche/src/lib.rs +1346 -1195
- package/vendor/quiche/src/minmax.rs +2 -6
- package/vendor/quiche/src/packet.rs +420 -552
- package/vendor/quiche/src/path.rs +202 -72
- package/vendor/quiche/src/pmtud.rs +18 -16
- package/vendor/quiche/src/ranges.rs +184 -82
- package/vendor/quiche/src/recovery/AGENTS.md +5 -2
- package/vendor/quiche/src/recovery/bandwidth.rs +59 -40
- package/vendor/quiche/src/recovery/bytes_in_flight.rs +2 -2
- package/vendor/quiche/src/recovery/congestion/cubic.rs +38 -47
- package/vendor/quiche/src/recovery/congestion/delivery_rate.rs +54 -60
- package/vendor/quiche/src/recovery/congestion/hystart.rs +6 -10
- package/vendor/quiche/src/recovery/congestion/mod.rs +110 -42
- package/vendor/quiche/src/recovery/congestion/prr.rs +4 -1
- package/vendor/quiche/src/recovery/congestion/recovery.rs +91 -95
- package/vendor/quiche/src/recovery/congestion/reno.rs +17 -12
- package/vendor/quiche/src/recovery/congestion/test_sender.rs +8 -27
- package/vendor/quiche/src/recovery/gcongestion/bbr/bandwidth_sampler.rs +159 -247
- package/vendor/quiche/src/recovery/gcongestion/bbr/windowed_filter.rs +9 -14
- package/vendor/quiche/src/recovery/gcongestion/bbr2/drain.rs +18 -15
- package/vendor/quiche/src/recovery/gcongestion/bbr2/mode.rs +43 -28
- package/vendor/quiche/src/recovery/gcongestion/bbr2/network_model.rs +349 -76
- package/vendor/quiche/src/recovery/gcongestion/bbr2/probe_bw.rs +147 -195
- package/vendor/quiche/src/recovery/gcongestion/bbr2/probe_rtt.rs +29 -27
- package/vendor/quiche/src/recovery/gcongestion/bbr2/rtt_jump_detector/global_min.rs +180 -0
- package/vendor/quiche/src/recovery/gcongestion/bbr2/rtt_jump_detector/global_min_tests.rs +221 -0
- package/vendor/quiche/src/recovery/gcongestion/bbr2/rtt_jump_detector/hmm.rs +395 -0
- package/vendor/quiche/src/recovery/gcongestion/bbr2/rtt_jump_detector/hmm_tests.rs +473 -0
- package/vendor/quiche/src/recovery/gcongestion/bbr2/rtt_jump_detector/mod.rs +175 -0
- package/vendor/quiche/src/recovery/gcongestion/bbr2/startup.rs +33 -26
- package/vendor/quiche/src/recovery/gcongestion/bbr2.rs +107 -60
- package/vendor/quiche/src/recovery/gcongestion/mod.rs +64 -11
- package/vendor/quiche/src/recovery/gcongestion/pacer.rs +34 -25
- package/vendor/quiche/src/recovery/gcongestion/recovery.rs +81 -86
- package/vendor/quiche/src/recovery/mod.rs +414 -173
- package/vendor/quiche/src/recovery/rtt.rs +8 -5
- package/vendor/quiche/src/stream/mod.rs +864 -133
- package/vendor/quiche/src/stream/recv_buf.rs +471 -172
- package/vendor/quiche/src/stream/send_buf.rs +338 -81
- package/vendor/quiche/src/test_utils.rs +78 -64
- package/vendor/quiche/src/tests.rs +2559 -1335
- package/vendor/quiche/src/tls/boringssl.rs +60 -63
- package/vendor/quiche/src/tls/mod.rs +146 -193
- package/vendor/quiche/src/transport_params.rs +87 -103
|
@@ -88,9 +88,7 @@ where
|
|
|
88
88
|
if match &self.estimates[0] {
|
|
89
89
|
None => true,
|
|
90
90
|
Some(best) if new_sample > best.sample => true,
|
|
91
|
-
_ =>
|
|
92
|
-
new_time - self.estimates[2].as_ref().unwrap().time >
|
|
93
|
-
self.window_length,
|
|
91
|
+
_ => new_time - self.estimates[2].as_ref().unwrap().time > self.window_length,
|
|
94
92
|
} {
|
|
95
93
|
return self.reset(new_sample, new_time);
|
|
96
94
|
}
|
|
@@ -118,10 +116,8 @@ where
|
|
|
118
116
|
sample: new_sample,
|
|
119
117
|
time: new_time,
|
|
120
118
|
});
|
|
121
|
-
//
|
|
122
|
-
//
|
|
123
|
-
// long time ago. Don't need to iterate once more since we cover that
|
|
124
|
-
// case at the beginning of the method.
|
|
119
|
+
// The new best estimate may also be stale. Check it once more. The
|
|
120
|
+
// check at the start of the method handles further stale samples.
|
|
125
121
|
if new_time - self.estimates[0].unwrap().time > self.window_length {
|
|
126
122
|
self.estimates[0] = self.estimates[1];
|
|
127
123
|
self.estimates[1] = self.estimates[2];
|
|
@@ -129,12 +125,11 @@ where
|
|
|
129
125
|
return;
|
|
130
126
|
}
|
|
131
127
|
|
|
132
|
-
if self.estimates[1].unwrap().sample == self.estimates[0].unwrap().sample
|
|
133
|
-
new_time - self.estimates[1].unwrap().time > self.window_length / 4
|
|
128
|
+
if self.estimates[1].unwrap().sample == self.estimates[0].unwrap().sample
|
|
129
|
+
&& new_time - self.estimates[1].unwrap().time > self.window_length / 4
|
|
134
130
|
{
|
|
135
|
-
//
|
|
136
|
-
// second-best estimate
|
|
137
|
-
// window.
|
|
131
|
+
// No better sample arrived for a quarter of the window, so take the
|
|
132
|
+
// second-best estimate from the second quarter.
|
|
138
133
|
self.estimates[1] = Some(Sample {
|
|
139
134
|
sample: new_sample,
|
|
140
135
|
time: new_time,
|
|
@@ -143,8 +138,8 @@ where
|
|
|
143
138
|
return;
|
|
144
139
|
}
|
|
145
140
|
|
|
146
|
-
if self.estimates[2].unwrap().sample == self.estimates[1].unwrap().sample
|
|
147
|
-
new_time - self.estimates[2].unwrap().time > self.window_length / 2
|
|
141
|
+
if self.estimates[2].unwrap().sample == self.estimates[1].unwrap().sample
|
|
142
|
+
&& new_time - self.estimates[2].unwrap().time > self.window_length / 2
|
|
148
143
|
{
|
|
149
144
|
// We've passed a half of the window without a better estimate, so
|
|
150
145
|
// take a third-best estimate from the second half of the
|
|
@@ -59,11 +59,16 @@ impl ModeImpl for Drain {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
fn on_congestion_event(
|
|
62
|
-
mut self,
|
|
63
|
-
|
|
62
|
+
mut self,
|
|
63
|
+
_prior_in_flight: usize,
|
|
64
|
+
event_time: Instant,
|
|
65
|
+
_acked_packets: &[Acked],
|
|
66
|
+
_lost_packets: &[Lost],
|
|
64
67
|
congestion_event: &mut BBRv2CongestionEvent,
|
|
65
|
-
_target_bytes_inflight: usize,
|
|
66
|
-
|
|
68
|
+
_target_bytes_inflight: usize,
|
|
69
|
+
params: &Params,
|
|
70
|
+
_recovery_stats: &mut RecoveryStats,
|
|
71
|
+
_cwnd: usize,
|
|
67
72
|
) -> Mode {
|
|
68
73
|
self.model.set_pacing_gain(params.drain_pacing_gain);
|
|
69
74
|
// Only STARTUP can transition to DRAIN, both of them use the same cwnd
|
|
@@ -72,11 +77,7 @@ impl ModeImpl for Drain {
|
|
|
72
77
|
|
|
73
78
|
let drain_target = self.drain_target();
|
|
74
79
|
if congestion_event.bytes_in_flight <= drain_target {
|
|
75
|
-
return self.into_probe_bw(
|
|
76
|
-
event_time,
|
|
77
|
-
Some(congestion_event),
|
|
78
|
-
params,
|
|
79
|
-
);
|
|
80
|
+
return self.into_probe_bw(event_time, Some(congestion_event), params);
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
Mode::Drain(self)
|
|
@@ -90,22 +91,24 @@ impl ModeImpl for Drain {
|
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
fn on_exit_quiescence(
|
|
93
|
-
self,
|
|
94
|
+
self,
|
|
95
|
+
_now: Instant,
|
|
96
|
+
_quiescence_start_time: Instant,
|
|
97
|
+
_params: &Params,
|
|
94
98
|
) -> Mode {
|
|
95
99
|
Mode::Drain(self)
|
|
96
100
|
}
|
|
97
101
|
|
|
98
|
-
fn enter(
|
|
99
|
-
&mut self, _: Instant, _: Option<&BBRv2CongestionEvent>, _params: &Params,
|
|
100
|
-
) {
|
|
101
|
-
}
|
|
102
|
+
fn enter(&mut self, _: Instant, _: Option<&BBRv2CongestionEvent>, _params: &Params) {}
|
|
102
103
|
|
|
103
104
|
fn leave(&mut self, _: Instant, _: Option<&BBRv2CongestionEvent>) {}
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
impl Drain {
|
|
107
108
|
fn into_probe_bw(
|
|
108
|
-
mut self,
|
|
109
|
+
mut self,
|
|
110
|
+
now: Instant,
|
|
111
|
+
congestion_event: Option<&BBRv2CongestionEvent>,
|
|
109
112
|
params: &Params,
|
|
110
113
|
) -> Mode {
|
|
111
114
|
self.leave(now, congestion_event);
|
|
@@ -123,29 +123,37 @@ pub(super) trait ModeImpl: Debug {
|
|
|
123
123
|
fn state_str(&self) -> &'static str;
|
|
124
124
|
|
|
125
125
|
fn enter(
|
|
126
|
-
&mut self,
|
|
126
|
+
&mut self,
|
|
127
|
+
now: Instant,
|
|
128
|
+
congestion_event: Option<&BBRv2CongestionEvent>,
|
|
127
129
|
params: &Params,
|
|
128
130
|
);
|
|
129
131
|
|
|
130
|
-
fn leave(
|
|
131
|
-
&mut self, now: Instant, congestion_event: Option<&BBRv2CongestionEvent>,
|
|
132
|
-
);
|
|
132
|
+
fn leave(&mut self, now: Instant, congestion_event: Option<&BBRv2CongestionEvent>);
|
|
133
133
|
|
|
134
134
|
fn is_probing_for_bandwidth(&self) -> bool;
|
|
135
135
|
|
|
136
136
|
#[allow(clippy::too_many_arguments)]
|
|
137
137
|
fn on_congestion_event(
|
|
138
|
-
self,
|
|
139
|
-
|
|
138
|
+
self,
|
|
139
|
+
prior_in_flight: usize,
|
|
140
|
+
event_time: Instant,
|
|
141
|
+
acked_packets: &[Acked],
|
|
142
|
+
lost_packets: &[Lost],
|
|
140
143
|
congestion_event: &mut BBRv2CongestionEvent,
|
|
141
|
-
target_bytes_inflight: usize,
|
|
142
|
-
|
|
144
|
+
target_bytes_inflight: usize,
|
|
145
|
+
params: &Params,
|
|
146
|
+
recovery_stats: &mut RecoveryStats,
|
|
147
|
+
cwnd: usize,
|
|
143
148
|
) -> Mode;
|
|
144
149
|
|
|
145
150
|
fn get_cwnd_limits(&self, params: &Params) -> Limits<usize>;
|
|
146
151
|
|
|
147
152
|
fn on_exit_quiescence(
|
|
148
|
-
self,
|
|
153
|
+
self,
|
|
154
|
+
now: Instant,
|
|
155
|
+
quiescence_start_time: Instant,
|
|
156
|
+
params: &Params,
|
|
149
157
|
) -> Mode;
|
|
150
158
|
}
|
|
151
159
|
|
|
@@ -187,11 +195,16 @@ impl Mode {
|
|
|
187
195
|
|
|
188
196
|
#[allow(clippy::too_many_arguments)]
|
|
189
197
|
pub(super) fn do_on_congestion_event(
|
|
190
|
-
&mut self,
|
|
191
|
-
|
|
198
|
+
&mut self,
|
|
199
|
+
prior_in_flight: usize,
|
|
200
|
+
event_time: Instant,
|
|
201
|
+
acked_packets: &[Acked],
|
|
202
|
+
lost_packets: &[Lost],
|
|
192
203
|
congestion_event: &mut BBRv2CongestionEvent,
|
|
193
|
-
target_bytes_inflight: usize,
|
|
194
|
-
|
|
204
|
+
target_bytes_inflight: usize,
|
|
205
|
+
params: &Params,
|
|
206
|
+
recovery_stats: &mut RecoveryStats,
|
|
207
|
+
cwnd: usize,
|
|
195
208
|
) -> bool {
|
|
196
209
|
let mode_before = std::mem::discriminant(self);
|
|
197
210
|
|
|
@@ -213,13 +226,12 @@ impl Mode {
|
|
|
213
226
|
}
|
|
214
227
|
|
|
215
228
|
pub(super) fn do_on_exit_quiescence(
|
|
216
|
-
&mut self,
|
|
229
|
+
&mut self,
|
|
230
|
+
now: Instant,
|
|
231
|
+
quiescence_start_time: Instant,
|
|
232
|
+
params: &Params,
|
|
217
233
|
) {
|
|
218
|
-
*self = std::mem::take(self).on_exit_quiescence(
|
|
219
|
-
now,
|
|
220
|
-
quiescence_start_time,
|
|
221
|
-
params,
|
|
222
|
-
)
|
|
234
|
+
*self = std::mem::take(self).on_exit_quiescence(now, quiescence_start_time, params)
|
|
223
235
|
}
|
|
224
236
|
|
|
225
237
|
pub fn network_model(&self) -> &BBRv2NetworkModel {
|
|
@@ -252,9 +264,7 @@ impl ModeImpl for Placeholder {
|
|
|
252
264
|
unreachable!()
|
|
253
265
|
}
|
|
254
266
|
|
|
255
|
-
fn enter(
|
|
256
|
-
&mut self, _: Instant, _: Option<&BBRv2CongestionEvent>, _params: &Params,
|
|
257
|
-
) {
|
|
267
|
+
fn enter(&mut self, _: Instant, _: Option<&BBRv2CongestionEvent>, _params: &Params) {
|
|
258
268
|
unreachable!()
|
|
259
269
|
}
|
|
260
270
|
|
|
@@ -267,9 +277,16 @@ impl ModeImpl for Placeholder {
|
|
|
267
277
|
}
|
|
268
278
|
|
|
269
279
|
fn on_congestion_event(
|
|
270
|
-
self,
|
|
271
|
-
_:
|
|
272
|
-
|
|
280
|
+
self,
|
|
281
|
+
_: usize,
|
|
282
|
+
_: Instant,
|
|
283
|
+
_: &[Acked],
|
|
284
|
+
_: &[Lost],
|
|
285
|
+
_: &mut BBRv2CongestionEvent,
|
|
286
|
+
_: usize,
|
|
287
|
+
_params: &Params,
|
|
288
|
+
_recovery_stats: &mut RecoveryStats,
|
|
289
|
+
_cwnd: usize,
|
|
273
290
|
) -> Mode {
|
|
274
291
|
unreachable!()
|
|
275
292
|
}
|
|
@@ -278,9 +295,7 @@ impl ModeImpl for Placeholder {
|
|
|
278
295
|
unreachable!()
|
|
279
296
|
}
|
|
280
297
|
|
|
281
|
-
fn on_exit_quiescence(
|
|
282
|
-
self, _: Instant, _: Instant, _params: &Params,
|
|
283
|
-
) -> Mode {
|
|
298
|
+
fn on_exit_quiescence(self, _: Instant, _: Instant, _params: &Params) -> Mode {
|
|
284
299
|
unreachable!()
|
|
285
300
|
}
|
|
286
301
|
}
|