Commit graph

506 commits

Author SHA1 Message Date
wangfuyu
def7d956d6
m) Fix: http1x memory leak (#427)
[Reproduce]
  http_client send GET/POST request with large headers(val_len > 256Bytes) to http_server, like:
    http_client -H quic.test.com -s ${SERVER_ADDR}:${SERVER_PORT} -p "/test/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -o version=h3 -n 1 -r 100 -R 100

Co-authored-by: wangfuyu <ivanfywang@gmail.com>
2022-10-13 08:34:04 -04:00
wangfuyu
8391f907f4
m) Fix: packet_in pool memory leak (#426)
[Reproduce]
       http_client POST large body request to http_server, like:
          http_client -H quic.test.com -s ${SERVER_ADDR}:${SERVER_PORT} -p /1KB_char.txt -M POST -P /test/quic-data/html/10KB_char.txt -o version=h3 -n 100 -r 50000000 -R 500 -w 10 -K

[Notes]
      [RFC5116 AEAD] Section 5.1
       An authentication tag with a length of 16 octets (128bits) is used.

      [RFC9001 QUIC-TLS] Section 5.3
       These cipher suites have a 16-byte authentication tag and
       produce an output 16 bytes larger than their input.

Co-authored-by: wangfuyu <ivanfywang@gmail.com>
2022-10-12 16:21:29 -04:00
M-BELLAHCENE
108c4e7629
fix useless getopt.h check (#424)
* link fix when using lsquic in a cpp project

* Update CMakeLists.txt

* Fix getopt.h error when not needed

Co-authored-by: MBellahcene <moussa.bellahcene@4d.com>
2022-09-29 09:15:30 -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
Pluto
a5b89b62b5
[fix] assertion failure if poison packet was acked (#416)
Description:
- Error may occur while processing ack frame, e.g. poison packet was
acked by hostile attack. and then conn is supposed to be aborted,
shortly but not immediately;
- if ack frame processing failed while calling lsquic_engine_packet_in,
and IFC_HAVE_SAVED_ACK had been set, then saved ack frame will be
processed while ticking connection before it is aborted, that may
lead to assert failure;

Solution:
- close connection if neccessary before processing ack while ci_tick.
2022-09-20 13:44:39 -04:00
M-BELLAHCENE
d5602cd335
LSQUIC_TESTS=OFF, LSQUIC_BIN=OFF : Remove getopt.h error : Build will succeed. (#420)
* link fix when using lsquic in a cpp project

* Update CMakeLists.txt

Co-authored-by: MBellahcene <moussa.bellahcene@4d.com>
2022-09-20 10:36:21 -04:00
wangfuyu
a4aac39013
m) Fix: ietf connection maybe abort if ack for hsk lost (#422)
1) After handshake done, handshake packets should not be sent or received.
2) IFC_ACK_QUED_HSK will be cancelled from conn->ifc_flags after handshake done, but it maybe set again if ACKs for handshake lost(Function: should_generate_ack).

Co-authored-by: ivanfywang <ivanfywang@gmail.com>
2022-09-20 10:29:10 -04:00
davidleitw
c1664a539b
Remove redundant include (#414) 2022-09-16 09:06:12 -04:00
M-BELLAHCENE
732da98508
link fix when using lsquic in a cpp project (#418)
Co-authored-by: MBellahcene <moussa.bellahcene@4d.com>
2022-09-16 08:56:16 -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
0aa00f2369 Release 3.1.3 2022-08-19 11:21:44 -04:00
George Wang
fa39a18664 Release 3.1.2 2022-08-16 14:39:07 -04:00
George Wang
ed0511ca98 Release 3.1.2 2022-08-16 14:24:05 -04:00
George Wang
df8bc70308 Release 3.1.2 2022-08-16 14:11:25 -04:00
George Wang
766edf299c Update ls-qpack to v2.4.0 2022-08-16 12:48:51 -04:00
George Wang
6efb8c5235 Release 3.1.2 2022-08-16 12:16:46 -04:00
wangfuyu
5f073670ba
m) correct qpack decoder stream log (#405)
Co-authored-by: wangfuyu <ivanfywang@gmail.com>
2022-08-15 08:25:34 -04:00
wangfuyu
43b1739859
m) Fix: quic server assert failed with special request (#403)
Co-authored-by: wangfuyu <ivanfywang@gmail.com>
2022-08-02 15:43:40 -04:00
msvoelker
d9b2c37837
set socket option IPV6_MTU_DISCOVER=IP_PMTUDISC_PROBE for linux (#399) 2022-07-26 11:47:31 -04:00
wangfuyu
b46a5b19bb
m) Fix: chop regen api may assert fail (#395)
packet's regen size MUST minus frame size which has been pad over
2022-07-19 08:37:28 -04:00
George Wang
9d60540faf Do not force ls-qpack to track branch v0.9.13 . 2022-07-12 15:47:42 -04:00
Ryan A. Pavlik
f3657f1f27
Add back vc_compat.h header install. (#389)
Windows installs are broken without it. Alternative is to inline the important parts
in lsquic.h which is probably better.
2022-06-20 15:02:31 -04:00
Ryan A. Pavlik
4e852fc0b9
Fix sign comparison warning, which broke 32-bit builds. (#388) 2022-06-20 15:01:50 -04:00
Ryan A. Pavlik
c7e856a2b1
Fix consistency in use of Perl. (#387)
FindPerl.cmake populates PERL_EXECUTABLE.
Corresponding fix also required in ls-qpack.
2022-06-20 14:59:58 -04:00
George Wang
0a4f8953dc Release 3.1.1 2022-05-13 10:52:37 -04:00
George Wang
a74702c630 Release 3.1.0 2022-05-06 12:49:46 -04:00
Ryan A. Pavlik
d755d26ed2
CMake-only computation of whether librt is needed. (#374) 2022-05-06 10:47:16 -04:00
George Wang
c4854d203f Merge branch 'master' of github.com:litespeedtech/lsquic 2022-05-05 18:58:03 -04:00
George Wang
e9ea352198 Update ls-qpack to 2.3.0 2022-05-05 18:57:56 -04:00
Ryan A. Pavlik
146ee2acf8
Remove refs to decrepit boringssl library. (#373)
It's unused, and it's not installed by vcpkg.
2022-04-28 12:24:14 -04:00
Ryan A. Pavlik
797b40e7c2
Add an installed CMake config. (#370)
* Add an installed CMake config.

Does not perform transitive link to boringssl though.

* Install vc_compat.h header
2022-04-28 12:11:45 -04:00
George Wang
e237d77919 Release 3.0.5 2022-04-27 15:40:59 -04:00
Sam Hurst
dbc62fc9fa
Tick connection on want_datagram_write (#314)
* Tick connection on datagram write

* Check that a connection can send before marking connection tickable
2022-04-23 15:53:40 -04:00
Ryan A. Pavlik
454939cdf8
CMake improvements (#369)
* Silence CMake warning by updating minimum versions.

* Generate files to build directory, not source directory
2022-04-23 14:54:05 -04:00
quink-black
61b4eaa64e
Make it easier to include boringssl and lsquic via add_subdirectory() (#354)
FIND_LIBRARY will fail if boringssl didn't get build yet, so the
following cmake build rule doesn't work:

add_subdirectory(third_party/boringssl)
set(BORINGSSL_LIB ${CMAKE_CURRENT_BINARY_DIR}/third_party/boringssl)
add_subdirectory(third_party/lsquic)

The patch fixed it by allow setting BORINGSSL_LIB_foo explicitly,
e.g.,
add_subdirectory(third_party/boringssl)
set(BORINGSSL_LIB_ssl ssl)
set(BORINGSSL_LIB_crypto crypto)
set(BORINGSSL_LIB_decrepit decrepit)
add_subdirectory(third_party/lsquic)
2022-04-23 14:24:03 -04:00
LiteSpeed Tech
bc20c35000
Disable cache for boringSSL, which causes build to fail. 2022-01-11 17:06:22 -05:00
George Wang
497ec21d16 Release 3.0.4 2022-01-11 11:17:44 -05:00
George Wang
f9e1c11a39 Merge branch 'master' of github.com:litespeedtech/lsquic 2022-01-11 11:10:41 -05:00
wangfuyu
d190ae8e66
m) fix: handshake may failed if client send too many early data (#352)
Co-authored-by: wangfuyu <ivanfywang@gmail.com>
2022-01-11 11:10:18 -05:00
George Wang
6ff1e9b834 [MISC] replace TAB with 4 spaces. 2021-12-16 21:54:52 -05:00
Tyler Young
f07b3eae43
[WIP] use vcpkg for getopt; build windows shared lib enhancements (#350)
* 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
2021-12-15 11:38:20 -05:00
Sijie Yang
df67278304
Use same style of boolean checking in conn_ok_to_close() (#347) 2021-11-08 09:06:06 -05:00
wangfuyu
646652a67c
update boringssl version info to support h3 (#346)
* update boringssl version info to support h3

RFC9001: QUIC transport parameters are carried in a TLS extension.
Different versions of QUIC might define a different method for negotiating transport configuration.

h3: quic_transport_parameters(0x39)

* Fix comments about support draft verions
2021-11-07 07:57:39 -05:00
Sijie Yang
83eb86cb6d
Fix typo in internals.rst (#342) 2021-10-27 22:10:52 -04:00
George Wang
e1c20fcbee Update ls-qpack to v2.2.2 . 2021-10-27 11:41:47 -04:00
anatasluo
103d146831
fix: fix compile error caused by store_ctx (#338)
When I compile lsquic with boringssl, I got
following error:

error: storage size of ‘store_ctx’ isn’t known

Signed-off-by: anatasluo <luolongjuna@gmail.com>
2021-10-17 14:25:55 -04:00
George Wang
082507cd10 Release 3.0.3 2021-09-30 11:23:56 -04:00
fastcome1985
f5bc76471f
[BUGFIX]IETF QUIC v1(RFC9000) Retry Packet Integrity use draft-ietf-quic-tls-33 (or RFC9001) (#332)
Co-authored-by: luojianxiang <luojianxiang05@gmailcom>
2021-09-29 15:50:33 -04:00
wangfuyu
843f807b95
m) fix: check if connection is out of startup phase by comparing cwnd but not cwnd_gain with target_window (#328) 2021-09-27 09:23:15 -04:00
wangweiwei
fb96e96193
[BUGFIX]add datasize to po_regen_sz which will not be retransmitted. (#327) 2021-09-24 21:24:28 -04:00