@ -263,11 +263,6 @@ static err_t proxy_recv_cb(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t
if ( p = = NULL | | err ! = LERR_OK ) {
DEBUG_INFO ( DEBUG_CATEGORY_SOCKET , " PROXY FIN stream=%016llx tun=1 active=%d " , ( unsigned long long ) ( pc - > remote_stream_id ? pc - > remote_stream_id : 0 ) , pc - > active ) ;
pc - > closing_tun = 1 ;
if ( pc - > closing_rem ) {
DEBUG_INFO ( DEBUG_CATEGORY_SOCKET , " PROXY CLOSE stream=%016llx tun=1 rem=1 (recv) " , ( unsigned long long ) pc - > remote_stream_id ) ;
} else if ( pc - > transport ) {
pc - > transport - > ops - > close ( pc - > transport ) ;
}
return LERR_OK ;
}
@ -314,6 +309,11 @@ static void proxy_err_cb(void *arg, err_t err) {
static err_t proxy_poll_cb ( void * arg , struct tcp_pcb * pcb ) {
struct proxy_conn * pc = ( struct proxy_conn * ) arg ;
if ( ! pc ) return LERR_OK ;
if ( pc - > closing_tun & & ! pc - > closing_rem & & pc - > transport & & pc - > transport_to_uip
& & queue_entry_count ( pc - > transport_to_uip ) = = 0 ) {
DEBUG_INFO ( DEBUG_CATEGORY_SOCKET , " PROXY CLOSE stream=%016llx tun=1 (no pending) " , ( unsigned long long ) pc - > remote_stream_id ) ;
pc - > transport - > ops - > close ( pc - > transport ) ;
}
if ( pc - > closing_tun & & pc - > closing_rem & & pc - > pcb ) {
DEBUG_INFO ( DEBUG_CATEGORY_SOCKET , " PROXY CLOSE stream=%016llx tun=1 rem=1 " , ( unsigned long long ) pc - > remote_stream_id ) ;
struct tcp_pcb * save = pc - > pcb ;