浏览代码

2006-07-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

        To improve the conditional compilation:

	* src/MultiDiskWriter.h:
	Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.	
	* src/MultiDiskWriter.cc:
	Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
	* src/Util.h:
	Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
	Added ENABLE_BITTORRENT around computeFastSet().
	* src/Util.cc:
	Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
	Added ENABLE_BITTORRENT around computeFastSet().	
	* src/messageDigest.h:
	Replaced ENABLE_BITTORRENT with ENABLE_SSL.
	* src/ShaVisitor.h:
	Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
	* src/ShaVisitor.cc:
	Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
	* src/main.cc:
	Added ENABLE_BITTORRENT around includes and blocks related to
	BitTorrent.
	* src/AbstractDiskWriter.h:
	Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
	* src/AbstractDiskWriter.cc:
	Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
	
	To add command-line options for Metalink:

	* src/main.cc:
	Added metalink-version, metalink-language, metalink-os,
	follow-metalink.

	To use EXIT_SUCCESS and EXIT_FAILURE with exit():

	* src/main.cc: Use these definition.
Tatsuhiro Tsujikawa 19 年之前
父节点
当前提交
31cf446f6d
共有 27 个文件被更改,包括 1030 次插入533 次删除
  1. 38 0
      ChangeLog
  2. 4 0
      Makefile.in
  3. 1 7
      TODO
  4. 3 3
      config.h.in
  5. 113 26
      configure
  6. 20 15
      configure.ac
  7. 4 0
      m4/Makefile.in
  8. 1 1
      po/Makefile.in
  9. 133 73
      po/aria2c.pot
  10. 二进制
      po/de.gmo
  11. 151 73
      po/de.po
  12. 二进制
      po/ja.gmo
  13. 149 75
      po/ja.po
  14. 6 6
      src/AbstractDiskWriter.cc
  15. 4 4
      src/AbstractDiskWriter.h
  16. 14 7
      src/Makefile.am
  17. 220 140
      src/Makefile.in
  18. 8 8
      src/MultiDiskWriter.cc
  19. 2 2
      src/MultiDiskWriter.h
  20. 12 12
      src/ShaVisitor.cc
  21. 4 4
      src/ShaVisitor.h
  22. 6 4
      src/Util.cc
  23. 8 2
      src/Util.h
  24. 2 2
      src/Xml2MetalinkProcessor.cc
  25. 121 67
      src/main.cc
  26. 2 2
      src/messageDigest.h
  27. 4 0
      test/Makefile.in

+ 38 - 0
ChangeLog

@@ -1,3 +1,41 @@
+2006-07-04  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
+
+        To improve the conditional compilation:
+
+	* src/MultiDiskWriter.h:
+	Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.	
+	* src/MultiDiskWriter.cc:
+	Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
+	* src/Util.h:
+	Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
+	Added ENABLE_BITTORRENT around computeFastSet().
+	* src/Util.cc:
+	Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
+	Added ENABLE_BITTORRENT around computeFastSet().	
+	* src/messageDigest.h:
+	Replaced ENABLE_BITTORRENT with ENABLE_SSL.
+	* src/ShaVisitor.h:
+	Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
+	* src/ShaVisitor.cc:
+	Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
+	* src/main.cc:
+	Added ENABLE_BITTORRENT around includes and blocks related to
+	BitTorrent.
+	* src/AbstractDiskWriter.h:
+	Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
+	* src/AbstractDiskWriter.cc:
+	Replaced ENABLE_SHA1DIGEST with ENABLE_MESSAGE_DIGEST.
+	
+	To add command-line options for Metalink:
+
+	* src/main.cc:
+	Added metalink-version, metalink-language, metalink-os,
+	follow-metalink.
+
+	To use EXIT_SUCCESS and EXIT_FAILURE with exit():
+
+	* src/main.cc: Use these definition.
+
 2006-07-03  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
 2006-07-03  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
 
 
 	To add Metalink support(http/ftp only):
 	To add Metalink support(http/ftp only):

+ 4 - 0
Makefile.in

@@ -113,6 +113,10 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EGREP = @EGREP@
+ENABLE_BITTORRENT_FALSE = @ENABLE_BITTORRENT_FALSE@
+ENABLE_BITTORRENT_TRUE = @ENABLE_BITTORRENT_TRUE@
+ENABLE_METALINK_FALSE = @ENABLE_METALINK_FALSE@
+ENABLE_METALINK_TRUE = @ENABLE_METALINK_TRUE@
 EXEEXT = @EXEEXT@
 EXEEXT = @EXEEXT@
 GENCAT = @GENCAT@
 GENCAT = @GENCAT@
 GLIBC21 = @GLIBC21@
 GLIBC21 = @GLIBC21@

+ 1 - 7
TODO

@@ -4,16 +4,10 @@
 * Add SSL client cert support
 * Add SSL client cert support
 * Better HTTP status handling
 * Better HTTP status handling
 * Download files listed in a specifed file.
 * Download files listed in a specifed file.
-* check MD5 checksum
 * Add the feature which adds or removes URLs on-the-fly.
 * Add the feature which adds or removes URLs on-the-fly.
-* Tracker UDP protocol
 * no-compact peers format
 * no-compact peers format
 * Add port range command-line option
 * Add port range command-line option
 * Add max peers command-line option
 * Add max peers command-line option
-* Distinguish seeder from leecher
-* Add Mainline-compatible DHT support
-* Add Message stream encryption support
 * Refacturing HttpConnection and FtpConnection
 * Refacturing HttpConnection and FtpConnection
-* Use EXIT_SUCCESS and EXIT_FAILURE
 * Query resource by location
 * Query resource by location
-* Conditional compilation based on ENABLE_LIBXML2
+* Log version

+ 3 - 3
config.h.in

@@ -11,6 +11,9 @@
 /* Define to 1 if BitTorrent support is enabled. */
 /* Define to 1 if BitTorrent support is enabled. */
 #undef ENABLE_BITTORRENT
 #undef ENABLE_BITTORRENT
 
 
+/* Define to 1 if message digest support is enabled. */
+#undef ENABLE_MESSAGE_DIGEST
+
 /* Define to 1 if Metalink support is enabled. */
 /* Define to 1 if Metalink support is enabled. */
 #undef ENABLE_METALINK
 #undef ENABLE_METALINK
 
 
@@ -18,9 +21,6 @@
    language is requested. */
    language is requested. */
 #undef ENABLE_NLS
 #undef ENABLE_NLS
 
 
-/* Define to 1 if SHA1 Digest support is enabled. */
-#undef ENABLE_SHA1DIGEST
-
 /* Define to 1 if ssl support is enabled. */
 /* Define to 1 if ssl support is enabled. */
 #undef ENABLE_SSL
 #undef ENABLE_SSL
 
 

+ 113 - 26
configure

@@ -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.5.2.
+# Generated by GNU Autoconf 2.59 for aria2c 0.6.0.
 #
 #
 # 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.5.2'
-PACKAGE_STRING='aria2c 0.5.2'
+PACKAGE_VERSION='0.6.0'
+PACKAGE_STRING='aria2c 0.6.0'
 PACKAGE_BUGREPORT='tujikawa@rednoah.com'
 PACKAGE_BUGREPORT='tujikawa@rednoah.com'
 
 
 ac_unique_file="src/Socket.h"
 ac_unique_file="src/Socket.h"
@@ -311,7 +311,7 @@ ac_includes_default="\
 # include <unistd.h>
 # include <unistd.h>
 #endif"
 #endif"
 
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CPPUNIT_CONFIG CPPUNIT_CFLAGS CPPUNIT_LIBS localedir CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB YACC XML2_CONFIG XML_CPPFLAGS XML_LIBS LIBGNUTLS_CONFIG LIBGNUTLS_CFLAGS LIBGNUTLS_LIBS LIBGCRYPT_CONFIG LIBGCRYPT_CFLAGS LIBGCRYPT_LIBS OPENSSL_LIBS OPENSSL_CFLAGS ALLOCA CPP EGREP MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE build build_cpu build_vendor build_os host host_cpu host_vendor host_os GLIBC21 LIBICONV LTLIBICONV INTLBISON BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT DATADIRNAME INSTOBJEXT GENCAT INTLOBJS INTL_LIBTOOL_SUFFIX_PREFIX INTLLIBS LIBINTL LTLIBINTL POSUB LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CPPUNIT_CONFIG CPPUNIT_CFLAGS CPPUNIT_LIBS localedir CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB YACC XML2_CONFIG XML_CPPFLAGS XML_LIBS LIBGNUTLS_CONFIG LIBGNUTLS_CFLAGS LIBGNUTLS_LIBS LIBGCRYPT_CONFIG LIBGCRYPT_CFLAGS LIBGCRYPT_LIBS OPENSSL_LIBS OPENSSL_CFLAGS ENABLE_BITTORRENT_TRUE ENABLE_BITTORRENT_FALSE ENABLE_METALINK_TRUE ENABLE_METALINK_FALSE ALLOCA CPP EGREP MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE build build_cpu build_vendor build_os host host_cpu host_vendor host_os GLIBC21 LIBICONV LTLIBICONV INTLBISON BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT DATADIRNAME INSTOBJEXT GENCAT INTLOBJS INTL_LIBTOOL_SUFFIX_PREFIX INTLLIBS LIBINTL LTLIBINTL POSUB LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 ac_subst_files=''
 
 
 # Initialize some variables set by options.
 # Initialize some variables set by options.
@@ -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.5.2 to adapt to many kinds of systems.
+\`configure' configures aria2c 0.6.0 to adapt to many kinds of systems.
 
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
 
@@ -854,13 +854,15 @@ 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.5.2:";;
+     short | recursive ) echo "Configuration of aria2c 0.6.0:";;
    esac
    esac
   cat <<\_ACEOF
   cat <<\_ACEOF
 
 
 Optional Features:
 Optional Features:
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+ --enable-bittorrent        enable BitTorrent support. Default: yes
+ --enable-metalink          enable Metalink support. Default: yes
   --disable-dependency-tracking  speeds up one-time build
   --disable-dependency-tracking  speeds up one-time build
   --enable-dependency-tracking   do not reject slow dependency extractors
   --enable-dependency-tracking   do not reject slow dependency extractors
   --disable-xmltest       Do not try to compile and run a test LIBXML program
   --disable-xmltest       Do not try to compile and run a test LIBXML program
@@ -998,7 +1000,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.5.2
+aria2c configure 0.6.0
 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.
@@ -1012,7 +1014,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.5.2, which was
+It was created by aria2c $as_me 0.6.0, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
 
   $ $0 $@
   $ $0 $@
@@ -1655,7 +1657,7 @@ fi
 
 
 # Define the identity of the package.
 # Define the identity of the package.
  PACKAGE='aria2c'
  PACKAGE='aria2c'
- VERSION='0.5.2'
+ VERSION='0.6.0'
 
 
 
 
 cat >>confdefs.h <<_ACEOF
 cat >>confdefs.h <<_ACEOF
@@ -1946,6 +1948,20 @@ else
   with_libxml2=yes
   with_libxml2=yes
 fi;
 fi;
 
 
+# Check whether --enable-bittorrent or --disable-bittorrent was given.
+if test "${enable_bittorrent+set}" = set; then
+  enableval="$enable_bittorrent"
+  enable_bittorrent=$enableval
+else
+  enable_bittorrent=yes
+fi;
+# Check whether --enable-metalink or --disable-metalink was given.
+if test "${enable_metalink+set}" = set; then
+  enableval="$enable_metalink"
+  enable_metalink=$enableval
+else
+  enable_metalink=yes
+fi;
 
 
 # Checks for programs.
 # Checks for programs.
 ac_ext=cc
 ac_ext=cc
@@ -4437,14 +4453,6 @@ _ACEOF
 fi
 fi
 
 
 if test "x$with_openssl" = "xyes" && test "x$have_libgnutls" != "xyes"; then
 if test "x$with_openssl" = "xyes" && test "x$have_libgnutls" != "xyes"; then
-#  AC_CHECK_LIB([ssl], [SSL_library_init], [have_openssl=yes])
-#  if test "x$have_openssl" = "xyes"; then
-#    AC_DEFINE([HAVE_LIBSSL], [1], [Define to 1 if you have openssl.])
-#    OPENSSL_LIBS="-lssl"
-#    OPENSSL_CFLAGS=""
-#    AC_SUBST(OPENSSL_LIBS)
-#    AC_SUBST(OPENSSL_CFLAGS)
-#  fi
 
 
 
 
 # Check whether --with-openssl-prefix or --without-openssl-prefix was given.
 # Check whether --with-openssl-prefix or --without-openssl-prefix was given.
@@ -4617,35 +4625,82 @@ CPPFLAGS=$CPPFLAGS_save
 
 
 fi
 fi
 
 
-if test "x$have_libxml2" = "xyes"; then
+# Define variables based on the result of the checks for libraries.
+if test "x$have_libgnutls" = "xyes" || test "x$have_openssl" = "xyes"; then
 
 
 cat >>confdefs.h <<\_ACEOF
 cat >>confdefs.h <<\_ACEOF
-#define ENABLE_METALINK 1
+#define ENABLE_SSL 1
 _ACEOF
 _ACEOF
 
 
 fi
 fi
 
 
-if test "x$have_libgnutls" = "xyes" || test "x$have_openssl" = "xyes"; then
+if test "x$have_libgcrypt" = "xyes" || test "x$have_openssl" = "xyes"; then
 
 
 cat >>confdefs.h <<\_ACEOF
 cat >>confdefs.h <<\_ACEOF
-#define ENABLE_SSL 1
+#define ENABLE_MESSAGE_DIGEST 1
 _ACEOF
 _ACEOF
 
 
+  enable_message_digest=yes
 fi
 fi
 
 
-if test "x$have_libgcrypt" = "xyes" || test "x$have_openssl" = "xyes"; then
+if test "x$enable_bittorrent" = "xyes" && test "x$enable_message_digest" = "xyes"; then
 
 
 cat >>confdefs.h <<\_ACEOF
 cat >>confdefs.h <<\_ACEOF
-#define ENABLE_SHA1DIGEST 1
+#define ENABLE_BITTORRENT 1
 _ACEOF
 _ACEOF
 
 
 
 
+
+if true; then
+  ENABLE_BITTORRENT_TRUE=
+  ENABLE_BITTORRENT_FALSE='#'
+else
+  ENABLE_BITTORRENT_TRUE='#'
+  ENABLE_BITTORRENT_FALSE=
+fi
+
+else
+
+
+if false; then
+  ENABLE_BITTORRENT_TRUE=
+  ENABLE_BITTORRENT_FALSE='#'
+else
+  ENABLE_BITTORRENT_TRUE='#'
+  ENABLE_BITTORRENT_FALSE=
+fi
+
+fi
+
+if test "x$have_libxml2" = "xyes" && test "x$enable_metalink" = "xyes" && \
+   test "x$enable_message_digest" = "xyes"; then
+
 cat >>confdefs.h <<\_ACEOF
 cat >>confdefs.h <<\_ACEOF
-#define ENABLE_BITTORRENT 1
+#define ENABLE_METALINK 1
 _ACEOF
 _ACEOF
 
 
+
+
+if true; then
+  ENABLE_METALINK_TRUE=
+  ENABLE_METALINK_FALSE='#'
+else
+  ENABLE_METALINK_TRUE='#'
+  ENABLE_METALINK_FALSE=
 fi
 fi
 
 
+else
+
+
+if false; then
+  ENABLE_METALINK_TRUE=
+  ENABLE_METALINK_FALSE='#'
+else
+  ENABLE_METALINK_TRUE='#'
+  ENABLE_METALINK_FALSE=
+fi
+
+fi
 
 
 # Checks for header files.
 # Checks for header files.
 ac_ext=c
 ac_ext=c
@@ -11590,6 +11645,34 @@ echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
    { (exit 1); exit 1; }; }
 fi
 fi
+if test -z "${ENABLE_BITTORRENT_TRUE}" && test -z "${ENABLE_BITTORRENT_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"ENABLE_BITTORRENT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"ENABLE_BITTORRENT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${ENABLE_BITTORRENT_TRUE}" && test -z "${ENABLE_BITTORRENT_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"ENABLE_BITTORRENT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"ENABLE_BITTORRENT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${ENABLE_METALINK_TRUE}" && test -z "${ENABLE_METALINK_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"ENABLE_METALINK\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"ENABLE_METALINK\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${ENABLE_METALINK_TRUE}" && test -z "${ENABLE_METALINK_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"ENABLE_METALINK\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"ENABLE_METALINK\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
 
 : ${CONFIG_STATUS=./config.status}
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
 ac_clean_files_save=$ac_clean_files
@@ -11861,7 +11944,7 @@ _ASBOX
 } >&5
 } >&5
 cat >&5 <<_CSEOF
 cat >&5 <<_CSEOF
 
 
-This file was extended by aria2c $as_me 0.5.2, which was
+This file was extended by aria2c $as_me 0.6.0, 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
@@ -11924,7 +12007,7 @@ _ACEOF
 
 
 cat >>$CONFIG_STATUS <<_ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
 ac_cs_version="\\
-aria2c config.status 0.5.2
+aria2c config.status 0.6.0
 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'`\\"
 
 
@@ -12197,6 +12280,10 @@ s,@LIBGCRYPT_CFLAGS@,$LIBGCRYPT_CFLAGS,;t t
 s,@LIBGCRYPT_LIBS@,$LIBGCRYPT_LIBS,;t t
 s,@LIBGCRYPT_LIBS@,$LIBGCRYPT_LIBS,;t t
 s,@OPENSSL_LIBS@,$OPENSSL_LIBS,;t t
 s,@OPENSSL_LIBS@,$OPENSSL_LIBS,;t t
 s,@OPENSSL_CFLAGS@,$OPENSSL_CFLAGS,;t t
 s,@OPENSSL_CFLAGS@,$OPENSSL_CFLAGS,;t t
+s,@ENABLE_BITTORRENT_TRUE@,$ENABLE_BITTORRENT_TRUE,;t t
+s,@ENABLE_BITTORRENT_FALSE@,$ENABLE_BITTORRENT_FALSE,;t t
+s,@ENABLE_METALINK_TRUE@,$ENABLE_METALINK_TRUE,;t t
+s,@ENABLE_METALINK_FALSE@,$ENABLE_METALINK_FALSE,;t t
 s,@ALLOCA@,$ALLOCA,;t t
 s,@ALLOCA@,$ALLOCA,;t t
 s,@CPP@,$CPP,;t t
 s,@CPP@,$CPP,;t t
 s,@EGREP@,$EGREP,;t t
 s,@EGREP@,$EGREP,;t t

+ 20 - 15
configure.ac

@@ -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.5.2, tujikawa@rednoah.com)
+AC_INIT(aria2c, 0.6.0, 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])
@@ -17,6 +17,8 @@ AC_ARG_WITH([gnutls],  [  --with-gnutls              use gnutls library if insta
 AC_ARG_WITH([openssl], [  --with-openssl             use openssl library if installed. Default: yes], [with_openssl=$enableval], [with_openssl=yes])
 AC_ARG_WITH([openssl], [  --with-openssl             use openssl library if installed. Default: yes], [with_openssl=$enableval], [with_openssl=yes])
 AC_ARG_WITH([libxml2], [  --with-libxml2             use libxml2 library if installed. Default: yes], [with_libxml2=$enableval], [with_libxml2=yes])
 AC_ARG_WITH([libxml2], [  --with-libxml2             use libxml2 library if installed. Default: yes], [with_libxml2=$enableval], [with_libxml2=yes])
 
 
+AC_ARG_ENABLE([bittorrent], [ --enable-bittorrent        enable BitTorrent support. Default: yes], [enable_bittorrent=$enableval], [enable_bittorrent=yes])
+AC_ARG_ENABLE([metalink], [ --enable-metalink          enable Metalink support. Default: yes], [enable_metalink=$enableval], [enable_metalink=yes])
 
 
 # Checks for programs.
 # Checks for programs.
 AC_PROG_CXX
 AC_PROG_CXX
@@ -48,30 +50,33 @@ if test "x$have_libgnutls" = "xyes"; then
 fi
 fi
 
 
 if test "x$with_openssl" = "xyes" && test "x$have_libgnutls" != "xyes"; then
 if test "x$with_openssl" = "xyes" && test "x$have_libgnutls" != "xyes"; then
-#  AC_CHECK_LIB([ssl], [SSL_library_init], [have_openssl=yes])
-#  if test "x$have_openssl" = "xyes"; then
-#    AC_DEFINE([HAVE_LIBSSL], [1], [Define to 1 if you have openssl.])
-#    OPENSSL_LIBS="-lssl"
-#    OPENSSL_CFLAGS=""
-#    AC_SUBST(OPENSSL_LIBS)
-#    AC_SUBST(OPENSSL_CFLAGS)
-#  fi
   AM_PATH_OPENSSL
   AM_PATH_OPENSSL
 fi
 fi
 
 
-if test "x$have_libxml2" = "xyes"; then
-  AC_DEFINE([ENABLE_METALINK], [1], [Define to 1 if Metalink support is enabled.])
-fi
-
+# Define variables based on the result of the checks for libraries.
 if test "x$have_libgnutls" = "xyes" || test "x$have_openssl" = "xyes"; then
 if test "x$have_libgnutls" = "xyes" || test "x$have_openssl" = "xyes"; then
   AC_DEFINE([ENABLE_SSL], [1], [Define to 1 if ssl support is enabled.])
   AC_DEFINE([ENABLE_SSL], [1], [Define to 1 if ssl support is enabled.])
 fi
 fi
 
 
 if test "x$have_libgcrypt" = "xyes" || test "x$have_openssl" = "xyes"; then
 if test "x$have_libgcrypt" = "xyes" || test "x$have_openssl" = "xyes"; then
-  AC_DEFINE([ENABLE_SHA1DIGEST], [1], [Define to 1 if SHA1 Digest support is enabled.])
-  AC_DEFINE([ENABLE_BITTORRENT], [1], [Define to 1 if BitTorrent support is enabled.])
+  AC_DEFINE([ENABLE_MESSAGE_DIGEST], [1], [Define to 1 if message digest support is enabled.])
+  enable_message_digest=yes
 fi
 fi
 
 
+if test "x$enable_bittorrent" = "xyes" && test "x$enable_message_digest" = "xyes"; then
+    AC_DEFINE([ENABLE_BITTORRENT], [1], [Define to 1 if BitTorrent support is enabled.])
+    AM_CONDITIONAL([ENABLE_BITTORRENT], true)
+else
+    AM_CONDITIONAL([ENABLE_BITTORRENT], false)
+fi
+
+if test "x$have_libxml2" = "xyes" && test "x$enable_metalink" = "xyes" && \
+   test "x$enable_message_digest" = "xyes"; then
+    AC_DEFINE([ENABLE_METALINK], [1], [Define to 1 if Metalink support is enabled.])
+    AM_CONDITIONAL([ENABLE_METALINK], true)
+else
+    AM_CONDITIONAL([ENABLE_METALINK], false)
+fi
 
 
 # Checks for header files.
 # Checks for header files.
 AC_FUNC_ALLOCA
 AC_FUNC_ALLOCA

+ 4 - 0
m4/Makefile.in

@@ -87,6 +87,10 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EGREP = @EGREP@
+ENABLE_BITTORRENT_FALSE = @ENABLE_BITTORRENT_FALSE@
+ENABLE_BITTORRENT_TRUE = @ENABLE_BITTORRENT_TRUE@
+ENABLE_METALINK_FALSE = @ENABLE_METALINK_FALSE@
+ENABLE_METALINK_TRUE = @ENABLE_METALINK_TRUE@
 EXEEXT = @EXEEXT@
 EXEEXT = @EXEEXT@
 GENCAT = @GENCAT@
 GENCAT = @GENCAT@
 GLIBC21 = @GLIBC21@
 GLIBC21 = @GLIBC21@

+ 1 - 1
po/Makefile.in

@@ -9,7 +9,7 @@
 # General Public License and is *not* in the public domain.
 # General Public License and is *not* in the public domain.
 
 
 PACKAGE = aria2c
 PACKAGE = aria2c
-VERSION = 0.5.2
+VERSION = 0.6.0
 
 
 SHELL = /bin/sh
 SHELL = /bin/sh
 
 

+ 133 - 73
po/aria2c.pot

@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: http://aria2.sourceforge.net/\n"
 "Report-Msgid-Bugs-To: http://aria2.sourceforge.net/\n"
-"POT-Creation-Date: 2006-05-27 00:27+0900\n"
+"POT-Creation-Date: 2006-07-04 01:30+0900\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -329,39 +329,39 @@ msgstr ""
 msgid "Failed to peek data, cause: %s"
 msgid "Failed to peek data, cause: %s"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:65
+#: src/main.cc:76
 #, c-format
 #, c-format
 msgid ""
 msgid ""
 "\n"
 "\n"
 "The download was complete. <%s>\n"
 "The download was complete. <%s>\n"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:73
+#: src/main.cc:84
 msgid ""
 msgid ""
 "\n"
 "\n"
 "The download was not complete because of errors. Check the log.\n"
 "The download was not complete because of errors. Check the log.\n"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:88
+#: src/main.cc:101
 msgid ""
 msgid ""
 "\n"
 "\n"
 "stopping application...\n"
 "stopping application...\n"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:94
+#: src/main.cc:107
 msgid "done\n"
 msgid "done\n"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:125
+#: src/main.cc:123
 #, c-format
 #, c-format
 msgid "Unrecognized URL or unsupported protocol: %s\n"
 msgid "Unrecognized URL or unsupported protocol: %s\n"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:131
+#: src/main.cc:129
 msgid " version "
 msgid " version "
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:135
+#: src/main.cc:133
 msgid ""
 msgid ""
 "This program is free software; you can redistribute it and/or modify\n"
 "This program is free software; you can redistribute it and/or modify\n"
 "it under the terms of the GNU General Public License as published by\n"
 "it under the terms of the GNU General Public License as published by\n"
@@ -378,45 +378,50 @@ msgid ""
 "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n"
 "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:149
+#: src/main.cc:147
 #, c-format
 #, c-format
 msgid "Contact Info: %s\n"
 msgid "Contact Info: %s\n"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:155
+#: src/main.cc:153
 #, c-format
 #, c-format
 msgid "Usage: %s [options] URL ...\n"
 msgid "Usage: %s [options] URL ...\n"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:157
+#: src/main.cc:155
 #, c-format
 #, c-format
 msgid "       %s [options] -T TORRENT_FILE FILE ...\n"
 msgid "       %s [options] -T TORRENT_FILE FILE ...\n"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:160
-msgid "Options:"
+#: src/main.cc:158
+#, c-format
+msgid "       %s [options] -M METALINK_FILE\n"
 msgstr ""
 msgstr ""
 
 
 #: src/main.cc:161
 #: src/main.cc:161
-msgid " -d, --dir=DIR                The directory to store downloaded file."
+msgid "Options:"
 msgstr ""
 msgstr ""
 
 
 #: src/main.cc:162
 #: src/main.cc:162
-msgid " -o, --out=FILE               The file name for downloaded file."
+msgid " -d, --dir=DIR                The directory to store downloaded file."
 msgstr ""
 msgstr ""
 
 
 #: src/main.cc:163
 #: src/main.cc:163
+msgid " -o, --out=FILE               The file name for downloaded file."
+msgstr ""
+
+#: src/main.cc:164
 msgid ""
 msgid ""
 " -l, --log=LOG                The file path to store log. If '-' is "
 " -l, --log=LOG                The file path to store log. If '-' is "
 "specified,\n"
 "specified,\n"
 "                              log is written to stdout."
 "                              log is written to stdout."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:165
+#: src/main.cc:166
 msgid " -D, --daemon                 Run as daemon."
 msgid " -D, --daemon                 Run as daemon."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:166
+#: src/main.cc:167
 msgid ""
 msgid ""
 " -s, --split=N                Download a file using N connections. N must "
 " -s, --split=N                Download a file using N connections. N must "
 "be\n"
 "be\n"
@@ -426,24 +431,24 @@ msgid ""
 "                              N connections."
 "                              N connections."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:170
+#: src/main.cc:171
 msgid ""
 msgid ""
 " --retry-wait=SEC             Set amount of time in second between requests\n"
 " --retry-wait=SEC             Set amount of time in second between requests\n"
 "                              for errors. Specify a value between 0 and 60.\n"
 "                              for errors. Specify a value between 0 and 60.\n"
 "                              Default: 5"
 "                              Default: 5"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:173
+#: src/main.cc:174
 msgid " -t, --timeout=SEC            Set timeout in second. Default: 60"
 msgid " -t, --timeout=SEC            Set timeout in second. Default: 60"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:174
+#: src/main.cc:175
 msgid ""
 msgid ""
 " -m, --max-tries=N            Set number of tries. 0 means unlimited.\n"
 " -m, --max-tries=N            Set number of tries. 0 means unlimited.\n"
 "                              Default: 5"
 "                              Default: 5"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:176
+#: src/main.cc:177
 msgid ""
 msgid ""
 " --min-segment-size=SIZE[K|M] Set minimum segment size. You can append\n"
 " --min-segment-size=SIZE[K|M] Set minimum segment size. You can append\n"
 "                              K or M(1K = 1024, 1M = 1024K). This\n"
 "                              K or M(1K = 1024, 1M = 1024K). This\n"
@@ -451,40 +456,40 @@ msgid ""
 "                              1024."
 "                              1024."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:180
+#: src/main.cc:181
 msgid ""
 msgid ""
 " --http-proxy=HOST:PORT       Use HTTP proxy server. This affects to all\n"
 " --http-proxy=HOST:PORT       Use HTTP proxy server. This affects to all\n"
 "                              URLs."
 "                              URLs."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:182
+#: src/main.cc:183
 msgid " --http-user=USER             Set HTTP user. This affects to all URLs."
 msgid " --http-user=USER             Set HTTP user. This affects to all URLs."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:183
+#: src/main.cc:184
 msgid ""
 msgid ""
 " --http-passwd=PASSWD         Set HTTP password. This affects to all URLs."
 " --http-passwd=PASSWD         Set HTTP password. This affects to all URLs."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:184
+#: src/main.cc:185
 msgid ""
 msgid ""
 " --http-proxy-user=USER       Set HTTP proxy user. This affects to all URLs"
 " --http-proxy-user=USER       Set HTTP proxy user. This affects to all URLs"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:185
+#: src/main.cc:186
 msgid ""
 msgid ""
 " --http-proxy-passwd=PASSWD   Set HTTP proxy password. This affects to all "
 " --http-proxy-passwd=PASSWD   Set HTTP proxy password. This affects to all "
 "URLs."
 "URLs."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:186
+#: src/main.cc:187
 msgid ""
 msgid ""
 " --http-proxy-method=METHOD   Set the method to use in proxy request.\n"
 " --http-proxy-method=METHOD   Set the method to use in proxy request.\n"
 "                              METHOD is either 'get' or 'tunnel'.\n"
 "                              METHOD is either 'get' or 'tunnel'.\n"
 "                              Default: tunnel"
 "                              Default: tunnel"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:189
+#: src/main.cc:190
 msgid ""
 msgid ""
 " --http-auth-scheme=SCHEME    Set HTTP authentication scheme. Currently, "
 " --http-auth-scheme=SCHEME    Set HTTP authentication scheme. Currently, "
 "basic\n"
 "basic\n"
@@ -492,23 +497,23 @@ msgid ""
 "                              Default: basic"
 "                              Default: basic"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:192
+#: src/main.cc:193
 msgid " --referer=REFERER            Set Referer. This affects to all URLs."
 msgid " --referer=REFERER            Set Referer. This affects to all URLs."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:193
+#: src/main.cc:194
 msgid ""
 msgid ""
 " --ftp-user=USER              Set FTP user. This affects to all URLs.\n"
 " --ftp-user=USER              Set FTP user. This affects to all URLs.\n"
 "                              Default: anonymous"
 "                              Default: anonymous"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:195
+#: src/main.cc:196
 msgid ""
 msgid ""
 " --ftp-passwd=PASSWD          Set FTP password. This affects to all URLs.\n"
 " --ftp-passwd=PASSWD          Set FTP password. This affects to all URLs.\n"
 "                              Default: ARIA2USER@"
 "                              Default: ARIA2USER@"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:197
+#: src/main.cc:198
 msgid ""
 msgid ""
 " --ftp-type=TYPE              Set FTP transfer type. TYPE is either "
 " --ftp-type=TYPE              Set FTP transfer type. TYPE is either "
 "'binary'\n"
 "'binary'\n"
@@ -516,11 +521,11 @@ msgid ""
 "                              Default: binary"
 "                              Default: binary"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:200
+#: src/main.cc:201
 msgid " -p, --ftp-pasv               Use passive mode in FTP."
 msgid " -p, --ftp-pasv               Use passive mode in FTP."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:201
+#: src/main.cc:202
 msgid ""
 msgid ""
 " --ftp-via-http-proxy=METHOD  Use HTTP proxy in FTP. METHOD is either 'get' "
 " --ftp-via-http-proxy=METHOD  Use HTTP proxy in FTP. METHOD is either 'get' "
 "or\n"
 "or\n"
@@ -528,11 +533,11 @@ msgid ""
 "                              Default: tunnel"
 "                              Default: tunnel"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:205
+#: src/main.cc:206
 msgid " -T, --torrent-file=TORRENT_FILE  The file path to .torrent file."
 msgid " -T, --torrent-file=TORRENT_FILE  The file path to .torrent file."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:206
+#: src/main.cc:207
 msgid ""
 msgid ""
 " --follow-torrent=true|false  Setting this option to false prevents aria2 "
 " --follow-torrent=true|false  Setting this option to false prevents aria2 "
 "to\n"
 "to\n"
@@ -541,25 +546,25 @@ msgid ""
 "                              Default: true"
 "                              Default: true"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:210
+#: src/main.cc:211
 msgid ""
 msgid ""
 " -S, --show-files             Print file listing of .torrent file and exit."
 " -S, --show-files             Print file listing of .torrent file and exit."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:211
+#: src/main.cc:212
 msgid ""
 msgid ""
 " --direct-file-mapping=true|false Directly read from and write to each file\n"
 " --direct-file-mapping=true|false Directly read from and write to each file\n"
 "                              mentioned in .torrent file.\n"
 "                              mentioned in .torrent file.\n"
 "                              Default: true"
 "                              Default: true"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:214
+#: src/main.cc:215
 msgid ""
 msgid ""
 " --listen-port=PORT           Set port number to listen to for peer "
 " --listen-port=PORT           Set port number to listen to for peer "
 "connection."
 "connection."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:215
+#: src/main.cc:216
 msgid ""
 msgid ""
 " --upload-limit=SPEED         Set upload speed limit in KB/sec. aria2 tries "
 " --upload-limit=SPEED         Set upload speed limit in KB/sec. aria2 tries "
 "to\n"
 "to\n"
@@ -567,7 +572,7 @@ msgid ""
 "unlimited."
 "unlimited."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:217
+#: src/main.cc:218
 msgid ""
 msgid ""
 " --select-file=INDEX...       Set file to download by specifing its index.\n"
 " --select-file=INDEX...       Set file to download by specifing its index.\n"
 "                              You can know file index through --show-files\n"
 "                              You can know file index through --show-files\n"
@@ -579,135 +584,190 @@ msgid ""
 "                              ',' and '-' can be used together."
 "                              ',' and '-' can be used together."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:224
+#: src/main.cc:226
+msgid " -M, --metalink-file=METALINK_FILE The file path to .metalink file."
+msgstr ""
+
+#: src/main.cc:227
+msgid ""
+" -C, --metalink-servers=NUM_SERVERS The number of servers to connect to\n"
+"                              simultaneously. If more than one connection "
+"per\n"
+"                              server is required, use -s option.\n"
+"                              Default: 15"
+msgstr ""
+
+#: src/main.cc:231
+msgid " --metalink-version=VERSION   The version of file to download."
+msgstr ""
+
+#: src/main.cc:232
+msgid " --metalink-language=LANGUAGE The language of file to download."
+msgstr ""
+
+#: src/main.cc:233
+msgid ""
+" --metalink-os=OS             The operating system the file is targeted."
+msgstr ""
+
+#: src/main.cc:234
+msgid ""
+" --follow-metalink=true|false  Setting this option to false prevents aria2 "
+"to\n"
+"                              enter Metalink mode even if the filename of\n"
+"                              downloaded file ends with .metalink.\n"
+"                              Default: true"
+msgstr ""
+
+#: src/main.cc:239
 msgid " -v, --version                Print the version number and exit."
 msgid " -v, --version                Print the version number and exit."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:225
+#: src/main.cc:240
 msgid " -h, --help                   Print this message and exit."
 msgid " -h, --help                   Print this message and exit."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:228
+#: src/main.cc:243
 msgid ""
 msgid ""
 " You can specify multiple URLs. All URLs must point to the same file\n"
 " You can specify multiple URLs. All URLs must point to the same file\n"
 " or downloading fails."
 " or downloading fails."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:233
+#: src/main.cc:248
 msgid ""
 msgid ""
 " Specify files in multi-file torrent to download. Use conjunction with\n"
 " Specify files in multi-file torrent to download. Use conjunction with\n"
 " -T option. This arguments are ignored if you specify --select-file option."
 " -T option. This arguments are ignored if you specify --select-file option."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:237
+#: src/main.cc:252
 msgid "Examples:"
 msgid "Examples:"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:238
+#: src/main.cc:253
 msgid " Download a file by 1 connection:"
 msgid " Download a file by 1 connection:"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:240
+#: src/main.cc:255
 msgid " Download a file by 2 connections:"
 msgid " Download a file by 2 connections:"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:242
+#: src/main.cc:257
 msgid " Download a file by 2 connections, each connects to a different server:"
 msgid " Download a file by 2 connections, each connects to a different server:"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:244
+#: src/main.cc:259
 msgid " You can mix up different protocols:"
 msgid " You can mix up different protocols:"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:247
+#: src/main.cc:263
 msgid " Download a torrent:"
 msgid " Download a torrent:"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:249
+#: src/main.cc:265
 msgid " Download a torrent using local .torrent file:"
 msgid " Download a torrent using local .torrent file:"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:251
+#: src/main.cc:267
 msgid " Download only selected files:"
 msgid " Download only selected files:"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:253
+#: src/main.cc:269
 msgid " Print file listing of .torrent file:"
 msgid " Print file listing of .torrent file:"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:257
+#: src/main.cc:274
+msgid " Metalink downloading:"
+msgstr ""
+
+#: src/main.cc:276
+msgid " Download a file using local .metalink file:"
+msgstr ""
+
+#: src/main.cc:278
+msgid " Metalink downloading with preferences:"
+msgstr ""
+
+#: src/main.cc:282
 #, c-format
 #, c-format
 msgid "Report bugs to %s"
 msgid "Report bugs to %s"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:353
+#: src/main.cc:444
 msgid "unrecognized proxy format"
 msgid "unrecognized proxy format"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:380
+#: src/main.cc:471
 msgid "Currently, supported authentication scheme is basic."
 msgid "Currently, supported authentication scheme is basic."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:389
+#: src/main.cc:480
 msgid "retry-wait must be between 0 and 60."
 msgid "retry-wait must be between 0 and 60."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:406
+#: src/main.cc:497
 msgid "ftp-type must be either 'binary' or 'ascii'."
 msgid "ftp-type must be either 'binary' or 'ascii'."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:415
+#: src/main.cc:506
 msgid "ftp-via-http-proxy must be either 'get' or 'tunnel'."
 msgid "ftp-via-http-proxy must be either 'get' or 'tunnel'."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:433
+#: src/main.cc:524
 msgid "min-segment-size invalid"
 msgid "min-segment-size invalid"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:444
+#: src/main.cc:535
 msgid "http-proxy-method must be either 'get' or 'tunnel'."
 msgid "http-proxy-method must be either 'get' or 'tunnel'."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:452
+#: src/main.cc:543
 msgid "listen-port must be between 1024 and 65535."
 msgid "listen-port must be between 1024 and 65535."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:463
+#: src/main.cc:554
 msgid "follow-torrent must be either 'true' or 'false'."
 msgid "follow-torrent must be either 'true' or 'false'."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:477
+#: src/main.cc:568
 msgid "direct-file-mapping must be either 'true' or 'false'."
 msgid "direct-file-mapping must be either 'true' or 'false'."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:485
+#: src/main.cc:576
 msgid "upload-limit must be greater than or equal to 0."
 msgid "upload-limit must be greater than or equal to 0."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:517
+#: src/main.cc:601
+msgid "follow-metalink must be either 'true' or 'false'."
+msgstr ""
+
+#: src/main.cc:628
 msgid "split must be between 1 and 5."
 msgid "split must be between 1 and 5."
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:527
+#: src/main.cc:638
 msgid "timeout must be between 1 and 600"
 msgid "timeout must be between 1 and 600"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:536
+#: src/main.cc:647
 msgid "max-tries invalid"
 msgid "max-tries invalid"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:565
+#: src/main.cc:669
+msgid "metalink-servers must be greater than 0."
+msgstr ""
+
+#: src/main.cc:687
 msgid "specify at least one URL"
 msgid "specify at least one URL"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:572
+#: src/main.cc:694
 msgid "daemon failed"
 msgid "daemon failed"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:673
+#: src/main.cc:831
 msgid "Files:"
 msgid "Files:"
 msgstr ""
 msgstr ""
 
 
-#: src/main.cc:704
+#: src/main.cc:862
 msgid "Errors occurred while binding port.\n"
 msgid "Errors occurred while binding port.\n"
 msgstr ""
 msgstr ""

二进制
po/de.gmo


+ 151 - 73
po/de.po

@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 msgstr ""
 "Project-Id-Version: de\n"
 "Project-Id-Version: de\n"
 "Report-Msgid-Bugs-To: http://aria2.sourceforge.net/\n"
 "Report-Msgid-Bugs-To: http://aria2.sourceforge.net/\n"
-"POT-Creation-Date: 2006-05-27 00:27+0900\n"
+"POT-Creation-Date: 2006-07-04 01:30+0900\n"
 "PO-Revision-Date: 2006-05-05 19:44+0900\n"
 "PO-Revision-Date: 2006-05-05 19:44+0900\n"
 "Last-Translator: Hermann J. Beckers <hj.beckers@onlinehome.de>\n"
 "Last-Translator: Hermann J. Beckers <hj.beckers@onlinehome.de>\n"
 "Language-Team: deutsch <de@li.org>\n"
 "Language-Team: deutsch <de@li.org>\n"
@@ -338,7 +338,7 @@ msgstr "Konnte Daten nicht erhalten, Ursache: %s"
 msgid "Failed to peek data, cause: %s"
 msgid "Failed to peek data, cause: %s"
 msgstr "Datenermittelung fehlgeschlagen, Ursache: %s"
 msgstr "Datenermittelung fehlgeschlagen, Ursache: %s"
 
 
-#: src/main.cc:65
+#: src/main.cc:76
 #, c-format
 #, c-format
 msgid ""
 msgid ""
 "\n"
 "\n"
@@ -347,7 +347,7 @@ msgstr ""
 "\n"
 "\n"
 "Abruf ist vollständig. <%s>\n"
 "Abruf ist vollständig. <%s>\n"
 
 
-#: src/main.cc:73
+#: src/main.cc:84
 msgid ""
 msgid ""
 "\n"
 "\n"
 "The download was not complete because of errors. Check the log.\n"
 "The download was not complete because of errors. Check the log.\n"
@@ -355,7 +355,7 @@ msgstr ""
 "\n"
 "\n"
 "Abruf wegen Fehlern nicht vollständig. Überprüfen Sie die Log-Datei.\n"
 "Abruf wegen Fehlern nicht vollständig. Überprüfen Sie die Log-Datei.\n"
 
 
-#: src/main.cc:88
+#: src/main.cc:101
 msgid ""
 msgid ""
 "\n"
 "\n"
 "stopping application...\n"
 "stopping application...\n"
@@ -363,20 +363,20 @@ msgstr ""
 "\n"
 "\n"
 "Anwendung wird gestoppt ...\n"
 "Anwendung wird gestoppt ...\n"
 
 
-#: src/main.cc:94
+#: src/main.cc:107
 msgid "done\n"
 msgid "done\n"
 msgstr "erledigt\n"
 msgstr "erledigt\n"
 
 
-#: src/main.cc:125
+#: src/main.cc:123
 #, c-format
 #, c-format
 msgid "Unrecognized URL or unsupported protocol: %s\n"
 msgid "Unrecognized URL or unsupported protocol: %s\n"
 msgstr "URL nicht erkannt oder nicht unterstütztes Protokoll: %s\n"
 msgstr "URL nicht erkannt oder nicht unterstütztes Protokoll: %s\n"
 
 
-#: src/main.cc:131
+#: src/main.cc:129
 msgid " version "
 msgid " version "
 msgstr " Version "
 msgstr " Version "
 
 
-#: src/main.cc:135
+#: src/main.cc:133
 msgid ""
 msgid ""
 "This program is free software; you can redistribute it and/or modify\n"
 "This program is free software; you can redistribute it and/or modify\n"
 "it under the terms of the GNU General Public License as published by\n"
 "it under the terms of the GNU General Public License as published by\n"
@@ -406,36 +406,41 @@ msgstr ""
 "along with this program; if not, write to the Free Software\n"
 "along with this program; if not, write to the Free Software\n"
 "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n"
 "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n"
 
 
-#: src/main.cc:149
+#: src/main.cc:147
 #, c-format
 #, c-format
 msgid "Contact Info: %s\n"
 msgid "Contact Info: %s\n"
 msgstr "Kontakt-Info: %s\n"
 msgstr "Kontakt-Info: %s\n"
 
 
-#: src/main.cc:155
+#: src/main.cc:153
 #, c-format
 #, c-format
 msgid "Usage: %s [options] URL ...\n"
 msgid "Usage: %s [options] URL ...\n"
 msgstr "Aufruf: %s [Optionen] URL ...\n"
 msgstr "Aufruf: %s [Optionen] URL ...\n"
 
 
-#: src/main.cc:157
+#: src/main.cc:155
 #, c-format
 #, c-format
 msgid "       %s [options] -T TORRENT_FILE FILE ...\n"
 msgid "       %s [options] -T TORRENT_FILE FILE ...\n"
 msgstr "       %s [Optionen] -T TORRENT_FILE FILE ...\n"
 msgstr "       %s [Optionen] -T TORRENT_FILE FILE ...\n"
 
 
-#: src/main.cc:160
+#: src/main.cc:158
+#, fuzzy, c-format
+msgid "       %s [options] -M METALINK_FILE\n"
+msgstr "       %s [Optionen] -T TORRENT_FILE FILE ...\n"
+
+#: src/main.cc:161
 msgid "Options:"
 msgid "Options:"
 msgstr "Optionen:"
 msgstr "Optionen:"
 
 
-#: src/main.cc:161
+#: src/main.cc:162
 msgid " -d, --dir=DIR                The directory to store downloaded file."
 msgid " -d, --dir=DIR                The directory to store downloaded file."
 msgstr ""
 msgstr ""
 " -d, --dir=DIR                Verzeichnis zum Speichern der abgerufenen "
 " -d, --dir=DIR                Verzeichnis zum Speichern der abgerufenen "
 "Datei."
 "Datei."
 
 
-#: src/main.cc:162
+#: src/main.cc:163
 msgid " -o, --out=FILE               The file name for downloaded file."
 msgid " -o, --out=FILE               The file name for downloaded file."
 msgstr " -o, --out=FILE               Dateiname für die abgerufene Datei."
 msgstr " -o, --out=FILE               Dateiname für die abgerufene Datei."
 
 
-#: src/main.cc:163
+#: src/main.cc:164
 msgid ""
 msgid ""
 " -l, --log=LOG                The file path to store log. If '-' is "
 " -l, --log=LOG                The file path to store log. If '-' is "
 "specified,\n"
 "specified,\n"
@@ -446,11 +451,11 @@ msgstr ""
 "                              wird das Log auf die Standardausgabe "
 "                              wird das Log auf die Standardausgabe "
 "geschrieben."
 "geschrieben."
 
 
-#: src/main.cc:165
+#: src/main.cc:166
 msgid " -D, --daemon                 Run as daemon."
 msgid " -D, --daemon                 Run as daemon."
 msgstr " -D, --daemon                 Start als Daemon-Prozeß."
 msgstr " -D, --daemon                 Start als Daemon-Prozeß."
 
 
-#: src/main.cc:166
+#: src/main.cc:167
 msgid ""
 msgid ""
 " -s, --split=N                Download a file using N connections. N must "
 " -s, --split=N                Download a file using N connections. N must "
 "be\n"
 "be\n"
@@ -466,7 +471,7 @@ msgstr ""
 "                              Daher verbindet sich aria2 zu jeder URL mit\n"
 "                              Daher verbindet sich aria2 zu jeder URL mit\n"
 "                              N Verbindungen."
 "                              N Verbindungen."
 
 
-#: src/main.cc:170
+#: src/main.cc:171
 msgid ""
 msgid ""
 " --retry-wait=SEC             Set amount of time in second between requests\n"
 " --retry-wait=SEC             Set amount of time in second between requests\n"
 "                              for errors. Specify a value between 0 and 60.\n"
 "                              for errors. Specify a value between 0 and 60.\n"
@@ -478,12 +483,12 @@ msgstr ""
 "und 60 an.\n"
 "und 60 an.\n"
 "                              Fehlwert: 5"
 "                              Fehlwert: 5"
 
 
-#: src/main.cc:173
+#: src/main.cc:174
 msgid " -t, --timeout=SEC            Set timeout in second. Default: 60"
 msgid " -t, --timeout=SEC            Set timeout in second. Default: 60"
 msgstr ""
 msgstr ""
 " -t, --timeout=SEC            Setzt Wartezeit in Sekunden. Fehlwert: 60"
 " -t, --timeout=SEC            Setzt Wartezeit in Sekunden. Fehlwert: 60"
 
 
-#: src/main.cc:174
+#: src/main.cc:175
 msgid ""
 msgid ""
 " -m, --max-tries=N            Set number of tries. 0 means unlimited.\n"
 " -m, --max-tries=N            Set number of tries. 0 means unlimited.\n"
 "                              Default: 5"
 "                              Default: 5"
@@ -491,7 +496,7 @@ msgstr ""
 " -m, --max-tries=N            Anzahl Versuche. 0 bedeutet unbegrenzt.\n"
 " -m, --max-tries=N            Anzahl Versuche. 0 bedeutet unbegrenzt.\n"
 "                              Fehlwert: 5"
 "                              Fehlwert: 5"
 
 
-#: src/main.cc:176
+#: src/main.cc:177
 msgid ""
 msgid ""
 " --min-segment-size=SIZE[K|M] Set minimum segment size. You can append\n"
 " --min-segment-size=SIZE[K|M] Set minimum segment size. You can append\n"
 "                              K or M(1K = 1024, 1M = 1024K). This\n"
 "                              K or M(1K = 1024, 1M = 1024K). This\n"
@@ -504,7 +509,7 @@ msgstr ""
 "                              Wert muss größer oder gleich \n"
 "                              Wert muss größer oder gleich \n"
 "                              1024 sein."
 "                              1024 sein."
 
 
-#: src/main.cc:180
+#: src/main.cc:181
 msgid ""
 msgid ""
 " --http-proxy=HOST:PORT       Use HTTP proxy server. This affects to all\n"
 " --http-proxy=HOST:PORT       Use HTTP proxy server. This affects to all\n"
 "                              URLs."
 "                              URLs."
@@ -512,26 +517,26 @@ msgstr ""
 " --http-proxy=HOST:PORT       HTTP-Proxyserver benutzen. Dies betrifft alle\n"
 " --http-proxy=HOST:PORT       HTTP-Proxyserver benutzen. Dies betrifft alle\n"
 "                              URLs."
 "                              URLs."
 
 
-#: src/main.cc:182
+#: src/main.cc:183
 msgid " --http-user=USER             Set HTTP user. This affects to all URLs."
 msgid " --http-user=USER             Set HTTP user. This affects to all URLs."
 msgstr ""
 msgstr ""
 " --http-user=USER             HTTP-Anwendername angeben. Dies betrifft alle "
 " --http-user=USER             HTTP-Anwendername angeben. Dies betrifft alle "
 "URLs."
 "URLs."
 
 
-#: src/main.cc:183
+#: src/main.cc:184
 msgid ""
 msgid ""
 " --http-passwd=PASSWD         Set HTTP password. This affects to all URLs."
 " --http-passwd=PASSWD         Set HTTP password. This affects to all URLs."
 msgstr ""
 msgstr ""
 " --http-passwd=PASSWD         HTTP-Passwort setzen. Dies betrifft alle URLs."
 " --http-passwd=PASSWD         HTTP-Passwort setzen. Dies betrifft alle URLs."
 
 
-#: src/main.cc:184
+#: src/main.cc:185
 msgid ""
 msgid ""
 " --http-proxy-user=USER       Set HTTP proxy user. This affects to all URLs"
 " --http-proxy-user=USER       Set HTTP proxy user. This affects to all URLs"
 msgstr ""
 msgstr ""
 " --http-proxy-user=USER       HTTP-Proxy-Anwender setzen. Dies betrifft alle "
 " --http-proxy-user=USER       HTTP-Proxy-Anwender setzen. Dies betrifft alle "
 "URLs."
 "URLs."
 
 
-#: src/main.cc:185
+#: src/main.cc:186
 msgid ""
 msgid ""
 " --http-proxy-passwd=PASSWD   Set HTTP proxy password. This affects to all "
 " --http-proxy-passwd=PASSWD   Set HTTP proxy password. This affects to all "
 "URLs."
 "URLs."
@@ -539,7 +544,7 @@ msgstr ""
 " --http-proxy-passwd=PASSWD   HTTP-Proxy-Passwort setzen. Dies betrifft alle "
 " --http-proxy-passwd=PASSWD   HTTP-Proxy-Passwort setzen. Dies betrifft alle "
 "URLs."
 "URLs."
 
 
-#: src/main.cc:186
+#: src/main.cc:187
 msgid ""
 msgid ""
 " --http-proxy-method=METHOD   Set the method to use in proxy request.\n"
 " --http-proxy-method=METHOD   Set the method to use in proxy request.\n"
 "                              METHOD is either 'get' or 'tunnel'.\n"
 "                              METHOD is either 'get' or 'tunnel'.\n"
@@ -550,7 +555,7 @@ msgstr ""
 "                              METHOD ist entweder 'get' oder 'tunnel'.\n"
 "                              METHOD ist entweder 'get' oder 'tunnel'.\n"
 "                              Fehlwert: tunnel"
 "                              Fehlwert: tunnel"
 
 
-#: src/main.cc:189
+#: src/main.cc:190
 msgid ""
 msgid ""
 " --http-auth-scheme=SCHEME    Set HTTP authentication scheme. Currently, "
 " --http-auth-scheme=SCHEME    Set HTTP authentication scheme. Currently, "
 "basic\n"
 "basic\n"
@@ -562,11 +567,11 @@ msgstr ""
 "                              das einzig zulässige Schema.\n"
 "                              das einzig zulässige Schema.\n"
 "                              Fehlwert: basic"
 "                              Fehlwert: basic"
 
 
-#: src/main.cc:192
+#: src/main.cc:193
 msgid " --referer=REFERER            Set Referer. This affects to all URLs."
 msgid " --referer=REFERER            Set Referer. This affects to all URLs."
 msgstr " --referer=REFERER            Referer setzen. Dies betrifft alle URLs."
 msgstr " --referer=REFERER            Referer setzen. Dies betrifft alle URLs."
 
 
-#: src/main.cc:193
+#: src/main.cc:194
 msgid ""
 msgid ""
 " --ftp-user=USER              Set FTP user. This affects to all URLs.\n"
 " --ftp-user=USER              Set FTP user. This affects to all URLs.\n"
 "                              Default: anonymous"
 "                              Default: anonymous"
@@ -574,7 +579,7 @@ msgstr ""
 " --ftp-user=USER              FTP-Anwender setzen. Dies betrifft alle URLs.\n"
 " --ftp-user=USER              FTP-Anwender setzen. Dies betrifft alle URLs.\n"
 "                              Fehlwert: anonymous"
 "                              Fehlwert: anonymous"
 
 
-#: src/main.cc:195
+#: src/main.cc:196
 msgid ""
 msgid ""
 " --ftp-passwd=PASSWD          Set FTP password. This affects to all URLs.\n"
 " --ftp-passwd=PASSWD          Set FTP password. This affects to all URLs.\n"
 "                              Default: ARIA2USER@"
 "                              Default: ARIA2USER@"
@@ -582,7 +587,7 @@ msgstr ""
 " --ftp-passwd=PASSWD          FTP-Passwort setzen. Dies betrifft alle URLs.\n"
 " --ftp-passwd=PASSWD          FTP-Passwort setzen. Dies betrifft alle URLs.\n"
 "                              Fehlwert: ARIA2USER@"
 "                              Fehlwert: ARIA2USER@"
 
 
-#: src/main.cc:197
+#: src/main.cc:198
 msgid ""
 msgid ""
 " --ftp-type=TYPE              Set FTP transfer type. TYPE is either "
 " --ftp-type=TYPE              Set FTP transfer type. TYPE is either "
 "'binary'\n"
 "'binary'\n"
@@ -594,11 +599,11 @@ msgstr ""
 "                              oder 'ascii'.\n"
 "                              oder 'ascii'.\n"
 "                              Fehlwert: binary"
 "                              Fehlwert: binary"
 
 
-#: src/main.cc:200
+#: src/main.cc:201
 msgid " -p, --ftp-pasv               Use passive mode in FTP."
 msgid " -p, --ftp-pasv               Use passive mode in FTP."
 msgstr " -p, --ftp-pasv               Passiv-Modus für FTP benutzen."
 msgstr " -p, --ftp-pasv               Passiv-Modus für FTP benutzen."
 
 
-#: src/main.cc:201
+#: src/main.cc:202
 msgid ""
 msgid ""
 " --ftp-via-http-proxy=METHOD  Use HTTP proxy in FTP. METHOD is either 'get' "
 " --ftp-via-http-proxy=METHOD  Use HTTP proxy in FTP. METHOD is either 'get' "
 "or\n"
 "or\n"
@@ -610,11 +615,11 @@ msgstr ""
 "                              'tunnel'.\n"
 "                              'tunnel'.\n"
 "                              Fehlwert: tunnel"
 "                              Fehlwert: tunnel"
 
 
-#: src/main.cc:205
+#: src/main.cc:206
 msgid " -T, --torrent-file=TORRENT_FILE  The file path to .torrent file."
 msgid " -T, --torrent-file=TORRENT_FILE  The file path to .torrent file."
 msgstr " -T, --torrent-file=TORRENT_FILE  Datenpfad zur torrent-Datei."
 msgstr " -T, --torrent-file=TORRENT_FILE  Datenpfad zur torrent-Datei."
 
 
-#: src/main.cc:206
+#: src/main.cc:207
 msgid ""
 msgid ""
 " --follow-torrent=true|false  Setting this option to false prevents aria2 "
 " --follow-torrent=true|false  Setting this option to false prevents aria2 "
 "to\n"
 "to\n"
@@ -629,14 +634,14 @@ msgstr ""
 "                              auf .torrent endet.\n"
 "                              auf .torrent endet.\n"
 "                              Fehlwert: true"
 "                              Fehlwert: true"
 
 
-#: src/main.cc:210
+#: src/main.cc:211
 msgid ""
 msgid ""
 " -S, --show-files             Print file listing of .torrent file and exit."
 " -S, --show-files             Print file listing of .torrent file and exit."
 msgstr ""
 msgstr ""
 " -S, --show-files             Dateiliste der .torrent-Datei ausgeben und "
 " -S, --show-files             Dateiliste der .torrent-Datei ausgeben und "
 "beenden."
 "beenden."
 
 
-#: src/main.cc:211
+#: src/main.cc:212
 msgid ""
 msgid ""
 " --direct-file-mapping=true|false Directly read from and write to each file\n"
 " --direct-file-mapping=true|false Directly read from and write to each file\n"
 "                              mentioned in .torrent file.\n"
 "                              mentioned in .torrent file.\n"
@@ -646,7 +651,7 @@ msgstr ""
 "                              .torrent-Datei erwähnten Datei.\n"
 "                              .torrent-Datei erwähnten Datei.\n"
 "                              Fehlwert: true"
 "                              Fehlwert: true"
 
 
-#: src/main.cc:214
+#: src/main.cc:215
 msgid ""
 msgid ""
 " --listen-port=PORT           Set port number to listen to for peer "
 " --listen-port=PORT           Set port number to listen to for peer "
 "connection."
 "connection."
@@ -654,7 +659,7 @@ msgstr ""
 " --listen-port=PORT           Port-Nummer zum Lauschen auf Peer-Verbindungen "
 " --listen-port=PORT           Port-Nummer zum Lauschen auf Peer-Verbindungen "
 "setzen."
 "setzen."
 
 
-#: src/main.cc:215
+#: src/main.cc:216
 msgid ""
 msgid ""
 " --upload-limit=SPEED         Set upload speed limit in KB/sec. aria2 tries "
 " --upload-limit=SPEED         Set upload speed limit in KB/sec. aria2 tries "
 "to\n"
 "to\n"
@@ -666,7 +671,7 @@ msgstr ""
 "                              Sendegeschwindigkeit unter SPEED zu halten. 0 "
 "                              Sendegeschwindigkeit unter SPEED zu halten. 0 "
 "bedeutet keine Begrenzung."
 "bedeutet keine Begrenzung."
 
 
-#: src/main.cc:217
+#: src/main.cc:218
 msgid ""
 msgid ""
 " --select-file=INDEX...       Set file to download by specifing its index.\n"
 " --select-file=INDEX...       Set file to download by specifing its index.\n"
 "                              You can know file index through --show-files\n"
 "                              You can know file index through --show-files\n"
@@ -686,15 +691,65 @@ msgstr ""
 "                              Sie können auch '-' verwenden wie in \"1-5\".\n"
 "                              Sie können auch '-' verwenden wie in \"1-5\".\n"
 "                              ',' und '-' können zusammen benutzt werden."
 "                              ',' und '-' können zusammen benutzt werden."
 
 
-#: src/main.cc:224
+#: src/main.cc:226
+#, fuzzy
+msgid " -M, --metalink-file=METALINK_FILE The file path to .metalink file."
+msgstr " -T, --torrent-file=TORRENT_FILE  Datenpfad zur torrent-Datei."
+
+#: src/main.cc:227
+#, fuzzy
+msgid ""
+" -C, --metalink-servers=NUM_SERVERS The number of servers to connect to\n"
+"                              simultaneously. If more than one connection "
+"per\n"
+"                              server is required, use -s option.\n"
+"                              Default: 15"
+msgstr ""
+" --follow-torrent=true|false  Setzen dieser Option auf false verhindert die "
+"Nutzung\n"
+"                              des BitTorrent-Modus, selbst wenn der Abruf-"
+"Dateiname \n"
+"                              auf .torrent endet.\n"
+"                              Fehlwert: true"
+
+#: src/main.cc:231
+msgid " --metalink-version=VERSION   The version of file to download."
+msgstr ""
+
+#: src/main.cc:232
+msgid " --metalink-language=LANGUAGE The language of file to download."
+msgstr ""
+
+#: src/main.cc:233
+msgid ""
+" --metalink-os=OS             The operating system the file is targeted."
+msgstr ""
+
+#: src/main.cc:234
+#, fuzzy
+msgid ""
+" --follow-metalink=true|false  Setting this option to false prevents aria2 "
+"to\n"
+"                              enter Metalink mode even if the filename of\n"
+"                              downloaded file ends with .metalink.\n"
+"                              Default: true"
+msgstr ""
+" --follow-torrent=true|false  Setzen dieser Option auf false verhindert die "
+"Nutzung\n"
+"                              des BitTorrent-Modus, selbst wenn der Abruf-"
+"Dateiname \n"
+"                              auf .torrent endet.\n"
+"                              Fehlwert: true"
+
+#: src/main.cc:239
 msgid " -v, --version                Print the version number and exit."
 msgid " -v, --version                Print the version number and exit."
 msgstr " -v, --version                Versionsnummer ausgeben und beenden."
 msgstr " -v, --version                Versionsnummer ausgeben und beenden."
 
 
-#: src/main.cc:225
+#: src/main.cc:240
 msgid " -h, --help                   Print this message and exit."
 msgid " -h, --help                   Print this message and exit."
 msgstr " -h, --help                   Diese Anzeige ausgeben und beenden."
 msgstr " -h, --help                   Diese Anzeige ausgeben und beenden."
 
 
-#: src/main.cc:228
+#: src/main.cc:243
 msgid ""
 msgid ""
 " You can specify multiple URLs. All URLs must point to the same file\n"
 " You can specify multiple URLs. All URLs must point to the same file\n"
 " or downloading fails."
 " or downloading fails."
@@ -703,7 +758,7 @@ msgstr ""
 "verweisen\n"
 "verweisen\n"
 "oder der Abruf schlägt fehl."
 "oder der Abruf schlägt fehl."
 
 
-#: src/main.cc:233
+#: src/main.cc:248
 msgid ""
 msgid ""
 " Specify files in multi-file torrent to download. Use conjunction with\n"
 " Specify files in multi-file torrent to download. Use conjunction with\n"
 " -T option. This arguments are ignored if you specify --select-file option."
 " -T option. This arguments are ignored if you specify --select-file option."
@@ -713,117 +768,140 @@ msgstr ""
 " -T-Option. Diese Argumente werden ignoriert, wenn sie die Option --select-"
 " -T-Option. Diese Argumente werden ignoriert, wenn sie die Option --select-"
 "file angeben."
 "file angeben."
 
 
-#: src/main.cc:237
+#: src/main.cc:252
 msgid "Examples:"
 msgid "Examples:"
 msgstr "Beispiele:"
 msgstr "Beispiele:"
 
 
-#: src/main.cc:238
+#: src/main.cc:253
 msgid " Download a file by 1 connection:"
 msgid " Download a file by 1 connection:"
 msgstr " Abruf einer Datei über 1 Verbindung:"
 msgstr " Abruf einer Datei über 1 Verbindung:"
 
 
-#: src/main.cc:240
+#: src/main.cc:255
 msgid " Download a file by 2 connections:"
 msgid " Download a file by 2 connections:"
 msgstr " Abruf einer Datei mit 2 Verbindungen:"
 msgstr " Abruf einer Datei mit 2 Verbindungen:"
 
 
-#: src/main.cc:242
+#: src/main.cc:257
 msgid " Download a file by 2 connections, each connects to a different server:"
 msgid " Download a file by 2 connections, each connects to a different server:"
 msgstr ""
 msgstr ""
 " Abruf einer Datei über 2 Verbindungen, jede verbindet zu einem anderen "
 " Abruf einer Datei über 2 Verbindungen, jede verbindet zu einem anderen "
 "Server:"
 "Server:"
 
 
-#: src/main.cc:244
+#: src/main.cc:259
 msgid " You can mix up different protocols:"
 msgid " You can mix up different protocols:"
 msgstr " Sie können verschiedene Protokolle mischen:"
 msgstr " Sie können verschiedene Protokolle mischen:"
 
 
-#: src/main.cc:247
+#: src/main.cc:263
 msgid " Download a torrent:"
 msgid " Download a torrent:"
 msgstr " Einen torrent abrufen:"
 msgstr " Einen torrent abrufen:"
 
 
-#: src/main.cc:249
+#: src/main.cc:265
 msgid " Download a torrent using local .torrent file:"
 msgid " Download a torrent using local .torrent file:"
 msgstr " Einen torrent mit einer lokalen .torrent-Datei abrufen:"
 msgstr " Einen torrent mit einer lokalen .torrent-Datei abrufen:"
 
 
-#: src/main.cc:251
+#: src/main.cc:267
 msgid " Download only selected files:"
 msgid " Download only selected files:"
 msgstr " Nur ausgewählte Dateien abrufen:"
 msgstr " Nur ausgewählte Dateien abrufen:"
 
 
-#: src/main.cc:253
+#: src/main.cc:269
 msgid " Print file listing of .torrent file:"
 msgid " Print file listing of .torrent file:"
 msgstr " Dateiliste einer .torrent-Datei ausgeben:"
 msgstr " Dateiliste einer .torrent-Datei ausgeben:"
 
 
-#: src/main.cc:257
+#: src/main.cc:274
+msgid " Metalink downloading:"
+msgstr ""
+
+#: src/main.cc:276
+#, fuzzy
+msgid " Download a file using local .metalink file:"
+msgstr " Einen torrent mit einer lokalen .torrent-Datei abrufen:"
+
+#: src/main.cc:278
+msgid " Metalink downloading with preferences:"
+msgstr ""
+
+#: src/main.cc:282
 #, c-format
 #, c-format
 msgid "Report bugs to %s"
 msgid "Report bugs to %s"
 msgstr "Fehler an %s melden"
 msgstr "Fehler an %s melden"
 
 
-#: src/main.cc:353
+#: src/main.cc:444
 msgid "unrecognized proxy format"
 msgid "unrecognized proxy format"
 msgstr "nicht erkanntes Proxy-Format"
 msgstr "nicht erkanntes Proxy-Format"
 
 
-#: src/main.cc:380
+#: src/main.cc:471
 msgid "Currently, supported authentication scheme is basic."
 msgid "Currently, supported authentication scheme is basic."
 msgstr "Derzeit unterstütztes Authentifizierungsschema ist basic."
 msgstr "Derzeit unterstütztes Authentifizierungsschema ist basic."
 
 
-#: src/main.cc:389
+#: src/main.cc:480
 msgid "retry-wait must be between 0 and 60."
 msgid "retry-wait must be between 0 and 60."
 msgstr "retry-wait muss zwischen 0 und 60 liegen."
 msgstr "retry-wait muss zwischen 0 und 60 liegen."
 
 
-#: src/main.cc:406
+#: src/main.cc:497
 msgid "ftp-type must be either 'binary' or 'ascii'."
 msgid "ftp-type must be either 'binary' or 'ascii'."
 msgstr "ftp-type muss entweder 'binary' oder 'ascii' sein."
 msgstr "ftp-type muss entweder 'binary' oder 'ascii' sein."
 
 
-#: src/main.cc:415
+#: src/main.cc:506
 msgid "ftp-via-http-proxy must be either 'get' or 'tunnel'."
 msgid "ftp-via-http-proxy must be either 'get' or 'tunnel'."
 msgstr "ftp-via-http-proxy muss entweder 'get' oder 'tunnel' sein."
 msgstr "ftp-via-http-proxy muss entweder 'get' oder 'tunnel' sein."
 
 
-#: src/main.cc:433
+#: src/main.cc:524
 msgid "min-segment-size invalid"
 msgid "min-segment-size invalid"
 msgstr "min-segment-size ungültig"
 msgstr "min-segment-size ungültig"
 
 
-#: src/main.cc:444
+#: src/main.cc:535
 msgid "http-proxy-method must be either 'get' or 'tunnel'."
 msgid "http-proxy-method must be either 'get' or 'tunnel'."
 msgstr "http-proxy-method muss entweder 'get' oder 'tunnel' sein."
 msgstr "http-proxy-method muss entweder 'get' oder 'tunnel' sein."
 
 
-#: src/main.cc:452
+#: src/main.cc:543
 msgid "listen-port must be between 1024 and 65535."
 msgid "listen-port must be between 1024 and 65535."
 msgstr "listen-port muss zwischen 1024 und 65535 liegen."
 msgstr "listen-port muss zwischen 1024 und 65535 liegen."
 
 
-#: src/main.cc:463
+#: src/main.cc:554
 msgid "follow-torrent must be either 'true' or 'false'."
 msgid "follow-torrent must be either 'true' or 'false'."
 msgstr "follow-torrent muss entweder 'true' oder 'false' sein."
 msgstr "follow-torrent muss entweder 'true' oder 'false' sein."
 
 
-#: src/main.cc:477
+#: src/main.cc:568
 msgid "direct-file-mapping must be either 'true' or 'false'."
 msgid "direct-file-mapping must be either 'true' or 'false'."
 msgstr "direct-file-mapping muss entweder 'true' oder 'false' sein."
 msgstr "direct-file-mapping muss entweder 'true' oder 'false' sein."
 
 
-#: src/main.cc:485
+#: src/main.cc:576
 msgid "upload-limit must be greater than or equal to 0."
 msgid "upload-limit must be greater than or equal to 0."
 msgstr "upload-limit muss größer oder gleich 0 sein."
 msgstr "upload-limit muss größer oder gleich 0 sein."
 
 
-#: src/main.cc:517
+#: src/main.cc:601
+#, fuzzy
+msgid "follow-metalink must be either 'true' or 'false'."
+msgstr "follow-torrent muss entweder 'true' oder 'false' sein."
+
+#: src/main.cc:628
 msgid "split must be between 1 and 5."
 msgid "split must be between 1 and 5."
 msgstr "split muss zwischen 1 und 5 liegen."
 msgstr "split muss zwischen 1 und 5 liegen."
 
 
-#: src/main.cc:527
+#: src/main.cc:638
 msgid "timeout must be between 1 and 600"
 msgid "timeout must be between 1 and 600"
 msgstr "timeout muss zwischen 1 und 600 liegen."
 msgstr "timeout muss zwischen 1 und 600 liegen."
 
 
-#: src/main.cc:536
+#: src/main.cc:647
 msgid "max-tries invalid"
 msgid "max-tries invalid"
 msgstr "max-tries ungültig"
 msgstr "max-tries ungültig"
 
 
-#: src/main.cc:565
+#: src/main.cc:669
+#, fuzzy
+msgid "metalink-servers must be greater than 0."
+msgstr "upload-limit muss größer oder gleich 0 sein."
+
+#: src/main.cc:687
 msgid "specify at least one URL"
 msgid "specify at least one URL"
 msgstr "Geben Sie zumindest eine URL an"
 msgstr "Geben Sie zumindest eine URL an"
 
 
-#: src/main.cc:572
+#: src/main.cc:694
 msgid "daemon failed"
 msgid "daemon failed"
 msgstr "Daemon-Start nicht erfolgreich"
 msgstr "Daemon-Start nicht erfolgreich"
 
 
-#: src/main.cc:673
+#: src/main.cc:831
 msgid "Files:"
 msgid "Files:"
 msgstr "Dateien:"
 msgstr "Dateien:"
 
 
-#: src/main.cc:704
+#: src/main.cc:862
 msgid "Errors occurred while binding port.\n"
 msgid "Errors occurred while binding port.\n"
 msgstr "Fehler beim Binden an Port aufgetreten.\n"
 msgstr "Fehler beim Binden an Port aufgetreten.\n"

二进制
po/ja.gmo


+ 149 - 75
po/ja.po

@@ -7,8 +7,8 @@ msgid ""
 msgstr ""
 msgstr ""
 "Project-Id-Version: aria2c 0.2.1\n"
 "Project-Id-Version: aria2c 0.2.1\n"
 "Report-Msgid-Bugs-To: http://aria2.sourceforge.net/\n"
 "Report-Msgid-Bugs-To: http://aria2.sourceforge.net/\n"
-"POT-Creation-Date: 2006-05-27 00:27+0900\n"
-"PO-Revision-Date: 2006-05-27 00:25+0900\n"
+"POT-Creation-Date: 2006-07-04 01:30+0900\n"
+"PO-Revision-Date: 2006-07-04 01:41+0900\n"
 "Last-Translator: Tatsuhiro Tsujikawa <tujikawa@rednoah.com>\n"
 "Last-Translator: Tatsuhiro Tsujikawa <tujikawa@rednoah.com>\n"
 "Language-Team: Japanese <ja@li.org>\n"
 "Language-Team: Japanese <ja@li.org>\n"
 "MIME-Version: 1.0\n"
 "MIME-Version: 1.0\n"
@@ -341,7 +341,7 @@ msgstr "
 msgid "Failed to peek data, cause: %s"
 msgid "Failed to peek data, cause: %s"
 msgstr "データの peek に失敗しました. 原因: %s"
 msgstr "データの peek に失敗しました. 原因: %s"
 
 
-#: src/main.cc:65
+#: src/main.cc:76
 #, c-format
 #, c-format
 msgid ""
 msgid ""
 "\n"
 "\n"
@@ -350,7 +350,7 @@ msgstr ""
 "\n"
 "\n"
 "<%s> のダウンロードが完了しました.\n"
 "<%s> のダウンロードが完了しました.\n"
 
 
-#: src/main.cc:73
+#: src/main.cc:84
 msgid ""
 msgid ""
 "\n"
 "\n"
 "The download was not complete because of errors. Check the log.\n"
 "The download was not complete because of errors. Check the log.\n"
@@ -358,7 +358,7 @@ msgstr ""
 "\n"
 "\n"
 "ダウンロードはエラーのため完了していません. ログを確認してください.\n"
 "ダウンロードはエラーのため完了していません. ログを確認してください.\n"
 
 
-#: src/main.cc:88
+#: src/main.cc:101
 msgid ""
 msgid ""
 "\n"
 "\n"
 "stopping application...\n"
 "stopping application...\n"
@@ -366,22 +366,22 @@ msgstr ""
 "\n"
 "\n"
 "アプリケーションを終了しています...\n"
 "アプリケーションを終了しています...\n"
 
 
-#: src/main.cc:94
+#: src/main.cc:107
 msgid "done\n"
 msgid "done\n"
 msgstr "完了\n"
 msgstr "完了\n"
 
 
-#: src/main.cc:125
+#: src/main.cc:123
 #, c-format
 #, c-format
 msgid "Unrecognized URL or unsupported protocol: %s\n"
 msgid "Unrecognized URL or unsupported protocol: %s\n"
 msgstr ""
 msgstr ""
 "%s は, 理解できない URL フォーマット, または, サポートされないプロトコルで"
 "%s は, 理解できない URL フォーマット, または, サポートされないプロトコルで"
 "す.\n"
 "す.\n"
 
 
-#: src/main.cc:131
+#: src/main.cc:129
 msgid " version "
 msgid " version "
 msgstr " バージョン "
 msgstr " バージョン "
 
 
-#: src/main.cc:135
+#: src/main.cc:133
 msgid ""
 msgid ""
 "This program is free software; you can redistribute it and/or modify\n"
 "This program is free software; you can redistribute it and/or modify\n"
 "it under the terms of the GNU General Public License as published by\n"
 "it under the terms of the GNU General Public License as published by\n"
@@ -411,36 +411,41 @@ msgstr ""
 "along with this program; if not, write to the Free Software\n"
 "along with this program; if not, write to the Free Software\n"
 "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n"
 "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n"
 
 
-#: src/main.cc:149
+#: src/main.cc:147
 #, c-format
 #, c-format
 msgid "Contact Info: %s\n"
 msgid "Contact Info: %s\n"
 msgstr "連絡先: %s\n"
 msgstr "連絡先: %s\n"
 
 
-#: src/main.cc:155
+#: src/main.cc:153
 #, c-format
 #, c-format
 msgid "Usage: %s [options] URL ...\n"
 msgid "Usage: %s [options] URL ...\n"
 msgstr "使い方: %s [オプション] URL ...\n"
 msgstr "使い方: %s [オプション] URL ...\n"
 
 
-#: src/main.cc:157
+#: src/main.cc:155
 #, c-format
 #, c-format
 msgid "       %s [options] -T TORRENT_FILE FILE ...\n"
 msgid "       %s [options] -T TORRENT_FILE FILE ...\n"
 msgstr "        %s [オプション] -T TORRENT_FILE FILE ...\n"
 msgstr "        %s [オプション] -T TORRENT_FILE FILE ...\n"
 
 
-#: src/main.cc:160
+#: src/main.cc:158
+#, c-format
+msgid "       %s [options] -M METALINK_FILE\n"
+msgstr "        %s [オプション] -M METALINK_FILE\n"
+
+#: src/main.cc:161
 msgid "Options:"
 msgid "Options:"
 msgstr "オプション:"
 msgstr "オプション:"
 
 
-#: src/main.cc:161
+#: src/main.cc:162
 msgid " -d, --dir=DIR                The directory to store downloaded file."
 msgid " -d, --dir=DIR                The directory to store downloaded file."
 msgstr ""
 msgstr ""
 " -d, --dir=DIR                ダウンロードしたファイルを保存するディレクトリ."
 " -d, --dir=DIR                ダウンロードしたファイルを保存するディレクトリ."
 
 
-#: src/main.cc:162
+#: src/main.cc:163
 msgid " -o, --out=FILE               The file name for downloaded file."
 msgid " -o, --out=FILE               The file name for downloaded file."
 msgstr ""
 msgstr ""
 " -o, --out=FILE               ダウンロードしたファイルの保存先ファイル名."
 " -o, --out=FILE               ダウンロードしたファイルの保存先ファイル名."
 
 
-#: src/main.cc:163
+#: src/main.cc:164
 msgid ""
 msgid ""
 " -l, --log=LOG                The file path to store log. If '-' is "
 " -l, --log=LOG                The file path to store log. If '-' is "
 "specified,\n"
 "specified,\n"
@@ -450,11 +455,11 @@ msgstr ""
 "力\n"
 "力\n"
 "                              に出力します."
 "                              に出力します."
 
 
-#: src/main.cc:165
+#: src/main.cc:166
 msgid " -D, --daemon                 Run as daemon."
 msgid " -D, --daemon                 Run as daemon."
 msgstr " -D, --daemon                 デーモンとして起動します."
 msgstr " -D, --daemon                 デーモンとして起動します."
 
 
-#: src/main.cc:166
+#: src/main.cc:167
 msgid ""
 msgid ""
 " -s, --split=N                Download a file using N connections. N must "
 " -s, --split=N                Download a file using N connections. N must "
 "be\n"
 "be\n"
@@ -473,7 +478,7 @@ msgstr ""
 "ショ\n"
 "ショ\n"
 "                              ンを確立します."
 "                              ンを確立します."
 
 
-#: src/main.cc:170
+#: src/main.cc:171
 msgid ""
 msgid ""
 " --retry-wait=SEC             Set amount of time in second between requests\n"
 " --retry-wait=SEC             Set amount of time in second between requests\n"
 "                              for errors. Specify a value between 0 and 60.\n"
 "                              for errors. Specify a value between 0 and 60.\n"
@@ -484,13 +489,13 @@ msgstr ""
 "                              す. 0 - 60 の値を指定してください.\n"
 "                              す. 0 - 60 の値を指定してください.\n"
 "                              デフォルト値: 5"
 "                              デフォルト値: 5"
 
 
-#: src/main.cc:173
+#: src/main.cc:174
 msgid " -t, --timeout=SEC            Set timeout in second. Default: 60"
 msgid " -t, --timeout=SEC            Set timeout in second. Default: 60"
 msgstr ""
 msgstr ""
 " -t, --timeout=SEC            タイムアウトとなる時間を秒で指定します.\n"
 " -t, --timeout=SEC            タイムアウトとなる時間を秒で指定します.\n"
 "                              デフォルト値: 60"
 "                              デフォルト値: 60"
 
 
-#: src/main.cc:174
+#: src/main.cc:175
 msgid ""
 msgid ""
 " -m, --max-tries=N            Set number of tries. 0 means unlimited.\n"
 " -m, --max-tries=N            Set number of tries. 0 means unlimited.\n"
 "                              Default: 5"
 "                              Default: 5"
@@ -499,7 +504,7 @@ msgstr ""
 "行\n"
 "行\n"
 "                              します. デフォルト値: 5"
 "                              します. デフォルト値: 5"
 
 
-#: src/main.cc:176
+#: src/main.cc:177
 msgid ""
 msgid ""
 " --min-segment-size=SIZE[K|M] Set minimum segment size. You can append\n"
 " --min-segment-size=SIZE[K|M] Set minimum segment size. You can append\n"
 "                              K or M(1K = 1024, 1M = 1024K). This\n"
 "                              K or M(1K = 1024, 1M = 1024K). This\n"
@@ -512,7 +517,7 @@ msgstr ""
 "1024K).\n"
 "1024K).\n"
 "                              1024 以上の値を指定してください."
 "                              1024 以上の値を指定してください."
 
 
-#: src/main.cc:180
+#: src/main.cc:181
 msgid ""
 msgid ""
 " --http-proxy=HOST:PORT       Use HTTP proxy server. This affects to all\n"
 " --http-proxy=HOST:PORT       Use HTTP proxy server. This affects to all\n"
 "                              URLs."
 "                              URLs."
@@ -521,14 +526,14 @@ msgstr ""
 "シ\n"
 "シ\n"
 "                              ョンはすべての URL に影響します."
 "                              ョンはすべての URL に影響します."
 
 
-#: src/main.cc:182
+#: src/main.cc:183
 msgid " --http-user=USER             Set HTTP user. This affects to all URLs."
 msgid " --http-user=USER             Set HTTP user. This affects to all URLs."
 msgstr ""
 msgstr ""
 " --http-user=USER             HTTP での認証ユーザーを指定します. このオプショ"
 " --http-user=USER             HTTP での認証ユーザーを指定します. このオプショ"
 "ン\n"
 "ン\n"
 "                              はすべての URL に影響します."
 "                              はすべての URL に影響します."
 
 
-#: src/main.cc:183
+#: src/main.cc:184
 msgid ""
 msgid ""
 " --http-passwd=PASSWD         Set HTTP password. This affects to all URLs."
 " --http-passwd=PASSWD         Set HTTP password. This affects to all URLs."
 msgstr ""
 msgstr ""
@@ -536,7 +541,7 @@ msgstr ""
 "ショ\n"
 "ショ\n"
 "                              ンはすべての URL に影響します."
 "                              ンはすべての URL に影響します."
 
 
-#: src/main.cc:184
+#: src/main.cc:185
 msgid ""
 msgid ""
 " --http-proxy-user=USER       Set HTTP proxy user. This affects to all URLs"
 " --http-proxy-user=USER       Set HTTP proxy user. This affects to all URLs"
 msgstr ""
 msgstr ""
@@ -546,7 +551,7 @@ msgstr ""
 "ま\n"
 "ま\n"
 "                              す."
 "                              す."
 
 
-#: src/main.cc:185
+#: src/main.cc:186
 msgid ""
 msgid ""
 " --http-proxy-passwd=PASSWD   Set HTTP proxy password. This affects to all "
 " --http-proxy-passwd=PASSWD   Set HTTP proxy password. This affects to all "
 "URLs."
 "URLs."
@@ -557,7 +562,7 @@ msgstr ""
 "し\n"
 "し\n"
 "                              ます."
 "                              ます."
 
 
-#: src/main.cc:186
+#: src/main.cc:187
 msgid ""
 msgid ""
 " --http-proxy-method=METHOD   Set the method to use in proxy request.\n"
 " --http-proxy-method=METHOD   Set the method to use in proxy request.\n"
 "                              METHOD is either 'get' or 'tunnel'.\n"
 "                              METHOD is either 'get' or 'tunnel'.\n"
@@ -568,7 +573,7 @@ msgstr ""
 "                              す. 'get' または 'tunnel' を指定してください.\n"
 "                              す. 'get' または 'tunnel' を指定してください.\n"
 "                              デフォルト値: tunnel"
 "                              デフォルト値: tunnel"
 
 
-#: src/main.cc:189
+#: src/main.cc:190
 msgid ""
 msgid ""
 " --http-auth-scheme=SCHEME    Set HTTP authentication scheme. Currently, "
 " --http-auth-scheme=SCHEME    Set HTTP authentication scheme. Currently, "
 "basic\n"
 "basic\n"
@@ -580,14 +585,14 @@ msgstr ""
 "                              いるのは basic です. \n"
 "                              いるのは basic です. \n"
 "                              デフォルト値: basic"
 "                              デフォルト値: basic"
 
 
-#: src/main.cc:192
+#: src/main.cc:193
 msgid " --referer=REFERER            Set Referer. This affects to all URLs."
 msgid " --referer=REFERER            Set Referer. This affects to all URLs."
 msgstr ""
 msgstr ""
 " --referer=REFERER            リファラーを指定します. このオプションはすべて"
 " --referer=REFERER            リファラーを指定します. このオプションはすべて"
 "の\n"
 "の\n"
 "                               URL に影響します."
 "                               URL に影響します."
 
 
-#: src/main.cc:193
+#: src/main.cc:194
 msgid ""
 msgid ""
 " --ftp-user=USER              Set FTP user. This affects to all URLs.\n"
 " --ftp-user=USER              Set FTP user. This affects to all URLs.\n"
 "                              Default: anonymous"
 "                              Default: anonymous"
@@ -597,7 +602,7 @@ msgstr ""
 "                              はすべての URL に影響します.\n"
 "                              はすべての URL に影響します.\n"
 "                              デフォルト値: anonymous"
 "                              デフォルト値: anonymous"
 
 
-#: src/main.cc:195
+#: src/main.cc:196
 msgid ""
 msgid ""
 " --ftp-passwd=PASSWD          Set FTP password. This affects to all URLs.\n"
 " --ftp-passwd=PASSWD          Set FTP password. This affects to all URLs.\n"
 "                              Default: ARIA2USER@"
 "                              Default: ARIA2USER@"
@@ -607,7 +612,7 @@ msgstr ""
 "                              ンはすべての URL に影響します.\n"
 "                              ンはすべての URL に影響します.\n"
 "                              デフォルト値: ARIA2USER@"
 "                              デフォルト値: ARIA2USER@"
 
 
-#: src/main.cc:197
+#: src/main.cc:198
 msgid ""
 msgid ""
 " --ftp-type=TYPE              Set FTP transfer type. TYPE is either "
 " --ftp-type=TYPE              Set FTP transfer type. TYPE is either "
 "'binary'\n"
 "'binary'\n"
@@ -618,11 +623,11 @@ msgstr ""
 "                              'ascii' を指定してください. デフォルト値: "
 "                              'ascii' を指定してください. デフォルト値: "
 "binary"
 "binary"
 
 
-#: src/main.cc:200
+#: src/main.cc:201
 msgid " -p, --ftp-pasv               Use passive mode in FTP."
 msgid " -p, --ftp-pasv               Use passive mode in FTP."
 msgstr " -p, --ftp-pasv               FTP で passive モードを使用します."
 msgstr " -p, --ftp-pasv               FTP で passive モードを使用します."
 
 
-#: src/main.cc:201
+#: src/main.cc:202
 msgid ""
 msgid ""
 " --ftp-via-http-proxy=METHOD  Use HTTP proxy in FTP. METHOD is either 'get' "
 " --ftp-via-http-proxy=METHOD  Use HTTP proxy in FTP. METHOD is either 'get' "
 "or\n"
 "or\n"
@@ -635,11 +640,11 @@ msgstr ""
 "く\n"
 "く\n"
 "                              ださい. デフォルト値: tunnel"
 "                              ださい. デフォルト値: tunnel"
 
 
-#: src/main.cc:205
+#: src/main.cc:206
 msgid " -T, --torrent-file=TORRENT_FILE  The file path to .torrent file."
 msgid " -T, --torrent-file=TORRENT_FILE  The file path to .torrent file."
 msgstr " -T, --torrent-file=TORRENT_FILE  .torrent ファイルのパスを指定."
 msgstr " -T, --torrent-file=TORRENT_FILE  .torrent ファイルのパスを指定."
 
 
-#: src/main.cc:206
+#: src/main.cc:207
 msgid ""
 msgid ""
 " --follow-torrent=true|false  Setting this option to false prevents aria2 "
 " --follow-torrent=true|false  Setting this option to false prevents aria2 "
 "to\n"
 "to\n"
@@ -654,7 +659,7 @@ msgstr ""
 "                              は, BitTorrent モードに入りません.\n"
 "                              は, BitTorrent モードに入りません.\n"
 "                              デフォルト値: true"
 "                              デフォルト値: true"
 
 
-#: src/main.cc:210
+#: src/main.cc:211
 msgid ""
 msgid ""
 " -S, --show-files             Print file listing of .torrent file and exit."
 " -S, --show-files             Print file listing of .torrent file and exit."
 msgstr ""
 msgstr ""
@@ -662,7 +667,7 @@ msgstr ""
 "し\n"
 "し\n"
 "                              終了します."
 "                              終了します."
 
 
-#: src/main.cc:211
+#: src/main.cc:212
 msgid ""
 msgid ""
 " --direct-file-mapping=true|false Directly read from and write to each file\n"
 " --direct-file-mapping=true|false Directly read from and write to each file\n"
 "                              mentioned in .torrent file.\n"
 "                              mentioned in .torrent file.\n"
@@ -673,14 +678,14 @@ msgstr ""
 "                              します.\n"
 "                              します.\n"
 "                              デフォルト値: true"
 "                              デフォルト値: true"
 
 
-#: src/main.cc:214
+#: src/main.cc:215
 msgid ""
 msgid ""
 " --listen-port=PORT           Set port number to listen to for peer "
 " --listen-port=PORT           Set port number to listen to for peer "
 "connection."
 "connection."
 msgstr ""
 msgstr ""
 " --listen-port=PORT           ピアからの接続を受け付けるポート番号を指定."
 " --listen-port=PORT           ピアからの接続を受け付けるポート番号を指定."
 
 
-#: src/main.cc:215
+#: src/main.cc:216
 msgid ""
 msgid ""
 " --upload-limit=SPEED         Set upload speed limit in KB/sec. aria2 tries "
 " --upload-limit=SPEED         Set upload speed limit in KB/sec. aria2 tries "
 "to\n"
 "to\n"
@@ -693,7 +698,7 @@ msgstr ""
 "し\n"
 "し\n"
 "                               ます. 0 は速度無制限を意味します."
 "                               ます. 0 は速度無制限を意味します."
 
 
-#: src/main.cc:217
+#: src/main.cc:218
 msgid ""
 msgid ""
 " --select-file=INDEX...       Set file to download by specifing its index.\n"
 " --select-file=INDEX...       Set file to download by specifing its index.\n"
 "                              You can know file index through --show-files\n"
 "                              You can know file index through --show-files\n"
@@ -714,16 +719,65 @@ msgstr ""
 "                              また, '-' を使って範囲指定もできます: \"1-5\"\n"
 "                              また, '-' を使って範囲指定もできます: \"1-5\"\n"
 "                              ',' と '-' は組み合わせて使うことができます."
 "                              ',' と '-' は組み合わせて使うことができます."
 
 
-#: src/main.cc:224
+#: src/main.cc:226
+msgid " -M, --metalink-file=METALINK_FILE The file path to .metalink file."
+msgstr " -M, --metalink-file=METALINK_FILE .metalink ファイルのパスを指定."
+
+#: src/main.cc:227
+msgid ""
+" -C, --metalink-servers=NUM_SERVERS The number of servers to connect to\n"
+"                              simultaneously. If more than one connection "
+"per\n"
+"                              server is required, use -s option.\n"
+"                              Default: 15"
+msgstr ""
+" -C, --metalink-servers=NUM_SERVERS 同時に接続するサーバの数を指定します.\n"
+"                              1 サーバに複数の接続が必要ならば, -s オプション"
+"を\n"
+"                              使用してください.\n"
+"                              デフォルト値: 15"
+
+#: src/main.cc:231
+msgid " --metalink-version=VERSION   The version of file to download."
+msgstr " --metalink-version=VERSION   ダウンロードするファイルのバージョン."
+
+#: src/main.cc:232
+msgid " --metalink-language=LANGUAGE The language of file to download."
+msgstr " --metalink-language=LANGUAGE ダウンロードするファイルの言語."
+
+#: src/main.cc:233
+msgid ""
+" --metalink-os=OS             The operating system the file is targeted."
+msgstr ""
+" --metalink-os=OS             ダウンロードするファイルがターゲットとするオペ"
+"レー\n"
+"                              ティング・システム."
+
+#: src/main.cc:234
+msgid ""
+" --follow-metalink=true|false  Setting this option to false prevents aria2 "
+"to\n"
+"                              enter Metalink mode even if the filename of\n"
+"                              downloaded file ends with .metalink.\n"
+"                              Default: true"
+msgstr ""
+" --follow-metalink=true|false  このオプションを false に設定すると, ダウン"
+"ロード\n"
+"                              したファイルの拡張子が .metalink であっても, "
+"aria2\n"
+"                              は, Metalink モードに入りません.\n"
+"                              デフォルト値: true"
+
+#: src/main.cc:239
 msgid " -v, --version                Print the version number and exit."
 msgid " -v, --version                Print the version number and exit."
 msgstr " -v, --version                バージョン番号を表示し, 終了します."
 msgstr " -v, --version                バージョン番号を表示し, 終了します."
 
 
-#: src/main.cc:225
+#: src/main.cc:240
 msgid " -h, --help                   Print this message and exit."
 msgid " -h, --help                   Print this message and exit."
 msgstr ""
 msgstr ""
 " -h, --help                   このヘルプメッセージを表示し, 終了します."
 " -h, --help                   このヘルプメッセージを表示し, 終了します."
 
 
-#: src/main.cc:228
+#: src/main.cc:243
 msgid ""
 msgid ""
 " You can specify multiple URLs. All URLs must point to the same file\n"
 " You can specify multiple URLs. All URLs must point to the same file\n"
 " or downloading fails."
 " or downloading fails."
@@ -732,7 +786,7 @@ msgstr ""
 "れ\n"
 "れ\n"
 " ばなりません. さもなくばダウンロードは失敗します."
 " ばなりません. さもなくばダウンロードは失敗します."
 
 
-#: src/main.cc:233
+#: src/main.cc:248
 msgid ""
 msgid ""
 " Specify files in multi-file torrent to download. Use conjunction with\n"
 " Specify files in multi-file torrent to download. Use conjunction with\n"
 " -T option. This arguments are ignored if you specify --select-file option."
 " -T option. This arguments are ignored if you specify --select-file option."
@@ -741,115 +795,135 @@ msgstr ""
 "ン\n"
 "ン\n"
 " と共に使用します. --select-file オプションと併用はできません."
 " と共に使用します. --select-file オプションと併用はできません."
 
 
-#: src/main.cc:237
+#: src/main.cc:252
 msgid "Examples:"
 msgid "Examples:"
 msgstr "例:"
 msgstr "例:"
 
 
-#: src/main.cc:238
+#: src/main.cc:253
 msgid " Download a file by 1 connection:"
 msgid " Download a file by 1 connection:"
 msgstr " 1 コネクションでのダウンロード:"
 msgstr " 1 コネクションでのダウンロード:"
 
 
-#: src/main.cc:240
+#: src/main.cc:255
 msgid " Download a file by 2 connections:"
 msgid " Download a file by 2 connections:"
 msgstr " 2 コネクションでのダウンロード:"
 msgstr " 2 コネクションでのダウンロード:"
 
 
-#: src/main.cc:242
+#: src/main.cc:257
 msgid " Download a file by 2 connections, each connects to a different server:"
 msgid " Download a file by 2 connections, each connects to a different server:"
 msgstr " 二つの異なるサーバーに接続してダウンロード:"
 msgstr " 二つの異なるサーバーに接続してダウンロード:"
 
 
-#: src/main.cc:244
+#: src/main.cc:259
 msgid " You can mix up different protocols:"
 msgid " You can mix up different protocols:"
 msgstr " 異なるプロトコルを混合させてダウンロード:"
 msgstr " 異なるプロトコルを混合させてダウンロード:"
 
 
-#: src/main.cc:247
+#: src/main.cc:263
 msgid " Download a torrent:"
 msgid " Download a torrent:"
-msgstr "torrent をダウンロード:"
+msgstr " torrent をダウンロード:"
 
 
-#: src/main.cc:249
+#: src/main.cc:265
 msgid " Download a torrent using local .torrent file:"
 msgid " Download a torrent using local .torrent file:"
 msgstr " ローカル .torrent ファイルを使ってダウンロード:"
 msgstr " ローカル .torrent ファイルを使ってダウンロード:"
 
 
-#: src/main.cc:251
+#: src/main.cc:267
 msgid " Download only selected files:"
 msgid " Download only selected files:"
 msgstr " ファイルを指定してダウンロード:"
 msgstr " ファイルを指定してダウンロード:"
 
 
-#: src/main.cc:253
+#: src/main.cc:269
 msgid " Print file listing of .torrent file:"
 msgid " Print file listing of .torrent file:"
 msgstr " この .torrent ファイルに含まれるファイルリストを表示:"
 msgstr " この .torrent ファイルに含まれるファイルリストを表示:"
 
 
-#: src/main.cc:257
+#: src/main.cc:274
+msgid " Metalink downloading:"
+msgstr " Metalink でダウンロード:"
+
+#: src/main.cc:276
+msgid " Download a file using local .metalink file:"
+msgstr " ローカル .metalink ファイルを使ってダウンロード:"
+
+#: src/main.cc:278
+msgid " Metalink downloading with preferences:"
+msgstr " ユーザ設定による Metalink ダウンロード:"
+
+#: src/main.cc:282
 #, c-format
 #, c-format
 msgid "Report bugs to %s"
 msgid "Report bugs to %s"
 msgstr "バグレポートはこちらへ: %s"
 msgstr "バグレポートはこちらへ: %s"
 
 
-#: src/main.cc:353
+#: src/main.cc:444
 msgid "unrecognized proxy format"
 msgid "unrecognized proxy format"
 msgstr "理解できないProxyフォーマットです."
 msgstr "理解できないProxyフォーマットです."
 
 
-#: src/main.cc:380
+#: src/main.cc:471
 msgid "Currently, supported authentication scheme is basic."
 msgid "Currently, supported authentication scheme is basic."
 msgstr "現在サポートされている認証方法は basic です."
 msgstr "現在サポートされている認証方法は basic です."
 
 
-#: src/main.cc:389
+#: src/main.cc:480
 msgid "retry-wait must be between 0 and 60."
 msgid "retry-wait must be between 0 and 60."
 msgstr "retry-wait は 0 から 60 の間で指定してください."
 msgstr "retry-wait は 0 から 60 の間で指定してください."
 
 
-#: src/main.cc:406
+#: src/main.cc:497
 msgid "ftp-type must be either 'binary' or 'ascii'."
 msgid "ftp-type must be either 'binary' or 'ascii'."
 msgstr "ftp-type は 'binary' または 'ascii' を指定してください."
 msgstr "ftp-type は 'binary' または 'ascii' を指定してください."
 
 
-#: src/main.cc:415
+#: src/main.cc:506
 msgid "ftp-via-http-proxy must be either 'get' or 'tunnel'."
 msgid "ftp-via-http-proxy must be either 'get' or 'tunnel'."
 msgstr "ftp-via-http-proxy は 'get' または 'tunnel' を指定してください."
 msgstr "ftp-via-http-proxy は 'get' または 'tunnel' を指定してください."
 
 
-#: src/main.cc:433
+#: src/main.cc:524
 msgid "min-segment-size invalid"
 msgid "min-segment-size invalid"
 msgstr "min-segment-size が不正です."
 msgstr "min-segment-size が不正です."
 
 
-#: src/main.cc:444
+#: src/main.cc:535
 msgid "http-proxy-method must be either 'get' or 'tunnel'."
 msgid "http-proxy-method must be either 'get' or 'tunnel'."
 msgstr "http-proxy-method は 'get' または 'tunnel' を指定してください."
 msgstr "http-proxy-method は 'get' または 'tunnel' を指定してください."
 
 
-#: src/main.cc:452
+#: src/main.cc:543
 msgid "listen-port must be between 1024 and 65535."
 msgid "listen-port must be between 1024 and 65535."
 msgstr "listen-port は 1024 - 65535 の値を指定してください."
 msgstr "listen-port は 1024 - 65535 の値を指定してください."
 
 
-#: src/main.cc:463
+#: src/main.cc:554
 msgid "follow-torrent must be either 'true' or 'false'."
 msgid "follow-torrent must be either 'true' or 'false'."
 msgstr "follow-torrent は 'true' または 'false を指定してください."
 msgstr "follow-torrent は 'true' または 'false を指定してください."
 
 
-#: src/main.cc:477
+#: src/main.cc:568
 msgid "direct-file-mapping must be either 'true' or 'false'."
 msgid "direct-file-mapping must be either 'true' or 'false'."
 msgstr "direct-file-mapping は 'true' または 'false を指定してください."
 msgstr "direct-file-mapping は 'true' または 'false を指定してください."
 
 
-#: src/main.cc:485
+#: src/main.cc:576
 msgid "upload-limit must be greater than or equal to 0."
 msgid "upload-limit must be greater than or equal to 0."
 msgstr "upload-limit は 0 以上の数を指定してください."
 msgstr "upload-limit は 0 以上の数を指定してください."
 
 
-#: src/main.cc:517
+#: src/main.cc:601
+msgid "follow-metalink must be either 'true' or 'false'."
+msgstr "follow-metalink は 'true' または 'false を指定してください."
+
+#: src/main.cc:628
 msgid "split must be between 1 and 5."
 msgid "split must be between 1 and 5."
 msgstr "split は 1 - 5 の値を指定してください."
 msgstr "split は 1 - 5 の値を指定してください."
 
 
-#: src/main.cc:527
+#: src/main.cc:638
 msgid "timeout must be between 1 and 600"
 msgid "timeout must be between 1 and 600"
 msgstr "timeout は 1 - 600 の値を指定してください."
 msgstr "timeout は 1 - 600 の値を指定してください."
 
 
-#: src/main.cc:536
+#: src/main.cc:647
 msgid "max-tries invalid"
 msgid "max-tries invalid"
 msgstr "max-tries が不正です."
 msgstr "max-tries が不正です."
 
 
-#: src/main.cc:565
+#: src/main.cc:669
+msgid "metalink-servers must be greater than 0."
+msgstr "metalink-servers は 0 以上の数を指定してください."
+
+#: src/main.cc:687
 msgid "specify at least one URL"
 msgid "specify at least one URL"
 msgstr "一個以上の URL を指定してください."
 msgstr "一個以上の URL を指定してください."
 
 
-#: src/main.cc:572
+#: src/main.cc:694
 msgid "daemon failed"
 msgid "daemon failed"
 msgstr "デーモン起動に失敗"
 msgstr "デーモン起動に失敗"
 
 
-#: src/main.cc:673
+#: src/main.cc:831
 msgid "Files:"
 msgid "Files:"
 msgstr "ファイル:"
 msgstr "ファイル:"
 
 
-#: src/main.cc:704
+#: src/main.cc:862
 msgid "Errors occurred while binding port.\n"
 msgid "Errors occurred while binding port.\n"
 msgstr "ポートをバインド中にエラーが発生しました.\n"
 msgstr "ポートをバインド中にエラーが発生しました.\n"

+ 6 - 6
src/AbstractDiskWriter.cc

@@ -31,17 +31,17 @@
 #include <fcntl.h>
 #include <fcntl.h>
 
 
 AbstractDiskWriter::AbstractDiskWriter():fd(0) {
 AbstractDiskWriter::AbstractDiskWriter():fd(0) {
-#ifdef ENABLE_SHA1DIGEST
+#ifdef ENABLE_MESSAGE_DIGEST
   ctx.setAlgo(MessageDigestContext::ALGO_SHA1);
   ctx.setAlgo(MessageDigestContext::ALGO_SHA1);
   digestInit(ctx);
   digestInit(ctx);
-#endif // ENABLE_SHA1DIGEST
+#endif // ENABLE_MESSAGE_DIGEST
 }
 }
 
 
 AbstractDiskWriter::~AbstractDiskWriter() {
 AbstractDiskWriter::~AbstractDiskWriter() {
   closeFile();
   closeFile();
-#ifdef ENABLE_SHA1DIGEST
+#ifdef ENABLE_MESSAGE_DIGEST
   digestFree(ctx);
   digestFree(ctx);
-#endif // ENABLE_SHA1DIGEST
+#endif // ENABLE_MESSAGE_DIGEST
 }
 }
 
 
 void AbstractDiskWriter::openFile(const string& filename) {
 void AbstractDiskWriter::openFile(const string& filename) {
@@ -99,7 +99,7 @@ int AbstractDiskWriter::readDataInternal(char* data, int len) {
 }
 }
 
 
 string AbstractDiskWriter::sha1Sum(long long int offset, long long int length) {
 string AbstractDiskWriter::sha1Sum(long long int offset, long long int length) {
-#ifdef ENABLE_SHA1DIGEST
+#ifdef ENABLE_MESSAGE_DIGEST
   digestReset(ctx);
   digestReset(ctx);
   try {
   try {
     int BUFSIZE = 16*1024;
     int BUFSIZE = 16*1024;
@@ -126,7 +126,7 @@ string AbstractDiskWriter::sha1Sum(long long int offset, long long int length) {
   }
   }
 #else
 #else
   return "";
   return "";
-#endif // ENABLE_SHA1DIGEST
+#endif // ENABLE_MESSAGE_DIGEST
 }
 }
 
 
 void AbstractDiskWriter::seek(long long int offset) {
 void AbstractDiskWriter::seek(long long int offset) {

+ 4 - 4
src/AbstractDiskWriter.h

@@ -23,17 +23,17 @@
 #define _D_ABSTRACT_DISK_WRITER_H_
 #define _D_ABSTRACT_DISK_WRITER_H_
 
 
 #include "DiskWriter.h"
 #include "DiskWriter.h"
-#ifdef ENABLE_SHA1DIGEST
+#ifdef ENABLE_MESSAGE_DIGEST
 #include "messageDigest.h"
 #include "messageDigest.h"
-#endif // ENABLE_SHA1DIGEST
+#endif // ENABLE_MESSAGE_DIGEST
 
 
 class AbstractDiskWriter:public DiskWriter {
 class AbstractDiskWriter:public DiskWriter {
 protected:
 protected:
   string filename;
   string filename;
   int fd;
   int fd;
-#ifdef ENABLE_SHA1DIGEST
+#ifdef ENABLE_MESSAGE_DIGEST
   MessageDigestContext ctx;
   MessageDigestContext ctx;
-#endif // ENABLE_SHA1DIGEST
+#endif // ENABLE_MESSAGE_DIGEST
 
 
   void createFile(const string& filename, int addFlags = 0);
   void createFile(const string& filename, int addFlags = 0);
 
 

+ 14 - 7
src/Makefile.am

@@ -47,7 +47,13 @@ SRCS =  Socket.cc Socket.h\
 	Option.cc Option.h\
 	Option.cc Option.h\
 	Base64.cc Base64.h\
 	Base64.cc Base64.h\
 	CookieBox.cc CookieBox.h\
 	CookieBox.cc CookieBox.h\
-	MetaEntry.h\
+	messageDigest.h\
+	LogFactory.cc LogFactory.h\
+	NullLogger.h\
+	Time.cc Time.h
+
+if ENABLE_BITTORRENT
+SRCS += MetaEntry.h\
 	Data.cc Data.h\
 	Data.cc Data.h\
 	Dictionary.cc Dictionary.h\
 	Dictionary.cc Dictionary.h\
 	List.cc List.h\
 	List.cc List.h\
@@ -72,7 +78,6 @@ SRCS =  Socket.cc Socket.h\
 	TorrentAutoSaveCommand.cc TorrentAutoSaveCommand.h\
 	TorrentAutoSaveCommand.cc TorrentAutoSaveCommand.h\
 	Directory.cc Directory.h\
 	Directory.cc Directory.h\
 	TrackerWatcherCommand.cc TrackerWatcherCommand.h\
 	TrackerWatcherCommand.cc TrackerWatcherCommand.h\
-	messageDigest.h\
 	PeerInteraction.cc PeerInteraction.h\
 	PeerInteraction.cc PeerInteraction.h\
 	MultiDiskWriter.cc MultiDiskWriter.h\
 	MultiDiskWriter.cc MultiDiskWriter.h\
 	DiskAdaptor.cc DiskAdaptor.h\
 	DiskAdaptor.cc DiskAdaptor.h\
@@ -80,7 +85,6 @@ SRCS =  Socket.cc Socket.h\
 	DirectDiskAdaptor.cc DirectDiskAdaptor.h\
 	DirectDiskAdaptor.cc DirectDiskAdaptor.h\
 	MultiDiskAdaptor.cc MultiDiskAdaptor.h\
 	MultiDiskAdaptor.cc MultiDiskAdaptor.h\
 	FileEntry.h\
 	FileEntry.h\
-	LogFactory.cc LogFactory.h\
 	TrackerUpdateCommand.cc TrackerUpdateCommand.h\
 	TrackerUpdateCommand.cc TrackerUpdateCommand.h\
 	ByteArrayDiskWriter.cc ByteArrayDiskWriter.h\
 	ByteArrayDiskWriter.cc ByteArrayDiskWriter.h\
 	PeerChokeCommand.cc PeerChokeCommand.h\
 	PeerChokeCommand.cc PeerChokeCommand.h\
@@ -100,14 +104,17 @@ SRCS =  Socket.cc Socket.h\
 	RejectMessage.cc RejectMessage.h\
 	RejectMessage.cc RejectMessage.h\
 	AllowedFastMessage.cc AllowedFastMessage.h\
 	AllowedFastMessage.cc AllowedFastMessage.h\
 	SuggestPieceMessage.cc SuggestPieceMessage.h\
 	SuggestPieceMessage.cc SuggestPieceMessage.h\
-	SimplePeerMessage.cc SimplePeerMessage.h\
-	NullLogger.h\
-	Time.cc Time.h\
-	Metalinker.cc Metalinker.h\
+	SimplePeerMessage.cc SimplePeerMessage.h
+endif # ENABLE_BITTORRENT
+
+if ENABLE_METALINK
+SRCS += Metalinker.cc Metalinker.h\
 	MetalinkEntry.cc MetalinkEntry.h\
 	MetalinkEntry.cc MetalinkEntry.h\
 	MetalinkResource.cc MetalinkResource.h\
 	MetalinkResource.cc MetalinkResource.h\
 	MetalinkProcessor.h\
 	MetalinkProcessor.h\
 	Xml2MetalinkProcessor.cc Xml2MetalinkProcessor.h
 	Xml2MetalinkProcessor.cc Xml2MetalinkProcessor.h
+endif # ENABLE_METALINK
+
 noinst_LIBRARIES = libaria2c.a
 noinst_LIBRARIES = libaria2c.a
 libaria2c_a_SOURCES = $(SRCS)
 libaria2c_a_SOURCES = $(SRCS)
 aria2c_LDADD = libaria2c.a @LIBINTL@ @ALLOCA@ @LIBGNUTLS_LIBS@\
 aria2c_LDADD = libaria2c.a @LIBINTL@ @ALLOCA@ @LIBGNUTLS_LIBS@\

+ 220 - 140
src/Makefile.in

@@ -38,6 +38,65 @@ POST_UNINSTALL = :
 build_triplet = @build@
 build_triplet = @build@
 host_triplet = @host@
 host_triplet = @host@
 bin_PROGRAMS = aria2c$(EXEEXT)
 bin_PROGRAMS = aria2c$(EXEEXT)
+@ENABLE_BITTORRENT_TRUE@am__append_1 = MetaEntry.h\
+@ENABLE_BITTORRENT_TRUE@	Data.cc Data.h\
+@ENABLE_BITTORRENT_TRUE@	Dictionary.cc Dictionary.h\
+@ENABLE_BITTORRENT_TRUE@	List.cc List.h\
+@ENABLE_BITTORRENT_TRUE@	MetaFileUtil.cc MetaFileUtil.h\
+@ENABLE_BITTORRENT_TRUE@	MetaEntryVisitor.h\
+@ENABLE_BITTORRENT_TRUE@	ShaVisitor.cc ShaVisitor.h\
+@ENABLE_BITTORRENT_TRUE@	TorrentMan.cc TorrentMan.h\
+@ENABLE_BITTORRENT_TRUE@	PeerConnection.cc PeerConnection.h\
+@ENABLE_BITTORRENT_TRUE@	PeerMessageUtil.cc PeerMessageUtil.h\
+@ENABLE_BITTORRENT_TRUE@	PeerAbstractCommand.cc PeerAbstractCommand.h\
+@ENABLE_BITTORRENT_TRUE@	PeerInitiateConnectionCommand.cc PeerInitiateConnectionCommand.h\
+@ENABLE_BITTORRENT_TRUE@	PeerInteractionCommand.cc PeerInteractionCommand.h\
+@ENABLE_BITTORRENT_TRUE@	Peer.cc Peer.h\
+@ENABLE_BITTORRENT_TRUE@	BitfieldMan.cc BitfieldMan.h\
+@ENABLE_BITTORRENT_TRUE@	TorrentDownloadEngine.cc TorrentDownloadEngine.h\
+@ENABLE_BITTORRENT_TRUE@	TorrentConsoleDownloadEngine.cc TorrentConsoleDownloadEngine.h\
+@ENABLE_BITTORRENT_TRUE@	PeerListenCommand.cc PeerListenCommand.h\
+@ENABLE_BITTORRENT_TRUE@	PeerMessage.cc PeerMessage.h\
+@ENABLE_BITTORRENT_TRUE@	HandshakeMessage.cc HandshakeMessage.h\
+@ENABLE_BITTORRENT_TRUE@	Piece.cc Piece.h\
+@ENABLE_BITTORRENT_TRUE@	RequestSlot.cc RequestSlot.h\
+@ENABLE_BITTORRENT_TRUE@	TorrentAutoSaveCommand.cc TorrentAutoSaveCommand.h\
+@ENABLE_BITTORRENT_TRUE@	Directory.cc Directory.h\
+@ENABLE_BITTORRENT_TRUE@	TrackerWatcherCommand.cc TrackerWatcherCommand.h\
+@ENABLE_BITTORRENT_TRUE@	PeerInteraction.cc PeerInteraction.h\
+@ENABLE_BITTORRENT_TRUE@	MultiDiskWriter.cc MultiDiskWriter.h\
+@ENABLE_BITTORRENT_TRUE@	DiskAdaptor.cc DiskAdaptor.h\
+@ENABLE_BITTORRENT_TRUE@	CopyDiskAdaptor.cc CopyDiskAdaptor.h\
+@ENABLE_BITTORRENT_TRUE@	DirectDiskAdaptor.cc DirectDiskAdaptor.h\
+@ENABLE_BITTORRENT_TRUE@	MultiDiskAdaptor.cc MultiDiskAdaptor.h\
+@ENABLE_BITTORRENT_TRUE@	FileEntry.h\
+@ENABLE_BITTORRENT_TRUE@	TrackerUpdateCommand.cc TrackerUpdateCommand.h\
+@ENABLE_BITTORRENT_TRUE@	ByteArrayDiskWriter.cc ByteArrayDiskWriter.h\
+@ENABLE_BITTORRENT_TRUE@	PeerChokeCommand.cc PeerChokeCommand.h\
+@ENABLE_BITTORRENT_TRUE@	ChokeMessage.cc ChokeMessage.h\
+@ENABLE_BITTORRENT_TRUE@	UnchokeMessage.cc UnchokeMessage.h\
+@ENABLE_BITTORRENT_TRUE@	InterestedMessage.cc InterestedMessage.h\
+@ENABLE_BITTORRENT_TRUE@	NotInterestedMessage.cc NotInterestedMessage.h\
+@ENABLE_BITTORRENT_TRUE@	HaveMessage.cc HaveMessage.h\
+@ENABLE_BITTORRENT_TRUE@	BitfieldMessage.cc BitfieldMessage.h\
+@ENABLE_BITTORRENT_TRUE@	RequestMessage.cc RequestMessage.h\
+@ENABLE_BITTORRENT_TRUE@	PieceMessage.cc PieceMessage.h\
+@ENABLE_BITTORRENT_TRUE@	CancelMessage.cc CancelMessage.h\
+@ENABLE_BITTORRENT_TRUE@	KeepAliveMessage.cc KeepAliveMessage.h\
+@ENABLE_BITTORRENT_TRUE@	PortMessage.cc PortMessage.h\
+@ENABLE_BITTORRENT_TRUE@	HaveAllMessage.cc HaveAllMessage.h\
+@ENABLE_BITTORRENT_TRUE@	HaveNoneMessage.cc HaveNoneMessage.h\
+@ENABLE_BITTORRENT_TRUE@	RejectMessage.cc RejectMessage.h\
+@ENABLE_BITTORRENT_TRUE@	AllowedFastMessage.cc AllowedFastMessage.h\
+@ENABLE_BITTORRENT_TRUE@	SuggestPieceMessage.cc SuggestPieceMessage.h\
+@ENABLE_BITTORRENT_TRUE@	SimplePeerMessage.cc SimplePeerMessage.h
+
+@ENABLE_METALINK_TRUE@am__append_2 = Metalinker.cc Metalinker.h\
+@ENABLE_METALINK_TRUE@	MetalinkEntry.cc MetalinkEntry.h\
+@ENABLE_METALINK_TRUE@	MetalinkResource.cc MetalinkResource.h\
+@ENABLE_METALINK_TRUE@	MetalinkProcessor.h\
+@ENABLE_METALINK_TRUE@	Xml2MetalinkProcessor.cc Xml2MetalinkProcessor.h
+
 subdir = src
 subdir = src
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in alloca.c
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in alloca.c
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -62,7 +121,126 @@ AR = ar
 ARFLAGS = cru
 ARFLAGS = cru
 libaria2c_a_AR = $(AR) $(ARFLAGS)
 libaria2c_a_AR = $(AR) $(ARFLAGS)
 libaria2c_a_LIBADD =
 libaria2c_a_LIBADD =
-am__objects_1 = Socket.$(OBJEXT) SocketCore.$(OBJEXT) \
+am__libaria2c_a_SOURCES_DIST = Socket.cc Socket.h SocketCore.cc \
+	SocketCore.h Command.h AbstractCommand.cc AbstractCommand.h \
+	InitiateConnectionCommandFactory.cc \
+	InitiateConnectionCommandFactory.h DownloadCommand.cc \
+	DownloadCommand.h HttpInitiateConnectionCommand.cc \
+	HttpInitiateConnectionCommand.h HttpRequestCommand.cc \
+	HttpRequestCommand.h HttpResponseCommand.cc \
+	HttpResponseCommand.h HttpProxyRequestCommand.cc \
+	HttpProxyRequestCommand.h HttpProxyResponseCommand.cc \
+	HttpProxyResponseCommand.h HttpDownloadCommand.cc \
+	HttpDownloadCommand.h HttpHeader.cc HttpHeader.h \
+	HttpConnection.cc HttpConnection.h FtpConnection.cc \
+	FtpConnection.h FtpInitiateConnectionCommand.cc \
+	FtpInitiateConnectionCommand.h FtpNegotiationCommand.cc \
+	FtpNegotiationCommand.h FtpDownloadCommand.cc \
+	FtpDownloadCommand.h FtpTunnelRequestCommand.cc \
+	FtpTunnelRequestCommand.h FtpTunnelResponseCommand.cc \
+	FtpTunnelResponseCommand.h SleepCommand.cc SleepCommand.h \
+	DownloadEngine.cc DownloadEngine.h ConsoleDownloadEngine.cc \
+	ConsoleDownloadEngine.h Segment.h SegmentMan.cc SegmentMan.h \
+	SegmentSplitter.cc SegmentSplitter.h \
+	SplitFirstSegmentSplitter.cc SplitFirstSegmentSplitter.h \
+	SplitSlowestSegmentSplitter.cc SplitSlowestSegmentSplitter.h \
+	Util.cc Util.h Request.cc Request.h common.h message.h \
+	Exception.h DlAbortEx.h DlRetryEx.h Logger.h SimpleLogger.cc \
+	SimpleLogger.h TransferEncoding.h ChunkedEncoding.cc \
+	ChunkedEncoding.h DiskWriter.h DefaultDiskWriter.cc \
+	DefaultDiskWriter.h PreAllocationDiskWriter.cc \
+	PreAllocationDiskWriter.h AbstractDiskWriter.cc \
+	AbstractDiskWriter.h File.cc File.h Option.cc Option.h \
+	Base64.cc Base64.h CookieBox.cc CookieBox.h messageDigest.h \
+	LogFactory.cc LogFactory.h NullLogger.h Time.cc Time.h \
+	MetaEntry.h Data.cc Data.h Dictionary.cc Dictionary.h List.cc \
+	List.h MetaFileUtil.cc MetaFileUtil.h MetaEntryVisitor.h \
+	ShaVisitor.cc ShaVisitor.h TorrentMan.cc TorrentMan.h \
+	PeerConnection.cc PeerConnection.h PeerMessageUtil.cc \
+	PeerMessageUtil.h PeerAbstractCommand.cc PeerAbstractCommand.h \
+	PeerInitiateConnectionCommand.cc \
+	PeerInitiateConnectionCommand.h PeerInteractionCommand.cc \
+	PeerInteractionCommand.h Peer.cc Peer.h BitfieldMan.cc \
+	BitfieldMan.h TorrentDownloadEngine.cc TorrentDownloadEngine.h \
+	TorrentConsoleDownloadEngine.cc TorrentConsoleDownloadEngine.h \
+	PeerListenCommand.cc PeerListenCommand.h PeerMessage.cc \
+	PeerMessage.h HandshakeMessage.cc HandshakeMessage.h Piece.cc \
+	Piece.h RequestSlot.cc RequestSlot.h TorrentAutoSaveCommand.cc \
+	TorrentAutoSaveCommand.h Directory.cc Directory.h \
+	TrackerWatcherCommand.cc TrackerWatcherCommand.h \
+	PeerInteraction.cc PeerInteraction.h MultiDiskWriter.cc \
+	MultiDiskWriter.h DiskAdaptor.cc DiskAdaptor.h \
+	CopyDiskAdaptor.cc CopyDiskAdaptor.h DirectDiskAdaptor.cc \
+	DirectDiskAdaptor.h MultiDiskAdaptor.cc MultiDiskAdaptor.h \
+	FileEntry.h TrackerUpdateCommand.cc TrackerUpdateCommand.h \
+	ByteArrayDiskWriter.cc ByteArrayDiskWriter.h \
+	PeerChokeCommand.cc PeerChokeCommand.h ChokeMessage.cc \
+	ChokeMessage.h UnchokeMessage.cc UnchokeMessage.h \
+	InterestedMessage.cc InterestedMessage.h \
+	NotInterestedMessage.cc NotInterestedMessage.h HaveMessage.cc \
+	HaveMessage.h BitfieldMessage.cc BitfieldMessage.h \
+	RequestMessage.cc RequestMessage.h PieceMessage.cc \
+	PieceMessage.h CancelMessage.cc CancelMessage.h \
+	KeepAliveMessage.cc KeepAliveMessage.h PortMessage.cc \
+	PortMessage.h HaveAllMessage.cc HaveAllMessage.h \
+	HaveNoneMessage.cc HaveNoneMessage.h RejectMessage.cc \
+	RejectMessage.h AllowedFastMessage.cc AllowedFastMessage.h \
+	SuggestPieceMessage.cc SuggestPieceMessage.h \
+	SimplePeerMessage.cc SimplePeerMessage.h Metalinker.cc \
+	Metalinker.h MetalinkEntry.cc MetalinkEntry.h \
+	MetalinkResource.cc MetalinkResource.h MetalinkProcessor.h \
+	Xml2MetalinkProcessor.cc Xml2MetalinkProcessor.h
+@ENABLE_BITTORRENT_TRUE@am__objects_1 = Data.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	Dictionary.$(OBJEXT) List.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	MetaFileUtil.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	ShaVisitor.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	TorrentMan.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	PeerConnection.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	PeerMessageUtil.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	PeerAbstractCommand.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	PeerInitiateConnectionCommand.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	PeerInteractionCommand.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	Peer.$(OBJEXT) BitfieldMan.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	TorrentDownloadEngine.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	TorrentConsoleDownloadEngine.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	PeerListenCommand.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	PeerMessage.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	HandshakeMessage.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	Piece.$(OBJEXT) RequestSlot.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	TorrentAutoSaveCommand.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	Directory.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	TrackerWatcherCommand.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	PeerInteraction.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	MultiDiskWriter.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	DiskAdaptor.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	CopyDiskAdaptor.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	DirectDiskAdaptor.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	MultiDiskAdaptor.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	TrackerUpdateCommand.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	ByteArrayDiskWriter.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	PeerChokeCommand.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	ChokeMessage.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	UnchokeMessage.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	InterestedMessage.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	NotInterestedMessage.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	HaveMessage.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	BitfieldMessage.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	RequestMessage.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	PieceMessage.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	CancelMessage.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	KeepAliveMessage.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	PortMessage.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	HaveAllMessage.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	HaveNoneMessage.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	RejectMessage.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	AllowedFastMessage.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	SuggestPieceMessage.$(OBJEXT) \
+@ENABLE_BITTORRENT_TRUE@	SimplePeerMessage.$(OBJEXT)
+@ENABLE_METALINK_TRUE@am__objects_2 = Metalinker.$(OBJEXT) \
+@ENABLE_METALINK_TRUE@	MetalinkEntry.$(OBJEXT) \
+@ENABLE_METALINK_TRUE@	MetalinkResource.$(OBJEXT) \
+@ENABLE_METALINK_TRUE@	Xml2MetalinkProcessor.$(OBJEXT)
+am__objects_3 = Socket.$(OBJEXT) SocketCore.$(OBJEXT) \
 	AbstractCommand.$(OBJEXT) \
 	AbstractCommand.$(OBJEXT) \
 	InitiateConnectionCommandFactory.$(OBJEXT) \
 	InitiateConnectionCommandFactory.$(OBJEXT) \
 	DownloadCommand.$(OBJEXT) \
 	DownloadCommand.$(OBJEXT) \
@@ -84,35 +262,9 @@ am__objects_1 = Socket.$(OBJEXT) SocketCore.$(OBJEXT) \
 	ChunkedEncoding.$(OBJEXT) DefaultDiskWriter.$(OBJEXT) \
 	ChunkedEncoding.$(OBJEXT) DefaultDiskWriter.$(OBJEXT) \
 	PreAllocationDiskWriter.$(OBJEXT) AbstractDiskWriter.$(OBJEXT) \
 	PreAllocationDiskWriter.$(OBJEXT) AbstractDiskWriter.$(OBJEXT) \
 	File.$(OBJEXT) Option.$(OBJEXT) Base64.$(OBJEXT) \
 	File.$(OBJEXT) Option.$(OBJEXT) Base64.$(OBJEXT) \
-	CookieBox.$(OBJEXT) Data.$(OBJEXT) Dictionary.$(OBJEXT) \
-	List.$(OBJEXT) MetaFileUtil.$(OBJEXT) ShaVisitor.$(OBJEXT) \
-	TorrentMan.$(OBJEXT) PeerConnection.$(OBJEXT) \
-	PeerMessageUtil.$(OBJEXT) PeerAbstractCommand.$(OBJEXT) \
-	PeerInitiateConnectionCommand.$(OBJEXT) \
-	PeerInteractionCommand.$(OBJEXT) Peer.$(OBJEXT) \
-	BitfieldMan.$(OBJEXT) TorrentDownloadEngine.$(OBJEXT) \
-	TorrentConsoleDownloadEngine.$(OBJEXT) \
-	PeerListenCommand.$(OBJEXT) PeerMessage.$(OBJEXT) \
-	HandshakeMessage.$(OBJEXT) Piece.$(OBJEXT) \
-	RequestSlot.$(OBJEXT) TorrentAutoSaveCommand.$(OBJEXT) \
-	Directory.$(OBJEXT) TrackerWatcherCommand.$(OBJEXT) \
-	PeerInteraction.$(OBJEXT) MultiDiskWriter.$(OBJEXT) \
-	DiskAdaptor.$(OBJEXT) CopyDiskAdaptor.$(OBJEXT) \
-	DirectDiskAdaptor.$(OBJEXT) MultiDiskAdaptor.$(OBJEXT) \
-	LogFactory.$(OBJEXT) TrackerUpdateCommand.$(OBJEXT) \
-	ByteArrayDiskWriter.$(OBJEXT) PeerChokeCommand.$(OBJEXT) \
-	ChokeMessage.$(OBJEXT) UnchokeMessage.$(OBJEXT) \
-	InterestedMessage.$(OBJEXT) NotInterestedMessage.$(OBJEXT) \
-	HaveMessage.$(OBJEXT) BitfieldMessage.$(OBJEXT) \
-	RequestMessage.$(OBJEXT) PieceMessage.$(OBJEXT) \
-	CancelMessage.$(OBJEXT) KeepAliveMessage.$(OBJEXT) \
-	PortMessage.$(OBJEXT) HaveAllMessage.$(OBJEXT) \
-	HaveNoneMessage.$(OBJEXT) RejectMessage.$(OBJEXT) \
-	AllowedFastMessage.$(OBJEXT) SuggestPieceMessage.$(OBJEXT) \
-	SimplePeerMessage.$(OBJEXT) Time.$(OBJEXT) \
-	Metalinker.$(OBJEXT) MetalinkEntry.$(OBJEXT) \
-	MetalinkResource.$(OBJEXT) Xml2MetalinkProcessor.$(OBJEXT)
-am_libaria2c_a_OBJECTS = $(am__objects_1)
+	CookieBox.$(OBJEXT) LogFactory.$(OBJEXT) Time.$(OBJEXT) \
+	$(am__objects_1) $(am__objects_2)
+am_libaria2c_a_OBJECTS = $(am__objects_3)
 libaria2c_a_OBJECTS = $(am_libaria2c_a_OBJECTS)
 libaria2c_a_OBJECTS = $(am_libaria2c_a_OBJECTS)
 am__installdirs = "$(DESTDIR)$(bindir)"
 am__installdirs = "$(DESTDIR)$(bindir)"
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
@@ -133,7 +285,7 @@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 CCLD = $(CC)
 CCLD = $(CC)
 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 SOURCES = $(libaria2c_a_SOURCES) $(aria2c_SOURCES)
 SOURCES = $(libaria2c_a_SOURCES) $(aria2c_SOURCES)
-DIST_SOURCES = $(libaria2c_a_SOURCES) $(aria2c_SOURCES)
+DIST_SOURCES = $(am__libaria2c_a_SOURCES_DIST) $(aria2c_SOURCES)
 ETAGS = etags
 ETAGS = etags
 CTAGS = ctags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -167,6 +319,10 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EGREP = @EGREP@
+ENABLE_BITTORRENT_FALSE = @ENABLE_BITTORRENT_FALSE@
+ENABLE_BITTORRENT_TRUE = @ENABLE_BITTORRENT_TRUE@
+ENABLE_METALINK_FALSE = @ENABLE_METALINK_FALSE@
+ENABLE_METALINK_TRUE = @ENABLE_METALINK_TRUE@
 EXEEXT = @EXEEXT@
 EXEEXT = @EXEEXT@
 GENCAT = @GENCAT@
 GENCAT = @GENCAT@
 GLIBC21 = @GLIBC21@
 GLIBC21 = @GLIBC21@
@@ -264,115 +420,39 @@ sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
 target_alias = @target_alias@
 aria2c_SOURCES = main.cc
 aria2c_SOURCES = main.cc
-SRCS = Socket.cc Socket.h\
-	SocketCore.cc SocketCore.h\
-	Command.h\
-	AbstractCommand.cc AbstractCommand.h\
-	InitiateConnectionCommandFactory.cc InitiateConnectionCommandFactory.h\
-	DownloadCommand.cc DownloadCommand.h\
-	HttpInitiateConnectionCommand.cc HttpInitiateConnectionCommand.h\
-	HttpRequestCommand.cc HttpRequestCommand.h\
-	HttpResponseCommand.cc HttpResponseCommand.h\
-	HttpProxyRequestCommand.cc HttpProxyRequestCommand.h\
-	HttpProxyResponseCommand.cc HttpProxyResponseCommand.h\
-	HttpDownloadCommand.cc HttpDownloadCommand.h\
-	HttpHeader.cc HttpHeader.h\
-	HttpConnection.cc HttpConnection.h\
-	FtpConnection.cc FtpConnection.h\
-	FtpInitiateConnectionCommand.cc FtpInitiateConnectionCommand.h\
-	FtpNegotiationCommand.cc FtpNegotiationCommand.h\
-	FtpDownloadCommand.cc FtpDownloadCommand.h\
-	FtpTunnelRequestCommand.cc FtpTunnelRequestCommand.h\
-	FtpTunnelResponseCommand.cc FtpTunnelResponseCommand.h\
-	SleepCommand.cc SleepCommand.h\
-	DownloadEngine.cc DownloadEngine.h\
-	ConsoleDownloadEngine.cc ConsoleDownloadEngine.h\
-	Segment.h\
-	SegmentMan.cc SegmentMan.h\
-	SegmentSplitter.cc SegmentSplitter.h\
-	SplitFirstSegmentSplitter.cc SplitFirstSegmentSplitter.h\
-	SplitSlowestSegmentSplitter.cc SplitSlowestSegmentSplitter.h\
-	Util.cc Util.h\
-	Request.cc Request.h\
-	common.h\
-	message.h\
-	Exception.h\
-	DlAbortEx.h\
-	DlRetryEx.h\
-	Logger.h\
-	SimpleLogger.cc SimpleLogger.h\
-	TransferEncoding.h\
-	ChunkedEncoding.cc ChunkedEncoding.h\
-	DiskWriter.h\
-	DefaultDiskWriter.cc DefaultDiskWriter.h\
-	PreAllocationDiskWriter.cc PreAllocationDiskWriter.h\
-	AbstractDiskWriter.cc AbstractDiskWriter.h\
-	File.cc File.h\
-	Option.cc Option.h\
-	Base64.cc Base64.h\
-	CookieBox.cc CookieBox.h\
-	MetaEntry.h\
-	Data.cc Data.h\
-	Dictionary.cc Dictionary.h\
-	List.cc List.h\
-	MetaFileUtil.cc MetaFileUtil.h\
-	MetaEntryVisitor.h\
-	ShaVisitor.cc ShaVisitor.h\
-	TorrentMan.cc TorrentMan.h\
-	PeerConnection.cc PeerConnection.h\
-	PeerMessageUtil.cc PeerMessageUtil.h\
-	PeerAbstractCommand.cc PeerAbstractCommand.h\
-	PeerInitiateConnectionCommand.cc PeerInitiateConnectionCommand.h\
-	PeerInteractionCommand.cc PeerInteractionCommand.h\
-	Peer.cc Peer.h\
-	BitfieldMan.cc BitfieldMan.h\
-	TorrentDownloadEngine.cc TorrentDownloadEngine.h\
-	TorrentConsoleDownloadEngine.cc TorrentConsoleDownloadEngine.h\
-	PeerListenCommand.cc PeerListenCommand.h\
-	PeerMessage.cc PeerMessage.h\
-	HandshakeMessage.cc HandshakeMessage.h\
-	Piece.cc Piece.h\
-	RequestSlot.cc RequestSlot.h\
-	TorrentAutoSaveCommand.cc TorrentAutoSaveCommand.h\
-	Directory.cc Directory.h\
-	TrackerWatcherCommand.cc TrackerWatcherCommand.h\
-	messageDigest.h\
-	PeerInteraction.cc PeerInteraction.h\
-	MultiDiskWriter.cc MultiDiskWriter.h\
-	DiskAdaptor.cc DiskAdaptor.h\
-	CopyDiskAdaptor.cc CopyDiskAdaptor.h\
-	DirectDiskAdaptor.cc DirectDiskAdaptor.h\
-	MultiDiskAdaptor.cc MultiDiskAdaptor.h\
-	FileEntry.h\
-	LogFactory.cc LogFactory.h\
-	TrackerUpdateCommand.cc TrackerUpdateCommand.h\
-	ByteArrayDiskWriter.cc ByteArrayDiskWriter.h\
-	PeerChokeCommand.cc PeerChokeCommand.h\
-	ChokeMessage.cc ChokeMessage.h\
-	UnchokeMessage.cc UnchokeMessage.h\
-	InterestedMessage.cc InterestedMessage.h\
-	NotInterestedMessage.cc NotInterestedMessage.h\
-	HaveMessage.cc HaveMessage.h\
-	BitfieldMessage.cc BitfieldMessage.h\
-	RequestMessage.cc RequestMessage.h\
-	PieceMessage.cc PieceMessage.h\
-	CancelMessage.cc CancelMessage.h\
-	KeepAliveMessage.cc KeepAliveMessage.h\
-	PortMessage.cc PortMessage.h\
-	HaveAllMessage.cc HaveAllMessage.h\
-	HaveNoneMessage.cc HaveNoneMessage.h\
-	RejectMessage.cc RejectMessage.h\
-	AllowedFastMessage.cc AllowedFastMessage.h\
-	SuggestPieceMessage.cc SuggestPieceMessage.h\
-	SimplePeerMessage.cc SimplePeerMessage.h\
-	NullLogger.h\
-	Time.cc Time.h\
-	Metalinker.cc Metalinker.h\
-	MetalinkEntry.cc MetalinkEntry.h\
-	MetalinkResource.cc MetalinkResource.h\
-	MetalinkProcessor.h\
-	Xml2MetalinkProcessor.cc Xml2MetalinkProcessor.h
-
+SRCS = Socket.cc Socket.h SocketCore.cc SocketCore.h Command.h \
+	AbstractCommand.cc AbstractCommand.h \
+	InitiateConnectionCommandFactory.cc \
+	InitiateConnectionCommandFactory.h DownloadCommand.cc \
+	DownloadCommand.h HttpInitiateConnectionCommand.cc \
+	HttpInitiateConnectionCommand.h HttpRequestCommand.cc \
+	HttpRequestCommand.h HttpResponseCommand.cc \
+	HttpResponseCommand.h HttpProxyRequestCommand.cc \
+	HttpProxyRequestCommand.h HttpProxyResponseCommand.cc \
+	HttpProxyResponseCommand.h HttpDownloadCommand.cc \
+	HttpDownloadCommand.h HttpHeader.cc HttpHeader.h \
+	HttpConnection.cc HttpConnection.h FtpConnection.cc \
+	FtpConnection.h FtpInitiateConnectionCommand.cc \
+	FtpInitiateConnectionCommand.h FtpNegotiationCommand.cc \
+	FtpNegotiationCommand.h FtpDownloadCommand.cc \
+	FtpDownloadCommand.h FtpTunnelRequestCommand.cc \
+	FtpTunnelRequestCommand.h FtpTunnelResponseCommand.cc \
+	FtpTunnelResponseCommand.h SleepCommand.cc SleepCommand.h \
+	DownloadEngine.cc DownloadEngine.h ConsoleDownloadEngine.cc \
+	ConsoleDownloadEngine.h Segment.h SegmentMan.cc SegmentMan.h \
+	SegmentSplitter.cc SegmentSplitter.h \
+	SplitFirstSegmentSplitter.cc SplitFirstSegmentSplitter.h \
+	SplitSlowestSegmentSplitter.cc SplitSlowestSegmentSplitter.h \
+	Util.cc Util.h Request.cc Request.h common.h message.h \
+	Exception.h DlAbortEx.h DlRetryEx.h Logger.h SimpleLogger.cc \
+	SimpleLogger.h TransferEncoding.h ChunkedEncoding.cc \
+	ChunkedEncoding.h DiskWriter.h DefaultDiskWriter.cc \
+	DefaultDiskWriter.h PreAllocationDiskWriter.cc \
+	PreAllocationDiskWriter.h AbstractDiskWriter.cc \
+	AbstractDiskWriter.h File.cc File.h Option.cc Option.h \
+	Base64.cc Base64.h CookieBox.cc CookieBox.h messageDigest.h \
+	LogFactory.cc LogFactory.h NullLogger.h Time.cc Time.h \
+	$(am__append_1) $(am__append_2)
 noinst_LIBRARIES = libaria2c.a
 noinst_LIBRARIES = libaria2c.a
 libaria2c_a_SOURCES = $(SRCS)
 libaria2c_a_SOURCES = $(SRCS)
 aria2c_LDADD = libaria2c.a @LIBINTL@ @ALLOCA@ @LIBGNUTLS_LIBS@\
 aria2c_LDADD = libaria2c.a @LIBINTL@ @ALLOCA@ @LIBGNUTLS_LIBS@\

+ 8 - 8
src/MultiDiskWriter.cc

@@ -26,17 +26,17 @@
 #include <errno.h>
 #include <errno.h>
 
 
 MultiDiskWriter::MultiDiskWriter(int pieceLength):pieceLength(pieceLength) {
 MultiDiskWriter::MultiDiskWriter(int pieceLength):pieceLength(pieceLength) {
-#ifdef ENABLE_SHA1DIGEST
+#ifdef ENABLE_MESSAGE_DIGEST
   ctx.setAlgo(MessageDigestContext::ALGO_SHA1);
   ctx.setAlgo(MessageDigestContext::ALGO_SHA1);
   digestInit(ctx);
   digestInit(ctx);
-#endif // ENABLE_SHA1DIGEST
+#endif // ENABLE_MESSAGE_DIGEST
 }
 }
 
 
 MultiDiskWriter::~MultiDiskWriter() {
 MultiDiskWriter::~MultiDiskWriter() {
   clearEntries();
   clearEntries();
-#ifdef ENABLE_SHA1DIGEST
+#ifdef ENABLE_MESSAGE_DIGEST
   digestFree(ctx);
   digestFree(ctx);
-#endif // ENABLE_SHA1DIGEST
+#endif // ENABLE_MESSAGE_DIGEST
 }
 }
 
 
 void MultiDiskWriter::clearEntries() {
 void MultiDiskWriter::clearEntries() {
@@ -143,7 +143,7 @@ int MultiDiskWriter::readData(char* data, int len, long long int offset) {
   return totalReadLength;
   return totalReadLength;
 }
 }
 
 
-#ifdef ENABLE_SHA1DIGEST
+#ifdef ENABLE_MESSAGE_DIGEST
 void MultiDiskWriter::hashUpdate(DiskWriterEntry* entry, long long int offset, long long int length) {
 void MultiDiskWriter::hashUpdate(DiskWriterEntry* entry, long long int offset, long long int length) {
   int BUFSIZE = 16*1024;
   int BUFSIZE = 16*1024;
   char buf[BUFSIZE];
   char buf[BUFSIZE];
@@ -162,10 +162,10 @@ void MultiDiskWriter::hashUpdate(DiskWriterEntry* entry, long long int offset, l
     digestUpdate(ctx, buf, r);
     digestUpdate(ctx, buf, r);
   }
   }
 }
 }
-#endif // ENABLE_SHA1DIGEST
+#endif // ENABLE_MESSAGE_DIGEST
 
 
 string MultiDiskWriter::sha1Sum(long long int offset, long long int length) {
 string MultiDiskWriter::sha1Sum(long long int offset, long long int length) {
-#ifdef ENABLE_SHA1DIGEST
+#ifdef ENABLE_MESSAGE_DIGEST
   long long int fileOffset = offset;
   long long int fileOffset = offset;
   bool reading = false;
   bool reading = false;
   int rem = length;
   int rem = length;
@@ -194,6 +194,6 @@ string MultiDiskWriter::sha1Sum(long long int offset, long long int length) {
   }
   }
 #else
 #else
   return "";
   return "";
-#endif // ENABLE_SHA1DIGEST
+#endif // ENABLE_MESSAGE_DIGEST
 }
 }
 
 

+ 2 - 2
src/MultiDiskWriter.h

@@ -48,10 +48,10 @@ private:
   bool isInRange(const DiskWriterEntry* entry, long long int offset) const;
   bool isInRange(const DiskWriterEntry* entry, long long int offset) const;
   int calculateLength(const DiskWriterEntry* entry, long long int fileOffset, int rem) const;
   int calculateLength(const DiskWriterEntry* entry, long long int fileOffset, int rem) const;
   void clearEntries();
   void clearEntries();
-#ifdef ENABLE_SHA1DIGEST
+#ifdef ENABLE_MESSAGE_DIGEST
   MessageDigestContext ctx;
   MessageDigestContext ctx;
   void hashUpdate(DiskWriterEntry* entry, long long int offset, long long int length);
   void hashUpdate(DiskWriterEntry* entry, long long int offset, long long int length);
-#endif // ENABLE_SHA1DIGEST
+#endif // ENABLE_MESSAGE_DIGEST
 
 
 public:
 public:
   MultiDiskWriter(int pieceLength);
   MultiDiskWriter(int pieceLength);

+ 12 - 12
src/ShaVisitor.cc

@@ -23,21 +23,21 @@
 #include "Util.h"
 #include "Util.h"
 
 
 ShaVisitor::ShaVisitor() {
 ShaVisitor::ShaVisitor() {
-#ifdef ENABLE_SHA1DIGEST
+#ifdef ENABLE_MESSAGE_DIGEST
   ctx.setAlgo(MessageDigestContext::ALGO_SHA1);
   ctx.setAlgo(MessageDigestContext::ALGO_SHA1);
   digestInit(ctx);
   digestInit(ctx);
   digestReset(ctx);
   digestReset(ctx);
-#endif // ENABLE_SHA1DIGEST
+#endif // ENABLE_MESSAGE_DIGEST
 }
 }
 
 
 ShaVisitor::~ShaVisitor() {
 ShaVisitor::~ShaVisitor() {
-#ifdef ENABLE_SHA1DIGEST
+#ifdef ENABLE_MESSAGE_DIGEST
   digestFree(ctx);
   digestFree(ctx);
-#endif // ENABLE_SHA1DIGEST
+#endif // ENABLE_MESSAGE_DIGEST
 }
 }
 
 
 void ShaVisitor::visit(const Data* d) {
 void ShaVisitor::visit(const Data* d) {
-#ifdef ENABLE_SHA1DIGEST
+#ifdef ENABLE_MESSAGE_DIGEST
   if(d->isNumber()) {
   if(d->isNumber()) {
     digestUpdate(ctx, "i", 1);
     digestUpdate(ctx, "i", 1);
   } else {
   } else {
@@ -49,11 +49,11 @@ void ShaVisitor::visit(const Data* d) {
   if(d->isNumber()) {
   if(d->isNumber()) {
     digestUpdate(ctx, "e", 1);
     digestUpdate(ctx, "e", 1);
   }
   }
-#endif // ENABLE_SHA1DIGEST
+#endif // ENABLE_MESSAGE_DIGEST
 }
 }
 
 
 void ShaVisitor::visit(const Dictionary* d) {
 void ShaVisitor::visit(const Dictionary* d) {
-#ifdef ENABLE_SHA1DIGEST
+#ifdef ENABLE_MESSAGE_DIGEST
   digestUpdate(ctx, "d", 1);
   digestUpdate(ctx, "d", 1);
   const Order& v = d->getOrder();
   const Order& v = d->getOrder();
   for(Order::const_iterator itr = v.begin(); itr != v.end(); itr++) {
   for(Order::const_iterator itr = v.begin(); itr != v.end(); itr++) {
@@ -65,17 +65,17 @@ void ShaVisitor::visit(const Dictionary* d) {
     this->visit(e);
     this->visit(e);
   }
   }
   digestUpdate(ctx, "e", 1);
   digestUpdate(ctx, "e", 1);
-#endif // ENABLE_SHA1DIGEST
+#endif // ENABLE_MESSAGE_DIGEST
 }
 }
 
 
 void ShaVisitor::visit(const List* l) {
 void ShaVisitor::visit(const List* l) {
-#ifdef ENABLE_SHA1DIGEST
+#ifdef ENABLE_MESSAGE_DIGEST
   digestUpdate(ctx, "l", 1);
   digestUpdate(ctx, "l", 1);
   for(MetaList::const_iterator itr = l->getList().begin(); itr != l->getList().end(); itr++) {
   for(MetaList::const_iterator itr = l->getList().begin(); itr != l->getList().end(); itr++) {
     this->visit(*itr);
     this->visit(*itr);
   }
   }
   digestUpdate(ctx, "e", 1);
   digestUpdate(ctx, "e", 1);
-#endif // ENABLE_SHA1DIGEST
+#endif // ENABLE_MESSAGE_DIGEST
 }
 }
 
 
 void ShaVisitor::visit(const MetaEntry* e) {
 void ShaVisitor::visit(const MetaEntry* e) {
@@ -89,8 +89,8 @@ void ShaVisitor::visit(const MetaEntry* e) {
 }
 }
 
 
 void ShaVisitor::getHash(unsigned char* hashValue, int& len) {
 void ShaVisitor::getHash(unsigned char* hashValue, int& len) {
-#ifdef ENABLE_SHA1DIGEST
+#ifdef ENABLE_MESSAGE_DIGEST
   digestFinal(ctx, hashValue);
   digestFinal(ctx, hashValue);
   len = 20;
   len = 20;
-#endif // ENABLE_SHA1DIGEST
+#endif // ENABLE_MESSAGE_DIGEST
 }
 }

+ 4 - 4
src/ShaVisitor.h

@@ -27,15 +27,15 @@
 #include "Dictionary.h"
 #include "Dictionary.h"
 #include "List.h"
 #include "List.h"
 #include "common.h"
 #include "common.h"
-#ifdef ENABLE_SHA1DIGEST
+#ifdef ENABLE_MESSAGE_DIGEST
 #include "messageDigest.h"
 #include "messageDigest.h"
-#endif // ENABLE_SHA1DIGEST
+#endif // ENABLE_MESSAGE_DIGEST
 
 
 class ShaVisitor : public MetaEntryVisitor {
 class ShaVisitor : public MetaEntryVisitor {
 private:
 private:
-#ifdef ENABLE_SHA1DIGEST
+#ifdef ENABLE_MESSAGE_DIGEST
   MessageDigestContext ctx;
   MessageDigestContext ctx;
-#endif // ENABLE_SHA1DIGEST
+#endif // ENABLE_MESSAGE_DIGEST
 public:
 public:
   ShaVisitor();
   ShaVisitor();
   ~ShaVisitor();
   ~ShaVisitor();

+ 6 - 4
src/Util.cc

@@ -360,20 +360,20 @@ string Util::getContentDispositionFilename(const string& header) {
   return trim(header.substr(filenamesp, filenameep-filenamesp));
   return trim(header.substr(filenamesp, filenameep-filenamesp));
 }
 }
 
 
+#ifdef ENABLE_MESSAGE_DIGEST
 void Util::sha1Sum(unsigned char* digest, const void* data, int dataLength) {
 void Util::sha1Sum(unsigned char* digest, const void* data, int dataLength) {
-#ifdef ENABLE_SHA1DIGEST
   MessageDigestContext ctx(MessageDigestContext::ALGO_SHA1);
   MessageDigestContext ctx(MessageDigestContext::ALGO_SHA1);
   digestInit(ctx);
   digestInit(ctx);
   digestReset(ctx);
   digestReset(ctx);
   digestUpdate(ctx, data, dataLength);
   digestUpdate(ctx, data, dataLength);
   digestFinal(ctx, digest);
   digestFinal(ctx, digest);
   digestFree(ctx);
   digestFree(ctx);
-#endif // ENABLE_SHA1DIGEST
 }
 }
+#endif // ENABLE_MESSAGE_DIGEST
 
 
+#ifdef ENABLE_MESSAGE_DIGEST
 void Util::fileChecksum(const string& filename, unsigned char* digest,
 void Util::fileChecksum(const string& filename, unsigned char* digest,
 			MessageDigestContext::HashAlgo algo) {
 			MessageDigestContext::HashAlgo algo) {
-#ifdef ENABLE_SHA1DIGEST
   MessageDigestContext ctx(algo);
   MessageDigestContext ctx(algo);
   digestInit(ctx);
   digestInit(ctx);
   digestReset(ctx);
   digestReset(ctx);
@@ -403,9 +403,10 @@ void Util::fileChecksum(const string& filename, unsigned char* digest,
   }
   }
   digestFinal(ctx, digest);
   digestFinal(ctx, digest);
   digestFree(ctx);
   digestFree(ctx);
-#endif // ENABLE_SHA1DIGEST
 }
 }
+#endif // ENABLE_MESSAGE_DIGEST
 
 
+#ifdef ENABLE_BITTORRENT
 Integers Util::computeFastSet(string ipaddr, const unsigned char* infoHash,
 Integers Util::computeFastSet(string ipaddr, const unsigned char* infoHash,
 			     int pieces, int fastSetSize) {
 			     int pieces, int fastSetSize) {
   Integers fastSet;
   Integers fastSet;
@@ -441,6 +442,7 @@ Integers Util::computeFastSet(string ipaddr, const unsigned char* infoHash,
   }
   }
   return fastSet;
   return fastSet;
 }
 }
+#endif // ENABLE_BITTORRENT
 
 
 /*
 /*
 int Util::countBit(unsigned int n) {
 int Util::countBit(unsigned int n) {

+ 8 - 2
src/Util.h

@@ -23,9 +23,9 @@
 #define _D_UTIL_H_
 #define _D_UTIL_H_
 
 
 #include "common.h"
 #include "common.h"
-#ifdef ENABLE_SHA1DIGEST
+#ifdef ENABLE_MESSAGE_DIGEST
 #include "messageDigest.h"
 #include "messageDigest.h"
-#endif // ENABLE_SHA1DIGEST
+#endif // ENABLE_MESSAGE_DIGEST
 #include <string>
 #include <string>
 #include <utility>
 #include <utility>
 #include <deque>
 #include <deque>
@@ -83,15 +83,21 @@ public:
   static string getContentDispositionFilename(const string& header);
   static string getContentDispositionFilename(const string& header);
 
 
   // digest must be at least 20 bytes long.
   // digest must be at least 20 bytes long.
+#ifdef ENABLE_MESSAGE_DIGEST
   static void sha1Sum(unsigned char* digest, const void* data, int dataLength);
   static void sha1Sum(unsigned char* digest, const void* data, int dataLength);
+#endif // ENABLE_MESSAGE_DIGEST
 
 
   // Before call this method, allocate enough memory to the parameter "digest".
   // Before call this method, allocate enough memory to the parameter "digest".
   // For sha1, you need 20 bytes. For md5, 16 bytes.
   // For sha1, you need 20 bytes. For md5, 16 bytes.
+#ifdef ENABLE_MESSAGE_DIGEST
   static void fileChecksum(const string& filename, unsigned char* digest,
   static void fileChecksum(const string& filename, unsigned char* digest,
 			   MessageDigestContext::HashAlgo algo);
 			   MessageDigestContext::HashAlgo algo);
+#endif // ENABLE_MESSAGE_DIGEST
 
 
+#ifdef ENABLE_BITTORRENT
   static Integers computeFastSet(string ipaddr, const unsigned char* infoHash,
   static Integers computeFastSet(string ipaddr, const unsigned char* infoHash,
 				int pieces, int fastSetSize);
 				int pieces, int fastSetSize);
+#endif // ENABLE_BITTORRENT
 
 
   static int countBit(unsigned int);
   static int countBit(unsigned int);
 
 

+ 2 - 2
src/Xml2MetalinkProcessor.cc

@@ -88,8 +88,8 @@ MetalinkEntry* Xml2MetalinkProcessor::getEntry(const string& xpath) {
     entry->version = Util::trim(xpathContent(xpath+"/m:version"));
     entry->version = Util::trim(xpathContent(xpath+"/m:version"));
     entry->language = Util::trim(xpathContent(xpath+"/m:language"));
     entry->language = Util::trim(xpathContent(xpath+"/m:language"));
     entry->os = Util::trim(xpathContent(xpath+"/m:os"));
     entry->os = Util::trim(xpathContent(xpath+"/m:os"));
-    entry->md5 = Util::trim(xpathContent(xpath+"/m:verification/m:hash[@type=\"md5\"]"));
-    entry->sha1 = Util::trim(xpathContent(xpath+"/m:verification/m:hash[@type=\"sha1\"]"));
+    entry->md5 = Util::toLower(Util::trim(xpathContent(xpath+"/m:verification/m:hash[@type=\"md5\"]")));
+    entry->sha1 = Util::toLower(Util::trim(xpathContent(xpath+"/m:verification/m:hash[@type=\"sha1\"]")));
     for(int index = 1; 1; index++) {
     for(int index = 1; 1; index++) {
       MetalinkResource* resource =
       MetalinkResource* resource =
 	getResource(xpath+"/m:resources/m:url["+Util::itos(index)+"]");
 	getResource(xpath+"/m:resources/m:url["+Util::itos(index)+"]");

+ 121 - 67
src/main.cc

@@ -21,9 +21,7 @@
 /* copyright --> */
 /* copyright --> */
 #include "HttpInitiateConnectionCommand.h"
 #include "HttpInitiateConnectionCommand.h"
 #include "ConsoleDownloadEngine.h"
 #include "ConsoleDownloadEngine.h"
-#include "TorrentConsoleDownloadEngine.h"
 #include "SegmentMan.h"
 #include "SegmentMan.h"
-#include "TorrentMan.h"
 #include "SplitSlowestSegmentSplitter.h"
 #include "SplitSlowestSegmentSplitter.h"
 #include "LogFactory.h"
 #include "LogFactory.h"
 #include "common.h"
 #include "common.h"
@@ -31,13 +29,22 @@
 #include "Util.h"
 #include "Util.h"
 #include "InitiateConnectionCommandFactory.h"
 #include "InitiateConnectionCommandFactory.h"
 #include "prefs.h"
 #include "prefs.h"
-#include "PeerListenCommand.h"
-#include "TorrentAutoSaveCommand.h"
-#include "TrackerWatcherCommand.h"
-#include "TrackerUpdateCommand.h"
-#include "ByteArrayDiskWriter.h"
-#include "PeerChokeCommand.h"
-#include "Xml2MetalinkProcessor.h"
+
+#ifdef ENABLE_BITTORRENT
+# include "TorrentConsoleDownloadEngine.h"
+# include "TorrentMan.h"
+# include "PeerListenCommand.h"
+# include "TorrentAutoSaveCommand.h"
+# include "TrackerWatcherCommand.h"
+# include "TrackerUpdateCommand.h"
+# include "ByteArrayDiskWriter.h"
+# include "PeerChokeCommand.h"
+#endif // ENABLE_BITTORRENT
+
+#ifdef ENABLE_METALINK
+# include "Xml2MetalinkProcessor.h"
+#endif // ENABLE_METALINK
+
 #include <deque>
 #include <deque>
 #include <algorithm>
 #include <algorithm>
 #include <time.h>
 #include <time.h>
@@ -86,7 +93,9 @@ void setSignalHander(int signal, void (*handler)(int), int flags) {
 }
 }
 
 
 DownloadEngine* e;
 DownloadEngine* e;
+#ifdef ENABLE_BITTORRENT
 TorrentDownloadEngine* te;
 TorrentDownloadEngine* te;
+#endif // ENABLE_BITTORRENT
 
 
 void handler(int signal) {
 void handler(int signal) {
   printf(_("\nstopping application...\n"));
   printf(_("\nstopping application...\n"));
@@ -96,28 +105,14 @@ void handler(int signal) {
   e->cleanQueue();
   e->cleanQueue();
   delete e;
   delete e;
   printf(_("done\n"));
   printf(_("done\n"));
-  exit(0);
+  exit(EXIT_SUCCESS);
 }
 }
 
 
+#ifdef ENABLE_BITTORRENT
 void torrentHandler(int signal) {
 void torrentHandler(int signal) {
-  /*
-  printf(_("\nstopping application...\n"));
-  fflush(stdout);
-  te->torrentMan->diskAdaptor->closeFile();
-  if(te->torrentMan->downloadComplete() && te->isFilenameFixed()) {
-    te->torrentMan->remove();
-    //te->torrentMan->deleteTempFile();
-    printDownloadCompeleteMessage();
-  } else {
-    te->torrentMan->save();
-  }
-  te->cleanQueue();
-  delete te;
-  printf(_("done\n"));
-  exit(0);
-  */
   te->torrentMan->setHalt(true);
   te->torrentMan->setHalt(true);
 }
 }
+#endif // ENABLE_BITTORRENT
 
 
 void createRequest(int cuid, const string& url, string referer, Requests& requests) {
 void createRequest(int cuid, const string& url, string referer, Requests& requests) {
   Request* req = new Request();
   Request* req = new Request();
@@ -159,6 +154,9 @@ void showUsage() {
 #ifdef ENABLE_BITTORRENT
 #ifdef ENABLE_BITTORRENT
   printf(_("       %s [options] -T TORRENT_FILE FILE ...\n"), PACKAGE_NAME);
   printf(_("       %s [options] -T TORRENT_FILE FILE ...\n"), PACKAGE_NAME);
 #endif // ENABLE_BITTORRENT
 #endif // ENABLE_BITTORRENT
+#ifdef ENABLE_METALINK
+  printf(_("       %s [options] -M METALINK_FILE\n"), PACKAGE_NAME);
+#endif // ENABLE_METALINK
   cout << endl;
   cout << endl;
   cout << _("Options:") << endl;
   cout << _("Options:") << endl;
   cout << _(" -d, --dir=DIR                The directory to store downloaded file.") << endl;
   cout << _(" -d, --dir=DIR                The directory to store downloaded file.") << endl;
@@ -224,6 +222,20 @@ void showUsage() {
 	    "                              You can also use '-' to specify rangelike \"1-5\".\n"
 	    "                              You can also use '-' to specify rangelike \"1-5\".\n"
 	    "                              ',' and '-' can be used together.") << endl;
 	    "                              ',' and '-' can be used together.") << endl;
 #endif // ENABLE_BITTORRENT
 #endif // ENABLE_BITTORRENT
+#ifdef ENABLE_METALINK
+  cout << _(" -M, --metalink-file=METALINK_FILE The file path to .metalink file.") << endl;
+  cout << _(" -C, --metalink-servers=NUM_SERVERS The number of servers to connect to\n"
+	    "                              simultaneously. If more than one connection per\n"
+	    "                              server is required, use -s option.\n"
+	    "                              Default: 15") << endl;
+  cout << _(" --metalink-version=VERSION   The version of file to download.") << endl;
+  cout << _(" --metalink-language=LANGUAGE The language of file to download.") << endl;
+  cout << _(" --metalink-os=OS             The operating system the file is targeted.") << endl;
+  cout << _(" --follow-metalink=true|false  Setting this option to false prevents aria2 to\n"
+	    "                              enter Metalink mode even if the filename of\n"
+	    "                              downloaded file ends with .metalink.\n"
+	    "                              Default: true") << endl;
+#endif // ENABLE_METALINK
   cout << _(" -v, --version                Print the version number and exit.") << endl;
   cout << _(" -v, --version                Print the version number and exit.") << endl;
   cout << _(" -h, --help                   Print this message and exit.") << endl;
   cout << _(" -h, --help                   Print this message and exit.") << endl;
   cout << endl;
   cout << endl;
@@ -247,6 +259,7 @@ void showUsage() {
   cout << _(" You can mix up different protocols:") << endl;
   cout << _(" You can mix up different protocols:") << endl;
   cout << "  aria2c http://AAA.BBB.CCC/file.zip ftp://DDD.EEE.FFF/GGG/file.zip" << endl;
   cout << "  aria2c http://AAA.BBB.CCC/file.zip ftp://DDD.EEE.FFF/GGG/file.zip" << endl;
 #ifdef ENABLE_BITTORRENT
 #ifdef ENABLE_BITTORRENT
+  cout << endl;
   cout << _(" Download a torrent:") << endl;
   cout << _(" Download a torrent:") << endl;
   cout << "  aria2c -t 180 -o test.torrent http://AAA.BBB.CCC/file.torrent" << endl;
   cout << "  aria2c -t 180 -o test.torrent http://AAA.BBB.CCC/file.torrent" << endl;
   cout << _(" Download a torrent using local .torrent file:") << endl;
   cout << _(" Download a torrent using local .torrent file:") << endl;
@@ -255,8 +268,17 @@ void showUsage() {
   cout << "  aria2c -t 180 -T test.torrent dir/file1.zip dir/file2.zip" << endl;
   cout << "  aria2c -t 180 -T test.torrent dir/file1.zip dir/file2.zip" << endl;
   cout << _(" Print file listing of .torrent file:") << endl;
   cout << _(" Print file listing of .torrent file:") << endl;
   cout << "  aria2c -t 180 -T test.torrent -S" << endl;  
   cout << "  aria2c -t 180 -T test.torrent -S" << endl;  
-  cout << endl;
 #endif // ENABLE_BITTORRENT
 #endif // ENABLE_BITTORRENT
+#ifdef ENABLE_METALINK
+  cout << endl;
+  cout << _(" Metalink downloading:") << endl;
+  cout << "  aria2c http://AAA.BBB.CCC/file.metalink" << endl;
+  cout << _(" Download a file using local .metalink file:") << endl;
+  cout << "  aria2c -M test.metalink" << endl;
+  cout << _(" Metalink downloading with preferences:") << endl;
+  cout << "  aria2c -M test.metalink --metalink-version=1.1.1 --metalink-language=en-US" << endl;
+#endif // ENABLE_METALINK
+  cout << endl;
   printf(_("Report bugs to %s"), "<tujikawa at users dot sourceforge dot net>");
   printf(_("Report bugs to %s"), "<tujikawa at users dot sourceforge dot net>");
   cout << endl;
   cout << endl;
 }
 }
@@ -329,7 +351,7 @@ int main(int argc, char* argv[]) {
   string metalinkVersion;
   string metalinkVersion;
   string metalinkLanguage;
   string metalinkLanguage;
   string metalinkOs;
   string metalinkOs;
-  int metalinkConnection = 15;
+  int metalinkServers = 15;
   Integers selectFileIndexes;
   Integers selectFileIndexes;
 #ifdef ENABLE_BITTORRENT
 #ifdef ENABLE_BITTORRENT
   bool followTorrent = true;
   bool followTorrent = true;
@@ -396,7 +418,11 @@ int main(int argc, char* argv[]) {
 #endif // ENABLE_BITTORRENT
 #endif // ENABLE_BITTORRENT
 #ifdef ENABLE_METALINK
 #ifdef ENABLE_METALINK
       { "metalink-file", required_argument, NULL, 'M' },
       { "metalink-file", required_argument, NULL, 'M' },
-      { "metalink-connection", required_argument, NULL, 'C' },
+      { "metalink-servers", required_argument, NULL, 'C' },
+      { "metalink-version", required_argument, &lopt, 100 },
+      { "metalink-language", required_argument, &lopt, 101 },
+      { "metalink-os", required_argument, &lopt, 102 },
+      { "follow-metalink", required_argument, &lopt, 103 },
 #endif // ENABLE_METALINK
 #endif // ENABLE_METALINK
       { "version", no_argument, NULL, 'v' },
       { "version", no_argument, NULL, 'v' },
       { "help", no_argument, NULL, 'h' },
       { "help", no_argument, NULL, 'h' },
@@ -417,7 +443,7 @@ int main(int argc, char* argv[]) {
 	   !(0 < port && port <= 65535)) {
 	   !(0 < port && port <= 65535)) {
 	  cerr << _("unrecognized proxy format") << endl;
 	  cerr << _("unrecognized proxy format") << endl;
 	  showUsage();
 	  showUsage();
-	  exit(1);
+	  exit(EXIT_FAILURE);
 	}
 	}
 	op->put(PREF_HTTP_PROXY_HOST, proxy.first);
 	op->put(PREF_HTTP_PROXY_HOST, proxy.first);
 	op->put(PREF_HTTP_PROXY_PORT, Util::itos(port));
 	op->put(PREF_HTTP_PROXY_PORT, Util::itos(port));
@@ -453,7 +479,7 @@ int main(int argc, char* argv[]) {
 	if(!(0 <= wait && wait <= 60)) {
 	if(!(0 <= wait && wait <= 60)) {
 	  cerr << _("retry-wait must be between 0 and 60.") << endl;
 	  cerr << _("retry-wait must be between 0 and 60.") << endl;
 	  showUsage();
 	  showUsage();
-	  exit(1);
+	  exit(EXIT_FAILURE);
 	}
 	}
 	op->put(PREF_RETRY_WAIT, Util::itos(wait));
 	op->put(PREF_RETRY_WAIT, Util::itos(wait));
 	break;
 	break;
@@ -470,7 +496,7 @@ int main(int argc, char* argv[]) {
 	} else {
 	} else {
 	  cerr << _("ftp-type must be either 'binary' or 'ascii'.") << endl;
 	  cerr << _("ftp-type must be either 'binary' or 'ascii'.") << endl;
 	  showUsage();
 	  showUsage();
-	  exit(1);
+	  exit(EXIT_FAILURE);
 	}
 	}
 	break;
 	break;
       case 12:
       case 12:
@@ -479,7 +505,7 @@ int main(int argc, char* argv[]) {
 	} else {
 	} else {
 	  cerr << _("ftp-via-http-proxy must be either 'get' or 'tunnel'.") << endl;
 	  cerr << _("ftp-via-http-proxy must be either 'get' or 'tunnel'.") << endl;
 	  showUsage();
 	  showUsage();
-	  exit(1);
+	  exit(EXIT_FAILURE);
 	}
 	}
 	break;
 	break;
       case 13: {
       case 13: {
@@ -497,7 +523,7 @@ int main(int argc, char* argv[]) {
 	if(size < 1024) {
 	if(size < 1024) {
 	  cerr << _("min-segment-size invalid") << endl;
 	  cerr << _("min-segment-size invalid") << endl;
 	  showUsage();
 	  showUsage();
-	  exit(1);
+	  exit(EXIT_FAILURE);
 	}
 	}
 	op->put(PREF_MIN_SEGMENT_SIZE, Util::llitos(size));
 	op->put(PREF_MIN_SEGMENT_SIZE, Util::llitos(size));
 	break;
 	break;
@@ -508,7 +534,7 @@ int main(int argc, char* argv[]) {
 	} else {
 	} else {
 	  cerr << _("http-proxy-method must be either 'get' or 'tunnel'.") << endl;
 	  cerr << _("http-proxy-method must be either 'get' or 'tunnel'.") << endl;
 	  showUsage();
 	  showUsage();
-	  exit(1);
+	  exit(EXIT_FAILURE);
 	}
 	}
 	break;
 	break;
       case 15:
       case 15:
@@ -516,7 +542,7 @@ int main(int argc, char* argv[]) {
 	if(!(1024 <= listenPort && listenPort <= 65535)) {
 	if(!(1024 <= listenPort && listenPort <= 65535)) {
 	  cerr << _("listen-port must be between 1024 and 65535.") << endl;
 	  cerr << _("listen-port must be between 1024 and 65535.") << endl;
 	  showUsage();
 	  showUsage();
-	  exit(1);
+	  exit(EXIT_FAILURE);
 	}
 	}
 	break;
 	break;
       case 16:
       case 16:
@@ -527,7 +553,7 @@ int main(int argc, char* argv[]) {
 	} else {
 	} else {
 	  cerr << _("follow-torrent must be either 'true' or 'false'.") << endl;
 	  cerr << _("follow-torrent must be either 'true' or 'false'.") << endl;
 	  showUsage();
 	  showUsage();
-	  exit(1);
+	  exit(EXIT_FAILURE);
 	}
 	}
 	break;
 	break;
       case 18:
       case 18:
@@ -541,7 +567,7 @@ int main(int argc, char* argv[]) {
 	} else {
 	} else {
 	  cerr << _("direct-file-mapping must be either 'true' or 'false'.") << endl;
 	  cerr << _("direct-file-mapping must be either 'true' or 'false'.") << endl;
 	  showUsage();
 	  showUsage();
-	  exit(1);
+	  exit(EXIT_FAILURE);
 	}
 	}
 	break;
 	break;
       case 20: {
       case 20: {
@@ -549,7 +575,7 @@ int main(int argc, char* argv[]) {
 	if(0 > uploadSpeed) {
 	if(0 > uploadSpeed) {
 	  cerr << _("upload-limit must be greater than or equal to 0.") << endl;
 	  cerr << _("upload-limit must be greater than or equal to 0.") << endl;
 	  showUsage();
 	  showUsage();
-	  exit(1);
+	  exit(EXIT_FAILURE);
 	}
 	}
 	op->put(PREF_UPLOAD_LIMIT, Util::itos(uploadSpeed));
 	op->put(PREF_UPLOAD_LIMIT, Util::itos(uploadSpeed));
 	break;
 	break;
@@ -557,6 +583,26 @@ int main(int argc, char* argv[]) {
       case 21:
       case 21:
 	Util::unfoldRange(optarg, selectFileIndexes);
 	Util::unfoldRange(optarg, selectFileIndexes);
 	break;
 	break;
+      case 100:
+	metalinkVersion = string(optarg);
+	break;
+      case 101:
+	metalinkLanguage = string(optarg);
+	break;
+      case 102:
+	metalinkOs = string(optarg);
+	break;
+      case 103:
+	if(string(optarg) == "true") {
+	  followMetalink = true;
+	} else if(string(optarg) == "false") {
+	  followMetalink = false;
+	} else {
+	  cerr << _("follow-metalink must be either 'true' or 'false'.") << endl;
+	  showUsage();
+	  exit(EXIT_FAILURE);
+	}
+	break;
       }
       }
       break;
       break;
     }
     }
@@ -581,7 +627,7 @@ int main(int argc, char* argv[]) {
       if(!(1 <= split && split <= 5)) {
       if(!(1 <= split && split <= 5)) {
 	cerr << _("split must be between 1 and 5.") << endl;
 	cerr << _("split must be between 1 and 5.") << endl;
 	showUsage();
 	showUsage();
-	exit(1);
+	exit(EXIT_FAILURE);
       }
       }
       break;
       break;
     case 't': {
     case 't': {
@@ -591,7 +637,7 @@ int main(int argc, char* argv[]) {
       } else {
       } else {
 	cerr << _("timeout must be between 1 and 600") << endl;
 	cerr << _("timeout must be between 1 and 600") << endl;
 	showUsage();
 	showUsage();
-	exit(1);
+	exit(EXIT_FAILURE);
       }
       }
       break;
       break;
     }
     }
@@ -600,7 +646,7 @@ int main(int argc, char* argv[]) {
       if(retries < 0) {
       if(retries < 0) {
 	cerr << _("max-tries invalid") << endl;
 	cerr << _("max-tries invalid") << endl;
 	showUsage();
 	showUsage();
-	exit(1);
+	exit(EXIT_FAILURE);
       }
       }
       op->put(PREF_MAX_TRIES, Util::itos(retries));
       op->put(PREF_MAX_TRIES, Util::itos(retries));
       break;
       break;
@@ -618,35 +664,35 @@ int main(int argc, char* argv[]) {
       metalinkFile = string(optarg);
       metalinkFile = string(optarg);
       break;
       break;
     case 'C':
     case 'C':
-      metalinkConnection = (int)strtol(optarg, NULL, 10);
-      if(metalinkConnection <= 0) {
-	cerr << _("metalink-connection must be greater than 0.") << endl;
+      metalinkServers = (int)strtol(optarg, NULL, 10);
+      if(metalinkServers <= 0) {
+	cerr << _("metalink-servers must be greater than 0.") << endl;
 	showUsage();
 	showUsage();
-	exit(1);
+	exit(EXIT_FAILURE);
       }
       }
       break;      
       break;      
     case 'v':
     case 'v':
       showVersion();
       showVersion();
-      exit(0);
+      exit(EXIT_SUCCESS);
     case 'h':
     case 'h':
       showUsage();
       showUsage();
-      exit(0);
+      exit(EXIT_SUCCESS);
     default:
     default:
       showUsage();
       showUsage();
-      exit(1);
+      exit(EXIT_FAILURE);
     }
     }
   }
   }
   if(torrentFile.empty() && metalinkFile.empty()) {
   if(torrentFile.empty() && metalinkFile.empty()) {
     if(optind == argc) {
     if(optind == argc) {
       cerr << _("specify at least one URL") << endl;
       cerr << _("specify at least one URL") << endl;
       showUsage();
       showUsage();
-      exit(1);
+      exit(EXIT_FAILURE);
     }
     }
   }
   }
   if(daemonMode) {
   if(daemonMode) {
     if(daemon(1, 1) < 0) {
     if(daemon(1, 1) < 0) {
       perror(_("daemon failed"));
       perror(_("daemon failed"));
-      exit(1);
+      exit(EXIT_FAILURE);
     }
     }
   }
   }
   
   
@@ -660,9 +706,9 @@ int main(int argc, char* argv[]) {
 #ifdef HAVE_LIBGNUTLS
 #ifdef HAVE_LIBGNUTLS
   gnutls_global_init();
   gnutls_global_init();
 #endif // HAVE_LIBGNUTLS
 #endif // HAVE_LIBGNUTLS
-#ifdef HAVE_LIBXML2
+#ifdef ENABLE_METALINK
   xmlInitParser();
   xmlInitParser();
-#endif // HAVE_LIBXML2
+#endif // ENABLE_METALINK
   srandom(time(NULL));
   srandom(time(NULL));
   if(stdoutLog) {
   if(stdoutLog) {
     LogFactory::setLogFile("/dev/stdout");
     LogFactory::setLogFile("/dev/stdout");
@@ -675,7 +721,7 @@ int main(int argc, char* argv[]) {
   } catch(Exception* ex) {
   } catch(Exception* ex) {
     cerr << ex->getMsg() << endl;
     cerr << ex->getMsg() << endl;
     delete ex;
     delete ex;
-    exit(1);
+    exit(EXIT_FAILURE);
   }
   }
 
 
   setSignalHander(SIGPIPE, SIG_IGN, 0);
   setSignalHander(SIGPIPE, SIG_IGN, 0);
@@ -699,6 +745,7 @@ int main(int argc, char* argv[]) {
     for_each(requests.begin(), requests.end(), Deleter());
     for_each(requests.begin(), requests.end(), Deleter());
     requests.clear();
     requests.clear();
   }
   }
+#ifdef ENABLE_METALINK
   if(!metalinkFile.empty() || followMetalink && readyToMetalinkMode) {
   if(!metalinkFile.empty() || followMetalink && readyToMetalinkMode) {
     string targetMetalinkFile = metalinkFile.empty() ?
     string targetMetalinkFile = metalinkFile.empty() ?
       downloadedMetalinkFile : metalinkFile;
       downloadedMetalinkFile : metalinkFile;
@@ -709,8 +756,8 @@ int main(int argc, char* argv[]) {
 						  metalinkLanguage,
 						  metalinkLanguage,
 						  metalinkOs);
 						  metalinkOs);
     if(entry == NULL) {
     if(entry == NULL) {
-      printf("No file matched with your preference");
-      exit(1);
+      printf("No file matched with your preference.\n");
+      exit(EXIT_FAILURE);
     }
     }
     entry->dropUnsupportedResource();
     entry->dropUnsupportedResource();
     entry->reorderResourcesByPreference();
     entry->reorderResourcesByPreference();
@@ -719,14 +766,17 @@ int main(int argc, char* argv[]) {
     for(MetalinkResources::const_iterator itr = entry->resources.begin();
     for(MetalinkResources::const_iterator itr = entry->resources.begin();
 	itr != entry->resources.end(); itr++) {
 	itr != entry->resources.end(); itr++) {
       MetalinkResource* resource = *itr;
       MetalinkResource* resource = *itr;
-      createRequest(cuidCounter, resource->url, referer, requests); 
-      cuidCounter++;
+      for(int s = 1; s <= split; s++) {
+	createRequest(cuidCounter, resource->url, referer, requests); 
+	cuidCounter++;
+      }
     }
     }
     Requests reserved;
     Requests reserved;
-    if((int)requests.size() > metalinkConnection) {
-      copy(requests.begin()+metalinkConnection, requests.end(),
+    int maxConnection = metalinkServers*split;
+    if((int)requests.size() > maxConnection) {
+      copy(requests.begin()+maxConnection, requests.end(),
 	   insert_iterator<Requests>(reserved, reserved.end()));
 	   insert_iterator<Requests>(reserved, reserved.end()));
-      requests.erase(requests.begin()+metalinkConnection, requests.end());
+      requests.erase(requests.begin()+maxConnection, requests.end());
     }
     }
 
 
     setSignalHander(SIGINT, handler, 0);
     setSignalHander(SIGINT, handler, 0);
@@ -749,7 +799,10 @@ int main(int argc, char* argv[]) {
     }
     }
 
 
     delete metalinker;
     delete metalinker;
-  } else if(!torrentFile.empty() || followTorrent && readyToTorrentMode) {
+  }
+#endif // ENABLE_METALINK
+#ifdef ENABLE_BITTORRENT
+  if(!torrentFile.empty() || followTorrent && readyToTorrentMode) {
     try {
     try {
       //op->put(PREF_MAX_TRIES, "0");
       //op->put(PREF_MAX_TRIES, "0");
       setSignalHander(SIGINT, torrentHandler, SA_RESETHAND);
       setSignalHander(SIGINT, torrentHandler, SA_RESETHAND);
@@ -785,7 +838,7 @@ int main(int argc, char* argv[]) {
 		 Util::llitos(itr->length, true).c_str());
 		 Util::llitos(itr->length, true).c_str());
 	  cout << "---+---------------------------------------------------------------------------" << endl;
 	  cout << "---+---------------------------------------------------------------------------" << endl;
 	}
 	}
-	exit(0);
+	exit(EXIT_SUCCESS);
       } else {
       } else {
 	if(selectFileIndexes.empty()) {
 	if(selectFileIndexes.empty()) {
 	  Strings targetFiles;
 	  Strings targetFiles;
@@ -807,7 +860,7 @@ int main(int argc, char* argv[]) {
       }
       }
       if(port == -1) {
       if(port == -1) {
 	printf(_("Errors occurred while binding port.\n"));
 	printf(_("Errors occurred while binding port.\n"));
-	exit(1);
+	exit(EXIT_FAILURE);
       }
       }
       te->torrentMan->setPort(port);
       te->torrentMan->setPort(port);
       te->commands.push_back(listenCommand);
       te->commands.push_back(listenCommand);
@@ -832,16 +885,17 @@ int main(int argc, char* argv[]) {
     } catch(Exception* ex) {
     } catch(Exception* ex) {
       cerr << ex->getMsg() << endl;
       cerr << ex->getMsg() << endl;
       delete ex;
       delete ex;
-      exit(1);
+      exit(EXIT_FAILURE);
     }
     }
   }
   }
+#endif // ENABLE_BITTORRENT
   delete op;
   delete op;
   LogFactory::release();
   LogFactory::release();
 #ifdef HAVE_LIBGNUTLS
 #ifdef HAVE_LIBGNUTLS
   gnutls_global_deinit();
   gnutls_global_deinit();
 #endif // HAVE_LIBGNUTLS
 #endif // HAVE_LIBGNUTLS
-#ifdef HAVE_LIBXML2
+#ifdef ENABLE_METALINK
   xmlCleanupParser();
   xmlCleanupParser();
-#endif // HAVE_LIBXML2
+#endif // ENABLE_METALINK
   return 0;
   return 0;
 }
 }

+ 2 - 2
src/messageDigest.h

@@ -24,7 +24,7 @@
 
 
 #include "common.h"
 #include "common.h"
 
 
-#ifdef ENABLE_BITTORRENT
+#ifdef ENABLE_SSL
 
 
 #ifdef HAVE_LIBSSL
 #ifdef HAVE_LIBSSL
 #include <openssl/evp.h>
 #include <openssl/evp.h>
@@ -103,6 +103,6 @@ memcpy(HASH, gcry_md_read(CTX.ctx, 0), gcry_md_get_algo_dlen(CTX.algo));\
 #define digestFree(CTX) gcry_md_close(CTX.ctx)
 #define digestFree(CTX) gcry_md_close(CTX.ctx)
 #endif // HAVE_LIBGCRYPT
 #endif // HAVE_LIBGCRYPT
 
 
-#endif // ENABLE_BITTORRENT
+#endif // ENABLE_SSL
 
 
 #endif // _D_MESSAGE_DIGEST_H_
 #endif // _D_MESSAGE_DIGEST_H_

+ 4 - 0
test/Makefile.in

@@ -120,6 +120,10 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EGREP = @EGREP@
+ENABLE_BITTORRENT_FALSE = @ENABLE_BITTORRENT_FALSE@
+ENABLE_BITTORRENT_TRUE = @ENABLE_BITTORRENT_TRUE@
+ENABLE_METALINK_FALSE = @ENABLE_METALINK_FALSE@
+ENABLE_METALINK_TRUE = @ENABLE_METALINK_TRUE@
 EXEEXT = @EXEEXT@
 EXEEXT = @EXEEXT@
 GENCAT = @GENCAT@
 GENCAT = @GENCAT@
 GLIBC21 = @GLIBC21@
 GLIBC21 = @GLIBC21@