diff options
author | Alexander Tkachev | 2016-07-09 16:10:58 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | 7fcdcc10cb8f6dad370e942ef917ff00e888e2ec (patch) | |
tree | 257b8461c2576bca902a6514b39a1990ac1e395e /backends/networking/sdl_net/reader.cpp | |
parent | abae5c437142b53d9099653fe5f14b3ac1967b18 (diff) | |
download | scummvm-rg350-7fcdcc10cb8f6dad370e942ef917ff00e888e2ec.tar.gz scummvm-rg350-7fcdcc10cb8f6dad370e942ef917ff00e888e2ec.tar.bz2 scummvm-rg350-7fcdcc10cb8f6dad370e942ef917ff00e888e2ec.zip |
CLOUD: Cleanup in UploadFileClientHandler
Adds Client::noMoreContent() and Reader::noMoreContent(), which return
true when whole client's request was read.
Diffstat (limited to 'backends/networking/sdl_net/reader.cpp')
-rw-r--r-- | backends/networking/sdl_net/reader.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/backends/networking/sdl_net/reader.cpp b/backends/networking/sdl_net/reader.cpp index d61eff2e68..143ab93816 100644 --- a/backends/networking/sdl_net/reader.cpp +++ b/backends/networking/sdl_net/reader.cpp @@ -57,6 +57,7 @@ Reader::Reader(): _randomSource("Networking::Reader") { _availableBytes = 0; _isFileField = false; _isBadRequest = false; + _allContentRead = false; } namespace { @@ -118,6 +119,7 @@ Reader &Reader::operator=(Reader &r) { _currentTempFileName = r._currentTempFileName; _isFileField = r._isFileField; _isBadRequest = r._isBadRequest; + _allContentRead = r._allContentRead; return *this; } @@ -216,19 +218,17 @@ bool Reader::readBlockContent(Common::WriteStream *stream) { if (!readWholeContentIntoStream(stream)) return false; - /* if (_availableBytes >= 2) { Common::String bts; bts += readOne(); bts += readOne(); - if (bts == "--") _isOver = true; + if (bts == "--") _allContentRead = true; else if (bts != "\r\n") warning("strange bytes: \"%s\"", bts.c_str()); } else { warning("strange ending"); - _isOver = true; + _allContentRead = true; } - */ return true; } @@ -601,7 +601,9 @@ void Reader::setContent(Common::MemoryReadWriteStream *stream) { _bytesLeft = stream->size() - stream->pos(); } -bool Reader::badRequest() { return _isBadRequest; } +bool Reader::badRequest() const { return _isBadRequest; } + +bool Reader::noMoreContent() const { return _allContentRead; } Common::String Reader::method() const { return _method; } |