X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=webcit%2Fserv_func.c;h=a6c41f711e858a9ec61cc87c88570d2d3cba6450;hp=873a3ffde67114687c9492af222b5273a31a1e0a;hb=2c1eedd6a74e856c5c2a48868c987a5ef38680fa;hpb=b1a59e318edf83d233764e945c67bad0364d9cde 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; }