Amaury Denoyelle [Fri, 27 Aug 2021 12:55:39 +0000 (14:55 +0200)]
MINOR: mux-quic: define FIN stream flag
Amaury Denoyelle [Tue, 24 Aug 2021 14:33:53 +0000 (16:33 +0200)]
MINOR: h3: define snd_buf callback and divert mux ops
Amaury Denoyelle [Fri, 27 Aug 2021 13:05:29 +0000 (15:05 +0200)]
MINOR: mux-quic: send SETTINGS on uni stream
Amaury Denoyelle [Tue, 24 Aug 2021 14:11:18 +0000 (16:11 +0200)]
MEDIUM: mux-quic: implement ring buffer on stream tx
Amaury Denoyelle [Tue, 24 Aug 2021 13:36:02 +0000 (15:36 +0200)]
MINOR: h3: allocate stream on headers
Amaury Denoyelle [Tue, 24 Aug 2021 13:30:12 +0000 (15:30 +0200)]
MINOR: h3: parse headers to htx
Amaury Denoyelle [Tue, 24 Aug 2021 13:13:20 +0000 (15:13 +0200)]
MINOR: qpack: generate headers list on decoder
TMP -> non-free strdup
TMP -> currently only support indexed field line or literal field line
with name reference
Amaury Denoyelle [Tue, 24 Aug 2021 13:36:39 +0000 (15:36 +0200)]
MINOR: qpack: fix wrong comment
Amaury Denoyelle [Tue, 24 Aug 2021 14:29:49 +0000 (16:29 +0200)]
MINOR: quic-enc: fix varint encoding
Amaury Denoyelle [Tue, 24 Aug 2021 13:16:58 +0000 (15:16 +0200)]
MINOR: h3: change default settings
In particular, advertise a 0-length dynamic table for QPACK.
Frédéric Lécaille [Wed, 25 Aug 2021 15:56:22 +0000 (17:56 +0200)]
MINOR: quic: Prepare STREAM frames to fill QUIC packets
We must take as most as possible data from STREAM frames to be encapsulated
in QUIC packets, almost as this is done for CRYPTO frames whose fields are
variable length fields. The difference is that STREAM frames are only accepted
for short packets without any "Length" field. So it is sufficient to call
max_available_room() for that in place of max_stream_data_size() as this
is done for CRYPTO data.
Frédéric Lécaille [Wed, 25 Aug 2021 14:11:00 +0000 (16:11 +0200)]
MINOR: quic: Wrong short packet minimum length
There is no destination connection ID length field in the short packet header.
Frédéric Lécaille [Wed, 25 Aug 2021 14:08:47 +0000 (16:08 +0200)]
MINOR: quic: Wrong STREAM frame length computing
The ->len and ->offset field of STREAM frame are optional.
Frédéric Lécaille [Mon, 23 Aug 2021 07:50:29 +0000 (09:50 +0200)]
MINOR: h3: Send h3 settings asap
As it is possible to send Application level packets during the handshake,
let's send the h3 settings asaps.
Frédéric Lécaille [Mon, 23 Aug 2021 06:54:28 +0000 (08:54 +0200)]
MINOR: quic: Prepare Application level packet asap.
It is possible the TLS stack stack provides us with 1-RTT TX secrets
at the same time as Handshake secrets are provided. Thanks to this
simple patch we can build Application level packets during the handshake.
Frédéric Lécaille [Thu, 19 Aug 2021 15:35:21 +0000 (17:35 +0200)]
MINOR: quic: Post handshake packet building improvements
Make qc_prep_hdshk_pkts() and qui_conn_io_cb() handle the case
where we enter them with QUIC_HS_ST_COMPLETE or QUIC_HS_ST_CONFIRMED
as connection state with QUIC_TLS_ENC_LEVEL_APP and QUIC_TLS_ENC_LEVEL_NONE
to consider to prepare packets.
quic_get_tls_enc_levels() is modified to return QUIC_TLS_ENC_LEVEL_APP
and QUIC_TLS_ENC_LEVEL_NONE as levels to consider when coalescing
packets in the same datagram.
Frédéric Lécaille [Thu, 19 Aug 2021 13:35:59 +0000 (15:35 +0200)]
MINOR: quic: Missing case when discarding HANDSHAKE secrets
With very few packets received by the listener, it is possible
that its state may move from QUIC_HS_ST_SERVER_INITIAL to
QUIC_HS_ST_COMPLETE without transition to QUIC_HS_ST_SERVER_HANDSHAKE state.
This latter state is not mandatory.
Frédéric Lécaille [Thu, 19 Aug 2021 13:19:09 +0000 (15:19 +0200)]
MINOR: quic: Wrong flags handling for acks
Fixes several concurrent accesses issue regarding QUIC_FL_PKTNS_ACK_RECEIVED and
QUIC_FL_PKTNS_ACK_REQUIRED flags.
Frédéric Lécaille [Thu, 19 Aug 2021 05:53:27 +0000 (07:53 +0200)]
MINOR: quic: Coalesce Application level packets with Handshake packets.
This simple enable use to coalesce Application level packet with
Handshake ones at the end of the handshake. This is highly useful
if we do want to send a short Handshake packet followed by Application
level ones.
Frédéric Lécaille [Thu, 19 Aug 2021 05:33:08 +0000 (07:33 +0200)]
MINOR: quic: Missing QUIC encryption level for qc_build_pkt()
qc_build_pkt() has recently been modified to support any type of
supported frame at any encryption level (assuming that an encryption level does
not support any type of frame) but quic_tls_level_pkt_type()
prevented it from building application level packet type because it was written
only for the handshake.
This patch simply adds the remaining encryption level QUIC_TLS_ENC_LEVEL_APP
which must be supported by quic_tls_level_pkt_type().
Frédéric Lécaille [Wed, 18 Aug 2021 07:16:01 +0000 (09:16 +0200)]
MINOR: quic: Atomically get/set the connection state
As ->state quic_conn struct member field is shared between threads
we must atomically get and set its value.
Frédéric Lécaille [Wed, 18 Aug 2021 07:10:48 +0000 (09:10 +0200)]
MINOR: quic: Fix handshake state debug strings
There was a collision between QUIC_HS_ST_CLIENT_HANDSHAKE_FAILED
and QUIC_HS_ST_CONFIRMED states.
Frédéric Lécaille [Mon, 16 Aug 2021 15:08:26 +0000 (17:08 +0200)]
MINOR: quic: Update the TLS extension for QUIC transport parameters
0xffa5 value was a draft one. Let's update this extension to the one
defined by the QUIC-TLS RFC 9001.
(See https://www.rfc-editor.org/rfc/rfc9001.html#name-quic-transport-parameters-e).
Frédéric Lécaille [Mon, 16 Aug 2021 10:06:46 +0000 (12:06 +0200)]
MINOR: quic: Evaluate the packet lengths in advance
We must evaluate the packet lenghts in advance to be sure we do not
consume a packet number for nothing. The packet building must always
succeeds. This is the role of qc_eval_pkt() implemented by this patch
called before calling qc_do_build_pkt() which was previously modified to
always succeed.
Frédéric Lécaille [Tue, 10 Aug 2021 07:54:03 +0000 (09:54 +0200)]
MINOR: quic: Missing acks encoded size updates.
There were cases where the encoded size of acks was not updated leading
to ACK frames building too big compared to the expected size. At this
time, this makes the code "BUG_ON()".
Frédéric Lécaille [Wed, 4 Aug 2021 13:10:32 +0000 (15:10 +0200)]
MINOR: quic: Make use of the last cbuf API when initializing TX ring buffers
Initialize the circular buffer internal buffer from a specific pool for TX ring
buffers named "pool_head_quic_tx_ring".
Frédéric Lécaille [Wed, 4 Aug 2021 13:27:37 +0000 (15:27 +0200)]
MINOR: quic: Add a pool for TX ring buffer internal buffer
We want to allocate the internal buffer of TX ring buffer from a pool.
This patch add "quic_tx_ring_pool" to do so.
Frédéric Lécaille [Wed, 4 Aug 2021 12:53:06 +0000 (14:53 +0200)]
MINOR: quic: Make circular buffer internal buffers be variable-sized.
For now on thanks to this simple patch we can use circular buffers with
a variable-sized internal buffer.
Frédéric Lécaille [Wed, 4 Aug 2021 08:49:51 +0000 (10:49 +0200)]
MINOR: quic: Rename functions which do not build only Handshake packets
Rename qc_build_hdshk_pkt() to qc_build_pkt() and qc_do_build_hdshk_pkt()
to qc_do_build_pkt().
Update their comments consequently.
Make qc_do_build_hdshk_pkt() BUG_ON() when it does not manage to build
a packet. This is a bug!
Frédéric Lécaille [Tue, 3 Aug 2021 15:07:23 +0000 (17:07 +0200)]
MINOR: quic: Remove Application level related functions
Remove the functions which were specific to the Application level.
This is the same function which build any packet for any encryption
level: quic_prep_hdshk_pkts() directly called from the quic_conn_io_cb().
Frédéric Lécaille [Tue, 3 Aug 2021 15:01:25 +0000 (17:01 +0200)]
MINOR: quic: qc_do_build_hdshk_pkt() does not need to pass a copy of CRYPTO frame
There is no need to pass a copy of CRYPTO frames to qc_build_frm() from
qc_do_build_hdshk_pkt(). Furthermore, after the previous modifications,
qc_do_build_hdshk_pkt() do not build only CRYPTO frame from ->pktns.tx.frms
MT_LIST but any type of frame.
Frédéric Lécaille [Tue, 3 Aug 2021 14:50:14 +0000 (16:50 +0200)]
MINOR: quic: Make qc_build_hdshk_pkt() atomically consume a packet number
Atomically increase the "next packet variable" before building a new packet.
Make the code bug on a packet building failure. This should never happen
if we do not want to consume a packet number for nothing. There are remaining
modifications to come to ensure this is the case.
Frédéric Lécaille [Tue, 3 Aug 2021 14:45:39 +0000 (16:45 +0200)]
MINOR: quic: quic_conn_io_cb() task rework
Modify this task which is called at least each a packet is received by a listener
so that to make it behave almost as qc_do_hdshk(). This latter is no more useful
and removed.
Frédéric Lécaille [Tue, 3 Aug 2021 14:38:49 +0000 (16:38 +0200)]
MINOR: quic: Modify qc_build_cfrms() to support any frame
This function was responsible of building CRYPTO frames to fill as much as
possible a packet passed as argument. This patch makes it support any frame
except STREAM frames whose lengths are highly variable.
Frédéric Lécaille [Tue, 3 Aug 2021 14:06:01 +0000 (16:06 +0200)]
MINOR: quic: Atomically handle packet number space ->largest_acked_pn variable
Protect this variable (largest acked packet number) from any concurrent access.
Frédéric Lécaille [Tue, 3 Aug 2021 14:03:09 +0000 (16:03 +0200)]
MINOR: quic: Modify qc_do_build_hdshk_pkt() to accept any packet type
With this patch qc_do_build_hdshk_pkt() is also able to build Application level
packet type. Its name should be consequently renamed (to come).
Frédéric Lécaille [Tue, 3 Aug 2021 13:03:35 +0000 (15:03 +0200)]
MINOR: quic: Add the packet type to quic_tx_packet struct
This is required to build packets from the same function.
Frédéric Lécaille [Tue, 3 Aug 2021 12:29:03 +0000 (14:29 +0200)]
MINOR: quic: Store post handshake frame in ->pktns.tx.frms MT_LIST
We want to treat all the frames to be built the same way as frames
built during handshake (CRYPTO frames). So, let't store them at the same
place which is an MT_LIST.
Frédéric Lécaille [Tue, 3 Aug 2021 12:25:36 +0000 (14:25 +0200)]
MINOR: quic: Add the QUIC connection state to traces
This connection variable was missing. It is useful to debug issues.
Frédéric Lécaille [Mon, 2 Aug 2021 14:41:28 +0000 (16:41 +0200)]
MINOR: quic: Add a useful function to compute any frame length.
This should be used by the function which build packets to prevent
it from failing. This is important when the packet numbers are consumed
by several threads. The packet number is used to build and encrypt packets
and must be incremented only and only if the packet it refers to has been
successfully built.
Frédéric Lécaille [Fri, 30 Jul 2021 12:42:33 +0000 (14:42 +0200)]
MINOR: quic: Add a mask for TX frame builders and their authorized packet types
As this has been done for RX frame parsers, we add a mask for each TX frame
builder to denote the packet types which are authorized to embed such frames.
Each time a TX frame builder is called, we check that its mask matches the
packet type the frame is built for.
Frédéric Lécaille [Tue, 27 Jul 2021 12:51:54 +0000 (14:51 +0200)]
MINOR: quic: Replace quic_tx_frm struct by quic_frame struct
These structures are similar. quic_tx_frm was there to try to reduce the
size of such objects which embed a union for all the QUIC frames.
Furtheremore this patch fixes the issue where quic_tx_frm objects were freed
from the pool for quic_frame.
Frédéric Lécaille [Tue, 27 Jul 2021 09:43:11 +0000 (11:43 +0200)]
MINOR: quic: Make ->tx.frms quic_pktns struct member be thread safe
Replace this member which is a list struct by an mt_list struct.
Frédéric Lécaille [Mon, 26 Jul 2021 14:42:56 +0000 (16:42 +0200)]
MINOR: quic: Make qc_treat_rx_pkts() be thread safe.
Make quic_rx_packet_ref(inc|dec)() functions be thread safe.
Make use of ->rx.crypto.frms_rwlock RW lock when manipulating RX frames
from qc_treat_rx_crypto_frms().
Modify atomically several variables attached to RX part of quic_enc_level struct.
Frédéric Lécaille [Mon, 26 Jul 2021 14:38:14 +0000 (16:38 +0200)]
MINOR: quic: Rename ->rx.rwlock of quic_enc_level struct to ->rx.pkts_rwlock
As there are at two RW lock in this structure, let's the name of this lock
be more explicit.
Frédéric Lécaille [Mon, 26 Jul 2021 14:23:53 +0000 (16:23 +0200)]
MINOR: quic: Missing encryption level rx.crypto member initialization and lock.
->rx.crypto member of quic_enc_level struct was not initialized as
this was done for all other members of this structure. This patch
fixes this.
Also adds a RW lock for the frame of this member.
Frédéric Lécaille [Wed, 21 Jul 2021 07:34:27 +0000 (09:34 +0200)]
MINOR: quic: Unitialized mux context upon Client Hello message receipt.
If we let the connection packet handler task (quic_conn_io_cb) process the first
client Initial packet which contain the TLS Client Hello message before the mux
context is initialized, quic_mux_transport_params_update() makes haproxy crash.
->start xprt callback already wakes up this task and is called after all the
connection contexts are initialized. So, this patch do not wakes up quic_conn_io_cb()
if the mux context is not initialized (this was already the case for the connection
context (conn_ctx)).
Frédéric Lécaille [Mon, 19 Jul 2021 12:48:36 +0000 (14:48 +0200)]
MINOR: quic: Add TX packets at the very last time to their tree.
If we add TX packets to their trees before sending them, they may
be detected as lost before being sent. This may make haproxy crash
when it retreives the prepared packets from TX ring buffers, dereferencing
them after they have been freed.
Frédéric Lécaille [Fri, 16 Jul 2021 09:42:44 +0000 (11:42 +0200)]
MINOR: Add function for TX packets reference counting
Add two functions to encrement or decrement a referenc counter
attached to TX packet structure (struct quic_tx_packet). The packet are freed
when their counters reach the null value.
Frédéric Lécaille [Tue, 6 Jul 2021 15:19:44 +0000 (17:19 +0200)]
MINOR: quic: Remove old TX buffer implementation
We use only ring buffers (struct qring) to prepare and send QUIC datagrams.
We can safely remove the old buffering implementation which was not thread safe.
Frédéric Lécaille [Tue, 6 Jul 2021 15:08:04 +0000 (17:08 +0200)]
MINOR: quic_tls: Make use of the QUIC V1 salt.
This salt is used to derive the Initial secrets.
Frédéric Lécaille [Tue, 6 Jul 2021 14:35:52 +0000 (16:35 +0200)]
MINOR: quic: Make use of TX ring buffers to send QUIC packets
We modify the functions responsible of building packets to put these latters
in ring buffers (qc_build_hdshk_pkt() during the handshake step, and
qc_build_phdshk_apkt() during the post-handshake step). These functions
remove a ring buffer from its list to build as much as possible datagrams.
Eache datagram is prepended of two field: the datagram length and the
first packet in the datagram. We chain the packets belonging to the same datagram
in a singly linked list to reach them from the first one: indeed we must
modify some members of each packet when we really send them from send_ppkts().
This function is also modified to retrieved the datagram from ring buffers.
Frédéric Lécaille [Tue, 6 Jul 2021 14:25:08 +0000 (16:25 +0200)]
MINOR: quic: Initialize pointers to TX ring buffer list
We initialize the pointer to the listener TX ring buffer list.
Note that this is not done for QUIC clients as we do not fully support them:
we only have to allocate the list and attach it to server struct I guess.
Frédéric Lécaille [Tue, 6 Jul 2021 13:39:26 +0000 (15:39 +0200)]
MINOR: proto_quic: Allocate TX ring buffers for listeners
We allocate an array of QUIC ring buffer, one by thread, and arranges them in a
MT_LIST. Everything is allocated or nothing: we do not want to usse an incomplete
array of ring buffers to ensure that each thread may safely acquire one of these
buffers.
Frédéric Lécaille [Tue, 6 Jul 2021 13:34:37 +0000 (15:34 +0200)]
MINOR: quic: Add ring buffer definition (struct qring) for QUIC
A ring buffer is made of a circular buffer (->cbuf) and must be arrange
in a MT_LIST (->mt_list).
Frédéric Lécaille [Tue, 6 Jul 2021 12:34:46 +0000 (14:34 +0200)]
MINOR: net_helper: add functions for pointers
Add two functions to read/write pointer values to/from vectors.
Frédéric Lécaille [Fri, 2 Jul 2021 15:20:04 +0000 (17:20 +0200)]
BUG/MINOR: quic: Too much reduced computed space to build handshake packets
Before this patch we reserved 16 bytes (QUIC_TLS_TAG_LEN) before building the
handshake packet to be sure to be able to add the tag which comes with the
the packet encryption, decreasing the end offset of the building buffer by 16 bytes.
But this tag length was taken into an account when calling qc_build_frms() which
computes and build crypto frames for the remaining available room thanks to <*len>
parameter which is the length of the already present bytes in the building buffer
before adding CRYPTO frames. This leaded us to waste the 16 last bytes of the buffer
which were not used.
Frédéric Lécaille [Thu, 1 Jul 2021 15:48:46 +0000 (17:48 +0200)]
MINOR: quic: Add the QUIC v1 initial salt.
See initial_salt value for QUIC-TLS RFC 9001 at
https://www.rfc-editor.org/rfc/rfc9001.html#name-initial-secrets
Frédéric Lécaille [Thu, 1 Jul 2021 15:09:05 +0000 (17:09 +0200)]
MINOR: quic: Prefer x25519 as ECDH preferred parametes.
This make at least our listeners answer to ngtcp2 clients without
HelloRetryRequest message. It seems the server choses the first
group in the group list ordered by preference and set by
SSL_CTX_set1_curves_list() which match the client ones.
Frédéric Lécaille [Wed, 30 Jun 2021 12:25:10 +0000 (14:25 +0200)]
MINOR: quic: Add a ring buffer implementation for QUIC
This implementation is inspired from Linux kernel circular buffer implementation
(see include/linux/circ-buf.h). Such buffers may be used at the same time both
by writer and reader (lock-free).
Frédéric Lécaille [Mon, 14 Jun 2021 12:18:10 +0000 (14:18 +0200)]
MINOR: quic: Make qc_lstnr_pkt_rcv() be thread safe.
Modify the I/O dgram handler principal function used to parse QUIC packets
be thread safe. Its role is at least to create new incoming connections
add to two trees protected by the same RW lock. The packets are for now on
fully parsed before possibly creating new connections.
Frédéric Lécaille [Mon, 14 Jun 2021 08:31:43 +0000 (10:31 +0200)]
MINOR: quic: Move conn_prepare() to ->accept_conn() callback
The xprt context must be initialized before receiving further packets from
the I/O dgram handler.
Frédéric Lécaille [Fri, 11 Jun 2021 13:44:24 +0000 (15:44 +0200)]
MINOR: quic: Connection allocations rework
Allocate everything needed for a connection (struct quic_conn) from the same
function.
Rename qc_new_conn_init() to qc_new_conn() to reflect these modifications.
Insert these connection objects in their tree after returning from this function.
Frédéric Lécaille [Fri, 11 Jun 2021 07:39:20 +0000 (09:39 +0200)]
MINOR: quic: Do not wakeup the xprt task on ACK receipt
This is an old statement which was there before implemeting the PTO and
packet loss detection. There is no reason to keep for now on.
Frédéric Lécaille [Thu, 10 Jun 2021 06:18:45 +0000 (08:18 +0200)]
MINOR: quic: Add useful traces for I/O dgram handler
This traces have already help in diagnosing multithreading issues.
Frédéric Lécaille [Mon, 7 Jun 2021 12:38:18 +0000 (14:38 +0200)]
MINOR: quic: Replace the RX unprotected packet list by a thread safety one.
This list is shared between the I/O dgram handler and the task responsible
for processing the QUIC packets inside.
Frédéric Lécaille [Mon, 7 Jun 2021 08:28:10 +0000 (10:28 +0200)]
MINOR: quic: Replace the RX list of packet by a thread safety one.
This list is shared between the I/O dgram handler and the task responsible
for processing the QUIC packets.
Frédéric Lécaille [Fri, 4 Jun 2021 12:59:59 +0000 (14:59 +0200)]
MINOR: quic: Replace quic_conn_ctx struct by ssl_sock_ctx struct
Some SSL call may be called with pointer to ssl_sock_ctx struct as parameter
which does not match the quic_conn_ctx struct type (see ssl_sock_infocb()).
I am not sure we have to keep such callbacks for QUIC but we must ensure
the SSL and QUIC xprts use the same data structure as context.
Frédéric Lécaille [Fri, 4 Jun 2021 09:52:35 +0000 (11:52 +0200)]
MINOR: quic: Move the connection state
Move the connection state from quic_conn_ctx struct to quic_conn struct which
is the structure which is used to store the QUIC connection part information.
This structure is initialized by the I/O dgram handler for each new connection
to QUIC listeners. This is needed for the multithread support so that to not
to have to depend on the connection context potentially initialized by another
thread.
Frédéric Lécaille [Fri, 4 Jun 2021 08:33:32 +0000 (10:33 +0200)]
MINOR: quic: Add a lock for RX packets
We must protect from concurrent the tree which stores the QUIC packets received
by the dgram I/O handler, these packets being also parsed by the xprt task.
Frédéric Lécaille [Fri, 4 Jun 2021 08:27:23 +0000 (10:27 +0200)]
MINOR: quic: Do not stop the packet parsing too early in qc_treat_rx_packets()
Continue to parse the packets even if we will not be able to acknowledge them.
Frédéric Lécaille [Fri, 4 Jun 2021 08:23:11 +0000 (10:23 +0200)]
BUG/MINOR: quic: Wrong RX packet reference counter usage
No need to call free_quic_rx_packet() after calling quic_rx_packet_eb64_delete()
as this latter already calls quic_rx_packet_refdec() also called by
free_quic_rx_packet().
Frédéric Lécaille [Fri, 4 Jun 2021 08:12:43 +0000 (10:12 +0200)]
CLEAUNUP: quic: Usage of a useless variable in qc_treat_rx_pkts()
The usage of a <drop> variable is unnecessary here.
Frédéric Lécaille [Wed, 2 Jun 2021 15:40:09 +0000 (17:40 +0200)]
BUG/MINOR: quic: Missing cases treatement when updating ACK ranges
Let's say that we have to insert a range R between to others A and B
with A->first <= R->first <= B->first. We have to remove the ranges
which are overlapsed by R during. This was correctly done when
the intersection between A and R was not empty, but not when the
intersection between R and B was not empty. If this latter case
after having inserting a new range R we set <new> variable as the
node to consider to check the overlaping between R and its following
ranges.
Frédéric Lécaille [Wed, 2 Jun 2021 15:38:13 +0000 (17:38 +0200)]
MINOR: quic: Remove a useless variable in quic_update_ack_ranges_list()
This very minor modification is there to ease the readibilyt of this function.
Frédéric Lécaille [Wed, 2 Jun 2021 13:36:12 +0000 (15:36 +0200)]
MINOR: quic: Useless test in quic_update_ack_ranges_list()
At this place, the condition "le_ar->first.key <= ar->first" is true because
<le_ar> is the ack-range just below <ar> ack range.
Frédéric Lécaille [Wed, 2 Jun 2021 13:27:34 +0000 (15:27 +0200)]
MINOR: quic: quic_update_ack_ranges_list() code factorization
Very minor modification to avoid repeating the same code section in this function
when allocation new ack range.
Frédéric Lécaille [Wed, 2 Jun 2021 13:04:03 +0000 (15:04 +0200)]
BUG/MINOR: quic: Wrong memory free in quic_update_ack_ranges_list()
Wrong call to free() in place of pool_free() for an object allocated from a pool
memory.
Frédéric Lécaille [Mon, 31 May 2021 16:04:07 +0000 (18:04 +0200)]
MINOR: quic: Remove header protection also for Initial packets
Make qc_try_rm_hp() be able to remove the header protection of Initial packets
which are the first incoming packets of a connection without context.
Frédéric Lécaille [Mon, 31 May 2021 13:16:13 +0000 (15:16 +0200)]
MINOR: quic: Derive the initial secrets asap
Make depends qc_new_isecs() only on quic_conn struct initialization only (no more
dependency on connection struct initialization) to be able to run it as soon as
the quic_conn struct is initialized (from the I/O handler) before running ->accept()
quic proto callback.
Frédéric Lécaille [Mon, 31 May 2021 08:24:49 +0000 (10:24 +0200)]
MINOR: quic: Remove header protection for conn with context
We remove the header protection of packet only for connection with already
initialized context. This latter keep traces of the connection state.
Furthermore, we enqueue the first Initial packet for a new connection
after having completely parsed the packet so that to not start the accept
process for nothing.
Frédéric Lécaille [Mon, 31 May 2021 07:30:14 +0000 (09:30 +0200)]
MINOR: quic: QUIC conn initialization from I/O handler
Move the QUIC conn (struct quic_conn) initialization from quic_sock_accept_conn()
to qc_lstnr_pkt_rcv() as this is done for the server part.
Move the timer initialization to ->start xprt callback to ensure the connection
context is done : it is initialized by the ->accept callback which may be run
by another thread than the one for the I/O handler which also run ->start.
Frédéric Lécaille [Fri, 28 May 2021 08:25:07 +0000 (10:25 +0200)]
BUG/MINOR: quic: Do not check the acception of a new conn from I/O handler.
As the ->conn member of quic_conn struct is reset to NULL value by the ->accept
callback potentially run by another thread, this check is irrelevant.
Frédéric Lécaille [Thu, 27 May 2021 15:12:36 +0000 (17:12 +0200)]
MINOR: quic: Initialize the session before starting the xprt.
We must ensure the session and the mux are initialized before starting the xprt.
Frédéric Lécaille [Thu, 27 May 2021 12:57:09 +0000 (14:57 +0200)]
MINOR: quic: Move an SSL func call from QUIC I/O handler to the xprt init.
Move the call to SSL_set_quic_transport_params() from the listener I/O dgram
handler to the ->init() callback of the xprt (qc_conn_init()) which initializes
its context where is stored the SSL context itself, needed by
SSL_set_quic_transport_params(). Furthermore this is already what is done for the
server counterpart of ->init() QUIC xprt callback. As the ->init() may be run
by another thread than the one for the I/O handler, the xprt context could
not be potentially already initialized before calling SSL_set_quic_transport_params()
from the I/O handler.
Frédéric Lécaille [Tue, 25 May 2021 07:12:35 +0000 (09:12 +0200)]
MINOR: quic: Enable some quic, h3 and qpack modules compilation.
Enable src/h3.c compilation for h3, src/qpack-dec.c and sr/qpack-tbl.c
compilation for qpack, and src/mux_quic.c for the QUIC mux.
Frédéric Lécaille [Mon, 17 May 2021 14:42:21 +0000 (16:42 +0200)]
MINOR: quic: Replace max_packet_size by max_udp_payload size.
The name the maximum packet size transport parameter was ambiguous and replaced
by maximum UDP payload size. Our code would be also ambiguous if it does not
reflect this change.
Frédéric Lécaille [Tue, 23 Mar 2021 13:46:56 +0000 (14:46 +0100)]
MINOR: quic: Avoid header collisions
Extract the QUIC varints encoding functions from xprt_quic.h to avoid
header collisions.
Frédéric Lécaille [Thu, 18 Mar 2021 14:05:18 +0000 (15:05 +0100)]
MINOR: quic: Update the streams transport parameters.
Set the streams transport parameters which could not be initialized because they
were not available during initializations. Indeed, the streams transport parameters
are provided by the peer during the handshake.
Frédéric Lécaille [Thu, 18 Mar 2021 14:01:27 +0000 (15:01 +0100)]
MINOR: quic: Add a wrapper function to update transport parameters.
This function calls quic_mux_transport_params_update() to update the related
streams transport parameter of the mux. It is there only so that not to have
to include mux_quic.h to update these parameters.
Frédéric Lécaille [Thu, 11 Mar 2021 16:06:30 +0000 (17:06 +0100)]
BUG/MINOR: quic: Wrong ->accept() error handling
Really signal the caller that ->accept() has failed if the session could not
be initialized because conn_complete_session() has failed. This is the case
if the mux could not be initialized too.
When it fails an ->accept() must returns -1 in case of resource shortage.
Frédéric Lécaille [Thu, 4 Mar 2021 18:12:20 +0000 (19:12 +0100)]
MINOR: quic: Variable-length integer encoding/decoding into/from buffer struct.
Add a function to encode a QUIC varint into a buffer struct. Samething for the
deconding part.
Frédéric Lécaille [Wed, 3 Mar 2021 16:28:34 +0000 (17:28 +0100)]
MINOR: quic: Add callbacks for (un)scribing to QUIC xprt.
Add these callbacks so that the QUIC mux may (un)scribe to the read/write xprt
events.
Frédéric Lécaille [Wed, 3 Mar 2021 15:23:44 +0000 (16:23 +0100)]
MINOR: quic: Disable the action of ->rcv_buf() xprt callback
Deactivate the action of this callback at this time. I am not sure
we will keep it for QUIC as it does not really make sense for QUIC:
the QUIC packet are already recvfrom()'ed by the low level I/O handler
used for all the connections.
Frédéric Lécaille [Wed, 3 Mar 2021 15:21:00 +0000 (16:21 +0100)]
MINOR: quic_sock: Finalize the QUIC connections.
Add a call to conn_connection_complete() so that to install the mux any
QUIC connection.
Frédéric Lécaille [Wed, 3 Mar 2021 15:13:10 +0000 (16:13 +0100)]
MINOR: qpack: Add QPACK compression.
Implement QPACK used for HTTP header compression by h3.
Frédéric Lécaille [Wed, 3 Mar 2021 15:09:02 +0000 (16:09 +0100)]
MINOR: h3: Add HTTP/3 definitions.
Add all the definitions for HTTP/3 implementation.
Frédéric Lécaille [Wed, 3 Mar 2021 15:04:28 +0000 (16:04 +0100)]
MINOR: quic: Add a new definition to store STREAM frames.
Add a new structure to store enough information about STREAM frames which
must be stored before being delivered to the application layer, for any
reason.
Frédéric Lécaille [Thu, 18 Feb 2021 09:16:06 +0000 (10:16 +0100)]
MINOR: quic: Attach QUIC mux connection objet to QUIC connection.
This add a qcc struct for QUIC mux/demux connection layer to quic_conn struct
at low level connection layer.
Frédéric Lécaille [Thu, 18 Feb 2021 09:04:27 +0000 (10:04 +0100)]
MINOR: connection: Add callbacks definitions for QUIC.
The flow control at stream level is organized by types (client bidi, server bidi,
client uni, server uni). Adds at least callback to retrieve the number
of available streams by direction.