summaryrefslogtreecommitdiffstats
path: root/net/http/http_chunked_decoder.cc
diff options
context:
space:
mode:
authorvandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-13 17:33:09 +0000
committervandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-13 17:33:09 +0000
commite1a96026a9403bfaa3c6efe120391261e5e795f4 (patch)
treebd97e3470f8d481e4464dcf5024ad311d2db707d /net/http/http_chunked_decoder.cc
parent8133c680452262815566bd8ba6c9b80ca8428780 (diff)
downloadchromium_src-e1a96026a9403bfaa3c6efe120391261e5e795f4.zip
chromium_src-e1a96026a9403bfaa3c6efe120391261e5e795f4.tar.gz
chromium_src-e1a96026a9403bfaa3c6efe120391261e5e795f4.tar.bz2
Add an interface to report the amount of data after a chunked encoding. This will be needed for pipelining. Separated out of http://codereview.chromium.org/249031.
BUG=13289 TEST=existing and added unittests Review URL: http://codereview.chromium.org/267042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28833 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_chunked_decoder.cc')
-rw-r--r--net/http/http_chunked_decoder.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/http/http_chunked_decoder.cc b/net/http/http_chunked_decoder.cc
index 25b789f..619c9a1 100644
--- a/net/http/http_chunked_decoder.cc
+++ b/net/http/http_chunked_decoder.cc
@@ -51,7 +51,8 @@ HttpChunkedDecoder::HttpChunkedDecoder()
: chunk_remaining_(0),
chunk_terminator_remaining_(false),
reached_last_chunk_(false),
- reached_eof_(false) {
+ reached_eof_(false),
+ bytes_after_eof_(0) {
}
int HttpChunkedDecoder::FilterBuf(char* buf, int buf_len) {
@@ -72,6 +73,7 @@ int HttpChunkedDecoder::FilterBuf(char* buf, int buf_len) {
chunk_terminator_remaining_ = true;
continue;
} else if (reached_eof_) {
+ bytes_after_eof_ += buf_len;
break; // Done!
}