зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1312548 - When changing buffer, get the new buffer size too. r=dd
--HG-- extra : rebase_source : c3a2bf6755847b6c5641913eda254648f28041ab
This commit is contained in:
Родитель
718b18d849
Коммит
442a764272
|
@ -96,14 +96,18 @@ nsHttpChunkedDecoder::ParseChunkRemaining(char *buf,
|
|||
char *p = static_cast<char *>(memchr(buf, '\n', count));
|
||||
if (p) {
|
||||
*p = 0;
|
||||
if ((p > buf) && (*(p-1) == '\r')) // eliminate a preceding CR
|
||||
count = p - buf; // new length
|
||||
*bytesConsumed = count + 1; // length + newline
|
||||
if ((p > buf) && (*(p-1) == '\r')) { // eliminate a preceding CR
|
||||
*(p-1) = 0;
|
||||
*bytesConsumed = p - buf + 1;
|
||||
count--;
|
||||
}
|
||||
|
||||
// make buf point to the full line buffer to parse
|
||||
if (!mLineBuf.IsEmpty()) {
|
||||
mLineBuf.Append(buf);
|
||||
mLineBuf.Append(buf, count);
|
||||
buf = (char *) mLineBuf.get();
|
||||
count = mLineBuf.Length();
|
||||
}
|
||||
|
||||
if (mWaitEOF) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче