Fix for unneccesary fatal exit when client is disconnected due to SSL error.
authorMartin Johansson <martin@fatbob.nu>
Wed, 7 Sep 2011 19:57:36 +0000 (21:57 +0200)
committerMartin Johansson <martin@fatbob.nu>
Wed, 7 Sep 2011 19:57:36 +0000 (21:57 +0200)
src/client.c

index e190a0b9f67fa30f94ebed2fc8a6951dd8f9a765..2ad53ba983273dbee7256d925a9b210829cb7826 100644 (file)
@@ -354,10 +354,10 @@ int Client_read_fd(int fd)
                        break;
                }
        }
-       if (client == NULL)
-               Log_fatal("No client found for fd %d", fd);
-       
-       return Client_read(client);
+       if (client != NULL)
+               return Client_read(client);
+       else
+               return -1;
 }
 
 int Client_read(client_t *client)
@@ -457,10 +457,10 @@ int Client_write_fd(int fd)
                        break;
                }
        }
-       if (client == NULL)
-               Log_fatal("No client found for fd %d", fd);
-       Client_write(client);
-       return 0;
+       if (client != NULL)
+               return Client_write(client);
+       else
+               return -1;
 }
 
 int Client_write(client_t *client)