Skip to content

Commit

Permalink
Release 4.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
gwanglst committed Sep 11, 2024
1 parent 48fac52 commit a2890f6
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 29 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2024-09-09
- 4.0.11
- Fix assert failure related to splitting a large packet.

2024-07-02
- 4.0.10
- Fix server initial packet padding.
- Fix a handshake failure corner case due to packet corruption.

2024-06-12
- 4.0.9
- Fix bpq_count (issue #504).
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# The short X.Y version
version = u'4.0'
# The full version, including alpha/beta/rc tags
release = u'4.0.9'
release = u'4.0.11'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion include/lsquic.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extern "C" {

#define LSQUIC_MAJOR_VERSION 4
#define LSQUIC_MINOR_VERSION 0
#define LSQUIC_PATCH_VERSION 9
#define LSQUIC_PATCH_VERSION 11

/**
* Engine flags:
Expand Down
2 changes: 1 addition & 1 deletion src/liblsquic/ls-qpack
4 changes: 4 additions & 0 deletions src/liblsquic/lsquic_full_conn_ietf.c
Original file line number Diff line number Diff line change
Expand Up @@ -4561,6 +4561,7 @@ generate_ping_frame (struct ietf_full_conn *conn, lsquic_time_t now)
return;
}
lsquic_send_ctl_incr_pack_sz(&conn->ifc_send_ctl, packet_out, sz);
packet_out->po_regen_sz += sz;
packet_out->po_frame_types |= 1 << QUIC_FRAME_PING;
LSQ_DEBUG("wrote PING frame");
conn->ifc_send_flags &= ~SF_SEND_PING;
Expand Down Expand Up @@ -7800,6 +7801,8 @@ process_incoming_packet_verneg (struct ietf_full_conn *conn,
lsquic_send_ctl_expire_all(&conn->ifc_send_ctl);
return 0;
}
else if (HETY_RETRY == packet_in->pi_header_type)
return process_retry_packet(conn, packet_in);

if (packet_in->pi_version != conn->ifc_u.cli.ifcli_ver_neg.vn_ver)
{
Expand Down Expand Up @@ -8147,6 +8150,7 @@ check_or_schedule_mtu_probe (struct ietf_full_conn *conn, lsquic_time_t now)
* resized, only discarded.
*/
lsquic_send_ctl_incr_pack_sz(&conn->ifc_send_ctl, packet_out, sz);
packet_out->po_regen_sz += sz;
packet_out->po_frame_types |= 1 << QUIC_FRAME_PING;
avail = lsquic_packet_out_avail(packet_out);
if (avail)
Expand Down
57 changes: 34 additions & 23 deletions src/liblsquic/lsquic_mini_conn_ietf.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,16 @@ imico_maybe_process_params (struct ietf_mini_conn *conn)
}


static void
imico_zero_pad (struct lsquic_packet_out *packet_out, size_t pad_size)
{
memset(packet_out->po_data + packet_out->po_data_sz, 0, pad_size);
packet_out->po_padding_sz = pad_size;
packet_out->po_data_sz += pad_size;
packet_out->po_frame_types |= QUIC_FTBIT_PADDING;
}


static int
imico_generate_ack (struct ietf_mini_conn *conn, enum packnum_space pns,
lsquic_time_t now);
Expand Down Expand Up @@ -309,11 +319,14 @@ imico_stream_write (void *stream, const void *bufp, size_t bufsz)
return -1;
// NOTE: reduce the size of first crypto frame to combine packets
int avail = lsquic_packet_out_avail(packet_out);
int coalescing = 0;
if (cryst->mcs_enc_level == ENC_LEV_HSK
&& cryst->mcs_write_off == 0
&& avail > conn->imc_hello_pkt_remain - conn->imc_long_header_sz)
&& avail > (int)conn->imc_hello_pkt_remain - conn->imc_long_header_sz)
{
avail = conn->imc_hello_pkt_remain - conn->imc_long_header_sz;
conn->imc_hello_pkt_remain = 0;
coalescing = 1;
}
p = msg_ctx.buf;
len = pf->pf_gen_crypto_frame(packet_out->po_data + packet_out->po_data_sz,
Expand All @@ -326,9 +339,15 @@ imico_stream_write (void *stream, const void *bufp, size_t bufsz)
packet_out->po_data_sz += len;
packet_out->po_frame_types |= 1 << QUIC_FRAME_CRYPTO;
packet_out->po_flags |= PO_HELLO;
if (coalescing && len < avail)
{
LSQ_DEBUG("generated PADDING frame: %d bytes for packet %"PRIu64,
avail - len, packet_out->po_packno);
imico_zero_pad(packet_out, avail - len);
}
cryst->mcs_write_off += msg_ctx.buf - p;
if (cryst->mcs_enc_level == ENC_LEV_INIT)
conn->imc_hello_pkt_remain = avail - len;
conn->imc_hello_pkt_remain = lsquic_packet_out_avail(packet_out);
}

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


// static void
// imico_zero_pad (struct lsquic_packet_out *packet_out)
// {
// size_t pad_size;
//
// pad_size = lsquic_packet_out_avail(packet_out);
// memset(packet_out->po_data + packet_out->po_data_sz, 0, pad_size);
// packet_out->po_padding_sz = pad_size;
// packet_out->po_data_sz += pad_size;
// packet_out->po_frame_types |= QUIC_FTBIT_PADDING;
// }


static lsquic_time_t
imico_rechist_largest_recv (void *rechist_ctx);

Expand Down Expand Up @@ -939,14 +945,19 @@ ietf_mini_conn_ci_next_packet_to_send (struct lsquic_conn *lconn,
"enough quota", packet_out->po_packno);
return NULL;
}
// if (!(packet_out->po_frame_types & (1 << QUIC_FRAME_PADDING))
// && (packet_out->po_frame_types & IQUIC_FRAME_ACKABLE_MASK)
// && lsquic_packet_out_avail(packet_out) > 0)
// {
// LSQ_DEBUG("generated PADDING frame: %hd bytes for packet %"PRIu64,
// lsquic_packet_out_avail(packet_out), packet_out->po_packno);
// imico_zero_pad(packet_out);
// }
// NOTE: do not padd INIT packet only, here, instead pad the coalesced
// later, can save one packet, more efficient.
// if (!(packet_out->po_frame_types & (1 << QUIC_FRAME_PADDING))
// && (packet_out->po_frame_types & IQUIC_FRAME_ACKABLE_MASK)
// && IQUIC_MIN_INIT_PACKET_SZ > packet_out->po_data_sz)
// {
// size_t pad_size;
//
// pad_size = IQUIC_MIN_INIT_PACKET_SZ - packet_out->po_data_sz;
// LSQ_DEBUG("generated PADDING frame: %zd bytes for packet %"PRIu64,
// pad_size, packet_out->po_packno);
// imico_zero_pad(packet_out, pad_size);
// }
}
packet_size = lsquic_packet_out_total_sz(lconn, packet_out);
if (!(to_coal
Expand Down
6 changes: 4 additions & 2 deletions src/liblsquic/lsquic_send_ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1569,8 +1569,10 @@ send_ctl_next_lost (lsquic_send_ctl_t *ctl)
lost_packet = TAILQ_FIRST(&ctl->sc_lost_packets);
while (lost_packet != NULL && lost_packet->po_regen_sz >= lost_packet->po_data_sz)
{
LSQ_DEBUG("Dropping packet %"PRIu64" from lost queue",
lost_packet->po_packno);
LSQ_DEBUG("Dropping packet %"PRIu64
" from lost queue, data size: %d, frames: %x",
lost_packet->po_packno, lost_packet->po_data_sz,
lost_packet->po_frame_types);
TAILQ_REMOVE(&ctl->sc_lost_packets, lost_packet, po_next);
lost_packet->po_flags &= ~PO_LOST;
send_ctl_destroy_chain(ctl, lost_packet, NULL);
Expand Down
2 changes: 1 addition & 1 deletion src/lshpack
Submodule lshpack updated 3 files
+1 −1 .cirrus.yml
+20 −12 lshpack.c
+1 −1 lshpack.h

0 comments on commit a2890f6

Please sign in to comment.