added some code
[NextIRCd.git] / src / ircd_sock.c
index a61686f5a22b089034b2b2d935f142e7b2d2fa62..259c74b84a851806a8e740d9d1d2aabeb2d834e1 100644 (file)
 #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;
@@ -196,7 +199,6 @@ static IOSOCKET_CALLBACK(sockets_iohandler_callback) {
             // listening socket could not be opened
         } else {
             sockets_remove_list(connection);
-            client_disconnected(connection);
             sockets_free_connection(connection);
         }
         break;
@@ -227,7 +229,7 @@ void socket_printf(struct Connection *conn, const char *text, ...) {
        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);