summaryrefslogtreecommitdiff
path: root/methods/http.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2005-10-23 11:12:54 +0000
committerMichael Vogt <mvo@debian.org>2005-10-23 11:12:54 +0000
commit927c393f1305925c1456c931e1e7b45afd6f051d (patch)
tree08e78830e218a42d0922c2853f29ca1bdb9984db /methods/http.cc
parent05d82b584c7e29b14325feca1003f76106e27683 (diff)
* added http data corruption fix patch (#280844)
Diffstat (limited to 'methods/http.cc')
-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;