before reading from the server socket check whether its connected at all.
[citadel.git] / 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,