Skip to content

Commit

Permalink
Release 4.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
gwanglst committed Feb 7, 2024
1 parent 515f453 commit 9c877a4
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-02-07
- 4.0.5
- Fix CPU spinning due to STREAM_BLOCKED frame.

2024-01-08
- 4.0.4
- Fix DCID validation.
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.4'
release = u'4.0.5'


# -- General configuration ---------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions 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 4
#define LSQUIC_PATCH_VERSION 5

/**
* Engine flags:
Expand Down Expand Up @@ -318,7 +318,7 @@ typedef struct ssl_ctx_st * (*lsquic_lookup_cert_f)(
#define LSQUIC_DF_STTL 86400
#define LSQUIC_DF_MAX_INCHOATE (1 * 1000 * 1000)

#define LSQUIC_DF_SUPPORT_SREJ_SERVER 0
#define LSQUIC_DF_SUPPORT_SREJ_SERVER 1
#define LSQUIC_DF_SUPPORT_SREJ_CLIENT 0

/** Do not use NSTP by default */
Expand Down
4 changes: 2 additions & 2 deletions src/liblsquic/lsquic_full_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -904,12 +904,12 @@ lsquic_gquic_full_conn_server_new (struct lsquic_engine_public *enpub,

for (n = 0; received; ++n)
{
if (received & (1U << n))
if (received & (1ULL << n))
/* Setting `now' to zero is OK here, as we should have had at
* least one other packet above.
*/
lsquic_rechist_received(&conn->fc_rechist, n + 1, 0);
received &= ~(1U << n);
received &= ~(1ULL << n);
}

/* Mini connection sends out packets 1, 2, 3... and so on. It deletes
Expand Down
28 changes: 23 additions & 5 deletions src/liblsquic/lsquic_full_conn_ietf.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ struct ietf_full_conn
unsigned ifc_n_slack_akbl[N_PNS];
unsigned ifc_n_slack_all; /* App PNS only */
unsigned ifc_max_retx_since_last_ack;
unsigned short ifc_max_udp_payload; /* Cached TP */
lsquic_time_t ifc_max_ack_delay;
uint64_t ifc_ecn_counts_in[N_PNS][4];
lsquic_stream_id_t ifc_max_req_id;
Expand Down Expand Up @@ -491,7 +492,8 @@ struct ietf_full_conn
unsigned ifc_max_pack_tol_sent;
#endif
unsigned ifc_max_ack_freq_seqno; /* Incoming */
unsigned short ifc_max_udp_payload; /* Cached TP */
unsigned short ifc_min_dg_sz,
ifc_max_dg_sz;
lsquic_time_t ifc_last_live_update;
struct conn_path ifc_paths[N_PATHS];
union {
Expand Down Expand Up @@ -520,8 +522,6 @@ struct ietf_full_conn
lsquic_time_t ifc_ping_period;
struct lsquic_hash *ifc_bpus;
uint64_t ifc_last_max_data_off_sent;
unsigned short ifc_min_dg_sz,
ifc_max_dg_sz;
struct packet_tolerance_stats
ifc_pts;
#if LSQUIC_CONN_STATS
Expand Down Expand Up @@ -768,7 +768,8 @@ blocked_ka_alarm_expired (enum alarm_id al_id, void *ctx,
el = lsquic_hash_next(conn->ifc_pub.all_streams))
{
stream = lsquic_hashelem_getdata(el);
if (lsquic_stream_is_blocked(stream))
if (lsquic_stream_is_blocked(stream)
&& !lsquic_stream_is_write_reset(stream))
{
has_send_flag = (stream->sm_qflags & SMQF_SENDING_FLAGS);
stream->sm_qflags |= SMQF_SEND_BLOCKED;
Expand All @@ -782,6 +783,7 @@ blocked_ka_alarm_expired (enum alarm_id al_id, void *ctx,
TAILQ_INSERT_TAIL(&conn->ifc_pub.sending_streams, stream,
next_send_stream);
}
return;
}
}
}
Expand Down Expand Up @@ -2882,10 +2884,26 @@ process_stream_ready_to_send (struct ietf_full_conn *conn,
struct lsquic_stream *stream)
{
int r = 1;

LSQ_DEBUG("process_stream_ready_to_send: stream: %"PRIu64", "
"sm_qflags: %d. stream_flags: %d, sm_bflags: %d, ", stream->id,
stream->sm_qflags, stream->stream_flags, stream->sm_bflags);

if (stream->sm_qflags & SMQF_SEND_MAX_STREAM_DATA)
r &= generate_max_stream_data_frame(conn, stream);
if (stream->sm_qflags & SMQF_SEND_BLOCKED)
r &= lsquic_sendctl_gen_stream_blocked_frame(&conn->ifc_send_ctl, stream);
{
if (lsquic_stream_is_write_reset(stream))
{
stream->sm_qflags &= ~SMQF_SEND_BLOCKED;
if (!(stream->sm_qflags & SMQF_SENDING_FLAGS))
TAILQ_REMOVE(&stream->conn_pub->sending_streams, stream,
next_send_stream);
}
else
r &= lsquic_sendctl_gen_stream_blocked_frame(&conn->ifc_send_ctl,
stream);
}
if (stream->sm_qflags & SMQF_SEND_RST)
r &= generate_rst_stream_frame(conn, stream);
if (stream->sm_qflags & SMQF_SEND_STOP_SENDING)
Expand Down
12 changes: 11 additions & 1 deletion src/liblsquic/lsquic_send_ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2976,13 +2976,23 @@ lsquic_sendctl_gen_stream_blocked_frame (struct lsquic_send_ctl *ctl,
unsigned need;
uint64_t off;
int sz;
int is_err;

off = lsquic_stream_combined_send_off(stream);
need = pf->pf_stream_blocked_frame_size(stream->id, off);
packet_out = lsquic_send_ctl_get_packet_for_stream(ctl, need,
stream->conn_pub->path, stream);
if (!packet_out)
return 0;
{
LSQ_DEBUG("failed to get packet_out with lsquic_send_ctl_get_packet_for_stream");
packet_out = lsquic_send_ctl_get_writeable_packet(ctl,
PNS_APP, need, stream->conn_pub->path, 0, &is_err);
if (!packet_out)
{
LSQ_DEBUG("cannot get writeable packet for STREAM_BLOCKED frame");
return 0;
}
}
sz = pf->pf_gen_stream_blocked_frame(
packet_out->po_data + packet_out->po_data_sz,
lsquic_packet_out_avail(packet_out), stream->id, off);
Expand Down
9 changes: 9 additions & 0 deletions src/liblsquic/lsquic_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,15 @@ lsquic_stream_stop_sending_in (struct lsquic_stream *stream,
&& !(stream->sm_qflags & SMQF_SEND_RST))
stream_reset(stream, 0, 0);

if (stream->sm_qflags & (SMQF_SEND_WUF | SMQF_SEND_BLOCKED \
| SMQF_SEND_STOP_SENDING))
{
stream->sm_qflags &= ~(SMQF_SEND_WUF | SMQF_SEND_BLOCKED \
| SMQF_SEND_STOP_SENDING);
if (!(stream->sm_qflags & SMQF_SENDING_FLAGS))
TAILQ_REMOVE(&stream->conn_pub->sending_streams, stream, next_send_stream);
}

maybe_finish_stream(stream);
maybe_schedule_call_on_close(stream);
}
Expand Down

0 comments on commit 9c877a4

Please sign in to comment.