diff options
author | vandebo@google.com <vandebo@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-24 00:58:46 +0000 |
---|---|---|
committer | vandebo@google.com <vandebo@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-24 00:58:46 +0000 |
commit | 9492e4abf1be2910ab72f300abb7e0f28118b434 (patch) | |
tree | 341551d0b61a7bbc4f7257fe9121d61c4b9d0af7 /net/http/http_stream.h | |
parent | d46dbac87b6f581e4c6df3f79207081265a09f20 (diff) | |
download | chromium_src-9492e4abf1be2910ab72f300abb7e0f28118b434.zip chromium_src-9492e4abf1be2910ab72f300abb7e0f28118b434.tar.gz chromium_src-9492e4abf1be2910ab72f300abb7e0f28118b434.tar.bz2 |
Add ERR_END_OF_STREAM
Add new error code "END_OF_STREAM" and use it in HttpStreamParser.
Update a test to expect failure instead of success on an incomplete stream.
BUG=25032
TEST=updated unittests
Review URL: http://codereview.chromium.org/650190
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39822 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_stream.h')
-rw-r--r-- | net/http/http_stream.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/http/http_stream.h b/net/http/http_stream.h index 183aee1..978ebdb 100644 --- a/net/http/http_stream.h +++ b/net/http/http_stream.h @@ -53,12 +53,14 @@ class HttpStream { // Reads response body data, up to |buf_len| bytes. |buf_len| should be a // reasonable size (<2MB). The number of bytes read is returned, or an - // error is returned upon failure. ERR_CONNECTION_CLOSED is returned to - // indicate end-of-connection. ERR_IO_PENDING is returned if the operation - // could not be completed synchronously, in which case the result will be - // passed to the callback when available. If the operation is not completed - // immediately, the socket acquires a reference to the provided buffer until - // the callback is invoked or the socket is destroyed. + // error is returned upon failure. ERR_END_OF_STREAM indicates that the + // request has been fully satisfied and there is no more data to read. + // ERR_CONNECTION_CLOSED is returned when the connection has been closed + // prematurely. ERR_IO_PENDING is returned if the operation could not be + // completed synchronously, in which case the result will be passed to the + // callback when available. If the operation is not completed immediately, + // the socket acquires a reference to the provided buffer until the callback + // is invoked or the socket is destroyed. virtual int ReadResponseBody(IOBuffer* buf, int buf_len, CompletionCallback* callback) = 0; |