2010-09-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Updated doc
	* src/FtpNegotiationCommand.cc
	* src/HttpResponseCommand.cc
	* src/RequestGroup.cc
pull/1/head
Tatsuhiro Tsujikawa 2010-09-13 11:53:38 +00:00
parent 97953dd1ae
commit 7f9e70e5c8
4 changed files with 19 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2010-09-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Updated doc
* src/FtpNegotiationCommand.cc
* src/HttpResponseCommand.cc
* src/RequestGroup.cc
2010-09-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that error occurs when downloading zero-length file.

View File

@ -405,10 +405,13 @@ bool FtpNegotiationCommand::onFileSizeDetermined(uint64_t totalLength)
if(getDownloadContext()->knowsTotalLength() &&
getRequestGroup()->downloadFinishedByFileLength()) {
// TODO If metalink file does not contain size and it contains
// hash and file is not zero length, but remote server says the
// file size is 0, no hash check is performed in the current
// implementation. See also
// HttpResponseCommand::handleOtherEncoding()
getRequestGroup()->initPieceStorage();
getPieceStorage()->markAllPiecesDone();
// TODO It would be good to issue ChecksumCheckIntegrity here
// instead of just pretending checksum verification is done.
getDownloadContext()->setChecksumVerified(true);
sequence_ = SEQ_DOWNLOAD_ALREADY_COMPLETED;
getLogger()->notice(MSG_DOWNLOAD_ALREADY_COMPLETED,

View File

@ -390,9 +390,13 @@ bool HttpResponseCommand::handleOtherEncoding
// For zero-length file, check existing file comparing its size
if(!chunkedUsed && getDownloadContext()->knowsTotalLength() &&
getRequestGroup()->downloadFinishedByFileLength()) {
// TODO If metalink file does not contain size and it contains
// hash and file is not zero length, but remote server says the
// file size is 0, no hash check is performed in the current
// implementation. See also
// FtpNegotiationCommand::onFileSizeDetermined()
getRequestGroup()->initPieceStorage();
getPieceStorage()->markAllPiecesDone();
// This is zero-size file, so hash check is no use.
getDownloadContext()->setChecksumVerified(true);
getLogger()->notice(MSG_DOWNLOAD_ALREADY_COMPLETED,
util::itos(getRequestGroup()->getGID()).c_str(),

View File

@ -542,6 +542,8 @@ void RequestGroup::initPieceStorage()
{
SharedHandle<PieceStorage> tempPieceStorage;
if(downloadContext_->knowsTotalLength() &&
// Following conditions are needed for chunked encoding with
// content-length = 0. Google's dl server used this before.
(downloadContext_->getTotalLength() > 0
#ifdef ENABLE_BITTORRENT
|| downloadContext_->hasAttribute(bittorrent::BITTORRENT)