[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdelibs/kioslave/http
From: Waldo Bastian <bastian () kde ! org>
Date: 2004-01-19 11:13:36
Message-ID: 20040119111336.1A6C01A0E () office ! kde ! org
[Download RAW message or body]
CVS commit by waba:
Rereverting now that the header file is there as well.
M +20 -4 http.cc 1.605
--- kdelibs/kioslave/http/http.cc #1.604:1.605
@@ -3979,4 +3979,12 @@ void HTTPProtocol::slotData(const QByteA
}
+ if (m_iContentLeft != NO_SIZE)
+ {
+ if (m_iContentLeft >= _d.size())
+ m_iContentLeft -= _d.size();
+ else
+ m_iContentLeft = NO_SIZE;
+ }
+
QByteArray d = _d;
if ( !m_dataInternal )
@@ -4137,4 +4145,6 @@ bool HTTPProtocol::readBody( bool dataIn
m_iBytesLeft = NO_SIZE;
+ m_iContentLeft = m_iBytesLeft;
+
if (m_bChunked)
m_iBytesLeft = NO_SIZE;
@@ -4209,10 +4219,16 @@ bool HTTPProtocol::readBody( bool dataIn
// make sure that this wasn't an error, first
-// kdDebug(7113) << "(" << m_pid << ") readBody: bytesReceived: "
-// << bytesReceived << " m_iSize: " << m_iSize << " Chunked: "
-// << m_bChunked << " BytesLeft: "<<m_iBytesLeft<<endl;
-
+ // kdDebug(7113) << "(" << (int) m_pid << ") readBody: bytesReceived: "
+ // << (int) bytesReceived << " m_iSize: " << (int) m_iSize << " Chunked: "
+ // << (int) m_bChunked << " BytesLeft: "<< (int) m_iBytesLeft << endl;
if (bytesReceived == -1)
{
+ if (m_iContentLeft == 0)
+ {
+ // gzip'ed data sometimes reports a too long content-length.
+ // (The length of the unzipped data)
+ m_iBytesLeft = 0;
+ break;
+ }
// Oh well... log an error and bug out
kdDebug(7113) << "(" << m_pid << ") readBody: bytesReceived==-1 sz=" << (int)sz
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic