added SSL backend for IOMultiplexer
[TransparentIRC.git] / src / UserClient.c
index bb43793981b87fa6fdadf84f9d64aa5670fd2085..762b0d600f7a516747524f934beeef7c1a2a7cb8 100644 (file)
@@ -27,7 +27,7 @@ static struct UserClient *userclients = NULL;
 
 void userclient_accepted(struct ServerSocket *server, int sockfd) {
     struct UserClient *client;
-    struct IODescriptor *iofd = iohandler_add(sockfd, IOTYPE_CLIENT, userclient_callback);
+    struct IODescriptor *iofd = iohandler_add(sockfd, IOTYPE_CLIENT, NULL, userclient_callback);
     if(!iofd) return;
     iofd->state = IO_CONNECTED;
     iofd->read_lines = 1;
@@ -56,7 +56,8 @@ void userclient_accepted(struct ServerSocket *server, int sockfd) {
 
 void userclient_close(struct UserClient *client) {
     if(client->flags & USERCLIENT_LOGGED_IN) {
-        usersession_client_close(client->user);
+        if(client->user)
+            usersession_client_close(client->user);
     } else {
         struct UserLogin *login = client->user;
         if(client->flags & USERCLIENT_LOGIN_PROCESSING) {
@@ -112,6 +113,7 @@ static void userclient_recv(struct UserClient *client, char *line) {
         int argc = parse_line(line, argv, 1);
         */
         
+        return;
     } else if(!(client->flags & USERCLIENT_LOGGED_IN)) {
         struct UserLogin *login = client->user;
         char *argv[MAXNUMPARAMS];