Complete moving all connection related data out of the hub_user object.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user