summaryrefslogtreecommitdiff
path: root/src/FtpNegotiationCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-06-03 14:24:37 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-06-03 14:24:37 +0000
commit453e2f10dddf3b158de39810c1130203fd8d67eb (patch)
treeccf06455843aa4fac0d54495de3fb87c254b28cd /src/FtpNegotiationCommand.cc
parentccdd5b31a3dfa07cd13d6f7f0f5eaa3d8ff8a61e (diff)
2007-06-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
RequestGroup::getNextCommand() was renamed to createNextCommand(). Added its overloaded method. * src/RequestGroup.h (_numConcurrentCommand): New variable. (setNumConcurrentCommand): New function. * src/RequestGroup.cc Abort download if same file is being downloaded concurrently. * src/RequestGroup.h, src/RequestGroupMan.cc (isSameFileBeingDownloaded): New function. * src/HttpResponseCommand.cc (executeInternal) * src/FtpNegotiateCommand.cc (recvSize) * src/message.h (EX_DUPLICATE_FILE_DOWNLOAD): New definition. * main.cc: Added help message for -i option.
Diffstat (limited to 'src/FtpNegotiationCommand.cc')
-rw-r--r--src/FtpNegotiationCommand.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/FtpNegotiationCommand.cc b/src/FtpNegotiationCommand.cc
index d9f8d741..ef39ce35 100644
--- a/src/FtpNegotiationCommand.cc
+++ b/src/FtpNegotiationCommand.cc
@@ -197,6 +197,10 @@ bool FtpNegotiationCommand::recvSize() {
// TODO validate filename and totalsize against hintFilename and hintTotalSize if these are provided.
_requestGroup->validateTotalLengthByHint(size);
+ if(e->_requestGroupMan->isSameFileBeingDownloaded(_requestGroup)) {
+ throw new FatalException(EX_DUPLICATE_FILE_DOWNLOAD, _requestGroup->getFilePath().c_str());
+ }
+
if(req->getMethod() == Request::METHOD_HEAD) {
_requestGroup->getSegmentMan()->isSplittable = false; // TODO because we don't want segment file to be saved.
sequence = SEQ_HEAD_OK;