From 2c1eedd6a74e856c5c2a48868c987a5ef38680fa Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Sun, 25 Mar 2012 14:51:04 +0200 Subject: [PATCH] fix read_server_text; it was broken. - fixes attendee availability + suppenkasper. --- webcit/serv_func.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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; } -- 2.30.2