Fix bug #3, sid allocation overflow. May lead to double SIDs being given out.

This commit is contained in:
Jan Vidar Krey
2009-08-02 21:04:10 +02:00
parent b78d48795b
commit 9bd0286c01
7 changed files with 92 additions and 84 deletions

View File

@@ -24,7 +24,7 @@ struct hub_user_manager
{
size_t count; /**<< "Number of all fully connected and logged in users" */
size_t count_peak; /**<< "Peak number of users" */
sid_t free_sid; /**<< "The next available SID." */
struct sid_pool* sids;
uint64_t shared_size; /**<< "The total number of shared bytes among fully connected users." */
uint64_t shared_files; /**<< "The total number of shared files among fully connected users." */
struct linked_list* list; /**<< "Contains all users" */
@@ -70,7 +70,7 @@ extern int uman_remove(struct hub_info* hub, struct hub_user* user);
/**
* Returns and allocates an unused session ID (SID).
*/
extern sid_t uman_get_free_sid(struct hub_info* hub);
extern sid_t uman_get_free_sid(struct hub_info* hub, struct hub_user* user);
/**
* Lookup a user based on the session ID (SID).