From f4c63245bf9a2ce365fbd3b977f3f7f50086fbb3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Sun, 21 Feb 2010 19:37:28 +0000 Subject: [PATCH] * fix endless loop; respect kill_me --- citadel/sysdep.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/citadel/sysdep.c b/citadel/sysdep.c index 28104218c..459b44ab2 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -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); -- 2.39.2