Don't poll the connection monitor if there are no connections added.
This caused the backends to return an error code, which in turn ended the mainloop. However, several other things also might occur in the main loop, such as DNS lookups which come prior to creating any connections that in turn would be monitored.
This commit is contained in:
@@ -132,9 +132,10 @@ struct timeout_queue* net_backend_get_timeout_queue()
|
||||
*/
|
||||
int net_backend_process()
|
||||
{
|
||||
int res;
|
||||
int res = 0;
|
||||
size_t secs = timeout_queue_get_next_timeout(&g_backend->timeout_queue, g_backend->now);
|
||||
|
||||
if (g_backend->common.num)
|
||||
res = g_backend->handler.backend_poll(g_backend->data, secs * 1000);
|
||||
|
||||
g_backend->now = time(0);
|
||||
|
||||
Reference in New Issue
Block a user