aboutsummaryrefslogtreecommitdiff
path: root/protocols/inspircd3.c
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2024-06-18 02:18:46 -0400
committerTest_User <hax@andrewyu.org>2024-06-18 02:18:46 -0400
commitc82ee1c2cdf492a05e4bf3d3d151205e50c9b603 (patch)
treed8e71d3c7b7c03bd512d427ab93b4c75ca4f990f /protocols/inspircd3.c
parentf67a7bd24b2e655c21ffdc6160d663d8d5ba5be6 (diff)
downloadhaxircd-c82ee1c2cdf492a05e4bf3d3d151205e50c9b603.tar.gz
haxircd-c82ee1c2cdf492a05e4bf3d3d151205e50c9b603.zip
Optional futex support, increased spam limit
Diffstat (limited to 'protocols/inspircd3.c')
-rw-r--r--protocols/inspircd3.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/protocols/inspircd3.c b/protocols/inspircd3.c
index 3c74a79..864b0d1 100644
--- a/protocols/inspircd3.c
+++ b/protocols/inspircd3.c
@@ -38,6 +38,7 @@
#include "../haxstring.h"
#include "../haxstring_utils.h"
#include "../main.h"
+#include "../mutex.h"
#include "../server_network.h"
#include "inspircd3.h"
@@ -211,7 +212,7 @@ void * inspircd3_protocol_connection(void *type) {
goto inspircd3_protocol_handle_connection_close;
timeout++;
- pthread_mutex_lock(&(state_lock));
+ mutex_lock(&(state_lock));
networks[net].send(handle, STRING(":"));
networks[net].send(handle, SID);
networks[net].send(handle, STRING(" PING :"));
@@ -222,7 +223,7 @@ void * inspircd3_protocol_connection(void *type) {
server->awaiting_pong = 1;
gettimeofday(&(server->last_ping), 0);
- pthread_mutex_unlock(&(state_lock));
+ mutex_unlock(&(state_lock));
} else {
goto inspircd3_protocol_handle_connection_close;
}
@@ -381,7 +382,7 @@ void * inspircd3_protocol_connection(void *type) {
i++;
}
- pthread_mutex_lock(&state_lock);
+ mutex_lock(&state_lock);
if (source.len != 0) {
struct server_info *server;
@@ -430,7 +431,7 @@ void * inspircd3_protocol_connection(void *type) {
WRITES(2, STRING("\n"));
do_trivial_reloads();
- pthread_mutex_unlock(&state_lock);
+ mutex_unlock(&state_lock);
memmove(full_msg.data, full_msg.data + msg_len + 1, full_msg.len - msg_len - 1);
full_msg.len -= msg_len + 1;
void *tmp = realloc(full_msg.data, full_msg.len);
@@ -440,14 +441,14 @@ void * inspircd3_protocol_connection(void *type) {
}
inspircd3_protocol_handle_connection_unlock_close:
- pthread_mutex_unlock(&state_lock);
+ mutex_unlock(&state_lock);
inspircd3_protocol_handle_connection_close:
free(full_msg.data);
if (ready) {
- pthread_mutex_lock(&(state_lock));
+ mutex_lock(&(state_lock));
unlink_server(config->sid, get_table_index(server_list, config->sid), self, INSPIRCD3_PROTOCOL);
- pthread_mutex_unlock(&(state_lock));
+ mutex_unlock(&(state_lock));
}
networks[net].close(fd, handle);