Skip to content

Commit

Permalink
Release 2.3.1
Browse files Browse the repository at this point in the history
- [BUGFIX] Fix memory leaks
- [BUGFIX] Fix unit tests
  • Loading branch information
Dmitri Tikhonov committed Sep 13, 2019
1 parent cca2541 commit a6cdaed
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 12 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2019-09-13
- 2.3.1
- [BUGFIX] Fix memory leaks
- [BUGFIX] Fix unit tests

2019-09-12
- 2.3.0
- [FEATURE] BBR congestion control is on by default
Expand Down
2 changes: 1 addition & 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 2
#define LSQUIC_MINOR_VERSION 3
#define LSQUIC_PATCH_VERSION 0
#define LSQUIC_PATCH_VERSION 1

/**
* Engine flags:
Expand Down
1 change: 1 addition & 0 deletions src/liblsquic/lsquic_bbr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,7 @@ lsquic_bbr_cleanup (void *cong_ctl)
{
struct lsquic_bbr *const bbr = cong_ctl;

lsquic_bw_sampler_cleanup(&bbr->bbr_bw_sampler);
LSQ_DEBUG("cleanup");
}

Expand Down
1 change: 1 addition & 0 deletions src/liblsquic/lsquic_send_ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,7 @@ lsquic_send_ctl_cleanup (lsquic_send_ctl_t *ctl)
}
if (ctl->sc_flags & SC_PACE)
pacer_cleanup(&ctl->sc_pacer);
ctl->sc_ci->cci_cleanup(CGP(ctl));
#if LSQUIC_SEND_STATS
LSQ_NOTICE("stats: n_total_sent: %u; n_resent: %u; n_delayed: %u",
ctl->sc_stats.n_total_sent, ctl->sc_stats.n_resent,
Expand Down
1 change: 1 addition & 0 deletions src/liblsquic/lsquic_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ lsquic_stream_destroy (lsquic_stream_t *stream)
stream_hq_frame_put(stream, shf);
destroy_uh(stream);
free(stream->sm_buf);
free(stream->sm_header_block);
LSQ_DEBUG("destroyed stream");
SM_HISTORY_DUMP_REMAINING(stream);
free(stream);
Expand Down
19 changes: 9 additions & 10 deletions test/unittests/test_send_headers.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ static const struct conn_iface our_conn_if =

static void
init_test_objs (struct test_objs *tobjs, unsigned initial_conn_window,
unsigned initial_stream_window)
unsigned initial_stream_window, enum stream_ctor_flags addl_ctor_flags)
{
int s;
memset(tobjs, 0, sizeof(*tobjs));
Expand Down Expand Up @@ -182,7 +182,8 @@ init_test_objs (struct test_objs *tobjs, unsigned initial_conn_window,
&tobjs->ver_neg, &tobjs->conn_pub, 0);
tobjs->stream_if = &stream_if;
tobjs->stream_if_ctx = NULL;
tobjs->ctor_flags = SCF_CALL_ON_NEW|SCF_DI_AUTOSWITCH|SCF_IETF|SCF_HTTP;
tobjs->ctor_flags = SCF_CALL_ON_NEW|SCF_DI_AUTOSWITCH|SCF_HTTP
|addl_ctor_flags;
if ((1 << tobjs->lconn.cn_version) & LSQUIC_IETF_VERSIONS)
{
lsquic_qeh_init(&tobjs->qeh, &tobjs->lconn);
Expand Down Expand Up @@ -233,7 +234,7 @@ lsquic_qeh_write_headers (struct qpack_enc_hdl *qeh,
const struct lsquic_http_headers *headers, unsigned char *buf,
size_t *prefix_sz, size_t *headers_sz, uint64_t *completion_offset)
{
memset(buf, 0xC5, *prefix_sz + *headers_sz);
memset(buf - *prefix_sz, 0xC5, *prefix_sz + *headers_sz);
*prefix_sz = test_vals.prefix_sz;
*headers_sz = test_vals.headers_sz;
*completion_offset = test_vals.completion_offset;
Expand Down Expand Up @@ -263,7 +264,7 @@ test_flushes_and_closes (void)
/* For our tests purposes, we treat headers as an opaque object */
struct lsquic_http_headers *headers = (void *) 1;

init_test_objs(&tobjs, 0x1000, 0x1000);
init_test_objs(&tobjs, 0x1000, 0x1000, SCF_IETF);

stream = new_stream(&tobjs, 0, 0x1000);
test_vals.status = QWH_FULL;
Expand Down Expand Up @@ -352,7 +353,7 @@ test_headers_wantwrite_restoration (const int want_write)
/* For our tests purposes, we treat headers as an opaque object */
struct lsquic_http_headers *headers = (void *) 1;

init_test_objs(&tobjs, 0x1000, 0x1000);
init_test_objs(&tobjs, 0x1000, 0x1000, SCF_IETF);

/* Mock server side stream cycle */

Expand Down Expand Up @@ -445,7 +446,7 @@ test_pp_wantwrite_restoration (const int want_write)
s_call_wantwrite_in_ctor = 1;
s_wantwrite_arg = want_write;

init_test_objs(&tobjs, 0x1000, 0x1000);
init_test_objs(&tobjs, 0x1000, 0x1000, SCF_IETF);

/* Mock server side stream cycle */

Expand Down Expand Up @@ -485,6 +486,7 @@ test_pp_wantwrite_restoration (const int want_write)
assert(SLIST_FIRST(&stream->sm_promises)->pp_write_state == PPWS_DONE); /* Done! */
assert(want_write == s_onwrite_called); /* Restored: and on_write called */

lsquic_stream_destroy(stream);
deinit_test_objs(&tobjs);
s_call_wantwrite_in_ctor = 0;
s_wantwrite_arg = 0;
Expand Down Expand Up @@ -554,10 +556,7 @@ test_read_headers (int ietf, int use_hset)
void *hset;
unsigned char buf[1];

init_test_objs(&tobjs, 0x1000, 0x1000);
tobjs.ctor_flags &= ~SCF_IETF;
if (ietf)
tobjs.ctor_flags |= SCF_IETF;
init_test_objs(&tobjs, 0x1000, 0x1000, ietf ? SCF_IETF : 0);

stream = new_stream(&tobjs, 0, 0x1000);
frame = new_frame_in(&tobjs, 0, 35, 1);
Expand Down
3 changes: 2 additions & 1 deletion test/unittests/test_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,10 @@ deinit_test_objs (struct test_objs *tobjs)
lsquic_malo_destroy(tobjs->conn_pub.packet_out_malo);
lsquic_mm_cleanup(&tobjs->eng_pub.enp_mm);
if ((1 << tobjs->lconn.cn_version) & LSQUIC_IETF_VERSIONS)
{
lsquic_qeh_cleanup(&tobjs->qeh);
if (tobjs->ctor_flags & SCF_IETF)
lsquic_prio_tree_destroy(tobjs->conn_pub.u.ietf.prio_tree);
}
}


Expand Down

0 comments on commit a6cdaed

Please sign in to comment.