Skip to content

Commit a2890f6

Browse files
committed
Release 4.0.11
1 parent 48fac52 commit a2890f6

File tree

8 files changed

+55
-29
lines changed

8 files changed

+55
-29
lines changed

CHANGELOG

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2024-09-09
2+
- 4.0.11
3+
- Fix assert failure related to splitting a large packet.
4+
5+
2024-07-02
6+
- 4.0.10
7+
- Fix server initial packet padding.
8+
- Fix a handshake failure corner case due to packet corruption.
9+
110
2024-06-12
211
- 4.0.9
312
- Fix bpq_count (issue #504).

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# The short X.Y version
2727
version = u'4.0'
2828
# The full version, including alpha/beta/rc tags
29-
release = u'4.0.9'
29+
release = u'4.0.11'
3030

3131

3232
# -- General configuration ---------------------------------------------------

include/lsquic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern "C" {
2727

2828
#define LSQUIC_MAJOR_VERSION 4
2929
#define LSQUIC_MINOR_VERSION 0
30-
#define LSQUIC_PATCH_VERSION 9
30+
#define LSQUIC_PATCH_VERSION 11
3131

3232
/**
3333
* Engine flags:

src/liblsquic/lsquic_full_conn_ietf.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4561,6 +4561,7 @@ generate_ping_frame (struct ietf_full_conn *conn, lsquic_time_t now)
45614561
return;
45624562
}
45634563
lsquic_send_ctl_incr_pack_sz(&conn->ifc_send_ctl, packet_out, sz);
4564+
packet_out->po_regen_sz += sz;
45644565
packet_out->po_frame_types |= 1 << QUIC_FRAME_PING;
45654566
LSQ_DEBUG("wrote PING frame");
45664567
conn->ifc_send_flags &= ~SF_SEND_PING;
@@ -7800,6 +7801,8 @@ process_incoming_packet_verneg (struct ietf_full_conn *conn,
78007801
lsquic_send_ctl_expire_all(&conn->ifc_send_ctl);
78017802
return 0;
78027803
}
7804+
else if (HETY_RETRY == packet_in->pi_header_type)
7805+
return process_retry_packet(conn, packet_in);
78037806

78047807
if (packet_in->pi_version != conn->ifc_u.cli.ifcli_ver_neg.vn_ver)
78057808
{
@@ -8147,6 +8150,7 @@ check_or_schedule_mtu_probe (struct ietf_full_conn *conn, lsquic_time_t now)
81478150
* resized, only discarded.
81488151
*/
81498152
lsquic_send_ctl_incr_pack_sz(&conn->ifc_send_ctl, packet_out, sz);
8153+
packet_out->po_regen_sz += sz;
81508154
packet_out->po_frame_types |= 1 << QUIC_FRAME_PING;
81518155
avail = lsquic_packet_out_avail(packet_out);
81528156
if (avail)

src/liblsquic/lsquic_mini_conn_ietf.c

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,16 @@ imico_maybe_process_params (struct ietf_mini_conn *conn)
265265
}
266266

267267

268+
static void
269+
imico_zero_pad (struct lsquic_packet_out *packet_out, size_t pad_size)
270+
{
271+
memset(packet_out->po_data + packet_out->po_data_sz, 0, pad_size);
272+
packet_out->po_padding_sz = pad_size;
273+
packet_out->po_data_sz += pad_size;
274+
packet_out->po_frame_types |= QUIC_FTBIT_PADDING;
275+
}
276+
277+
268278
static int
269279
imico_generate_ack (struct ietf_mini_conn *conn, enum packnum_space pns,
270280
lsquic_time_t now);
@@ -309,11 +319,14 @@ imico_stream_write (void *stream, const void *bufp, size_t bufsz)
309319
return -1;
310320
// NOTE: reduce the size of first crypto frame to combine packets
311321
int avail = lsquic_packet_out_avail(packet_out);
322+
int coalescing = 0;
312323
if (cryst->mcs_enc_level == ENC_LEV_HSK
313324
&& cryst->mcs_write_off == 0
314-
&& avail > conn->imc_hello_pkt_remain - conn->imc_long_header_sz)
325+
&& avail > (int)conn->imc_hello_pkt_remain - conn->imc_long_header_sz)
315326
{
316327
avail = conn->imc_hello_pkt_remain - conn->imc_long_header_sz;
328+
conn->imc_hello_pkt_remain = 0;
329+
coalescing = 1;
317330
}
318331
p = msg_ctx.buf;
319332
len = pf->pf_gen_crypto_frame(packet_out->po_data + packet_out->po_data_sz,
@@ -326,9 +339,15 @@ imico_stream_write (void *stream, const void *bufp, size_t bufsz)
326339
packet_out->po_data_sz += len;
327340
packet_out->po_frame_types |= 1 << QUIC_FRAME_CRYPTO;
328341
packet_out->po_flags |= PO_HELLO;
342+
if (coalescing && len < avail)
343+
{
344+
LSQ_DEBUG("generated PADDING frame: %d bytes for packet %"PRIu64,
345+
avail - len, packet_out->po_packno);
346+
imico_zero_pad(packet_out, avail - len);
347+
}
329348
cryst->mcs_write_off += msg_ctx.buf - p;
330349
if (cryst->mcs_enc_level == ENC_LEV_INIT)
331-
conn->imc_hello_pkt_remain = avail - len;
350+
conn->imc_hello_pkt_remain = lsquic_packet_out_avail(packet_out);
332351
}
333352

334353
assert(msg_ctx.buf == msg_ctx.end);
@@ -795,19 +814,6 @@ imico_can_send (const struct ietf_mini_conn *conn, size_t size)
795814
}
796815

797816

798-
// static void
799-
// imico_zero_pad (struct lsquic_packet_out *packet_out)
800-
// {
801-
// size_t pad_size;
802-
//
803-
// pad_size = lsquic_packet_out_avail(packet_out);
804-
// memset(packet_out->po_data + packet_out->po_data_sz, 0, pad_size);
805-
// packet_out->po_padding_sz = pad_size;
806-
// packet_out->po_data_sz += pad_size;
807-
// packet_out->po_frame_types |= QUIC_FTBIT_PADDING;
808-
// }
809-
810-
811817
static lsquic_time_t
812818
imico_rechist_largest_recv (void *rechist_ctx);
813819

@@ -939,14 +945,19 @@ ietf_mini_conn_ci_next_packet_to_send (struct lsquic_conn *lconn,
939945
"enough quota", packet_out->po_packno);
940946
return NULL;
941947
}
942-
// if (!(packet_out->po_frame_types & (1 << QUIC_FRAME_PADDING))
943-
// && (packet_out->po_frame_types & IQUIC_FRAME_ACKABLE_MASK)
944-
// && lsquic_packet_out_avail(packet_out) > 0)
945-
// {
946-
// LSQ_DEBUG("generated PADDING frame: %hd bytes for packet %"PRIu64,
947-
// lsquic_packet_out_avail(packet_out), packet_out->po_packno);
948-
// imico_zero_pad(packet_out);
949-
// }
948+
// NOTE: do not padd INIT packet only, here, instead pad the coalesced
949+
// later, can save one packet, more efficient.
950+
// if (!(packet_out->po_frame_types & (1 << QUIC_FRAME_PADDING))
951+
// && (packet_out->po_frame_types & IQUIC_FRAME_ACKABLE_MASK)
952+
// && IQUIC_MIN_INIT_PACKET_SZ > packet_out->po_data_sz)
953+
// {
954+
// size_t pad_size;
955+
//
956+
// pad_size = IQUIC_MIN_INIT_PACKET_SZ - packet_out->po_data_sz;
957+
// LSQ_DEBUG("generated PADDING frame: %zd bytes for packet %"PRIu64,
958+
// pad_size, packet_out->po_packno);
959+
// imico_zero_pad(packet_out, pad_size);
960+
// }
950961
}
951962
packet_size = lsquic_packet_out_total_sz(lconn, packet_out);
952963
if (!(to_coal

src/liblsquic/lsquic_send_ctl.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,8 +1569,10 @@ send_ctl_next_lost (lsquic_send_ctl_t *ctl)
15691569
lost_packet = TAILQ_FIRST(&ctl->sc_lost_packets);
15701570
while (lost_packet != NULL && lost_packet->po_regen_sz >= lost_packet->po_data_sz)
15711571
{
1572-
LSQ_DEBUG("Dropping packet %"PRIu64" from lost queue",
1573-
lost_packet->po_packno);
1572+
LSQ_DEBUG("Dropping packet %"PRIu64
1573+
" from lost queue, data size: %d, frames: %x",
1574+
lost_packet->po_packno, lost_packet->po_data_sz,
1575+
lost_packet->po_frame_types);
15741576
TAILQ_REMOVE(&ctl->sc_lost_packets, lost_packet, po_next);
15751577
lost_packet->po_flags &= ~PO_LOST;
15761578
send_ctl_destroy_chain(ctl, lost_packet, NULL);

0 commit comments

Comments
 (0)