Skip to content

Commit

Permalink
Release 3.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gwanglst committed Sep 30, 2021
1 parent f5bc764 commit 082507c
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 13 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2021-09-30
- 3.0.3
- Generate ACK for DATAGRAM frame while avoid RETX (issue #312 #325).
- Fix BBR end of startup phase detection (issue #328).
- Fix HTTP/3 v1 retry handling (issue #332)
- Fix memory leak when reset dcid (issue #333)
- Fix double decrement for ifc_active_cids_count (#334)
- Fix uninitialized value in frame_reader/frame_writer (#316)
- Remove a few overly strict asserts.

2021-06-16
- 3.0.2
- Do not timeout connection if peer sends PING frames.
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'3.0'
# The full version, including alpha/beta/rc tags
release = u'3.0.2'
release = u'3.0.3'


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

#define LSQUIC_MAJOR_VERSION 3
#define LSQUIC_MINOR_VERSION 0
#define LSQUIC_PATCH_VERSION 2
#define LSQUIC_PATCH_VERSION 3

/**
* Engine flags:
Expand Down Expand Up @@ -1689,6 +1689,12 @@ lsquic_stream_id (const lsquic_stream_t *s);
lsquic_stream_ctx_t *
lsquic_stream_get_ctx (const lsquic_stream_t *s);

/**
* Set user-supplied context associated with the stream.
*/
void
lsquic_stream_set_ctx (lsquic_stream_t *stream, lsquic_stream_ctx_t *ctx);

/** Returns true if this is a pushed stream */
int
lsquic_stream_is_pushed (const lsquic_stream_t *s);
Expand Down
4 changes: 3 additions & 1 deletion src/liblsquic/lsquic_enc_sess_ietf.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,8 @@ gen_trans_params (struct enc_sess_iquic *enc_sess, unsigned char *buf,
cce->cce_seqno = seqno + 1;
cce->cce_flags = CCE_SEQNO;

enc_sess->esi_enpub->enp_generate_scid(enc_sess->esi_conn,
enc_sess->esi_enpub->enp_generate_scid(
enc_sess->esi_enpub->enp_gen_scid_ctx, enc_sess->esi_conn,
&cce->cce_cid, enc_sess->esi_enpub->enp_settings.es_scid_len);

/* Don't add to hash: migration must not start until *after*
Expand Down Expand Up @@ -2638,6 +2639,7 @@ iquic_esfi_reset_dcid (enc_session_t *enc_session_p,
pair = &enc_sess->esi_hsk_pairs[ENC_LEV_CLEAR];
cleanup_crypto_ctx(&pair->ykp_ctx[0]);
cleanup_crypto_ctx(&pair->ykp_ctx[1]);
cleanup_hp(&enc_sess->esi_hsk_hps[ENC_LEV_CLEAR]);

if (0 == setup_handshake_keys(enc_sess, new_dcid))
{
Expand Down
4 changes: 2 additions & 2 deletions src/liblsquic/lsquic_full_conn_ietf.c
Original file line number Diff line number Diff line change
Expand Up @@ -6353,9 +6353,9 @@ process_retire_connection_id_frame (struct ietf_full_conn *conn,
&& (cce->cce_flags & CCE_SEQNO)
&& cce->cce_seqno == seqno))
break;

/* NOTE: https://github.com/litespeedtech/lsquic/issues/334
conn->ifc_active_cids_count -= seqno >= conn->ifc_first_active_cid_seqno;

*/
if (cce < END_OF_CCES(lconn))
{
if (LSQUIC_CIDS_EQ(&cce->cce_cid, &packet_in->pi_dcid))
Expand Down
2 changes: 1 addition & 1 deletion src/liblsquic/lsquic_ietf.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extern const unsigned char *const lsquic_retry_key_buf[N_IETF_RETRY_VERSIONS];
extern const unsigned char *const lsquic_retry_nonce_buf[N_IETF_RETRY_VERSIONS];
#define lsquic_version_2_retryver(ver_) ( \
(ver_) <= LSQVER_ID27 ? 0 : \
(ver_) < LSQVER_I001 ? 1 : \
(ver_) < LSQVER_I001 ? 1 : \
2)

#endif
7 changes: 5 additions & 2 deletions src/liblsquic/lsquic_packet_out.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,11 @@ lsquic_packet_out_turn_on_fin (struct lsquic_packet_out *packet_out,
{
len = pf->pf_parse_stream_frame(packet_out->po_data + frec->fe_off,
frec->fe_len, &stream_frame);
assert(len >= 0);
if (len < 0)

// Got a corner case because of short write, df_size == 0 && df_fin == 0
// It is OK to just turn on the fin bit.
assert(len >= 0 || frec->fe_len == 5);
if (len < 0 && stream_frame.data_frame.df_size != 0)
return -1;
last_offset = stream_frame.data_frame.df_offset
+ stream_frame.data_frame.df_size;
Expand Down
3 changes: 2 additions & 1 deletion src/liblsquic/lsquic_parse_ietf_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@ ietf_v1_gen_stream_frame (unsigned char *buf, size_t buf_len,

/* Read as much as we can */
nr = gsf_read(stream, p + dlen, size, &fin);
assert(nr != 0);
if (nr == 0)
return 0;
assert(nr <= size);

if (dlen)
Expand Down
15 changes: 12 additions & 3 deletions src/liblsquic/lsquic_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -3108,7 +3108,7 @@ write_stream_frame (struct frame_gen_ctx *fg_ctx, const size_t size,
lsquic_packet_out_avail(packet_out), stream->id,
stream->tosend_off,
fg_ctx->fgc_fin(fg_ctx), size, fg_ctx->fgc_read, fg_ctx);
if (len < 0)
if (len <= 0)
return len;

#if LSQUIC_CONN_STATS
Expand Down Expand Up @@ -3223,7 +3223,8 @@ stream_write_to_packet_std (struct frame_gen_ctx *fg_ctx, const size_t size)
len = write_stream_frame(fg_ctx, size, packet_out);
if (len > 0)
return SWTP_OK;
assert(len < 0);
if (len == 0)
return SWTP_STOP;
if (-len > (int) need_at_least)
{
LSQ_DEBUG("need more room (%d bytes) than initially calculated "
Expand Down Expand Up @@ -4617,6 +4618,13 @@ lsquic_stream_get_ctx (const lsquic_stream_t *stream)
}


void
lsquic_stream_set_ctx (lsquic_stream_t *stream, lsquic_stream_ctx_t *ctx)
{
stream->st_ctx = ctx;
}


int
lsquic_stream_refuse_push (lsquic_stream_t *stream)
{
Expand Down Expand Up @@ -5067,7 +5075,8 @@ hq_filter_df (struct lsquic_stream *stream, struct data_frame *data_frame)
(unsigned) data_frame->df_size - data_frame->df_read_off);
else
{
if (!(filter->hqfi_type == HQFT_HEADERS
if (!((filter->hqfi_type == HQFT_HEADERS
|| filter->hqfi_type == HQFT_PUSH_PROMISE)
&& (filter->hqfi_flags & HQFI_FLAG_BLOCKED)))
assert(data_frame->df_read_off == data_frame->df_size);
return 0;
Expand Down
19 changes: 18 additions & 1 deletion src/liblsquic/lsquic_version.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ const char *const lsquic_ver2str[N_LSQVER] = {
};


const char *const lsquic_ver2altstr[N_LSQVER] = {
[LSQVER_043] = NULL,
[LSQVER_046] = NULL,
[LSQVER_050] = NULL,
[LSQVER_ID27] = "h3-27",
[LSQVER_ID29] = "h3-29",
[LSQVER_I001] = "h3",
[LSQVER_VERNEG] = "VERNEG",
};


enum lsquic_version
lsquic_str2ver (const char *str, size_t len)
{
Expand All @@ -71,12 +82,18 @@ lsquic_str2ver (const char *str, size_t len)
}

for (ver = 0; ver < N_LSQVER; ++ver)
{
if (strlen(lsquic_ver2str[ver]) == len
&& strncasecmp(lsquic_ver2str[ver], str, len) == 0)
{
return ver;
}

if (lsquic_ver2altstr[ver] && strlen(lsquic_ver2altstr[ver]) == len
&& strncasecmp(lsquic_ver2altstr[ver], str, len) == 0)
{
return ver;
}
}
return -1;
}

Expand Down

0 comments on commit 082507c

Please sign in to comment.