mirror of
https://gitea.invidious.io/iv-org/litespeed-quic.git
synced 2024-08-15 00:53:43 +00:00
Release 3.3.0
This commit is contained in:
parent
b5efa50a5a
commit
48365d5741
12 changed files with 82 additions and 42 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 5c1d58268b05dc47b7adf74dca5e677169710258
|
||||
Subproject commit 60cae6e1564b01c2699c759b952523d5986671d1
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */
|
||||
/* Copyright (c) 2017 - 2023 LiteSpeed Technologies Inc. See LICENSE. */
|
||||
/*
|
||||
* lsquic_engine.c - QUIC engine
|
||||
*/
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
#define MAX_RETR_PACKETS_SINCE_LAST_ACK 2
|
||||
#define MAX_ANY_PACKETS_SINCE_LAST_ACK 20
|
||||
#define ACK_TIMEOUT (TP_DEF_MAX_ACK_DELAY * 1000)
|
||||
#define INITIAL_CHAL_TIMEOUT 25000
|
||||
#define INITIAL_CHAL_TIMEOUT 250000
|
||||
|
||||
/* Retire original CID after this much time has elapsed: */
|
||||
#define RET_CID_TIMEOUT 2000000
|
||||
|
@ -332,6 +332,10 @@ struct conn_path
|
|||
COP_GOT_NONPROB = 1 << 2,
|
||||
/* Spin bit is enabled on this path. */
|
||||
COP_SPIN_BIT = 1 << 3,
|
||||
/* Allow padding packet to 1200 bytes */
|
||||
COP_ALLOW_MTU_PADDING = 1 << 4,
|
||||
/* Verified that the path MTU is at least 1200 bytes */
|
||||
COP_VALIDATED_MTU = 1 << 5,
|
||||
} cop_flags;
|
||||
unsigned char cop_n_chals;
|
||||
unsigned char cop_cce_idx;
|
||||
|
@ -1542,7 +1546,7 @@ lsquic_ietf_full_conn_server_new (struct lsquic_engine_public *enpub,
|
|||
conn->ifc_flags |= IFC_IGNORE_INIT;
|
||||
|
||||
conn->ifc_paths[0].cop_path = imc->imc_path;
|
||||
conn->ifc_paths[0].cop_flags = COP_VALIDATED|COP_INITIALIZED;
|
||||
conn->ifc_paths[0].cop_flags = COP_VALIDATED|COP_INITIALIZED|COP_ALLOW_MTU_PADDING;
|
||||
conn->ifc_used_paths = 1 << 0;
|
||||
maybe_enable_spin(conn, &conn->ifc_paths[0]);
|
||||
if (imc->imc_flags & IMC_ADDR_VALIDATED)
|
||||
|
@ -4592,9 +4596,11 @@ generate_path_chal_frame (struct ietf_full_conn *conn, lsquic_time_t now,
|
|||
if (copath->cop_n_chals >= sizeof(copath->cop_path_chals)
|
||||
/ sizeof(copath->cop_path_chals[0]))
|
||||
{
|
||||
/* TODO: path failure? */
|
||||
assert(0);
|
||||
return;
|
||||
/* path failure? it is non-fatal, keep trying */
|
||||
memmove(&copath->cop_path_chals[0], &copath->cop_path_chals[1],
|
||||
sizeof(copath->cop_path_chals) - sizeof(copath->cop_path_chals[0]));
|
||||
copath->cop_n_chals = sizeof(copath->cop_path_chals)
|
||||
/ sizeof(copath->cop_path_chals[0]) - 1;
|
||||
}
|
||||
|
||||
need = conn->ifc_conn.cn_pf->pf_path_chal_frame_size();
|
||||
|
@ -4630,9 +4636,14 @@ generate_path_chal_frame (struct ietf_full_conn *conn, lsquic_time_t now,
|
|||
packet_out->po_frame_types |= QUIC_FTBIT_PATH_CHALLENGE;
|
||||
lsquic_send_ctl_incr_pack_sz(&conn->ifc_send_ctl, packet_out, w);
|
||||
packet_out->po_regen_sz += w;
|
||||
maybe_pad_packet(conn, packet_out);
|
||||
conn->ifc_send_flags &= ~(SF_SEND_PATH_CHAL << path_id);
|
||||
lsquic_alarmset_set(&conn->ifc_alset, AL_PATH_CHAL + path_id,
|
||||
/* Anti-amplification, only pad packet if allowed
|
||||
* (confirmed path or incoming packet >= 400 bytes). */
|
||||
if (copath->cop_flags & COP_ALLOW_MTU_PADDING)
|
||||
maybe_pad_packet(conn, packet_out);
|
||||
/* Only retry for confirmed path */
|
||||
if (copath->cop_flags & COP_VALIDATED)
|
||||
lsquic_alarmset_set(&conn->ifc_alset, AL_PATH_CHAL + path_id,
|
||||
now + (INITIAL_CHAL_TIMEOUT << (copath->cop_n_chals - 1)));
|
||||
}
|
||||
|
||||
|
@ -5192,9 +5203,17 @@ process_path_response_frame (struct ietf_full_conn *conn,
|
|||
return 0;
|
||||
|
||||
found:
|
||||
path->cop_flags |= COP_VALIDATED;
|
||||
conn->ifc_send_flags &= ~(SF_SEND_PATH_CHAL << path_id);
|
||||
lsquic_alarmset_unset(&conn->ifc_alset, AL_PATH_CHAL + path_id);
|
||||
if (path->cop_flags & COP_ALLOW_MTU_PADDING)
|
||||
{
|
||||
path->cop_flags |= (COP_VALIDATED | COP_VALIDATED_MTU);
|
||||
conn->ifc_send_flags &= ~(SF_SEND_PATH_CHAL << path_id);
|
||||
lsquic_alarmset_unset(&conn->ifc_alset, AL_PATH_CHAL + path_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
path->cop_flags |= (COP_VALIDATED | COP_ALLOW_MTU_PADDING);
|
||||
conn->ifc_send_flags |= (SF_SEND_PATH_CHAL << path_id);
|
||||
}
|
||||
switch ((path_id != conn->ifc_cur_path_id) |
|
||||
(!!(path->cop_flags & COP_GOT_NONPROB) << 1))
|
||||
{
|
||||
|
@ -5522,7 +5541,8 @@ process_stop_sending_frame (struct ietf_full_conn *conn,
|
|||
return 0;
|
||||
}
|
||||
lsquic_stream_stop_sending_in(stream, error_code);
|
||||
lsquic_stream_call_on_new(stream);
|
||||
if (!(conn->ifc_flags & IFC_HTTP))
|
||||
lsquic_stream_call_on_new(stream);
|
||||
}
|
||||
|
||||
return parsed_len;
|
||||
|
@ -6579,7 +6599,8 @@ process_ack_frequency_frame (struct ietf_full_conn *conn,
|
|||
uint64_t seqno, pack_tol, upd_mad;
|
||||
int parsed_len, ignore;
|
||||
|
||||
if (!(conn->ifc_flags & IFC_DELAYED_ACKS))
|
||||
if (!conn->ifc_settings->es_delayed_acks
|
||||
&& !(conn->ifc_flags & IFC_DELAYED_ACKS))
|
||||
{
|
||||
ABORT_QUIETLY(0, TEC_PROTOCOL_VIOLATION,
|
||||
"Received unexpected ACK_FREQUENCY frame (not negotiated)");
|
||||
|
@ -6857,7 +6878,11 @@ on_new_or_unconfirmed_path (struct ietf_full_conn *conn,
|
|||
LSQ_DEBUGC("packet in DCID: %"CID_FMT"; changed: %d",
|
||||
CID_BITS(&packet_in->pi_dcid), dcid_changed);
|
||||
if (0 == init_new_path(conn, path, dcid_changed))
|
||||
{
|
||||
path->cop_flags |= COP_INITIALIZED;
|
||||
if (packet_in->pi_data_sz >= IQUIC_MIN_INIT_PACKET_SZ / 3)
|
||||
path->cop_flags |= COP_ALLOW_MTU_PADDING;
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
|
||||
|
|
|
@ -2346,8 +2346,8 @@ update_for_resending (lsquic_send_ctl_t *ctl, lsquic_packet_out_t *packet_out)
|
|||
packno = send_ctl_next_packno(ctl);
|
||||
|
||||
packet_out->po_flags &= ~PO_SENT_SZ;
|
||||
assert(packet_out->po_frame_types & ~BQUIC_FRAME_REGEN_MASK);
|
||||
packet_out->po_frame_types &= ~BQUIC_FRAME_REGEN_MASK;
|
||||
assert(packet_out->po_frame_types);
|
||||
packet_out->po_packno = packno;
|
||||
lsquic_packet_out_set_ecn(packet_out, ctl->sc_ecn);
|
||||
|
||||
|
|
|
@ -2291,8 +2291,9 @@ stream_dispatch_write_events_loop (lsquic_stream_t *stream)
|
|||
no_progress_count = 0;
|
||||
stream->stream_flags |= STREAM_LAST_WRITE_OK;
|
||||
while ((stream->sm_qflags & SMQF_WANT_WRITE)
|
||||
&& (stream->stream_flags & STREAM_LAST_WRITE_OK)
|
||||
&& stream_writeable(stream))
|
||||
&& (stream->stream_flags & STREAM_LAST_WRITE_OK)
|
||||
&& !(stream->stream_flags & STREAM_ONCLOSE_DONE)
|
||||
&& stream_writeable(stream))
|
||||
{
|
||||
progress = stream_progress(stream);
|
||||
|
||||
|
@ -2415,6 +2416,7 @@ lsquic_stream_dispatch_write_events (lsquic_stream_t *stream)
|
|||
if (stream->sm_bflags & SMBF_RW_ONCE)
|
||||
{
|
||||
if ((stream->sm_qflags & SMQF_WANT_WRITE)
|
||||
&& !(stream->stream_flags & STREAM_ONCLOSE_DONE)
|
||||
&& stream_writeable(stream))
|
||||
{
|
||||
on_write = select_on_write(stream);
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 14bec45020023db299b0a2c12a0c9ac90fbed49b
|
||||
Subproject commit a84a6b9f6d1e2dd5605c399fc2edcfeea8291258
|
Loading…
Add table
Add a link
Reference in a new issue