1
0
Fork 0

ooops left debug output behind

This commit is contained in:
Kaveh Vahedipour 2017-05-08 15:51:14 +02:00
parent 5cdaad53a8
commit 6d63f88464
1 changed files with 5 additions and 6 deletions

View File

@ -658,12 +658,14 @@ void SimpleHttpClient::processHeader() {
if (*ptr == '\r' || *ptr == '\n' || *ptr == '\0') {
size_t len = pos - ptr;
_readBufferOffset += len + 1;
ptr += len + 1;
remain -= len + 1;
if (*pos == '\r') {
// adjust offset if line ended with \r\n
++_readBufferOffset;
ptr++;
remain--;
}
@ -729,18 +731,13 @@ void SimpleHttpClient::processHeader() {
ptr += len + 1;
_readBufferOffset += len + 1;
remain -= (len + 1);
TRI_ASSERT(_readBufferOffset <= _readBuffer.length());
TRI_ASSERT(ptr == _readBuffer.c_str() + _readBufferOffset);
TRI_ASSERT(remain == _readBuffer.length() - _readBufferOffset);
pos = static_cast<char const*>(memchr(ptr, '\n', remain));
if (pos == nullptr) {
_readBufferOffset++;
ptr++;
remain--;
}
}
}
}
@ -783,6 +780,7 @@ void SimpleHttpClient::processBody() {
}
_readBufferOffset += _result->getContentLength();
_result->setResultType(SimpleHttpResult::COMPLETE);
_state = FINISHED;
@ -894,6 +892,7 @@ void SimpleHttpClient::processChunkedBody() {
}
_readBufferOffset += (size_t)_nextChunkedSize + 2;
_state = IN_READ_CHUNKED_HEADER;
processChunkedHeader();
}