From aa820211702c148b95f2be18eb4643a029b653dc Mon Sep 17 00:00:00 2001 From: Dmitri Tikhonov Date: Fri, 14 Feb 2020 09:11:22 -0500 Subject: [PATCH] Release 2.10.6 - [BUGFIX] HTTP/3 framing: don't misinterpret rare occurence as error. - [BUGFIX] Send gap warning due to missing poisoned packet. --- CHANGELOG | 6 ++++++ include/lsquic.h | 2 +- src/liblsquic/lsquic_send_ctl.c | 2 +- src/liblsquic/lsquic_stream.c | 8 ++------ test/unittests/test_h3_framing.c | 20 +++++++++++++++----- 5 files changed, 25 insertions(+), 13 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 922ebeab2..0bebc5f46 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +2020-02-14 + - 2.10.6 + - [BUGFIX] HTTP/3 framing: don't misinterpret rare occurence as error. + - [BUGFIX] Send gap warning due to missing poisoned packet. + - Stream unit test for scenario in issue #106. + 2020-02-13 - 2.10.5 - [BUGFIX] BBR: call cci_sent() with correct arguments and at correct diff --git a/include/lsquic.h b/include/lsquic.h index 89933b510..a308159e7 100644 --- a/include/lsquic.h +++ b/include/lsquic.h @@ -25,7 +25,7 @@ extern "C" { #define LSQUIC_MAJOR_VERSION 2 #define LSQUIC_MINOR_VERSION 10 -#define LSQUIC_PATCH_VERSION 5 +#define LSQUIC_PATCH_VERSION 6 /** * Engine flags: diff --git a/src/liblsquic/lsquic_send_ctl.c b/src/liblsquic/lsquic_send_ctl.c index 371ed86b8..7ac100ee9 100644 --- a/src/liblsquic/lsquic_send_ctl.c +++ b/src/liblsquic/lsquic_send_ctl.c @@ -644,7 +644,7 @@ lsquic_send_ctl_sent_packet (lsquic_send_ctl_t *ctl, assert(!(packet_out->po_flags & PO_ENCRYPTED)); ctl->sc_last_sent_time = packet_out->po_sent; pns = lsquic_packet_out_pns(packet_out); - if (packet_out->po_packno == ctl->sc_gap + 1 && pns == PNS_APP) + if (packet_out->po_packno == ctl->sc_gap + 1) { assert(!(ctl->sc_flags & SC_POISON)); lsquic_senhist_add(&ctl->sc_senhist, ctl->sc_gap); diff --git a/src/liblsquic/lsquic_stream.c b/src/liblsquic/lsquic_stream.c index acca6f72e..527ee4795 100644 --- a/src/liblsquic/lsquic_stream.c +++ b/src/liblsquic/lsquic_stream.c @@ -3021,12 +3021,8 @@ maybe_close_varsize_hq_frame (struct lsquic_stream *stream) } } else if (!shf->shf_frame_ptr) - { - LSQ_ERROR("dangling HTTP/3 frame, on stream %"PRIu64, stream->id); - stream->conn_pub->lconn->cn_if->ci_internal_error( - stream->conn_pub->lconn, "dangling HTTP/3 frame"); - stream_hq_frame_put(stream, shf); - } + LSQ_DEBUG("HQ frame of type 0x%X has not yet been written, not " + "closing", shf->shf_frame_type); else { assert(stream->sm_n_buffered); diff --git a/test/unittests/test_h3_framing.c b/test/unittests/test_h3_framing.c index 81c47aa7a..7b7fad329 100644 --- a/test/unittests/test_h3_framing.c +++ b/test/unittests/test_h3_framing.c @@ -722,7 +722,8 @@ fuzz_guided_testing (const char *input) static void -test_frame_header_split (unsigned n_packets) +test_frame_header_split (unsigned n_packets, unsigned extra_sz, + int add_one_more) { struct test_objs tobjs; struct lsquic_stream *stream; @@ -771,7 +772,7 @@ test_frame_header_split (unsigned n_packets) const size_t pad_size = packet_out->po_n_alloc - 2 /* STREAM header */ - 5 /* 3-byte HEADERS frame */ - - 2; + - extra_sz; packet_out->po_data_sz = pad_size; lsquic_send_ctl_scheduled_one(&tobjs.send_ctl, packet_out); @@ -784,6 +785,12 @@ test_frame_header_split (unsigned n_packets) assert(w >= 0 && (size_t) w == buf_in_sz); lsquic_stream_flush(stream); + if (add_one_more) + { + ++g_ctl_settings.tcs_can_send; + lsquic_stream_flush(stream); + } + /* Verify written data: */ nw = read_from_scheduled_packets(&tobjs.send_ctl, 0, buf_out, buf_out_sz, 0, &fin, 1); @@ -953,7 +960,8 @@ int main (int argc, char **argv) { const char *fuzz_input = NULL; - int opt; + int opt, add_one_more; + unsigned n_packets, extra_sz; lsquic_global_init(LSQUIC_GLOBAL_SERVER); @@ -980,8 +988,10 @@ main (int argc, char **argv) else { main_test_hq_framing(); - test_frame_header_split(1); - test_frame_header_split(2); + for (n_packets = 1; n_packets <= 2; ++n_packets) + for (extra_sz = 0; extra_sz <= 2; ++extra_sz) + for (add_one_more = 0; add_one_more <= 1; ++add_one_more) + test_frame_header_split(n_packets, extra_sz, add_one_more); test_zero_size_frame(); }