From: Wilfried Goesgens Date: Sun, 25 Mar 2012 12:51:04 +0000 (+0200) Subject: fix read_server_text; it was broken. X-Git-Tag: v8.11~116 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=4ad8eb8889b1b4b7f5d434ca3ffdfe36b59d2610 fix read_server_text; it was broken. - fixes attendee availability + suppenkasper. --- diff --git a/webcit/serv_func.c b/webcit/serv_func.c index 873a3ffde..a6c41f711 100644 --- a/webcit/serv_func.c +++ b/webcit/serv_func.c @@ -524,22 +524,23 @@ void server_to_text() int read_server_text(StrBuf *Buf, long *nLines) { wcsession *WCC = WC; + StrBuf *ReadBuf; long nRead; long nTotal = 0; long nlines; nlines = 0; + ReadBuf = NewStrBuf(); while ((WCC->serv_sock!=-1) && - (nRead = StrBuf_ServGetln(Buf), (nRead >= 0) )) + (nRead = StrBuf_ServGetln(ReadBuf), (nRead >= 0) && + ((nRead != 3)||(strcmp(ChrPtr(ReadBuf), "000") != 0)))) { - if (strcmp(ChrPtr(Buf) + nTotal, "000") != 0) { - StrBufCutRight(Buf, nRead); - break; - } + StrBufAppendBuf(Buf, ReadBuf, 0); + StrBufAppendBufPlain(Buf, HKEY("\n"), 0); nTotal += nRead; nlines ++; } - + FreeStrBuf(&ReadBuf); *nLines = nlines; return nTotal; }