|
|
|
@ -588,12 +588,11 @@ void tcp_proxy_client_destroy(struct tcp_proxy_client* p) { |
|
|
|
udp_proxy_destroy(p->inst); |
|
|
|
udp_proxy_destroy(p->inst); |
|
|
|
icmp_proxy_destroy(p->inst); |
|
|
|
icmp_proxy_destroy(p->inst); |
|
|
|
|
|
|
|
|
|
|
|
if (p->lwip) { lwip_tcp_destroy(p->lwip); p->lwip = NULL; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct tcp_proxy_client_conn* pc = p->conns; |
|
|
|
struct tcp_proxy_client_conn* pc = p->conns; |
|
|
|
while (pc) { |
|
|
|
while (pc) { |
|
|
|
struct tcp_proxy_client_conn* next = pc->next; |
|
|
|
struct tcp_proxy_client_conn* next = pc->next; |
|
|
|
if (pc->pcb) { tcp_arg(pc->pcb, NULL); tcp_abort(pc->pcb); pc->pcb = NULL; } |
|
|
|
if (pc->pcb && pc->pcb->state != CLOSED) { tcp_arg(pc->pcb, NULL); tcp_abort(pc->pcb); } |
|
|
|
|
|
|
|
pc->pcb = NULL; |
|
|
|
if (pc->to_lwip) { |
|
|
|
if (pc->to_lwip) { |
|
|
|
struct ll_entry *e; |
|
|
|
struct ll_entry *e; |
|
|
|
while ((e = queue_data_get(pc->to_lwip))) { queue_dgram_free(e); queue_entry_free(e); } |
|
|
|
while ((e = queue_data_get(pc->to_lwip))) { queue_dgram_free(e); queue_entry_free(e); } |
|
|
|
@ -605,6 +604,8 @@ void tcp_proxy_client_destroy(struct tcp_proxy_client* p) { |
|
|
|
} |
|
|
|
} |
|
|
|
p->conns = NULL; |
|
|
|
p->conns = NULL; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (p->lwip) { lwip_tcp_destroy(p->lwip); p->lwip = NULL; } |
|
|
|
|
|
|
|
|
|
|
|
if (p->tun) tun_close(p->tun); |
|
|
|
if (p->tun) tun_close(p->tun); |
|
|
|
if (p->entry_pool) memory_pool_destroy(p->entry_pool); |
|
|
|
if (p->entry_pool) memory_pool_destroy(p->entry_pool); |
|
|
|
u_free(p); |
|
|
|
u_free(p); |
|
|
|
|