Skip to content

Commit adcb25b

Browse files
committed
quic: sai fixes
1 parent 96ffafa commit adcb25b

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

lib/core-net/service.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ lws_handle_POLLOUT_event(struct lws *wsi, struct lws_pollfd *pollfd)
148148

149149
#if defined(LWS_WITH_CLIENT)
150150
/* Intercept POLLOUT for parallel sockets if we are racing H3 */
151-
if (pollfd && pollfd->fd != wsi->desc.sockfd) {
151+
if (pollfd && wsi->parallel_count > 0 && pollfd->fd != wsi->desc.sockfd) {
152152
lws_client_connect_3_connect(wsi, NULL, NULL, 0, pollfd);
153153
return 0;
154154
}

lib/roles/quic/crypto-quic.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,7 @@ lws_quic_encrypt_payload(struct lws_quic_keys *keys, uint8_t *packet, size_t pac
725725
int
726726
lws_tls_quic_rx_crypto(struct lws *wsi, int level, const uint8_t *buf, size_t len)
727727
{
728+
struct lws *orig_wsi = wsi;
728729
int n;
729730

730731
if (len > 0 && wsi->quic.qn) {
@@ -935,14 +936,14 @@ lws_tls_quic_rx_crypto(struct lws *wsi, int level, const uint8_t *buf, size_t le
935936
}
936937
#endif
937938

938-
if (wsi->role_ops) {
939-
enum lws_callback_reasons cb = (enum lws_callback_reasons)wsi->role_ops->adoption_cb[lwsi_role_server(wsi)];
940-
if (cb && wsi->a.protocol && wsi->a.protocol->callback) {
941-
wsi->a.protocol->callback(wsi, cb, wsi->user_space, NULL, 0);
939+
if (orig_wsi->role_ops) {
940+
enum lws_callback_reasons cb = (enum lws_callback_reasons)orig_wsi->role_ops->adoption_cb[lwsi_role_server(orig_wsi)];
941+
if (cb && orig_wsi->a.protocol && orig_wsi->a.protocol->callback) {
942+
orig_wsi->a.protocol->callback(orig_wsi, cb, orig_wsi->user_space, NULL, 0);
942943
}
943944
}
944945

945-
lws_callback_on_writable(wsi);
946+
lws_callback_on_writable(orig_wsi);
946947
}
947948

948949
return 0;

lib/roles/quic/ops-quic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,8 +1494,6 @@ rops_handle_POLLOUT_quic(struct lws *wsi)
14941494
int eagain_blocked = 0;
14951495
uint8_t pkt[2048]; memset(pkt, 0, sizeof(pkt));
14961496

1497-
wsi->mux.requested_POLLOUT = 0;
1498-
14991497
// lwsl_notice("QUIC TX: POLLOUT called for %s, qn=%p, is_server=%d\n", lws_wsi_tag(wsi), qn, qn ? qn->is_server : -1);
15001498

15011499
if (!qn) {
@@ -1514,6 +1512,8 @@ rops_handle_POLLOUT_quic(struct lws *wsi)
15141512
return LWS_HP_RET_DROP_POLLOUT;
15151513
}
15161514

1515+
wsi->mux.requested_POLLOUT = 0;
1516+
15171517
lws_usec_t pto_base = qn->smoothed_rtt ? (qn->smoothed_rtt + (4 * qn->rttvar) + 25000) : LWS_QUIC_DEFAULT_PTO_US;
15181518
lws_usec_t pto_delay = pto_base << qn->pto_count;
15191519
if (pto_delay > 10000000)

0 commit comments

Comments
 (0)