before reading from the server socket check whether its connected at all.
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 26 Feb 2012 12:58:02 +0000 (13:58 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 26 Feb 2012 12:58:02 +0000 (13:58 +0100)
webcit/tcp_sockets.c

index 9952fd9ab081057539640bec98177487fbb39de0..30164144e35e0bbf223092e27d5c6100010265ab 100644 (file)
@@ -172,6 +172,9 @@ int StrBuf_ServGetln(StrBuf *buf)
        const char *ErrStr = NULL;
        int rc;
        
+       if (!WCC->connected)
+               return -1;
+
        FlushStrBuf(buf);
        rc = StrBufTCP_read_buffered_line_fast(buf, 
                                               WCC->ReadBuf,