fixed path of mysql/errmsg.h (OSX compilation fix)
[NeonServV5.git] / src / ClientSocket.c
index 3c05457da8d90d733a53b891e14fbc6c7d10f75e..3be703765123bcbe931f7dd5c03ffa2f174da235 100644 (file)
@@ -24,6 +24,7 @@
 #include "ConfigParser.h"
 #include "version.h"
 #include "IOHandler.h"
+#include "IRCEvents.h"
 
 struct socket_list {
     struct ClientSocket *data;
@@ -136,6 +137,7 @@ int destroy_socket(struct ClientSocket *client) {
         } else
             last_sock = sock;
     }
+    event_freeclient(client);
     free(client->host);
     if(client->bind)
         free(client->bind);
@@ -224,9 +226,9 @@ static IOHANDLER_CALLBACK(socket_callback) {
     case IOEVENT_CONNECTED:
         client->flags |= SOCKET_FLAG_CONNECTED;
         if(client->pass && strcmp(client->pass, ""))
-            iohandler_printf(event->iofd, "PASS :%s", client->pass);
-        iohandler_printf(event->iofd, "USER %s 0 0 :%s", client->ident, client->realname);
-        iohandler_printf(event->iofd, "NICK %s", client->nick);
+            putsock(client, "PASS :%s", client->pass);
+        putsock(client, "USER %s 0 0 :%s", client->ident, client->realname);
+        putsock(client, "NICK %s", client->nick);
         break;
     case IOEVENT_NOTCONNECTED:
     case IOEVENT_CLOSED: