Only quit Event loops for clients

This commit is contained in:
Pierre Pronchery 2020-03-29 21:19:52 +02:00
parent c4e1784816
commit 874d7a8fee

View File

@ -697,6 +697,7 @@ static int _tcp_callback_connect(int fd, TCP * tcp)
else
/* deregister this callback */
ret = 1;
if(tcp->mode == ATM_CLIENT)
event_loop_quit(tcp->helper->event);
#ifdef DEBUG
fprintf(stderr, "DEBUG: %s() => %d\n", __func__, ret);
@ -855,6 +856,7 @@ static int _tcp_socket_callback_write(int fd, TCPSocket * tcpsocket)
/* unregister the callback if there is nothing left to write */
if(tcpsocket->bufout_cnt == 0)
{
if(tcpsocket->tcp->mode == ATM_CLIENT)
event_loop_quit(tcpsocket->tcp->helper->event);
return 1;
}