mirror of
https://gitea.invidious.io/iv-org/litespeed-quic.git
synced 2024-08-15 00:53:43 +00:00
Fix bug in lsquic_engine_connect() exposed by recent changes.
This commit is contained in:
parent
82f3bcef32
commit
5296a94ba2
3 changed files with 13 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2018-04-20
|
||||||
|
|
||||||
|
- [BUGFIX] Fix bug in lsquic_engine_connect() exposed by yesterday's
|
||||||
|
changes.
|
||||||
|
|
||||||
2018-04-19
|
2018-04-19
|
||||||
|
|
||||||
- [BUGFIX] Add connection to Tickable Queue on stream write
|
- [BUGFIX] Add connection to Tickable Queue on stream write
|
||||||
|
|
|
@ -144,4 +144,4 @@ Have fun,
|
||||||
|
|
||||||
LiteSpeed QUIC Team.
|
LiteSpeed QUIC Team.
|
||||||
|
|
||||||
Copyright (c) 2017 LiteSpeed Technologies Inc
|
Copyright (c) 2017 - 2018 LiteSpeed Technologies Inc
|
||||||
|
|
|
@ -568,11 +568,12 @@ lsquic_engine_connect (lsquic_engine_t *engine, const struct sockaddr *peer_sa,
|
||||||
const char *hostname, unsigned short max_packet_size)
|
const char *hostname, unsigned short max_packet_size)
|
||||||
{
|
{
|
||||||
lsquic_conn_t *conn;
|
lsquic_conn_t *conn;
|
||||||
|
ENGINE_IN(engine);
|
||||||
|
|
||||||
if (engine->flags & ENG_SERVER)
|
if (engine->flags & ENG_SERVER)
|
||||||
{
|
{
|
||||||
LSQ_ERROR("`%s' must only be called in client mode", __func__);
|
LSQ_ERROR("`%s' must only be called in client mode", __func__);
|
||||||
return NULL;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 == max_packet_size)
|
if (0 == max_packet_size)
|
||||||
|
@ -590,16 +591,19 @@ lsquic_engine_connect (lsquic_engine_t *engine, const struct sockaddr *peer_sa,
|
||||||
|
|
||||||
conn = new_full_conn_client(engine, hostname, max_packet_size);
|
conn = new_full_conn_client(engine, hostname, max_packet_size);
|
||||||
if (!conn)
|
if (!conn)
|
||||||
return NULL;
|
goto err;
|
||||||
lsquic_mh_insert(&engine->conns_tickable, conn, conn->cn_last_ticked);
|
lsquic_mh_insert(&engine->conns_tickable, conn, conn->cn_last_ticked);
|
||||||
engine_incref_conn(conn, LSCONN_TICKABLE);
|
engine_incref_conn(conn, LSCONN_TICKABLE);
|
||||||
ENGINE_IN(engine);
|
|
||||||
lsquic_conn_record_peer_sa(conn, peer_sa);
|
lsquic_conn_record_peer_sa(conn, peer_sa);
|
||||||
conn->cn_peer_ctx = peer_ctx;
|
conn->cn_peer_ctx = peer_ctx;
|
||||||
lsquic_conn_set_ctx(conn, conn_ctx);
|
lsquic_conn_set_ctx(conn, conn_ctx);
|
||||||
full_conn_client_call_on_new(conn);
|
full_conn_client_call_on_new(conn);
|
||||||
|
end:
|
||||||
ENGINE_OUT(engine);
|
ENGINE_OUT(engine);
|
||||||
return conn;
|
return conn;
|
||||||
|
err:
|
||||||
|
conn = NULL;
|
||||||
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue