Skip to content

Commit

Permalink
net/tcp: mark connections as being added in reactor
Browse files Browse the repository at this point in the history
This way we can "remember" to remove them from the reactor when the
connection times out.

Full credits go to @vitalikvoip for reporting, troubleshooting and
fixing this problem. Close #2134
  • Loading branch information
razvancrainea committed Jun 15, 2020
1 parent bfd2bbe commit 3e862f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/net_tcp.c
Expand Up @@ -1177,8 +1177,10 @@ inline static int handle_tcpconn_ev(struct tcp_connection* tcpconn, int fd_i,

/* now that we completed the async connection, we also need to
* listen for READ events, otherwise these will get lost */
if (tcpconn->flags & F_CONN_REMOVED_READ)
if (tcpconn->flags & F_CONN_REMOVED_READ) {
reactor_add_reader( tcpconn->s, F_TCPCONN, RCT_PRIO_NET, tcpconn);
tcpconn->flags&=~F_CONN_REMOVED_READ;
}

goto async_write;
} else {
Expand Down

0 comments on commit 3e862f0

Please sign in to comment.