Skip to content

Commit cee5f5b

Browse files
committed
the access to ->async->pending should be under lock
1 parent 4754e12 commit cee5f5b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

modules/proto_tls/proto_tls.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,11 @@ static int proto_tls_send(const struct socket_info* send_sock,
618618
send_sock->last_real_ports->local = c->rcv.dst_port;
619619
send_sock->last_real_ports->remote = c->rcv.src_port;
620620

621-
tcp_conn_release(c, 0);
621+
int pending_data = 0;
622+
lock_get(&c->write_lock);
623+
pending_data = (c->async && c->async->pending)?1:0;
624+
lock_release(&c->write_lock);
625+
tcp_conn_release(c, pending_data);
622626
return rlen;
623627
con_release:
624628
sh_log(c->hist, TCP_SEND2MAIN, "send 1, (%d)", c->refcnt);

0 commit comments

Comments
 (0)