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.
这个提交包含在:
Jan Vidar Krey
2013-02-05 22:38:13 +01:00
父节点 4f3c71234b
当前提交 4d438e1e90
+3 -2
查看文件
@@ -132,10 +132,11 @@ 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);
res = g_backend->handler.backend_poll(g_backend->data, secs * 1000);
if (g_backend->common.num)
res = g_backend->handler.backend_poll(g_backend->data, secs * 1000);
g_backend->now = time(0);
timeout_queue_process(&g_backend->timeout_queue, g_backend->now);