-/* HandleInfoHandler.c - NeonServ v5.2
- * Copyright (C) 2011 Philipp Kreil (pk910)
+/* HandleInfoHandler.c - NeonServ v5.3
+ * Copyright (C) 2011-2012 Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "HandleInfoHandler.h"
#include "ClientSocket.h"
#include "UserNode.h"
+#include "ChanNode.h"
#include "IRCEvents.h"
#include "tools.h"
perror("malloc() failed");
return NULL;
}
+ SYNCHRONIZE(cache_sync);
entry->next = NULL;
if(client->handleinfo_last)
client->handleinfo_last->next = entry;
else
client->handleinfo_first = entry;
client->handleinfo_last = entry;
+ DESYNCHRONIZE(cache_sync);
return entry;
}
static struct HandleInfoQueueEntry* getNextHandleInfoQueueEntry(struct ClientSocket *client, int freeEntry) {
if(!client->handleinfo_first) return NULL;
+ SYNCHRONIZE(cache_sync);
struct HandleInfoQueueEntry *entry = client->handleinfo_first;
if(freeEntry) {
client->handleinfo_first = entry->next;
client->handleinfo_last = NULL;
}
}
+ DESYNCHRONIZE(cache_sync);
return entry;
}
void clear_handleinfoqueue(struct ClientSocket *client) {
if(!client->handleinfo_first) return;
+ SYNCHRONIZE(cache_sync);
struct HandleInfoQueueEntry *entry, *next;
for(entry = client->handleinfo_first; entry; entry = next) {
next = entry->next;
}
client->handleinfo_last = NULL;
client->handleinfo_first = NULL;
+ DESYNCHRONIZE(cache_sync);
}
void lookup_authname(char *auth, authlookup_callback_t callback, void *data) {