Commit Graph

11 Commits

Author SHA1 Message Date
George Wang 0e32849de5 Release 3.2.0 2022-10-20 11:47:58 -04:00
wangfuyu 5c669eea50
m) Fix: compile test_rechist error (#425)
error: 'for' loop initial declarations are only allowed in C99 mode

Co-authored-by: wangfuyu <ivanfywang@gmail.com>
2022-09-29 09:04:15 -04:00
Paul Jakma 188c055a9c
Test case and fix for lsquic rechist list problem (#410)
* Test case and debug for lsquic rechist list problem

Add:
- test case
- debug rechist print function (not called)
Modify:
- rechist_test_sanity to be more robust

Test case:
Added test case which produces a corrupt rechist.  The rechist
grows and then is emptied, then a rechist is produced that is nominally
empty (rh_n_used == 0) but has a circular list in rh_elems.  E.g.  (using
debug print at the problem site):

lsquic_rechist_received: insert before done
0x7ffe65ce75a0: cutoff 9 l. acked 12087061905995 masks 1 alloced 4 used 1 max ranges 0 head 0
  (0)[9-9] (0)[9-9] (0)[9-9] (0)[9-9] (0)[9-9] (0)[9-9] (0)[9-9]
test_rechist: /tmp/lsquic/src/liblsquic/lsquic_rechist.c:272: rechist_test_sanity: Assertion `rechist->rh_n_used == n_elems' failed.

Debug print:
Added 'rechist_dump' for ease of debugging, marked as unused.
Useful for calling from gdb or adding to code temporarily.

rechist_test_sanity:
Make it more robust to bad rechists by limiting
how many list items it will follow, to prevent infinite loops or walking off
the end of the list.

* rechist: Fix bug in lsquic_rechist_received causing circular list to be created

Fix bug in lsquic_rechist_received demonstrated by the test6 test-case.

When the list is empty, i.e.  rh_n_used == 0, the 'first_elem' path should
be used.  However, the test for this was using rh_n_alloced, which would
cause the code to continue on incorrectly.  One possibility is that it goes
to insert_before and creates a circular list in the rechist with the head at
index 0 having a next of 0.

This causes history to be lost I think.

The list at this point is still 'empty', however a following call could go
to the insert_before path and then insert an elem pointing to the circular
list, and bump up rh_n_used. Now you have a circular list.

Weird things can happen now.  Notably, ACK generation will exhaust the
packet buffer and generate an error, and so cause connections to be
prematurely aborted.

Fix lsquic_rechist_received to use rh_n_used. Also modify
rechist_alloc_elem to NULL the next pointer for robustness.

It would be nice for rechist_free_elem to also invalidate the elem, but it
is meant for relinking elems in the list and should preserve the next
pointer.
2022-08-26 09:15:35 -04:00
George Wang a74702c630 Release 3.1.0 2022-05-06 12:49:46 -04:00
Dmitri Tikhonov bbee242ac0 Release 2.27.5
- [BUGFIX] Assertion in send controller when path validation fails.
- [BUGFIX] Assertion in BBR when sending out-of-order packets is
  detected.
- [BUGFIX] Drop overflow receive history ranges when cloning.
- Log correct size of the incoming packet.
- Fix internal stream function.
2021-01-18 13:26:33 -05:00
Dmitri Tikhonov 1a0003e3b9 Release 2.27.2
- [BUGFIX] Memory corruption in receive history copy-ranges function.
2021-01-06 17:53:07 -05:00
Dmitri Tikhonov 06b2a2363e Release 2.27.1
- [API] New knob to set outgoing packet batch size.
- Aborted connection now become tickable immediately.
- Abort connection when HTTP/3 frame cannot be opened (can only happen
  when malloc fails).
2021-01-06 09:00:05 -05:00
Dmitri Tikhonov f38b395a31 Release 2.24.5
- [FEATURE] Improve Delayed ACKs extension and turn it on by default.
- Limit receive history to a finite amount of memory.
2020-11-24 08:51:36 -05:00
Dmitri Tikhonov b62ec17fd2 Release 2.21.0
- [FEATURE] QUIC and HTTP/3 Internet Draft 31 support.
- [API] Let user generate Souce Connection IDs.
- [FEATURE] Allow building lsquic as shared library.
- [OPTIMIZATION] Receive history: use a single contiguous memory
  block for everything.
- Deprecate QUIC versions ID-27 and ID-30.
2020-09-29 08:56:43 -04:00
Dmitri Tikhonov fb3e20e0bc Fix Windows support 2020-06-03 00:20:46 -04:00
Dmitri Tikhonov 9a690580c9 Rename test/unittests to tests/ and test/ to bin/ 2020-05-17 12:42:32 -04:00
Renamed from test/unittests/test_rechist.c (Browse further)