Skip to content

Commit d87a9a0

Browse files
authored
Merge pull request #438 from Tencent/release/v1.6.0
Release/v1.6.0
2 parents c97daa6 + b469f62 commit d87a9a0

18 files changed

+52
-39
lines changed

.github/workflows/tquic-benchmark.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111
jobs:
1212
config:
1313
name: Prepare config
14-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-22.04
1515
outputs:
1616
benchmark_date: ${{ steps.set-benchmark-date.outputs.benchmark_date }}
1717
benchmark_impls: ${{ steps.set-implements.outputs.benchmark_impls }}
@@ -43,7 +43,7 @@ jobs:
4343
4444
build_tquic:
4545
name: Build tquic
46-
runs-on: ubuntu-latest
46+
runs-on: ubuntu-22.04
4747
needs: config
4848
steps:
4949
- uses: actions/checkout@v4
@@ -75,7 +75,7 @@ jobs:
7575

7676
build_lsquic:
7777
name: Build lsquic
78-
runs-on: ubuntu-latest
78+
runs-on: ubuntu-22.04
7979
needs: config
8080
steps:
8181
- uses: actions/checkout@v4
@@ -109,7 +109,7 @@ jobs:
109109
110110
gen_cert:
111111
name: Generate cert
112-
runs-on: ubuntu-latest
112+
runs-on: ubuntu-22.04
113113
needs: config
114114
steps:
115115
- name: Generate cert
@@ -124,7 +124,7 @@ jobs:
124124

125125
gen_files:
126126
name: Generate files
127-
runs-on: ubuntu-latest
127+
runs-on: ubuntu-22.04
128128
needs: config
129129
steps:
130130
- name: Generate files
@@ -142,7 +142,7 @@ jobs:
142142
run_long_conn:
143143
name: Run long connection scenario benchmark
144144
needs: [ config, build_tquic, build_lsquic, gen_cert, gen_files ]
145-
runs-on: ubuntu-latest
145+
runs-on: ubuntu-22.04
146146
strategy:
147147
matrix:
148148
file: [ 15K, 50K, 2M ]
@@ -177,7 +177,7 @@ jobs:
177177
run_short_conn:
178178
name: Run short connection scenario benchmark
179179
needs: [ config, build_tquic, build_lsquic, gen_cert, gen_files ]
180-
runs-on: ubuntu-latest
180+
runs-on: ubuntu-22.04
181181
steps:
182182
- name: Download all
183183
uses: actions/download-artifact@v4
@@ -191,7 +191,7 @@ jobs:
191191
sh ${impl}_server_bin/start_${impl}.sh
192192
pgrep ${impl}_server
193193
sleep 1
194-
./tquic_client_bin/tquic_client https://tquic_benchmark:4433/file_1K --connect-to 127.0.0.1:4433 --threads 10 --max-concurrent-conns 1 --max-concurrent-requests 1 --max-requests-per-conn 1 --total-requests-per-thread 0 -d ${{ needs.config.outputs.benchmark_duration }} --disable-stateless-reset --send-batch-size 1 --recv-udp-payload-size 1350 --send-udp-payload-size 1350 --log-level OFF > client.log 2>&1
194+
./tquic_client_bin/tquic_client https://tquic_benchmark:4433/file_1K --connect-to 127.0.0.1:4433 --threads 10 --max-concurrent-conns 10 --max-concurrent-requests 1 --max-requests-per-conn 1 --total-requests-per-thread 0 -d ${{ needs.config.outputs.benchmark_duration }} --disable-stateless-reset --send-batch-size 1 --recv-udp-payload-size 1350 --send-udp-payload-size 1350 --log-level OFF > client.log 2>&1
195195
cat client.log | grep "finished in" | awk '{print $4}' > benchmark_short_${impl}_1K_10_1.${round}.${{ needs.config.outputs.benchmark_date }}
196196
killall ${impl}_server
197197
sleep 1
@@ -205,7 +205,7 @@ jobs:
205205
retention-days: 90
206206

207207
result:
208-
runs-on: ubuntu-latest
208+
runs-on: ubuntu-22.04
209209
needs: [ run_long_conn, run_short_conn ]
210210
steps:
211211
- name: Download plot tools

CHANGELOG.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1111
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1212

1313

14-
## [v1.5.0] - 2024-10-28
14+
## [v1.6.0] - 2025-02-25
15+
16+
### Added
17+
18+
### Fixed
19+
- Fix packets_acked event for qlog
20+
- Fix the issue where sending coalesced packets occasionally causes a panic
21+
- Fix code lint
22+
- Fix spelling mistakes
23+
24+
25+
## [v1.5.0] - 2024-11-08
1526

1627
### Added
1728
- Add h3 feature flag to reduce the size of complied library
@@ -349,6 +360,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
349360
- Provide example clients and servers.
350361

351362

363+
[v1.6.0]: https://github.com/tencent/tquic/compare/v1.5.0...v1.6.0
352364
[v1.5.0]: https://github.com/tencent/tquic/compare/v1.4.0...v1.5.0
353365
[v1.4.0]: https://github.com/tencent/tquic/compare/v1.3.1...v1.4.0
354366
[v1.3.1]: https://github.com/tencent/tquic/compare/v1.3.0...v1.3.1

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tquic"
3-
version = "1.5.0"
3+
version = "1.6.0"
44
edition = "2021"
55
rust-version = "1.70.0"
66
license = "Apache-2.0"

src/congestion_control/bbr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ impl CongestionController for Bbr {
10641064
}
10651065

10661066
fn in_recovery(&self, sent_time: Instant) -> bool {
1067-
self.recovery_epoch_start.map_or(false, |t| sent_time <= t)
1067+
self.recovery_epoch_start.is_some_and(|t| sent_time <= t)
10681068
}
10691069

10701070
fn in_slow_start(&self) -> bool {

src/congestion_control/bbr3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ impl Bbr3 {
760760
}
761761

762762
fn in_recovery(&self, sent_time: Instant) -> bool {
763-
self.recovery_epoch_start.map_or(false, |t| sent_time <= t)
763+
self.recovery_epoch_start.is_some_and(|t| sent_time <= t)
764764
}
765765

766766
fn in_slow_start(&self) -> bool {

src/congestion_control/cubic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ impl CongestionController for Cubic {
506506
}
507507

508508
fn in_recovery(&self, sent_time: Instant) -> bool {
509-
self.recovery_epoch_start.map_or(false, |t| sent_time <= t)
509+
self.recovery_epoch_start.is_some_and(|t| sent_time <= t)
510510
}
511511

512512
fn congestion_window(&self) -> u64 {

src/connection/connection.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -1708,7 +1708,11 @@ impl Connection {
17081708
}
17091709

17101710
// Encode packet number
1711-
let len = packet::encode_packet_num(pkt_num, pkt_num_len, &mut out[pkt_num_offset..left])?;
1711+
let len = packet::encode_packet_num(
1712+
pkt_num,
1713+
pkt_num_len,
1714+
&mut out[pkt_num_offset..pkt_num_offset + pkt_num_len],
1715+
)?;
17121716
let payload_offset = pkt_num_offset + len;
17131717

17141718
// Write frames into the packet payload
@@ -2992,7 +2996,7 @@ impl Connection {
29922996
// frame in a packet with the highest level of packet protection to
29932997
// avoid the packet being discarded.
29942998
// See RFC 9000 Section 10.2.3
2995-
if self.local_error.as_ref().map_or(false, |e| !e.is_app) {
2999+
if self.local_error.as_ref().is_some_and(|e| !e.is_app) {
29963000
let pkt_type = match self.tls_session.write_level() {
29973001
Level::Initial => PacketType::Initial,
29983002
Level::Handshake => PacketType::Handshake,
@@ -3069,7 +3073,7 @@ impl Connection {
30693073
|| self.tls_session.is_in_early_data())
30703074
&& (self.need_send_handshake_done_frame()
30713075
|| self.need_send_new_token_frame()
3072-
|| self.local_error.as_ref().map_or(false, |e| e.is_app)
3076+
|| self.local_error.as_ref().is_some_and(|e| e.is_app)
30733077
|| path.need_send_validation_frames(self.is_server)
30743078
|| path.dplpmtud.should_probe()
30753079
|| path.need_send_ping
@@ -3090,7 +3094,7 @@ impl Connection {
30903094
fn need_send_path_unaware_frames(&self) -> bool {
30913095
self.need_send_handshake_done_frame()
30923096
|| self.need_send_new_token_frame()
3093-
|| self.local_error.as_ref().map_or(false, |e| e.is_app)
3097+
|| self.local_error.as_ref().is_some_and(|e| e.is_app)
30943098
|| self.cids.need_send_cid_control_frames()
30953099
|| self.streams.need_send_stream_frames()
30963100
}

src/connection/recovery.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ impl Recovery {
802802
space.lost.clear();
803803
space.acked.clear();
804804

805-
// Reset loss dection timer
805+
// Reset loss detection timer
806806
space.time_of_last_sent_ack_eliciting_pkt = None;
807807
space.loss_time = None;
808808
space.loss_probes = 0;

src/connection/stream.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -4731,7 +4731,7 @@ mod tests {
47314731
// write empty data with fin flag, it should be ok.
47324732
assert_eq!(stream.send.write(Bytes::new(), true), Ok(0));
47334733

4734-
// Shutdown the stream abrubtly, it should be ok.
4734+
// Shutdown the stream abruptly, it should be ok.
47354735
assert_eq!(stream.send.shutdown(), Ok((0, 18)));
47364736
// Here we call `write` to make sure the stream's fin_off is set.
47374737
assert_eq!(stream.recv.write(0, Bytes::new(), true), Ok(()));
@@ -4939,7 +4939,7 @@ mod tests {
49394939
assert_eq!(map.get(20).unwrap().recv.fin_off, Some(30));
49404940

49414941
// 10. Receive a RESET_STREAM frame for a stream which has been closed.
4942-
// Shutdown the stream abrubtly, it should be ok.
4942+
// Shutdown the stream abruptly, it should be ok.
49434943
let stream = map.get_or_create(24, false).unwrap();
49444944
assert_eq!(stream.send.shutdown(), Ok((0, 0)));
49454945
// Here we call `write` to make sure the stream's fin_off is set.
@@ -5064,7 +5064,7 @@ mod tests {
50645064
assert_eq!(map.on_stop_sending_frame_received(4, 0), Ok(()));
50655065

50665066
// 5. Receive a STOP_SENDING frame for a stream which has been closed.
5067-
// Shutdown the stream abrubtly, it should be ok.
5067+
// Shutdown the stream abruptly, it should be ok.
50685068
let stream = map.get_or_create(24, false).unwrap();
50695069
assert_eq!(stream.send.shutdown(), Ok((0, 0)));
50705070
// Here we call `write` to make sure the stream's fin_off is set.
@@ -5134,7 +5134,7 @@ mod tests {
51345134
assert_eq!(map.on_stop_sending_frame_received(5, 0), Ok(()));
51355135

51365136
// 5. Receive a STOP_SENDING frame for a stream which has been closed.
5137-
// Shutdown the stream abrubtly, it should be ok.
5137+
// Shutdown the stream abruptly, it should be ok.
51385138
let stream = map.get_or_create(25, false).unwrap();
51395139
assert_eq!(stream.send.shutdown(), Ok((0, 0)));
51405140
// Here we call `write` to make sure the stream's fin_off is set.

src/connection/timer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl TimerTable {
7777

7878
/// Check whether the given timer is expired
7979
pub fn is_expired(&self, timer: Timer, after: Instant) -> bool {
80-
self.expires[timer as usize].map_or(false, |x| x <= after)
80+
self.expires[timer as usize].is_some_and(|x| x <= after)
8181
}
8282
}
8383

src/endpoint.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -757,10 +757,7 @@ impl Endpoint {
757757
&self.trace_id,
758758
);
759759

760-
let done = match self.sender.on_packets_send(batch) {
761-
Ok(v) => v,
762-
Err(e) => return Err(e),
763-
};
760+
let done = self.sender.on_packets_send(batch)?;
764761
if done == 0 {
765762
break;
766763
}

src/ffi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1992,7 +1992,7 @@ pub struct PacketInfo<'a> {
19921992
dst_len: socklen_t,
19931993
}
19941994

1995-
impl<'a> From<&PacketInfo<'a>> for crate::PacketInfo {
1995+
impl From<&PacketInfo<'_>> for crate::PacketInfo {
19961996
fn from(info: &PacketInfo) -> crate::PacketInfo {
19971997
crate::PacketInfo {
19981998
src: sock_addr_from_c(info.src, info.src_len),

src/h3/h3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ impl<'a> HeaderRef<'a> {
175175
}
176176
}
177177

178-
impl<'a> NameValue for HeaderRef<'a> {
178+
impl NameValue for HeaderRef<'_> {
179179
fn name(&self) -> &[u8] {
180180
self.0
181181
}

src/h3/qpack/huffman.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ const ENCODE_TABLE: [(usize, u64); 257] = [
419419
];
420420

421421
/// The multi-level decoding table for huffman decoder.
422-
const DECODE_TABLE: [[(usize, u8, u8); 16]; 256] = [
422+
static DECODE_TABLE: [[(usize, u8, u8); 16]; 256] = [
423423
// 0
424424
[
425425
// (next-state, byte, flags).

src/packet.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ fn encrypt_header(
494494
/// Decrypt payload of a QUIC packet.
495495
///
496496
/// The `pkt_buf` is the raw data of a QUIC packet.
497-
/// The `paylaod_offset` is the offset of packet payload in `pkt_buf`.
497+
/// The `payload_offset` is the offset of packet payload in `pkt_buf`.
498498
/// The `payload_len` is the length of pacekt payload (other than the value of Length field).
499499
/// The `pkt_num` is the decrypted and decoded packet number.
500500
#[allow(unexpected_cfgs)]

src/qlog/events.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ pub enum EventData {
302302
/// first time, as QUIC uses ACK ranges which can include repeated ACKs.
303303
/// Additionally, this event can be used by implementations that do not log
304304
/// frame contents.
305-
#[serde(rename = "quic:version_information")]
305+
#[serde(rename = "quic:packets_acked")]
306306
QuicPacketsAcked {
307307
packet_number_space: Option<PacketNumberSpace>,
308308
packet_numbers: Option<Vec<u64>>,

src/ranges.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ pub struct Iter<'a> {
307307
set: btree_map::Iter<'a, u64, u64>,
308308
}
309309

310-
impl<'a> Iterator for Iter<'a> {
310+
impl Iterator for Iter<'_> {
311311
type Item = Range<u64>;
312312

313313
fn next(&mut self) -> Option<Range<u64>> {
@@ -316,14 +316,14 @@ impl<'a> Iterator for Iter<'a> {
316316
}
317317
}
318318

319-
impl<'a> DoubleEndedIterator for Iter<'a> {
319+
impl DoubleEndedIterator for Iter<'_> {
320320
fn next_back(&mut self) -> Option<Range<u64>> {
321321
let (&start, &end) = self.set.next_back()?;
322322
Some(start..end)
323323
}
324324
}
325325

326-
impl<'a> ExactSizeIterator for Iter<'a> {
326+
impl ExactSizeIterator for Iter<'_> {
327327
fn len(&self) -> usize {
328328
self.set.len()
329329
}
@@ -335,7 +335,7 @@ pub struct Flatten<'a> {
335335
end: u64,
336336
}
337337

338-
impl<'a> Iterator for Flatten<'a> {
338+
impl Iterator for Flatten<'_> {
339339
type Item = u64;
340340

341341
fn next(&mut self) -> Option<u64> {
@@ -353,7 +353,7 @@ impl<'a> Iterator for Flatten<'a> {
353353
}
354354
}
355355

356-
impl<'a> DoubleEndedIterator for Flatten<'a> {
356+
impl DoubleEndedIterator for Flatten<'_> {
357357
fn next_back(&mut self) -> Option<u64> {
358358
if self.next == self.end {
359359
let (&start, &end) = self.set.next_back()?;

tools/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tquic_tools"
3-
version = "1.5.0"
3+
version = "1.6.0"
44
edition = "2021"
55
rust-version = "1.70.0"
66
license = "Apache-2.0"

0 commit comments

Comments
 (0)