summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
Diffstat (limited to 'methods')
-rw-r--r--methods/http.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/methods/http.cc b/methods/http.cc
index e2337a9ba..dbf2d1b43 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -205,28 +205,23 @@ bool CircleBuf::WriteTillEl(string &Data,bool Single)
if (Buf[I%Size] != '\n')
continue;
++I;
- if (I < InP && Buf[I%Size] == '\r')
- ++I;
if (Single == false)
{
- if (Buf[I%Size] != '\n')
- continue;
- ++I;
if (I < InP && Buf[I%Size] == '\r')
++I;
+ if (I >= InP || Buf[I%Size] != '\n')
+ continue;
+ ++I;
}
- if (I > InP)
- I = InP;
-
Data = "";
while (OutP < I)
{
unsigned long Sz = LeftWrite();
if (Sz == 0)
return false;
- if (I - OutP < LeftWrite())
+ if (I - OutP < Sz)
Sz = I - OutP;
Data += string((char *)(Buf + (OutP%Size)),Sz);
OutP += Sz;