summaryrefslogtreecommitdiff
path: root/methods/http.cc
diff options
context:
space:
mode:
Diffstat (limited to 'methods/http.cc')
-rw-r--r--methods/http.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/methods/http.cc b/methods/http.cc
index dc3f0b763..cb63ada49 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -58,7 +58,6 @@ unsigned long PipelineDepth = 10;
unsigned long TimeOut = 120;
bool Debug = false;
-
unsigned long CircleBuf::BwReadLimit=0;
unsigned long CircleBuf::BwTickReadData=0;
struct timeval CircleBuf::BwReadTick={0,0};
@@ -241,28 +240,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;