Make sure we call the timeout code.
This commit is contained in:
parent
78ad9b8572
commit
b29da11f3b
|
@ -114,6 +114,9 @@ int net_backend_process()
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_backend->now = time(0);
|
||||||
|
timeout_queue_process(&g_backend->timeout_queue, g_backend->now);
|
||||||
|
|
||||||
for (n = 0; n < res; n++)
|
for (n = 0; n < res; n++)
|
||||||
{
|
{
|
||||||
struct net_connection_epoll* con = (struct net_connection_epoll*) g_backend->events[n].data.ptr;
|
struct net_connection_epoll* con = (struct net_connection_epoll*) g_backend->events[n].data.ptr;
|
||||||
|
@ -232,6 +235,10 @@ void net_con_close(struct net_connection* con_)
|
||||||
{
|
{
|
||||||
LOG_WARN("epoll_ctl() delete failed.");
|
LOG_WARN("epoll_ctl() delete failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
net_close(con->sd);
|
||||||
|
con->sd = -1;
|
||||||
|
|
||||||
net_con_print("DEL", con);
|
net_con_print("DEL", con);
|
||||||
net_cleanup_delayed_free(g_backend->cleaner, con_);
|
net_cleanup_delayed_free(g_backend->cleaner, con_);
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,6 +117,9 @@ int net_backend_process()
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_backend->now = time(0);
|
||||||
|
timeout_queue_process(&g_backend->timeout_queue, g_backend->now);
|
||||||
|
|
||||||
for (n = 0, found = 0; found < res && n < (maxfd+1); n++)
|
for (n = 0, found = 0; found < res && n < (maxfd+1); n++)
|
||||||
{
|
{
|
||||||
struct net_connection_select* con = g_backend->conns[n];
|
struct net_connection_select* con = g_backend->conns[n];
|
||||||
|
@ -197,6 +200,9 @@ void net_con_close(struct net_connection* con)
|
||||||
|
|
||||||
net_con_clear_timeout(con);
|
net_con_clear_timeout(con);
|
||||||
|
|
||||||
|
net_close(con->sd);
|
||||||
|
con->sd = -1;
|
||||||
|
|
||||||
net_con_print("DEL", (struct net_connection_select*) con);
|
net_con_print("DEL", (struct net_connection_select*) con);
|
||||||
net_cleanup_delayed_free(g_backend->cleaner, con);
|
net_cleanup_delayed_free(g_backend->cleaner, con);
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,6 @@ size_t timeout_queue_process(struct timeout_queue* t, time_t now)
|
||||||
while ((evt = t->events[pos % t->max]))
|
while ((evt = t->events[pos % t->max]))
|
||||||
{
|
{
|
||||||
timeout_queue_remove(t, evt);
|
timeout_queue_remove(t, evt);
|
||||||
timeout_evt_reset(evt);
|
|
||||||
evt->callback(evt);
|
evt->callback(evt);
|
||||||
events++;
|
events++;
|
||||||
}
|
}
|
||||||
|
@ -125,8 +124,7 @@ void timeout_queue_remove(struct timeout_queue* t, struct timeout_evt* evt)
|
||||||
evt->prev->next = evt->next;
|
evt->prev->next = evt->next;
|
||||||
evt->next->prev = evt->prev;
|
evt->next->prev = evt->prev;
|
||||||
}
|
}
|
||||||
evt->next = 0;
|
timeout_evt_reset(evt);
|
||||||
evt->prev = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void timeout_queue_reschedule(struct timeout_queue* t, struct timeout_evt* evt, size_t seconds)
|
void timeout_queue_reschedule(struct timeout_queue* t, struct timeout_evt* evt, size_t seconds)
|
||||||
|
|
Loading…
Reference in New Issue