Minor cleanups and stack reduction.

Signed-off-by: Jan Vidar Krey <janvidar@extatic.org>
This commit is contained in:
Jan Vidar Krey 2009-03-19 01:27:34 +01:00
parent 1d491055c5
commit 669ab14022

View File

@ -242,11 +242,10 @@ void net_on_accept(int server_fd, short ev, void *arg)
{ {
struct hub_info* hub = (struct hub_info*) arg; struct hub_info* hub = (struct hub_info*) arg;
struct user* user = 0; struct user* user = 0;
int accept_more = 1;
const char* addr; const char* addr;
struct timeval timeout = { TIMEOUT_CONNECTED, 0 }; struct timeval timeout = { TIMEOUT_CONNECTED, 0 };
while (accept_more) for (;;)
{ {
int fd = net_accept(server_fd); int fd = net_accept(server_fd);
if (fd == -1) if (fd == -1)
@ -294,7 +293,6 @@ void net_on_accept(int server_fd, short ev, void *arg)
event_base_set(hub->evbase, user->ev_read); event_base_set(hub->evbase, user->ev_read);
event_base_set(hub->evbase, user->ev_write); event_base_set(hub->evbase, user->ev_write);
event_add(user->ev_read, &timeout); event_add(user->ev_read, &timeout);
} }
} }