Release 3.0.3

This commit is contained in:
George Wang 2021-09-30 11:23:56 -04:00
parent f5bc76471f
commit 082507cd10
10 changed files with 61 additions and 13 deletions

View file

@ -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.

View file

@ -26,7 +26,7 @@ author = u'LiteSpeed Technologies'
# 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 ---------------------------------------------------

View file

@ -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:
@ -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);

View file

@ -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*
@ -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))
{

View file

@ -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))

View file

@ -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;

View file

@ -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)

View file

@ -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
@ -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 "
@ -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)
{
@ -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;

View file

@ -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)
{
@ -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;
}