* 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.
* fix MSVC compiler shared library issues - mostly around 'extern const'
* add vcpkg install getopt to appveyor-windows.yml
show appveyor where to get getopt from vcpkg (non-static lib to avoid LGPL violation)
* add missing else case in lsquic_shared_support.h for windows static lib path
* have cmake spit out it's version
have cmake copy dependent dlls to build dir for tests on windows (getopt.dll)
* copy getopt.dll dep for tests
added commented version that requires >= 3.21 but handles any dll deps
* try caching boringssl dir to reduce CI build time since it's always same commit specified in config file
define VCPKG_ROOT in env since I can't seem to find it by VCPKG_ROOT or VCPKG_INSTALLED_DIR in appveyor's cmake v3.16 + vcpkg
* make windows cache dependent on yml and cmd
* sync up with changes to ls-qpack
- [BUGFIX] Do not send RESET_STREAM if writing to stream is already
finished.
- perf_client: wait for all ACKs before exiting.
- Improve how generated RESET_STREAM is logged.
- Fix compilation in different combos of adv_tick/conn_stats flags.
- Move qpack warning disablement into src/liblsquic/CMakeLists.txt.
- [FEATURE] QUIC and HTTP/3 Internet Draft 34 support and v1 support.
The latter is turned off by default.
- Drop support for ID-28 and ID-32.
- [BUGFIX] IETF QUIC mini conn receive history (trechist): allow
unlimited inserts by dropping smallest elements.
- [BUGFIX] gQUIC: set STTL to correct value, issue #226.
- [BUGFIX] Account for poison packet gap when MTU probe was too large.
- [API] lsquic_ssl_sess_to_resume_info() is the new way to get
session info.
- [API] Add user pointer to ea_generate_scid callback.
- [API] Add lsquic_dcid_from_packet() -- a fast function to parse
out DCID.
- [API] Add es_max_batch_size to control outgoing packet batch size.
- [BUGFIX] Disallow sending of header while promise is being written.
- [BUGFIX] Flush stream when buffered bytes exhaust stream cap.
- [BUGFIX] Deactivate HQ frame if writing push promise fails.
- Perform sanity check on peer transport parameters and fail the
handshake if some flow control limits are too low. This can be
turned off, see es_check_tp_sanity.
- http_server: fix how requests are read in "hq" mode.
- [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.
- [BUGFIX] gQUIC: do not destroy critical streams when connection is
closed. See issue #201.
- [BUGFIX] Drop #if LSQUIC_CONN_STATS from lsquic.h. See issue #211.
- [BUGFIX] Challenge cancellation when path validation fails.
- [BUGFIX] Do not send FIN if RST is scheduled to be sent on a stream.
- [BUGFIX] gQUIC's is_tickable() when connection is closing.
- [BUGFIX] Q050 processing of GOAWAY frames.
- [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).
- [BUGFIX] Do not drop incoming data when STOP_SENDING is received.
- [BUGFIX] Receipt of STOP_SENDING should not cause read-reset.
- [BUGFIX] Allow stream writes after receiving RESET.
- [BUGFIX] Typo in stream: ANDing enum with wrong flag.
- [BUGFIX] Reset elision: do not use zero as special stream ID value,
for zero is a valid stream ID in IETF QUIC.
- [API] Add optional on_conncloseframe_received() callback.
- Use zero error code in RESET stream sent in response to STOP_SENDING.
- [API, FEATURE] Add es_delay_onclose option to delay on_close until all
data is ACKed. Use new function lsquic_stream_has_unacked_data() to
learn whether peer acknowledged all data written to stream.
- [API] Add optional on_reset() stream callback to get notifications
when RESET or STOP_SENDING frames are received.
- [BUGFIX] On STOP_SENDING, make conn tickable is _writeable_, not
readable.
- [FEATURE] QUIC and HTTP/3 Internet Draft 31 support. Drop ID-30
and ID-31 support.
- [BUGFIX] Divide-by-zero in newly enabled conn stats code when no
packets were sent.
- [BUGFIX] Memory leak in gQUIC client when server hello cannot be
parsed.
- [BUGFIX] Server Initial packet size calculation.
- Log user-agent and CONN_CLOSE reason when peer reports error.
- Example programs: Specify ALPN for echo and md5 clients and servers
(issue #184).
- Example programs: Don't add "QUIC_" prefix to lines in keylog file
(issue #185).
- http_server: Fix fd leak in preadv mode; fix preadv() usage when
reading from disk.
- Add QPACK stats collection and experimentation mode, see the new
es_qpack_experiment setting.
- Log busy connection stats every second using the new "conn-stats"
log module.
- Log about skipping only once.
- Update HTTP/3 greased frame type formula.
- Use ls-qpack v2.2.1.
- [FEATURE] Extensible HTTP Priorities (HTTP/3 only).
- [FEATURE] Add conn context to packet-out memory interface (PR #175).
- [BUGFIX] gQUIC proof generation: allocate buffer big enough for
signature (issue #173).
- [BUGFIX] Make library thread-safe: drop use of global variables
(issue #133, issue #167).
- [BUGFIX] Deactivate only *recent* HQ frame, not any HQ frame.
- [BUGFIX] gQUIC server: associate compressed cert with SSL_CTX,
instead of keeping them in a separate hash, potentially leading
to mismatches.
- [BUGFIX] Stream data discard infinite loop: break on FIN.
- cmake: add install target via -DCMAKE_INSTALL_PREFIX (PR #171).
- Support randomized packet number to begin a connection.
- Mini and full IETF connection size optimization.
- http_client: specify HTTP priorities based on stream conditions.
- [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.
- [BUGFIX] Typo in new "validate peer addr by DCID" code. It is
a benign bug (works either way), but better to fix it.
- Simplify Stream Priority Iterator (SPI).
- Minor documentation updates.
- [FEATURE] QUIC and HTTP/3 Internet Draft 30 support.
- [FEATURE] Unreliable Datagram Extension support.
- [FEATURE] Adaptive congestion controller.
- [BUGFIX] Do not send MAX_STREAM_DATA frames on crypto streams.
- [BUGFIX] Fail with CRYPTO_BUFFER_EXCEEDED when too much CRYPTO
data comes in.
- [BUFFIX] Spin bit is now strictly per path; value is reset on
DCID change.
- [BUGFIX] Check that max value of max_streams_uni and
max_streams_bidi TPs is 2^60.
- [BUGFIX] Close IETF mini conn immediately if crypto session
cannot be initialized.
- Deprecate ID-28 (no browser uses it): it's no longer in the
default versions list.
- New programs duck_server and duck_client that implement the
experimental siduck-00 protocol. They quack!
- IETF crypto streams: don't limit ourselves from sending.
- Command-line programs: turn off QL loss bits if -G is used, as
Wireshark cannot decrypt QUIC packets when this extension is used.
- Turn all h3 framing unit tests back on.
- Fix malo initialization when compiled in no-pool mode.
- [FEATURE] Add lsquic_stream_pwritev(). This function allows one to
reduce the number of system calls required to read a file from disk
by using lsquic_stream_pwritev() together with preadv(2).
- [BUGFIX] When stream is reset, it is writeable -- let user collect
the error.
- [BUGFIX] Calculate correct conn flow control if reading ends early.
- [BUGFIX] Remove stream from read and write queues on internal
shutdown. This is a regression introduced in 2.19.7.
- [BUGFIX] Swapped arguments in IETF RESET_FRAME generation.
- Turn off mini conn history when compiling with Visual Studio; this
allows the project to compile on Windows again.
- http_client: Add -3 flag to stop reading from streams early; code
cleanup.
- Don't use -Werror.
- [FEATURE] Update the timestamp extension to latest version.
- [FEATURE] Cope with appearance of ECN blackholes.
- [OPTIMIZATION] return packno offset and size when header is generated.
- [BUGFIX] ignore old ACK frames in mini conns.
- [BUGFIX] Mark initial server path as initialized.
- [BUGFIX] Do not merge ACK if ECN counts do not match.
- Turn incoming packet number history in mini conn back on.
- Record mini conn event history again when compiled in debug mode.
- IETF mini conn: log when ACK is queued.
- Clean up and refactor code in several places.
- [FEATURE] DPLPMTUD support. IETF connections now search for the
maximum packet size, improving throughput.
- [DEBUG] Record event in stream history when on_close() is called
in dtor.
- [API] Rename "0-RTT" to "session resumption." In IETF QUIC, "0-RTT"
always refers to early data, meaning a request that the server can
reply to in the very first return flight. A more appropriate name
for what we support on the client site is "session resumption," which
is standard TLS terminology. Later, when we add support for 0-RTT
(early data), we can use the 0-RTT terminology again, this time in
proper context.
- [BUGFIX] Do not set certificate callback if ea_lookup_cert is NULL.
- [BUGFIX] Make connection tickable when it's marked as closed.
- [BUGFIX] Fail certificate lookup if SNI is not present in HTTP mode.
- Several documentation fixes and improvements.
- Minor code cleanup.
- [FEATURE] QUIC and HTTP/3 Internet Draft 29 support.
- [BUGFIX] Check that scheduled packets are also sendable when
calculating a connection's "tickable" property.
- [BUGFIX] Don't count scheduled packets as in-flight when pacer is
checked on tick.
- gQUIC: delay calling on_new for pushed stream until headers are
available.
- Allow nested calls to lsquic_engine_connect().
- [FEATURE] Use "no-progress timeout" after which connection is closed.
- [BUGFIX] Select new SCID when current SCID is retired.
- [BUGFIX] Don't warn about dropped Initial packet sequence gaps during
mini/full handoff.
- [BUGFIX] Send correct conn error when HTTP/3 frame is truncated.
- [BUGFIX] Mini conn: consider amplification when deciding to return
TICK_SEND.
- [BUGFIX] Don't double-count tag length in amplification logic.
- [BUGFIX] Don't squeeze out lone path challenges.
- [BUGFIX] Log messages dealing with scheduled packet queue squeezing.
- [BUGFIX] don't wipe current path if no path challenge responses
come back.
- [BUGFIX] When path is reset, don't lose path_id which is used for
logging.
- Downgrade flow control violations to info log level from warnings.
- Fix connection cap extra check, avoid checks in nested calls.
- Fix some unit tests when extra checks are enabled.
- Use ls-hpack 2.2.1.
- Turn off unconditional extra checks for IETF clients.
- Extra checks: don't verify sent size of hello packets. Client
changes DCID length and this check will fail.
- [FEATURE] QUIC and HTTP/3 Internet Draft 28 support.
- [BUGFIX] Ignore Retry packets after other packets are decrypted
successfully.
- [BUGFIX] Transport parameter decoding: CID no longer has 4-byte
length minimum.
- http_client: fix and optimize lsxpack_header allocator.
- Drop support for Internet Draft 25.