Skip to content

Commit

Permalink
Release 2.21.0
Browse files Browse the repository at this point in the history
- [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.
  • Loading branch information
Dmitri Tikhonov committed Sep 29, 2020
1 parent 2e1429b commit b62ec17
Show file tree
Hide file tree
Showing 33 changed files with 651 additions and 424 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2020-09-29
- 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-25
- 2.20.2
- [BUGFIX] Memory leak: free pushed promise when refcnt is zero.
Expand Down
4 changes: 3 additions & 1 deletion CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2017 - 2020 LiteSpeed Technologies Inc. See LICENSE.
In addition to the LiteSpeed QUIC Team, the following people contributed
to the LiteSpeed Client Library:
to the LiteSpeed QUIC and HTTP/3 Library:

- Brian Prodoehl -- Docker file
- Amol Desphande -- Windows support
Expand All @@ -10,6 +10,8 @@ to the LiteSpeed Client Library:
- Omar Roth -- Alpine Linux build and Crystal language bindings
- initlife (?) -- XCode build
- Rahul Jadhav -- Android support
- Victor Stewart -- Generate SCIDs API (connection ID steering)
- Aaron France -- Shared library support and Lisp bindings

Thank you!

Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ Description
LiteSpeed QUIC (LSQUIC) Library is an open-source implementation of QUIC
and HTTP/3 functionality for servers and clients. Most of the code in this
distribution is used in our own products: LiteSpeed Web Server, LiteSpeed ADC,
and OpenLiteSpeed. We think it is free of major problems. Nevertheless, do
not hesitate to report bugs back to us. Even better, send us fixes and
improvements!
and OpenLiteSpeed. Do not hesitate to report bugs back to us. Even better,
send us fixes and improvements!

Currently supported QUIC versions are Q043, Q046, Q050, ID-27, ID-28, ID-29,
and ID-30. Support for newer versions will be added soon after they are
released.
ID-30, and ID-31. Support for newer versions will be added soon after they
are released.

Documentation
-------------
Expand Down
15 changes: 11 additions & 4 deletions docs/apiref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ developed by the IETF. Both types are included in a single enum:

.. member:: LSQVER_ID27

IETF QUIC version ID (Internet-Draft) 27
IETF QUIC version ID (Internet-Draft) 27; this version is deprecated.

.. member:: LSQVER_ID28

Expand All @@ -58,10 +58,14 @@ developed by the IETF. Both types are included in a single enum:

IETF QUIC version ID 29

.. member:: LSQVER_ID30
.. member:: LSQVER_ID30; this version is deprecated.

IETF QUIC version ID 30

.. member:: LSQVER_ID31

IETF QUIC version ID 31

.. member:: N_LSQVER

Special value indicating the number of versions in the enum. It
Expand Down Expand Up @@ -294,6 +298,10 @@ optional members.
The optional ALPN string is used by the client if :macro:`LSENG_HTTP`
is not set.

.. member:: void (*ea_generate_scid)(lsquic_conn_t *, lsquic_cid_t *, unsigned)

Optional interface to control the creation of connection IDs.

.. _apiref-engine-settings:

Engine Settings
Expand Down Expand Up @@ -786,7 +794,7 @@ settings structure:
.. member:: unsigned es_mtu_probe_timer

This value specifies how long the DPLPMTUD probe timer is, in
milliseconds. `[draft-ietf-tsvwg-datagram-plpmtud-22] <https://tools.ietf.org/html/draft-ietf-tsvwg-datagram-plpmtud-22>`_ says:
milliseconds. :rfc:`8899` says:

PROBE_TIMER: The PROBE_TIMER is configured to expire after a period
longer than the maximum time to receive an acknowledgment to a
Expand Down Expand Up @@ -2169,7 +2177,6 @@ The following log modules are defined:
- *qlog*: QLOG output. At the moment, it is out of date.
- *qpack-dec*: QPACK decoder.
- *qpack-enc*: QPACK encoder.
- *rechist*: Receive history.
- *sendctl*: Send controller.
- *sfcw*: Stream flow control window.
- *spi*: Stream priority iterator.
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
author = u'LiteSpeed Technologies'

# The short X.Y version
version = u'2.20'
version = u'2.21'
# The full version, including alpha/beta/rc tags
release = u'2.20.2'
release = u'2.21.0'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Most of the code in this distribution has been used in our own products
since 2017.

Currently supported QUIC versions are Q043, Q046, Q050, ID-27, ID-28,
ID-29, and ID-30.
ID-29, ID-30, and ID-31.
Support for newer versions will be added soon after they are released.

LSQUIC is licensed under the `MIT License`_; see LICENSE in the source
Expand Down
32 changes: 20 additions & 12 deletions include/lsquic.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ extern "C" {
#endif

#define LSQUIC_MAJOR_VERSION 2
#define LSQUIC_MINOR_VERSION 20
#define LSQUIC_PATCH_VERSION 2
#define LSQUIC_MINOR_VERSION 21
#define LSQUIC_PATCH_VERSION 0

/**
* Engine flags:
Expand Down Expand Up @@ -96,6 +96,11 @@ enum lsquic_version
*/
LSQVER_ID30,

/**
* IETF QUIC Draft-31
*/
LSQVER_ID31,

/**
* Special version to trigger version negotiation.
* [draft-ietf-quic-transport-11], Section 3.
Expand All @@ -107,7 +112,7 @@ enum lsquic_version

/**
* We currently support versions 43, 46, 50, Draft-27, Draft-28, Draft-29,
* and Draft-30.
* Draft-30, and Draft-31.
* @see lsquic_version
*/
#define LSQUIC_SUPPORTED_VERSIONS ((1 << N_LSQVER) - 1)
Expand All @@ -120,15 +125,18 @@ enum lsquic_version
#define LSQUIC_EXPERIMENTAL_VERSIONS ( \
(1 << LSQVER_VERNEG) | LSQUIC_EXPERIMENTAL_Q098)

#define LSQUIC_DEPRECATED_VERSIONS (1 << LSQVER_ID28)
#define LSQUIC_DEPRECATED_VERSIONS ((1 << LSQVER_ID27) | (1 << LSQVER_ID28) \
| (1 << LSQVER_ID30))

#define LSQUIC_GQUIC_HEADER_VERSIONS (1 << LSQVER_043)

#define LSQUIC_IETF_VERSIONS ((1 << LSQVER_ID27) | (1 << LSQVER_ID28) \
| (1 << LSQVER_ID29) | (1 << LSQVER_ID30) | (1 << LSQVER_VERNEG))
| (1 << LSQVER_ID29) | (1 << LSQVER_ID30) \
| (1 << LSQVER_ID31) | (1 << LSQVER_VERNEG))

#define LSQUIC_IETF_DRAFT_VERSIONS ((1 << LSQVER_ID27) | (1 << LSQVER_ID28) \
| (1 << LSQVER_ID29) | (1 << LSQVER_ID30) | (1 << LSQVER_VERNEG))
| (1 << LSQVER_ID29) | (1 << LSQVER_ID30) \
| (1 << LSQVER_ID31) | (1 << LSQVER_VERNEG))

enum lsquic_hsk_status
{
Expand Down Expand Up @@ -1186,12 +1194,6 @@ struct lsquic_engine_api
*/
const struct lsquic_packout_mem_if *ea_pmi;
void *ea_pmi_ctx;

/**
* Optional interface to control the creation of connection IDs
*/
void (*es_generate_scid)(lsquic_conn_t *, lsquic_cid_t *, unsigned);

/**
* Optional interface to report new and old source connection IDs.
*/
Expand Down Expand Up @@ -1240,6 +1242,12 @@ struct lsquic_engine_api
* is not set.
*/
const char *ea_alpn;

/**
* Optional interface to control the creation of connection IDs
*/
void (*ea_generate_scid)(lsquic_conn_t *,
lsquic_cid_t *, unsigned);
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/liblsquic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ SET(lsquic_STAT_SRCS
lsquic_packet_in.c
lsquic_packet_out.c
lsquic_packet_resize.c
lsquic_packints.c
lsquic_parse_Q046.c
lsquic_parse_Q050.c
lsquic_parse_common.c
Expand Down Expand Up @@ -115,3 +114,4 @@ IF(LSQUIC_SHARED_LIB)
ELSE()
add_library(lsquic STATIC ${lsquic_STAT_SRCS})
ENDIF()

1 change: 0 additions & 1 deletion src/liblsquic/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ liblsquic_a_SOURCES = ls-qpack/lsqpack.c \
lsquic_qdec_hdl.c \
lsquic_qenc_hdl.c \
lsquic_qlog.c \
lsquic_rechist.c \
lsquic_rtt.c \
lsquic_send_ctl.c \
lsquic_senhist.c \
Expand Down
8 changes: 8 additions & 0 deletions src/liblsquic/lsquic_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,14 @@ lsquic_generate_cid (lsquic_cid_t *cid, size_t len)
}


void
lsquic_generate_scid (struct lsquic_conn *lconn, lsquic_cid_t *scid,
unsigned len)
{
lsquic_generate_cid(scid, len);
}


void
lsquic_generate_cid_gquic (lsquic_cid_t *cid)
{
Expand Down
4 changes: 4 additions & 0 deletions src/liblsquic/lsquic_conn.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,10 @@ lsquic_generate_cid (lsquic_cid_t *cid, size_t len);
void
lsquic_generate_cid_gquic (lsquic_cid_t *cid);

void
lsquic_generate_scid (struct lsquic_conn *lconn, lsquic_cid_t *scid,
unsigned len);

void
lsquic_conn_retire_cid (lsquic_conn_t *lconn);

Expand Down
3 changes: 1 addition & 2 deletions src/liblsquic/lsquic_di_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
* which makes it a good choice when we have a lot of stream frames
* coming in.
*
* Another difference is that it does not check for frame overlap, which
* is something that is present in Chrome, but it is not required by QUIC.
* Another difference is that incoming STREAM frames are allowed to overlap.
*/


Expand Down
1 change: 1 addition & 0 deletions src/liblsquic/lsquic_enc_sess.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ extern const struct enc_session_funcs_iquic lsquic_enc_session_iquic_ietf_v1;
ver == LSQVER_ID28 ? &lsquic_enc_session_common_ietf_v1 : \
ver == LSQVER_ID29 ? &lsquic_enc_session_common_ietf_v1 : \
ver == LSQVER_ID30 ? &lsquic_enc_session_common_ietf_v1 : \
ver == LSQVER_ID31 ? &lsquic_enc_session_common_ietf_v1 : \
ver == LSQVER_VERNEG ? &lsquic_enc_session_common_ietf_v1 : \
ver == LSQVER_050 ? &lsquic_enc_session_common_gquic_2 : \
&lsquic_enc_session_common_gquic_1 )
Expand Down
12 changes: 5 additions & 7 deletions src/liblsquic/lsquic_enc_sess_ietf.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ static const struct alpn_map {
{ LSQVER_ID28, (unsigned char *) "\x05h3-28", },
{ LSQVER_ID29, (unsigned char *) "\x05h3-29", },
{ LSQVER_ID30, (unsigned char *) "\x05h3-30", },
{ LSQVER_VERNEG, (unsigned char *) "\x05h3-30", },
{ LSQVER_ID31, (unsigned char *) "\x05h3-31", },
{ LSQVER_VERNEG, (unsigned char *) "\x05h3-31", },
};

struct enc_sess_iquic;
Expand Down Expand Up @@ -554,12 +555,9 @@ gen_trans_params (struct enc_sess_iquic *enc_sess, unsigned char *buf,
cce->cce_seqno = seqno + 1;
cce->cce_flags = CCE_SEQNO;

if (enc_sess->esi_enpub->enp_generate_scid)
enc_sess->esi_enpub->enp_generate_scid(enc_sess->esi_conn, &cce->cce_cid, enc_sess->esi_enpub->enp_settings.es_scid_len);
else
lsquic_generate_cid(&cce->cce_cid, enc_sess->esi_enpub->enp_settings.es_scid_len);


enc_sess->esi_enpub->enp_generate_scid(enc_sess->esi_conn,
&cce->cce_cid, enc_sess->esi_enpub->enp_settings.es_scid_len);

/* Don't add to hash: migration must not start until *after*
* handshake is complete.
*/
Expand Down
5 changes: 4 additions & 1 deletion src/liblsquic/lsquic_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,10 @@ lsquic_engine_new (unsigned flags,
engine->pub.enp_cert_lu_ctx = api->ea_cert_lu_ctx;
engine->pub.enp_get_ssl_ctx = api->ea_get_ssl_ctx;

engine->pub.enp_generate_scid = api->es_generate_scid;
if (api->ea_generate_scid)
engine->pub.enp_generate_scid = api->ea_generate_scid;
else
engine->pub.enp_generate_scid = lsquic_generate_scid;

if (api->ea_shi)
{
Expand Down
4 changes: 3 additions & 1 deletion src/liblsquic/lsquic_engine_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifndef LSQUIC_ENGINE_PUBLIC_H
#define LSQUIC_ENGINE_PUBLIC_H 1

struct lsquic_cid;
struct lsquic_conn;
struct lsquic_engine;
struct stack_st_X509;
Expand Down Expand Up @@ -44,7 +45,8 @@ struct lsquic_engine_public {
void *enp_stream_if_ctx;
const struct lsquic_hset_if *enp_hsi_if;
void *enp_hsi_ctx;
void (*enp_generate_scid)(lsquic_conn_t *, lsquic_cid_t *, unsigned);
void (*enp_generate_scid)(struct lsquic_conn *,
struct lsquic_cid *, unsigned);
int (*enp_verify_cert)(void *verify_ctx,
struct stack_st_X509 *chain);
void *enp_verify_ctx;
Expand Down
4 changes: 2 additions & 2 deletions src/liblsquic/lsquic_full_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ new_conn_common (lsquic_cid_t cid, struct lsquic_engine_public *enpub,
conn->fc_pub.all_streams = lsquic_hash_create();
if (!conn->fc_pub.all_streams)
goto cleanup_on_error;
lsquic_rechist_init(&conn->fc_rechist, &conn->fc_conn, 0);
lsquic_rechist_init(&conn->fc_rechist, 0);
if (conn->fc_flags & FC_HTTP)
{
conn->fc_pub.u.gquic.hs = lsquic_headers_stream_new(
Expand Down Expand Up @@ -4418,7 +4418,7 @@ lsquic_gquic_full_conn_srej (struct lsquic_conn *lconn)

/* Reset receive history */
lsquic_rechist_cleanup(&conn->fc_rechist);
lsquic_rechist_init(&conn->fc_rechist, &conn->fc_conn, 0);
lsquic_rechist_init(&conn->fc_rechist, 0);

/* Reset send controller state */
lsquic_send_ctl_cleanup(&conn->fc_send_ctl);
Expand Down
Loading

0 comments on commit b62ec17

Please sign in to comment.