Fix some asserts.
This commit is contained in:
parent
1642b8dfbe
commit
d45383fe4d
@ -13,7 +13,7 @@ USE_SSL ?= NO
|
|||||||
USE_BIGENDIAN ?= AUTO
|
USE_BIGENDIAN ?= AUTO
|
||||||
BITS ?= AUTO
|
BITS ?= AUTO
|
||||||
SILENT ?= YES
|
SILENT ?= YES
|
||||||
LDLIBS += -levent
|
LDLIBS += -lev
|
||||||
TERSE ?= NO
|
TERSE ?= NO
|
||||||
STACK_PROTECT ?= NO
|
STACK_PROTECT ?= NO
|
||||||
|
|
||||||
|
@ -959,8 +959,6 @@ void hub_schedule_destroy_user(struct hub_info* hub, struct hub_user* user)
|
|||||||
post.ptr = user;
|
post.ptr = user;
|
||||||
event_queue_post(hub->queue, &post);
|
event_queue_post(hub->queue, &post);
|
||||||
|
|
||||||
net_con_close(&user->net.connection);
|
|
||||||
|
|
||||||
if (user->id.sid)
|
if (user->id.sid)
|
||||||
{
|
{
|
||||||
sid_free(hub->users->sids, user->id.sid);
|
sid_free(hub->users->sids, user->id.sid);
|
||||||
@ -976,20 +974,6 @@ void hub_disconnect_all(struct hub_info* hub)
|
|||||||
event_queue_post(hub->queue, &post);
|
event_queue_post(hub->queue, &post);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void hub_schedule_destroy_all(struct hub_info* hub)
|
|
||||||
{
|
|
||||||
struct hub_user* user = (struct hub_user*) list_get_first(hub->users->list);
|
|
||||||
while (user)
|
|
||||||
{
|
|
||||||
|
|
||||||
hub_schedule_destroy_user(hub, user);
|
|
||||||
user = (struct hub_user*) list_get_next(hub->users->list);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void hub_event_loop(struct hub_info* hub)
|
void hub_event_loop(struct hub_info* hub)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
@ -1035,6 +1019,7 @@ void hub_disconnect_user(struct hub_info* hub, struct hub_user* user, int reason
|
|||||||
|
|
||||||
/* stop reading from user */
|
/* stop reading from user */
|
||||||
net_shutdown_r(user->net.connection.sd);
|
net_shutdown_r(user->net.connection.sd);
|
||||||
|
net_con_close(&user->net.connection);
|
||||||
|
|
||||||
LOG_TRACE("hub_disconnect_user(), user=%p, reason=%d, state=%d", user, reason, user->state);
|
LOG_TRACE("hub_disconnect_user(), user=%p, reason=%d, state=%d", user, reason, user->state);
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ void net_con_update(struct net_connection* con, int ev)
|
|||||||
if (events & EV_READ) net_con_flag_set(con, NET_WANT_READ);
|
if (events & EV_READ) net_con_flag_set(con, NET_WANT_READ);
|
||||||
if (events & EV_WRITE) net_con_flag_set(con, NET_WANT_WRITE);
|
if (events & EV_WRITE) net_con_flag_set(con, NET_WANT_WRITE);
|
||||||
|
|
||||||
if (event_pending(&con->event, EV_READ | EV_WRITE, 0) == events)
|
if (con->sd == -1 || event_pending(&con->event, EV_READ | EV_WRITE, 0) == events)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
event_del(&con->event);
|
event_del(&con->event);
|
||||||
|
Loading…
Reference in New Issue
Block a user