Fix TCP connect timer ownership and pending FIN state

This commit is contained in:
evgeny committed 2026-10-21 16:44:19 +02:00
1 parent d5e489598d
commit d467d3aa8f
3 files changed
+80 -27

No files matched your search

+8 -1
View File
@@ -330,7 +330,14 @@ int tcp_proxy_server_handle_connect(struct UTUN_INSTANCE* inst, struct ll_entry*
rc->next = ctx->conns; ctx->conns = rc;
if (ret == 0) { rc->tc->connected = 1; on_connected_cb(rc->tc, rc); }
tcp_conn_set_connect_timeout(rc->tc, g->tcp_proxy_server_connect_timeout_ms);
int timeout_rc = tcp_conn_set_connect_timeout(rc->tc, g->tcp_proxy_server_connect_timeout_ms);
if (timeout_rc < 0) {
DEBUG_ERROR(DEBUG_CATEGORY_PROXY, "TCP proxy server: cannot set connect timeout sid=%08x timeout=%d rc=%d",
stream_id, g->tcp_proxy_server_connect_timeout_ms, timeout_rc);
on_error_cb(rc->tc, -timeout_rc, rc);
queue_dgram_free(entry); queue_entry_free(entry);
return -1;
}
rc->diag_timer = uasync_set_timeout(rc->ua, 10000, rc, diag_timer_cb, "tps_diag");
queue_dgram_free(entry); queue_entry_free(entry);