diff --git a/ChangeLog b/ChangeLog index 6fdcad1b..bc92659a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,34 @@ +2010-04-08 Tatsuhiro Tsujikawa + + Added --save-session=FILE option. This option saves + error/unfinished downloads to FILE on exit. You can pass this + output file to aria2c with -i option on restart. Please note that + downloads added by aria2.addTorrent and aria2.addMetalink XML-RPC + method are not saved. + * src/BtPostDownloadHandler.cc + * src/DownloadResult.h + * src/Makefile.am + * src/MetadataInfo.cc + * src/MetadataInfo.h + * src/Metalink2RequestGroup.cc + * src/MetalinkPostDownloadHandler.cc + * src/MultiUrlRequestInfo.cc + * src/OptionHandlerFactory.cc + * src/RequestGroup.cc + * src/RequestGroup.h + * src/SessionSerializer.cc + * src/SessionSerializer.h + * src/UTMetadataPostDownloadHandler.cc + * src/download_helper.cc + * src/download_helper.h + * src/prefs.cc + * src/prefs.h + * src/usage_text.h + * test/Makefile.am + * test/SessionSerializerTest.cc + * test/XmlRpcMethodTest.cc + * test/serialize_session.meta4 + 2010-04-07 Tatsuhiro Tsujikawa Fixed the bug that FTP data connection is not established via diff --git a/doc/aria2c.1 b/doc/aria2c.1 index c56cf6a7..478e928b 100644 --- a/doc/aria2c.1 +++ b/doc/aria2c.1 @@ -2,12 +2,12 @@ .\" Title: aria2c .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 04/03/2010 +.\" Date: 04/08/2010 .\" Manual: Aria2 Manual .\" Source: Aria2 1.9.1a .\" Language: English .\" -.TH "ARIA2C" "1" "04/03/2010" "Aria2 1\&.9\&.1a" "Aria2 Manual" +.TH "ARIA2C" "1" "04/08/2010" "Aria2 1\&.9\&.1a" "Aria2 Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -1354,6 +1354,17 @@ For Metalink downloads, \-C1 is recommended for proxy server which disables resu .sp .5v .RE .PP +\fB\-\-save\-session\fR=FILE +.RS 4 +Save error/unfinished downloads to FILE on exit\&. You can pass this output file to aria2c with +\fB\-i\fR +option on restart\&. Please note that downloads added by +\fBaria2\&.addTorrent\fR +and +\fBaria2\&.addMetalink\fR +XML\-RPC method are not saved\&. +.RE +.PP \fB\-\-stop\fR=SEC .RS 4 Stop application after SEC seconds has passed\&. If diff --git a/doc/aria2c.1.html b/doc/aria2c.1.html index 412e7617..fadabc7b 100644 --- a/doc/aria2c.1.html +++ b/doc/aria2c.1.html @@ -2201,6 +2201,17 @@ connections.
+--save-session=FILE +
+
+

+ Save error/unfinished downloads to FILE on exit. You can pass this + output file to aria2c with -i option on restart. Please note that + downloads added by aria2.addTorrent and aria2.addMetalink + XML-RPC method are not saved. +

+
+
--stop=SEC
@@ -4137,7 +4148,7 @@ files in the program, then also delete it here.


diff --git a/doc/aria2c.1.txt b/doc/aria2c.1.txt index 1dba74dd..7bcbad71 100644 --- a/doc/aria2c.1.txt +++ b/doc/aria2c.1.txt @@ -914,6 +914,13 @@ For Metalink downloads, -C1 is recommended for proxy server which disables resume, in order to avoid establishing unnecessary connections. +*--save-session*=FILE:: + + Save error/unfinished downloads to FILE on exit. You can pass this + output file to aria2c with *-i* option on restart. Please note that + downloads added by *aria2.addTorrent* and *aria2.addMetalink* + XML-RPC method are not saved. + *--stop*=SEC:: Stop application after SEC seconds has passed. If '0' is given, this feature is disabled. diff --git a/src/BtPostDownloadHandler.cc b/src/BtPostDownloadHandler.cc index 0281e9f6..2398d7f7 100644 --- a/src/BtPostDownloadHandler.cc +++ b/src/BtPostDownloadHandler.cc @@ -82,6 +82,11 @@ void BtPostDownloadHandler::getNextRequestGroups std::vector(), content); requestGroup->followedBy(newRgs.begin(), newRgs.end()); + SharedHandle mi = + createMetadataInfoFromFirstFileEntry(requestGroup->getDownloadContext()); + if(!mi.isNull()) { + setMetadataInfo(newRgs.begin(), newRgs.end(), mi); + } groups.insert(groups.end(), newRgs.begin(), newRgs.end()); } diff --git a/src/DownloadResult.h b/src/DownloadResult.h index 7318d946..54c0f924 100644 --- a/src/DownloadResult.h +++ b/src/DownloadResult.h @@ -45,6 +45,8 @@ #include "SharedHandle.h" #include "DownloadResultCode.h" #include "RequestGroup.h" +#include "Option.h" +#include "MetadataInfo.h" namespace aria2 { @@ -74,6 +76,10 @@ public: // RequestGroup.cc::_belongsToGID. gid_t belongsTo; + SharedHandle