mirror of
https://gitea.invidious.io/iv-org/litespeed-quic.git
synced 2024-08-15 00:53:43 +00:00
Code cleanup. Improve comments in lsquic.h
This commit is contained in:
parent
aa82021170
commit
b86524a470
8 changed files with 113 additions and 141 deletions
|
@ -187,14 +187,6 @@ lsquic_conn_is_push_enabled (lsquic_conn_t *lconn)
|
|||
}
|
||||
|
||||
|
||||
struct lsquic_stream *
|
||||
lsquic_conn_get_stream_by_id (struct lsquic_conn *lconn,
|
||||
lsquic_stream_id_t stream_id)
|
||||
{
|
||||
return lconn->cn_if->ci_get_stream_by_id(lconn, stream_id);
|
||||
}
|
||||
|
||||
|
||||
struct lsquic_engine *
|
||||
lsquic_conn_get_engine (struct lsquic_conn *lconn)
|
||||
{
|
||||
|
|
|
@ -156,9 +156,6 @@ struct conn_iface
|
|||
int
|
||||
(*ci_is_push_enabled) (struct lsquic_conn *);
|
||||
|
||||
struct lsquic_stream *
|
||||
(*ci_get_stream_by_id) (struct lsquic_conn *, lsquic_stream_id_t stream_id);
|
||||
|
||||
struct lsquic_engine *
|
||||
(*ci_get_engine) (struct lsquic_conn *);
|
||||
|
||||
|
|
|
@ -2849,10 +2849,3 @@ const struct lsquic_stream_if lsquic_mini_cry_sm_if =
|
|||
};
|
||||
|
||||
|
||||
struct ssl_st *
|
||||
lsquic_hsk_getssl (lsquic_conn_t *conn)
|
||||
{
|
||||
if (!conn || !(conn->cn_flags & LSCONN_IETF))
|
||||
return NULL;
|
||||
return ((struct enc_sess_iquic *)conn->cn_enc_session)->esi_ssl;
|
||||
}
|
||||
|
|
|
@ -140,9 +140,14 @@ force_close_conn (lsquic_engine_t *engine, lsquic_conn_t *conn);
|
|||
|
||||
/* A connection can be referenced from one of six places:
|
||||
*
|
||||
* 1. A hash. The engine maintains two hash tables -- one for full, and
|
||||
* one for mini connections. A connection starts its life in one of
|
||||
* those.
|
||||
* 1. A hash is used to find connections in order to dispatch an incoming
|
||||
* packet. Connections can be hashed by CIDs or by address. In the
|
||||
* former case, each connection has one or more mappings in the hash
|
||||
* table. IETF QUIC connections have up to eight (in our implementation)
|
||||
* source CIDs and each of those would have a mapping. In client mode,
|
||||
* depending on QUIC versions and options selected, it is may be
|
||||
* necessary to hash connections by address, in which case incoming
|
||||
* packets are delivered to connections based on the address.
|
||||
*
|
||||
* 2. Outgoing queue.
|
||||
*
|
||||
|
@ -216,13 +221,6 @@ struct lsquic_engine
|
|||
struct lsquic_hash *conns_hash;
|
||||
struct min_heap conns_tickable;
|
||||
struct min_heap conns_out;
|
||||
/* Use a union because only one iterator is being used at any one time */
|
||||
union {
|
||||
struct {
|
||||
struct cert_susp_head *head;
|
||||
} resumed;
|
||||
struct lsquic_conn *one_conn;
|
||||
} iter_state;
|
||||
struct eng_hist history;
|
||||
unsigned batch_size;
|
||||
struct pr_queue *pr_queue;
|
||||
|
@ -2611,8 +2609,7 @@ lsquic_engine_packet_in (lsquic_engine_t *engine,
|
|||
|
||||
if (engine->flags & ENG_SERVER)
|
||||
parse_packet_in_begin = lsquic_parse_packet_in_server_begin;
|
||||
else
|
||||
if (engine->flags & ENG_CONNS_BY_ADDR)
|
||||
else if (engine->flags & ENG_CONNS_BY_ADDR)
|
||||
{
|
||||
struct lsquic_hash_elem *el;
|
||||
const struct lsquic_conn *conn;
|
||||
|
|
|
@ -1407,15 +1407,6 @@ find_stream_by_id (struct full_conn *conn, lsquic_stream_id_t stream_id)
|
|||
}
|
||||
|
||||
|
||||
static struct lsquic_stream *
|
||||
full_conn_ci_get_stream_by_id (struct lsquic_conn *lconn,
|
||||
lsquic_stream_id_t stream_id)
|
||||
{
|
||||
struct full_conn *conn = (struct full_conn *) lconn;
|
||||
return find_stream_by_id(conn, stream_id);
|
||||
}
|
||||
|
||||
|
||||
static struct lsquic_engine *
|
||||
full_conn_ci_get_engine (struct lsquic_conn *lconn)
|
||||
{
|
||||
|
@ -4406,7 +4397,6 @@ static const struct conn_iface full_conn_iface = {
|
|||
.ci_get_ctx = full_conn_ci_get_ctx,
|
||||
.ci_get_engine = full_conn_ci_get_engine,
|
||||
.ci_get_path = full_conn_ci_get_path,
|
||||
.ci_get_stream_by_id = full_conn_ci_get_stream_by_id,
|
||||
#if LSQUIC_CONN_STATS
|
||||
.ci_get_stats = full_conn_ci_get_stats,
|
||||
#endif
|
||||
|
|
|
@ -4026,15 +4026,6 @@ find_stream_by_id (struct id24_full_conn *conn, lsquic_stream_id_t stream_id)
|
|||
}
|
||||
|
||||
|
||||
static struct lsquic_stream *
|
||||
ieft_full_conn_ci_get_stream_by_id (struct lsquic_conn *lconn,
|
||||
lsquic_stream_id_t stream_id)
|
||||
{
|
||||
struct id24_full_conn *conn = (struct id24_full_conn *) lconn;
|
||||
return find_stream_by_id(conn, stream_id);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
maybe_schedule_ss_for_stream (struct id24_full_conn *conn,
|
||||
lsquic_stream_id_t stream_id, enum http_error_code error_code)
|
||||
|
@ -6610,7 +6601,6 @@ id24_full_conn_ci_drop_crypto_streams (struct lsquic_conn *lconn)
|
|||
.ci_get_engine = id24_full_conn_ci_get_engine, \
|
||||
.ci_get_log_cid = id24_full_conn_ci_get_log_cid, \
|
||||
.ci_get_path = id24_full_conn_ci_get_path, \
|
||||
.ci_get_stream_by_id = ieft_full_conn_ci_get_stream_by_id, \
|
||||
.ci_going_away = id24_full_conn_ci_going_away, \
|
||||
.ci_hsk_done = id24_full_conn_ci_hsk_done, \
|
||||
.ci_internal_error = id24_full_conn_ci_internal_error, \
|
||||
|
|
|
@ -4274,15 +4274,6 @@ find_stream_by_id (struct ietf_full_conn *conn, lsquic_stream_id_t stream_id)
|
|||
}
|
||||
|
||||
|
||||
static struct lsquic_stream *
|
||||
ieft_full_conn_ci_get_stream_by_id (struct lsquic_conn *lconn,
|
||||
lsquic_stream_id_t stream_id)
|
||||
{
|
||||
struct ietf_full_conn *conn = (struct ietf_full_conn *) lconn;
|
||||
return find_stream_by_id(conn, stream_id);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
maybe_schedule_ss_for_stream (struct ietf_full_conn *conn,
|
||||
lsquic_stream_id_t stream_id, enum http_error_code error_code)
|
||||
|
@ -6968,7 +6959,6 @@ ietf_full_conn_ci_drop_crypto_streams (struct lsquic_conn *lconn)
|
|||
.ci_get_engine = ietf_full_conn_ci_get_engine, \
|
||||
.ci_get_log_cid = ietf_full_conn_ci_get_log_cid, \
|
||||
.ci_get_path = ietf_full_conn_ci_get_path, \
|
||||
.ci_get_stream_by_id = ieft_full_conn_ci_get_stream_by_id, \
|
||||
.ci_going_away = ietf_full_conn_ci_going_away, \
|
||||
.ci_hsk_done = ietf_full_conn_ci_hsk_done, \
|
||||
.ci_internal_error = ietf_full_conn_ci_internal_error, \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue