fix RST storm: stop proxy_feed after CLOSE sent + free unsent before tcp_close
This commit is contained in:
1 parent
80e4e4fd5d
commit
40d35ee2a5
1 file changed
+2
-1
+2
-1
@@ -187,7 +187,7 @@ static void transport_to_uip_cb(struct ll_queue* q, void* arg) {
|
||||
// Helper: feed data from transport_to_uip queue to lwIP TCP
|
||||
// ====================================================================
|
||||
static void proxy_feed_from_transport(struct proxy_conn *pc) {
|
||||
if (!pc->transport_to_uip || !pc->pcb) return;
|
||||
if (!pc->transport_to_uip || !pc->pcb || pc->closing_sent) return;
|
||||
int sent_any = 0;
|
||||
int entries_fed = 0;
|
||||
while (1) {
|
||||
@@ -330,6 +330,7 @@ static err_t proxy_poll_cb(void *arg, struct tcp_pcb *pcb) {
|
||||
tcp_arg(save, NULL); pc->pcb = NULL;
|
||||
{ uint16_t wnd_gap = TCP_WND_MAX(save) - save->rcv_wnd;
|
||||
if (wnd_gap > 0) tcp_recved(save, wnd_gap); }
|
||||
while (save->unsent) { struct tcp_seg *seg = save->unsent; save->unsent = seg->next; u_free(seg); }
|
||||
tcp_close(save);
|
||||
struct tcp_proxy *proxy = pc->proxy;
|
||||
struct proxy_conn **prev = &proxy->conns;
|
||||
|
||||
Reference in new issue
Block a user