mirror of https://github.com/aria2/aria2
* AbstractCommand.cc:
* DownloadCommand.{h, cc}: Aborted downloading commands now properly unregister its cuid from SegmentMan. * DownloadEngine.cc: .aria2 file was written when a downloading failed with errors.pull/1/head
parent
d770d1c40a
commit
bc1cf6ed2d
|
@ -1,3 +1,11 @@
|
||||||
|
2006-03-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
|
* AbstractCommand.cc:
|
||||||
|
* DownloadCommand.{h, cc}: Aborted downloading commands now properly
|
||||||
|
unregister its cuid from SegmentMan.
|
||||||
|
* DownloadEngine.cc: .aria2 file was written when a downloading
|
||||||
|
failed with errors.
|
||||||
|
|
||||||
2006-02-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
2006-02-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
* Util.{h,cc}: added startsWith().
|
* Util.{h,cc}: added startsWith().
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.59 for aria2c 0.2.0-dev.
|
# Generated by GNU Autoconf 2.59 for aria2c 0.2.1-dev.
|
||||||
#
|
#
|
||||||
# Report bugs to <tujikawa@rednoah.com>.
|
# Report bugs to <tujikawa@rednoah.com>.
|
||||||
#
|
#
|
||||||
|
@ -269,8 +269,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
|
||||||
# Identity of this package.
|
# Identity of this package.
|
||||||
PACKAGE_NAME='aria2c'
|
PACKAGE_NAME='aria2c'
|
||||||
PACKAGE_TARNAME='aria2c'
|
PACKAGE_TARNAME='aria2c'
|
||||||
PACKAGE_VERSION='0.2.0-dev'
|
PACKAGE_VERSION='0.2.1-dev'
|
||||||
PACKAGE_STRING='aria2c 0.2.0-dev'
|
PACKAGE_STRING='aria2c 0.2.1-dev'
|
||||||
PACKAGE_BUGREPORT='tujikawa@rednoah.com'
|
PACKAGE_BUGREPORT='tujikawa@rednoah.com'
|
||||||
|
|
||||||
ac_unique_file="src/Socket.h"
|
ac_unique_file="src/Socket.h"
|
||||||
|
@ -788,7 +788,7 @@ if test "$ac_init_help" = "long"; then
|
||||||
# Omit some internal or obsolete options to make the list less imposing.
|
# Omit some internal or obsolete options to make the list less imposing.
|
||||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||||
cat <<_ACEOF
|
cat <<_ACEOF
|
||||||
\`configure' configures aria2c 0.2.0-dev to adapt to many kinds of systems.
|
\`configure' configures aria2c 0.2.1-dev to adapt to many kinds of systems.
|
||||||
|
|
||||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||||
|
|
||||||
|
@ -850,7 +850,7 @@ fi
|
||||||
|
|
||||||
if test -n "$ac_init_help"; then
|
if test -n "$ac_init_help"; then
|
||||||
case $ac_init_help in
|
case $ac_init_help in
|
||||||
short | recursive ) echo "Configuration of aria2c 0.2.0-dev:";;
|
short | recursive ) echo "Configuration of aria2c 0.2.1-dev:";;
|
||||||
esac
|
esac
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
|
|
||||||
|
@ -977,7 +977,7 @@ fi
|
||||||
test -n "$ac_init_help" && exit 0
|
test -n "$ac_init_help" && exit 0
|
||||||
if $ac_init_version; then
|
if $ac_init_version; then
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
aria2c configure 0.2.0-dev
|
aria2c configure 0.2.1-dev
|
||||||
generated by GNU Autoconf 2.59
|
generated by GNU Autoconf 2.59
|
||||||
|
|
||||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
Copyright (C) 2003 Free Software Foundation, Inc.
|
||||||
|
@ -991,7 +991,7 @@ cat >&5 <<_ACEOF
|
||||||
This file contains any messages produced by compilers while
|
This file contains any messages produced by compilers while
|
||||||
running configure, to aid debugging if configure makes a mistake.
|
running configure, to aid debugging if configure makes a mistake.
|
||||||
|
|
||||||
It was created by aria2c $as_me 0.2.0-dev, which was
|
It was created by aria2c $as_me 0.2.1-dev, which was
|
||||||
generated by GNU Autoconf 2.59. Invocation command line was
|
generated by GNU Autoconf 2.59. Invocation command line was
|
||||||
|
|
||||||
$ $0 $@
|
$ $0 $@
|
||||||
|
@ -1634,7 +1634,7 @@ fi
|
||||||
|
|
||||||
# Define the identity of the package.
|
# Define the identity of the package.
|
||||||
PACKAGE='aria2c'
|
PACKAGE='aria2c'
|
||||||
VERSION='0.2.0-dev'
|
VERSION='0.2.1-dev'
|
||||||
|
|
||||||
|
|
||||||
cat >>confdefs.h <<_ACEOF
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
@ -5808,7 +5808,7 @@ _ASBOX
|
||||||
} >&5
|
} >&5
|
||||||
cat >&5 <<_CSEOF
|
cat >&5 <<_CSEOF
|
||||||
|
|
||||||
This file was extended by aria2c $as_me 0.2.0-dev, which was
|
This file was extended by aria2c $as_me 0.2.1-dev, which was
|
||||||
generated by GNU Autoconf 2.59. Invocation command line was
|
generated by GNU Autoconf 2.59. Invocation command line was
|
||||||
|
|
||||||
CONFIG_FILES = $CONFIG_FILES
|
CONFIG_FILES = $CONFIG_FILES
|
||||||
|
@ -5871,7 +5871,7 @@ _ACEOF
|
||||||
|
|
||||||
cat >>$CONFIG_STATUS <<_ACEOF
|
cat >>$CONFIG_STATUS <<_ACEOF
|
||||||
ac_cs_version="\\
|
ac_cs_version="\\
|
||||||
aria2c config.status 0.2.0-dev
|
aria2c config.status 0.2.1-dev
|
||||||
configured by $0, generated by GNU Autoconf 2.59,
|
configured by $0, generated by GNU Autoconf 2.59,
|
||||||
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
|
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Process this file with autoconf to produce a configure script.
|
# Process this file with autoconf to produce a configure script.
|
||||||
#
|
#
|
||||||
AC_PREREQ(2.59)
|
AC_PREREQ(2.59)
|
||||||
AC_INIT(aria2c, 0.2.0-dev, tujikawa@rednoah.com)
|
AC_INIT(aria2c, 0.2.1-dev, tujikawa@rednoah.com)
|
||||||
AM_INIT_AUTOMAKE()
|
AM_INIT_AUTOMAKE()
|
||||||
AM_PATH_CPPUNIT(1.10.2)
|
AM_PATH_CPPUNIT(1.10.2)
|
||||||
AC_CONFIG_SRCDIR([src/Socket.h])
|
AC_CONFIG_SRCDIR([src/Socket.h])
|
||||||
|
|
|
@ -99,11 +99,14 @@ bool AbstractCommand::execute() {
|
||||||
return true;
|
return true;
|
||||||
} catch(DlRetryEx* err) {
|
} catch(DlRetryEx* err) {
|
||||||
e->logger->error(MSG_RESTARTING_DOWNLOAD, err, cuid);
|
e->logger->error(MSG_RESTARTING_DOWNLOAD, err, cuid);
|
||||||
delete(err);
|
|
||||||
//req->resetUrl();
|
|
||||||
req->addTryCount();
|
req->addTryCount();
|
||||||
if(e->option->getAsInt(PREF_MAX_TRIES) != 0 &&
|
bool isAbort = e->option->getAsInt(PREF_MAX_TRIES) != 0 &&
|
||||||
req->getTryCount() >= e->option->getAsInt(PREF_MAX_TRIES)) {
|
req->getTryCount() >= e->option->getAsInt(PREF_MAX_TRIES);
|
||||||
|
if(isAbort) {
|
||||||
|
onAbort(err);
|
||||||
|
}
|
||||||
|
delete(err);
|
||||||
|
if(isAbort) {
|
||||||
e->logger->error(MSG_MAX_TRY, cuid, req->getTryCount());
|
e->logger->error(MSG_MAX_TRY, cuid, req->getTryCount());
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -123,7 +126,9 @@ bool AbstractCommand::prepareForRetry(int wait) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractCommand::onAbort(Exception* e) {
|
void AbstractCommand::onAbort(Exception* ex) {
|
||||||
|
e->logger->debug(MSG_UNREGISTER_CUID, cuid);
|
||||||
|
e->segmentMan->unregisterId(cuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractCommand::setReadCheckSocket(Socket* socket) {
|
void AbstractCommand::setReadCheckSocket(Socket* socket) {
|
||||||
|
|
|
@ -39,7 +39,7 @@ protected:
|
||||||
Socket* socket;
|
Socket* socket;
|
||||||
|
|
||||||
virtual bool prepareForRetry(int wait);
|
virtual bool prepareForRetry(int wait);
|
||||||
virtual void onAbort(Exception* e);
|
virtual void onAbort(Exception* ex);
|
||||||
virtual bool executeInternal(Segment segment) = 0;
|
virtual bool executeInternal(Segment segment) = 0;
|
||||||
|
|
||||||
void setReadCheckSocket(Socket* socket);
|
void setReadCheckSocket(Socket* socket);
|
||||||
|
|
|
@ -99,8 +99,3 @@ bool DownloadCommand::prepareForNextSegment() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DownloadCommand::onAbort(Exception* ex) {
|
|
||||||
e->logger->debug(MSG_UNREGISTER_CUID, cuid);
|
|
||||||
e->segmentMan->unregisterId(cuid);
|
|
||||||
}
|
|
||||||
|
|
|
@ -38,7 +38,6 @@ protected:
|
||||||
|
|
||||||
bool prepareForRetry(int wait);
|
bool prepareForRetry(int wait);
|
||||||
bool prepareForNextSegment();
|
bool prepareForNextSegment();
|
||||||
void onAbort(Exception* ex);
|
|
||||||
public:
|
public:
|
||||||
DownloadCommand(int cuid, Request* req, DownloadEngine* e, Socket* s);
|
DownloadCommand(int cuid, Request* req, DownloadEngine* e, Socket* s);
|
||||||
virtual ~DownloadCommand();
|
virtual ~DownloadCommand();
|
||||||
|
|
|
@ -78,11 +78,12 @@ void DownloadEngine::run() {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
segmentMan->removeIfFinished();
|
|
||||||
diskWriter->closeFile();
|
diskWriter->closeFile();
|
||||||
if(segmentMan->finished()) {
|
if(segmentMan->finished()) {
|
||||||
|
segmentMan->remove();
|
||||||
cout << "\nThe download was complete. <" << segmentMan->getFilePath() << ">" << endl;
|
cout << "\nThe download was complete. <" << segmentMan->getFilePath() << ">" << endl;
|
||||||
} else {
|
} else {
|
||||||
|
segmentMan->save();
|
||||||
cout << "\nThe download was not complete because of errors. Check the log." << endl;
|
cout << "\nThe download was not complete because of errors. Check the log." << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue