projects
/
citadel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix read_server_text; it was broken.
[citadel.git]
/
webcit
/
serv_func.c
diff --git
a/webcit/serv_func.c
b/webcit/serv_func.c
index 873a3ffde67114687c9492af222b5273a31a1e0a..a6c41f711e858a9ec61cc87c88570d2d3cba6450 100644
(file)
--- 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;
int read_server_text(StrBuf *Buf, long *nLines)
{
wcsession *WCC = WC;
+ StrBuf *ReadBuf;
long nRead;
long nTotal = 0;
long nlines;
nlines = 0;
long nRead;
long nTotal = 0;
long nlines;
nlines = 0;
+ ReadBuf = NewStrBuf();
while ((WCC->serv_sock!=-1) &&
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 ++;
}
nTotal += nRead;
nlines ++;
}
-
+ FreeStrBuf(&ReadBuf);
*nLines = nlines;
return nTotal;
}
*nLines = nlines;
return nTotal;
}