* fix endless loop; respect kill_me
authorWilfried Göesgens <willi@citadel.org>
Sun, 21 Feb 2010 19:37:28 +0000 (19:37 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 21 Feb 2010 19:37:28 +0000 (19:37 +0000)
citadel/sysdep.c

index 28104218c251f66db999fe9208ea0a9db3a1998e..459b44ab22ca0fd271648e205191b130e1555912 100644 (file)
@@ -632,7 +632,10 @@ int client_read_to(char *buf, int bytes, int timeout)
 
 int HaveMoreLinesWaiting(CitContext *CCC)
 {
-       if ((CCC->Pos == NULL) && (StrLength(CCC->ReadBuf) == 0))
+       if ((CCC->kill_me == 1) &&
+           (CCC->Pos == NULL) && 
+           (StrLength(CCC->ReadBuf) == 0) && 
+           (CCC->client_socket != -1))
                return 0;
        else
                return 1;
@@ -732,6 +735,9 @@ int client_getln(char *buf, int bufsize)
        const char *pCh;
 
        retval = CtdlClientGetLine(CCC->MigrateBuf);
+       if (retval < 0)
+         return(retval >= 0);
+
 
        i = StrLength(CCC->MigrateBuf);
        pCh = ChrPtr(CCC->MigrateBuf);