aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/main.c b/main.c
index cfedf93..557dc77 100644
--- a/main.c
+++ b/main.c
@@ -10,6 +10,7 @@
#include "conn_data.h"
#include "db.h"
#include "runloop.h"
+#include "user_data.h"
#define PORT (29536) // python: int("msg",36)
@@ -50,6 +51,7 @@ static void delete_conn_data(int fd){
struct hash_item *item=conn_hash[fd%CONN_HASH_SIZE];
assert(item);
if(item->cd.fd==fd){
+ if(item->cd.userid!=-1)userdata_unregister(item->cd.userid,fd);
conn_hash[fd%CONN_HASH_SIZE]=item->next;
conn_data_nullify(&item->cd);
free(item);
@@ -62,6 +64,7 @@ static void delete_conn_data(int fd){
}
assert(parent);
assert(item);
+ if(item->cd.userid!=-1)userdata_unregister(item->cd.userid,fd);
conn_data_nullify(&item->cd);
parent->next=item->next;
free(item);