diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-06-28 10:48:26 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-06-28 10:48:26 +0000 |
| commit | d2afc0ca8ec0b6e8efb767cc917fdb3677f4b070 (patch) | |
| tree | c678bbe38ea516d46e4bcee90fbbdd11e8650cdf /src | |
| parent | 5699b675268658ea958f7c2306e19849dff9bc41 (diff) | |
2009-06-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed _currentRequest from StreamCheckIntegrityEntry and
StreamFileAllocationEntry.
* src/AbstractCommand.cc
* src/HttpResponseCommand.cc
* src/RequestGroup.cc
* src/StreamCheckIntegrityEntry.cc
* src/StreamCheckIntegrityEntry.h
* src/StreamFileAllocationEntry.cc
* src/StreamFileAllocationEntry.h
Diffstat (limited to 'src')
| -rw-r--r-- | src/AbstractCommand.cc | 3 | ||||
| -rw-r--r-- | src/HttpResponseCommand.cc | 10 | ||||
| -rw-r--r-- | src/RequestGroup.cc | 2 | ||||
| -rw-r--r-- | src/StreamCheckIntegrityEntry.cc | 10 | ||||
| -rw-r--r-- | src/StreamCheckIntegrityEntry.h | 6 | ||||
| -rw-r--r-- | src/StreamFileAllocationEntry.cc | 7 | ||||
| -rw-r--r-- | src/StreamFileAllocationEntry.h | 6 |
7 files changed, 15 insertions, 29 deletions
diff --git a/src/AbstractCommand.cc b/src/AbstractCommand.cc index 57f1a80a..2c05a555 100644 --- a/src/AbstractCommand.cc +++ b/src/AbstractCommand.cc @@ -525,7 +525,8 @@ bool AbstractCommand::nameResolveFinished() const { void AbstractCommand::prepareForNextAction(Command* nextCommand) { - CheckIntegrityEntryHandle entry(new StreamCheckIntegrityEntry(req, _requestGroup, nextCommand)); + CheckIntegrityEntryHandle entry + (new StreamCheckIntegrityEntry(_requestGroup, nextCommand)); std::deque<Command*> commands; _requestGroup->processCheckIntegrityEntry(commands, entry, e); diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc index ece2606a..9dbf9ffe 100644 --- a/src/HttpResponseCommand.cc +++ b/src/HttpResponseCommand.cc @@ -122,12 +122,12 @@ bool HttpResponseCommand::executeInternal() return skipResponseBody(httpResponse); } if(!_requestGroup->isSingleHostMultiConnectionEnabled()) { - // Query by hostname. Searching by CUID may returns NULL. - // In case when resuming download, ServerHost is registered with CUID A. + // Query by hostname. Searching by CUID may returns NULL. In case + // when resuming download, ServerHost is registered with CUID A. // Then if requested range is not equal to saved one, - // StreamFileAllocationEntry is created with _nextCommand NULL and - // _currentRequest not NULL. This results creating new command CUID, say - // B and same URI. So searching ServerHost by CUID B fails. + // StreamFileAllocationEntry is created with _nextCommand NULL. + // This results creating new command CUID, say B and same URI. So + // searching ServerHost by CUID B fails. SharedHandle<ServerHost> sv = _requestGroup->searchServerHost(req->getHost()); if(!sv.isNull()) { diff --git a/src/RequestGroup.cc b/src/RequestGroup.cc index 2e7d9096..19432816 100644 --- a/src/RequestGroup.cc +++ b/src/RequestGroup.cc @@ -380,7 +380,7 @@ void RequestGroup::createInitialCommand(std::deque<Command*>& commands, } else { loadAndOpenFile(infoFile); SharedHandle<CheckIntegrityEntry> checkIntegrityEntry - (new StreamCheckIntegrityEntry(SharedHandle<Request>(), this)); + (new StreamCheckIntegrityEntry(this)); processCheckIntegrityEntry(commands, checkIntegrityEntry, e); } } diff --git a/src/StreamCheckIntegrityEntry.cc b/src/StreamCheckIntegrityEntry.cc index 39e25393..aab617be 100644 --- a/src/StreamCheckIntegrityEntry.cc +++ b/src/StreamCheckIntegrityEntry.cc @@ -36,16 +36,13 @@ #include "RequestGroup.h" #include "DownloadEngine.h" #include "StreamFileAllocationEntry.h" -#include "Request.h" #include "DownloadContext.h" namespace aria2 { -StreamCheckIntegrityEntry::StreamCheckIntegrityEntry(const RequestHandle& currentRequest, - RequestGroup* requestGroup, +StreamCheckIntegrityEntry::StreamCheckIntegrityEntry(RequestGroup* requestGroup, Command* nextCommand): - PieceHashCheckIntegrityEntry(requestGroup, nextCommand), - _currentRequest(currentRequest) + PieceHashCheckIntegrityEntry(requestGroup, nextCommand) {} StreamCheckIntegrityEntry::~StreamCheckIntegrityEntry() {} @@ -54,8 +51,7 @@ void StreamCheckIntegrityEntry::onDownloadIncomplete (std::deque<Command*>& commands, DownloadEngine* e) { FileAllocationEntryHandle entry - (new StreamFileAllocationEntry(_currentRequest, _requestGroup, - popNextCommand())); + (new StreamFileAllocationEntry(_requestGroup, popNextCommand())); proceedFileAllocation(commands, entry, e); } diff --git a/src/StreamCheckIntegrityEntry.h b/src/StreamCheckIntegrityEntry.h index ccc79468..5117957a 100644 --- a/src/StreamCheckIntegrityEntry.h +++ b/src/StreamCheckIntegrityEntry.h @@ -40,16 +40,12 @@ namespace aria2 { -class Request; - class StreamCheckIntegrityEntry:public PieceHashCheckIntegrityEntry { private: - SharedHandle<Request> _currentRequest; Time _timer; public: - StreamCheckIntegrityEntry(const SharedHandle<Request>& currentRequest, - RequestGroup* requestGroup, + StreamCheckIntegrityEntry(RequestGroup* requestGroup, Command* nextCommand = 0); virtual ~StreamCheckIntegrityEntry(); diff --git a/src/StreamFileAllocationEntry.cc b/src/StreamFileAllocationEntry.cc index 5caf81d5..a4f759c5 100644 --- a/src/StreamFileAllocationEntry.cc +++ b/src/StreamFileAllocationEntry.cc @@ -38,7 +38,6 @@ #include "DownloadEngine.h" #include "Option.h" -#include "Request.h" #include "prefs.h" #include "RequestGroup.h" #include "DownloadContext.h" @@ -46,11 +45,9 @@ namespace aria2 { -StreamFileAllocationEntry::StreamFileAllocationEntry(const RequestHandle& currentRequest, - RequestGroup* requestGroup, +StreamFileAllocationEntry::StreamFileAllocationEntry(RequestGroup* requestGroup, Command* nextCommand): - FileAllocationEntry(requestGroup, nextCommand), - _currentRequest(currentRequest) + FileAllocationEntry(requestGroup, nextCommand) {} StreamFileAllocationEntry::~StreamFileAllocationEntry() {} diff --git a/src/StreamFileAllocationEntry.h b/src/StreamFileAllocationEntry.h index 6dd2f60d..be308786 100644 --- a/src/StreamFileAllocationEntry.h +++ b/src/StreamFileAllocationEntry.h @@ -40,15 +40,11 @@ namespace aria2 { -class Request; - class StreamFileAllocationEntry : public FileAllocationEntry { private: - SharedHandle<Request> _currentRequest; Time _timer; public: - StreamFileAllocationEntry(const SharedHandle<Request>& currentRequest, - RequestGroup* requestGroup, + StreamFileAllocationEntry(RequestGroup* requestGroup, Command* nextCommand = 0); virtual ~StreamFileAllocationEntry(); |
