Complete moving all connection related data out of the hub_user object.

This commit is contained in:
Jan Vidar Krey
2009-08-07 00:22:30 +02:00
parent cfb450c3fc
commit 86ba3ca86f
14 changed files with 60 additions and 48 deletions

View File

@@ -42,8 +42,9 @@ 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->id.sid = 1;
inf_user->net.connection.sd = -1;
inf_user->connection->sd = -1;
inf_user->limits.upload_slots = 1;
}

View File

@@ -4,6 +4,7 @@
static struct hub_info um_hub;
static struct hub_user um_user[MAX_USERS];
static struct net_connection um_cons[MAX_USERS];
EXO_TEST(um_test_setup, {
int i = 0;
@@ -11,9 +12,12 @@ EXO_TEST(um_test_setup, {
for (i = 0; i < MAX_USERS; i++)
{
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].net.connection.sd = -1;
um_user[i].connection = &um_cons[i];
}
return 1;
});