summaryrefslogtreecommitdiff
path: root/lib/tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tcp.c')
-rw-r--r--lib/tcp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/tcp.c b/lib/tcp.c
index f98e971..c4948c0 100644
--- a/lib/tcp.c
+++ b/lib/tcp.c
@@ -179,7 +179,11 @@ tcp_event_cb (struct bufferevent *bev, short events, void *user_data)
{
if (conn->tev)
evtimer_del (conn->tev); /* Cancel connect timer. */
- event_on_connect (conn, pkt);
+ if (event_on_connect (conn, pkt))
+ {
+ event_on_disconnect (conn);
+ event_loopbreak (conn);
+ }
}
else if (events & BEV_EVENT_EOF)
{