#include "ircd_parse.h"
#include "ircd_auth.h"
#include "struct_connection.h"
+#include "struct_client.h"
+#include "struct_auth.h"
#include "IOHandler/IOSockets.h"
#include <stdlib.h>
#include <string.h>
+#include <stdarg.h>
#include <stdio.h> // @debug
static struct Connection *sockets_listening = NULL;
// listening socket could not be opened
} else {
sockets_remove_list(connection);
- client_disconnected(connection);
sockets_free_connection(connection);
}
break;
va_start(arg_list, text);
pos = vsnprintf(sendBuf, 512 - 2, text, arg_list);
va_end(arg_list);
- if (pos < 0 || pos > (512 - 2)) pos = CLIENT_MAXLEN - 2;
+ if (pos < 0 || pos > (512 - 2)) pos = 512 - 2;
sendBuf[pos] = '\n';
sendBuf[pos+1] = '\0';
iosocket_send(conn->socket, sendBuf, pos+1);