diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-09-06 14:29:36 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-09-06 14:29:36 +0000 |
| commit | efbfe4c006cfb6e0bf3ee4ed57d0657c0cd85c19 (patch) | |
| tree | a72723a125c34220772259f051673ff88598bded /src/RequestGroup.cc | |
| parent | 552c753dbba55005964ad60698d803a44dac6391 (diff) | |
2010-09-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Data from remote server in HTTP/FTP download are now written to
the disk(or memory) through StreamFilter. Decoding chunked and
gziped streams are done cascading StreamFilter.
Removed inefficient 1byte read code.
* src/ChunkedDecodingStreamFilter.cc
* src/ChunkedDecodingStreamFilter.h
* src/DownloadCommand.cc
* src/DownloadCommand.h
* src/GZipDecodingStreamFilter.cc
* src/GZipDecodingStreamFilter.h
* src/HttpConnection.cc
* src/HttpDownloadCommand.cc
* src/HttpResponse.cc
* src/HttpResponse.h
* src/HttpResponseCommand.cc
* src/HttpResponseCommand.h
* src/HttpSkipResponseCommand.cc
* src/HttpSkipResponseCommand.h
* src/Makefile.am
* src/NullSinkStreamFilter.cc
* src/NullSinkStreamFilter.h
* src/RequestGroup.cc
* src/SinkStreamFilter.cc
* src/SinkStreamFilter.h
* src/StreamFilter.cc
* src/StreamFilter.h
* test/ChunkedDecodingStreamFilterTest.cc
* test/GZipDecodingStreamFilterTest.cc
* test/HttpResponseTest.cc
* test/Makefile.am
* test/MockSegment.h
Diffstat (limited to 'src/RequestGroup.cc')
| -rw-r--r-- | src/RequestGroup.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/RequestGroup.cc b/src/RequestGroup.cc index 1e79bda6..7835782d 100644 --- a/src/RequestGroup.cc +++ b/src/RequestGroup.cc @@ -525,7 +525,9 @@ void RequestGroup::processCheckIntegrityEntry void RequestGroup::initPieceStorage() { SharedHandle<PieceStorage> tempPieceStorage; - if(downloadContext_->knowsTotalLength()) { + if(downloadContext_->knowsTotalLength() && + (downloadContext_->getTotalLength() > 0 || + downloadContext_->hasAttribute(bittorrent::BITTORRENT))) { #ifdef ENABLE_BITTORRENT SharedHandle<DefaultPieceStorage> ps (new DefaultPieceStorage(downloadContext_, option_.get())); |
