Various fixes for epoll handling without libevent.

This should take care of most compile issues as well as busy loops caused by unhandled recv() calls returning 0 and general cleanups.
This commit is contained in:
Jan Vidar Krey
2010-01-19 14:53:47 +01:00
parent af8421fa47
commit f84073f7cc
22 changed files with 315 additions and 400 deletions

View File

@@ -42,9 +42,8 @@ static void inf_create_user()
{
if (inf_user) return;
inf_user = (struct hub_user*) hub_malloc_zero(sizeof(struct hub_user));
inf_user->connection = (struct net_connection*) hub_malloc_zero(sizeof(struct net_connection));
inf_user->connection = net_con_create();
inf_user->id.sid = 1;
inf_user->connection->sd = -1;
inf_user->limits.upload_slots = 1;
}

View File

@@ -4,7 +4,7 @@
static struct hub_info um_hub;
static struct hub_user um_user[MAX_USERS];
static struct net_connection um_cons[MAX_USERS];
// static struct net_connection um_cons[MAX_USERS];
EXO_TEST(um_test_setup, {
int i = 0;
@@ -12,12 +12,12 @@ EXO_TEST(um_test_setup, {
for (i = 0; i < MAX_USERS; i++)
{
memset(&um_cons[i], 0, sizeof(struct net_connection));
/* memset(&um_cons[i], 0, sizeof(struct net_connection));
um_cons[i].sd = -1;
memset(&um_user[i], 0, sizeof(struct hub_user));
um_user[i].id.sid = i+1;
um_user[i].connection = &um_cons[i];
um_user[i].connection = &um_cons[i];*/
}
return 1;
});