mirror of
https://github.com/aria2/aria2.git
synced 2025-01-04 09:03:46 +00:00
This commit is contained in:
parent
29374cd70c
commit
01118364a5
@ -154,6 +154,7 @@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
YACC = @YACC@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
|
8
README
8
README
@ -50,6 +50,8 @@ multi-file mode:
|
||||
The directory to store the top directory of downloaded files can be
|
||||
specified by -d option.
|
||||
|
||||
Note: -o option is used to change the filename of downloaded .torrent file.
|
||||
|
||||
This version only supports compact peers list format.
|
||||
Note:
|
||||
* -o option is used to change the filename of downloaded .torrent file.
|
||||
* This version only supports compact peers list format.
|
||||
* The ports aria2c uses are 6881-6999.
|
||||
* The maxmum number of peers are 55.
|
||||
|
42
config.h.in
42
config.h.in
@ -84,9 +84,15 @@
|
||||
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
|
||||
#undef HAVE_LANGINFO_CODESET
|
||||
|
||||
/* Define to 1 if you have the <langinfo.h> header file. */
|
||||
#undef HAVE_LANGINFO_H
|
||||
|
||||
/* Define if your <locale.h> file defines LC_MESSAGES. */
|
||||
#undef HAVE_LC_MESSAGES
|
||||
|
||||
/* Define to 1 if you have the <libintl.h> header file. */
|
||||
#undef HAVE_LIBINTL_H
|
||||
|
||||
/* Define to 1 if you have the `ssl' library (-lssl). */
|
||||
#undef HAVE_LIBSSL
|
||||
|
||||
@ -96,9 +102,16 @@
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
#undef HAVE_LOCALE_H
|
||||
|
||||
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
|
||||
to 0 otherwise. */
|
||||
#undef HAVE_MALLOC
|
||||
|
||||
/* Define to 1 if you have the <malloc.h> header file. */
|
||||
#undef HAVE_MALLOC_H
|
||||
|
||||
/* Define to 1 if you have the `memchr' function. */
|
||||
#undef HAVE_MEMCHR
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
@ -123,12 +136,19 @@
|
||||
/* Define to 1 if you have the <netinet/in.h> header file. */
|
||||
#undef HAVE_NETINET_IN_H
|
||||
|
||||
/* Define to 1 if you have the `nl_langinfo' function. */
|
||||
#undef HAVE_NL_LANGINFO
|
||||
|
||||
/* Define to 1 if you have the <nl_types.h> header file. */
|
||||
#undef HAVE_NL_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the `putenv' function. */
|
||||
#undef HAVE_PUTENV
|
||||
|
||||
/* Define to 1 if your system has a GNU libc compatible `realloc' function,
|
||||
and to 0 otherwise. */
|
||||
#undef HAVE_REALLOC
|
||||
|
||||
/* Define to 1 if you have the `rmdir' function. */
|
||||
#undef HAVE_RMDIR
|
||||
|
||||
@ -161,6 +181,9 @@
|
||||
uintmax_t. */
|
||||
#undef HAVE_STDINT_H_WITH_UINTMAX
|
||||
|
||||
/* Define to 1 if you have the <stdio_ext.h> header file. */
|
||||
#undef HAVE_STDIO_EXT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
@ -170,6 +193,12 @@
|
||||
/* Define to 1 if you have the `strcasecmp' function. */
|
||||
#undef HAVE_STRCASECMP
|
||||
|
||||
/* Define to 1 if you have the `strchr' function. */
|
||||
#undef HAVE_STRCHR
|
||||
|
||||
/* Define to 1 if you have the `strcspn' function. */
|
||||
#undef HAVE_STRCSPN
|
||||
|
||||
/* Define to 1 if you have the `strdup' function. */
|
||||
#undef HAVE_STRDUP
|
||||
|
||||
@ -293,6 +322,9 @@
|
||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
|
||||
#undef TM_IN_SYS_TIME
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
@ -305,12 +337,22 @@
|
||||
#undef inline
|
||||
#endif
|
||||
|
||||
/* Define to rpl_malloc if the replacement function should be used. */
|
||||
#undef malloc
|
||||
|
||||
/* Define to `long' if <sys/types.h> does not define. */
|
||||
#undef off_t
|
||||
|
||||
/* Define to rpl_realloc if the replacement function should be used. */
|
||||
#undef realloc
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
||||
|
||||
/* Define to unsigned long or unsigned long long if <stdint.h> and
|
||||
<inttypes.h> don't define. */
|
||||
#undef uintmax_t
|
||||
|
||||
/* Define to empty if the keyword `volatile' does not work. Warning: valid
|
||||
code using `volatile' can become incorrect without. Disable with care. */
|
||||
#undef volatile
|
||||
|
31
configure.in
31
configure.in
@ -2,14 +2,11 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
#
|
||||
AC_PREREQ(2.59)
|
||||
AC_INIT(aria2c, 0.2.1, tujikawa@rednoah.com)
|
||||
AC_INIT(aria2c, 0.3.0, tujikawa@rednoah.com)
|
||||
AM_INIT_AUTOMAKE()
|
||||
AM_PATH_CPPUNIT(1.10.2)
|
||||
AC_CONFIG_SRCDIR([src/Socket.h])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_PROG_RANLIB
|
||||
AM_GNU_GETTEXT
|
||||
AM_GNU_GETTEXT_VERSION(0.12.1)
|
||||
|
||||
# Set localedir
|
||||
localedir=${datadir}/locale
|
||||
@ -21,6 +18,9 @@ AC_ARG_ENABLE([ssl], [ --enable-ssl enalbe SSL support if libssl is
|
||||
# Checks for programs.
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_YACC
|
||||
|
||||
# Checks for libraries.
|
||||
if test "x$enable_ssl" = "xyes"; then
|
||||
@ -28,21 +28,36 @@ if test "x$enable_ssl" = "xyes"; then
|
||||
fi
|
||||
|
||||
# Checks for header files.
|
||||
AC_FUNC_ALLOCA
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h string.h sys/socket.h sys/time.h unistd.h limits.h])
|
||||
AC_CHECK_HEADERS([argz.h arpa/inet.h fcntl.h inttypes.h langinfo.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdio_ext.h stdlib.h string.h strings.h sys/param.h sys/socket.h sys/time.h unistd.h])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_HEADER_STDBOOL
|
||||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
AC_TYPE_SIZE_T
|
||||
AC_HEADER_TIME
|
||||
AC_STRUCT_TM
|
||||
AC_C_VOLATILE
|
||||
|
||||
# Checks for library functions.
|
||||
AM_GNU_GETTEXT
|
||||
AM_GNU_GETTEXT_VERSION(0.12.1)
|
||||
AC_FUNC_ERROR_AT_LINE
|
||||
|
||||
AC_FUNC_MALLOC
|
||||
AC_FUNC_MEMCMP
|
||||
AC_FUNC_MMAP
|
||||
AC_FUNC_REALLOC
|
||||
AC_FUNC_SELECT_ARGTYPES
|
||||
AC_FUNC_STAT
|
||||
AC_FUNC_VPRINTF
|
||||
AC_CHECK_FUNCS([getpagesize gettimeofday inet_ntoa memset mkdir rmdir select socket strcasecmp strerror strstr strtol])
|
||||
|
||||
AC_CONFIG_FILES([Makefile src/Makefile test/Makefile po/Makefile.in m4/Makefile intl/Makefile ])
|
||||
AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify getcwd getpagesize gettimeofday inet_ntoa memchr mempcpy memset mkdir munmap nl_langinfo rmdir select setlocale socket stpcpy strcasecmp strchr strcspn strdup strerror strstr strtol strtoul])
|
||||
AC_CONFIG_FILES([Makefile
|
||||
src/Makefile
|
||||
test/Makefile
|
||||
po/Makefile.in
|
||||
m4/Makefile
|
||||
intl/Makefile])
|
||||
AC_OUTPUT
|
||||
|
@ -128,6 +128,7 @@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
YACC = @YACC@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
|
@ -9,7 +9,7 @@
|
||||
# General Public License and is *not* in the public domain.
|
||||
|
||||
PACKAGE = aria2c
|
||||
VERSION = 0.2.1
|
||||
VERSION = 0.3.0
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
|
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: http://aria2.sourceforge.net/\n"
|
||||
"POT-Creation-Date: 2006-03-21 23:10+0900\n"
|
||||
"POT-Creation-Date: 2006-03-22 00:47+0900\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@ -370,11 +370,11 @@ msgid ""
|
||||
" Default: tunnel"
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:181
|
||||
#: src/main.cc:182
|
||||
msgid " --torrent-file=TORRENT_FILE The file path to .torrent file."
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:182
|
||||
#: src/main.cc:183
|
||||
msgid ""
|
||||
" --follow-torrent=true|false Setting this option to false prevents aria2 "
|
||||
"to\n"
|
||||
@ -383,93 +383,97 @@ msgid ""
|
||||
" Default: true"
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:186
|
||||
#: src/main.cc:188
|
||||
msgid " -v, --version Print the version number and exit."
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:187
|
||||
#: src/main.cc:189
|
||||
msgid " -h, --help Print this message and exit."
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:190
|
||||
#: src/main.cc:192
|
||||
msgid ""
|
||||
" You can specify multiple URLs. All URLs must point to the same file\n"
|
||||
" or downloading fails."
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:193
|
||||
#: src/main.cc:195
|
||||
msgid "Examples:"
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:194
|
||||
#: src/main.cc:196
|
||||
msgid " Download a file by 1 connection:"
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:196
|
||||
#: src/main.cc:198
|
||||
msgid " Download a file by 2 connections:"
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:198
|
||||
#: src/main.cc:200
|
||||
msgid " Download a file by 2 connections, each connects to a different server:"
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:200
|
||||
#: src/main.cc:202
|
||||
msgid " You can mix up different protocols:"
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:202
|
||||
msgid " Download a torrent"
|
||||
#: src/main.cc:205
|
||||
msgid " Download a torrent:"
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:205
|
||||
#: src/main.cc:207
|
||||
msgid " Download a torrent using local .torrent file:"
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:211
|
||||
#, c-format
|
||||
msgid "Reports bugs to %s"
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:284
|
||||
#: src/main.cc:296
|
||||
msgid "unrecognized proxy format"
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:310
|
||||
#: src/main.cc:322
|
||||
msgid "Currently, supported authentication scheme is basic."
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:319
|
||||
#: src/main.cc:331
|
||||
msgid "retry-wait must be between 0 and 60."
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:336
|
||||
#: src/main.cc:348
|
||||
msgid "ftp-type must be either 'binary' or 'ascii'."
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:345
|
||||
#: src/main.cc:357
|
||||
msgid "ftp-via-http-proxy must be either 'get' or 'tunnel'."
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:363
|
||||
#: src/main.cc:375
|
||||
msgid "min-segment-size invalid"
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:374
|
||||
#: src/main.cc:386
|
||||
msgid "http-proxy-method must be either 'get' or 'tunnel'."
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:388
|
||||
#: src/main.cc:400
|
||||
msgid "follow-torrent must be either 'true' or 'false'."
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:414
|
||||
#: src/main.cc:426
|
||||
msgid "split must be between 1 and 5."
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:424
|
||||
#: src/main.cc:436
|
||||
msgid "timeout must be between 1 and 600"
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:433
|
||||
#: src/main.cc:445
|
||||
msgid "max-tries invalid"
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:456
|
||||
#: src/main.cc:468
|
||||
msgid "specify at least one URL"
|
||||
msgstr ""
|
||||
|
74
po/ja.po
74
po/ja.po
@ -7,8 +7,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: aria2c 0.2.1\n"
|
||||
"Report-Msgid-Bugs-To: http://aria2.sourceforge.net/\n"
|
||||
"POT-Creation-Date: 2006-03-21 23:10+0900\n"
|
||||
"PO-Revision-Date: 2006-03-05 15:21+0900\n"
|
||||
"POT-Creation-Date: 2006-03-22 00:47+0900\n"
|
||||
"PO-Revision-Date: 2006-03-22 00:48+0900\n"
|
||||
"Last-Translator: Tatsuhiro Tsujikawa <tujikawa@rednoah.com>\n"
|
||||
"Language-Team: Japanese <ja@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -477,11 +477,11 @@ msgstr ""
|
||||
"く\n"
|
||||
" ださい. デフォルト値: tunnel"
|
||||
|
||||
#: src/main.cc:181
|
||||
msgid " --torrent-file=TORRENT_FILE The file path to .torrent file."
|
||||
msgstr ""
|
||||
|
||||
#: src/main.cc:182
|
||||
msgid " --torrent-file=TORRENT_FILE The file path to .torrent file."
|
||||
msgstr " --torrent-file=TORRENT_FILE .torrent ファイルのパスを指定."
|
||||
|
||||
#: src/main.cc:183
|
||||
msgid ""
|
||||
" --follow-torrent=true|false Setting this option to false prevents aria2 "
|
||||
"to\n"
|
||||
@ -489,17 +489,23 @@ msgid ""
|
||||
" downloaded file ends with .torrent.\n"
|
||||
" Default: true"
|
||||
msgstr ""
|
||||
" --follow-torrent=true|false このオプションを false に設定すると, ダウンロー"
|
||||
"ド\n"
|
||||
" したファイルの拡張子が .torrent であっても, "
|
||||
"aria2\n"
|
||||
" は, BitTorrent モードに入りません.\n"
|
||||
" デフォルト値: true"
|
||||
|
||||
#: src/main.cc:186
|
||||
#: src/main.cc:188
|
||||
msgid " -v, --version Print the version number and exit."
|
||||
msgstr " -v, --version バージョン番号を表示し, 終了します."
|
||||
|
||||
#: src/main.cc:187
|
||||
#: src/main.cc:189
|
||||
msgid " -h, --help Print this message and exit."
|
||||
msgstr ""
|
||||
" -h, --help このヘルプメッセージを表示し, 終了します."
|
||||
|
||||
#: src/main.cc:190
|
||||
#: src/main.cc:192
|
||||
msgid ""
|
||||
" You can specify multiple URLs. All URLs must point to the same file\n"
|
||||
" or downloading fails."
|
||||
@ -508,81 +514,83 @@ msgstr ""
|
||||
"れ\n"
|
||||
" ばなりません. さもなくばダウンロードは失敗します."
|
||||
|
||||
#: src/main.cc:193
|
||||
#: src/main.cc:195
|
||||
msgid "Examples:"
|
||||
msgstr "例:"
|
||||
|
||||
#: src/main.cc:194
|
||||
#: src/main.cc:196
|
||||
msgid " Download a file by 1 connection:"
|
||||
msgstr " 1 コネクションでのダウンロード:"
|
||||
|
||||
#: src/main.cc:196
|
||||
#: src/main.cc:198
|
||||
msgid " Download a file by 2 connections:"
|
||||
msgstr " 2 コネクションでのダウンロード:"
|
||||
|
||||
#: src/main.cc:198
|
||||
#: src/main.cc:200
|
||||
msgid " Download a file by 2 connections, each connects to a different server:"
|
||||
msgstr " 二つの異なるサーバーに接続してダウンロード:"
|
||||
|
||||
#: src/main.cc:200
|
||||
#: src/main.cc:202
|
||||
msgid " You can mix up different protocols:"
|
||||
msgstr " 異なるプロトコルを混合させてダウンロード:"
|
||||
|
||||
#: src/main.cc:202
|
||||
#, fuzzy
|
||||
msgid " Download a torrent"
|
||||
msgstr "CUID#%d - ダウンロードを中止します."
|
||||
|
||||
#: src/main.cc:205
|
||||
msgid " Download a torrent:"
|
||||
msgstr "torrent をダウンロード:"
|
||||
|
||||
#: src/main.cc:207
|
||||
msgid " Download a torrent using local .torrent file:"
|
||||
msgstr " ローカル .torrent ファイルを使ってダウンロード:"
|
||||
|
||||
#: src/main.cc:211
|
||||
#, c-format
|
||||
msgid "Reports bugs to %s"
|
||||
msgstr "バグレポートはこちらへ: %s"
|
||||
|
||||
#: src/main.cc:284
|
||||
#: src/main.cc:296
|
||||
msgid "unrecognized proxy format"
|
||||
msgstr "理解できないProxyフォーマットです."
|
||||
|
||||
#: src/main.cc:310
|
||||
#: src/main.cc:322
|
||||
msgid "Currently, supported authentication scheme is basic."
|
||||
msgstr "現在サポートされている認証方法は basic です."
|
||||
|
||||
#: src/main.cc:319
|
||||
#: src/main.cc:331
|
||||
msgid "retry-wait must be between 0 and 60."
|
||||
msgstr "retry-wait は 0 から 60 の間で指定してください."
|
||||
|
||||
#: src/main.cc:336
|
||||
#: src/main.cc:348
|
||||
msgid "ftp-type must be either 'binary' or 'ascii'."
|
||||
msgstr "ftp-type は 'binary' または 'ascii' を指定してください."
|
||||
|
||||
#: src/main.cc:345
|
||||
#: src/main.cc:357
|
||||
msgid "ftp-via-http-proxy must be either 'get' or 'tunnel'."
|
||||
msgstr "ftp-via-http-proxy は 'get' または 'tunnel' を指定してください."
|
||||
|
||||
#: src/main.cc:363
|
||||
#: src/main.cc:375
|
||||
msgid "min-segment-size invalid"
|
||||
msgstr "min-segment-size が不正です."
|
||||
|
||||
#: src/main.cc:374
|
||||
#: src/main.cc:386
|
||||
msgid "http-proxy-method must be either 'get' or 'tunnel'."
|
||||
msgstr "http-proxy-method は 'get' または 'tunnel' を指定してください."
|
||||
|
||||
#: src/main.cc:388
|
||||
#, fuzzy
|
||||
#: src/main.cc:400
|
||||
msgid "follow-torrent must be either 'true' or 'false'."
|
||||
msgstr "ftp-type は 'binary' または 'ascii' を指定してください."
|
||||
msgstr "follow-torrent は 'true' または 'false を指定してください."
|
||||
|
||||
#: src/main.cc:414
|
||||
#: src/main.cc:426
|
||||
msgid "split must be between 1 and 5."
|
||||
msgstr "split は 1 - 5 の値を指定してください."
|
||||
|
||||
#: src/main.cc:424
|
||||
#: src/main.cc:436
|
||||
msgid "timeout must be between 1 and 600"
|
||||
msgstr "timeout は 1 - 600 の値を指定してください."
|
||||
|
||||
#: src/main.cc:433
|
||||
#: src/main.cc:445
|
||||
msgid "max-tries invalid"
|
||||
msgstr "max-tries が不正です."
|
||||
|
||||
#: src/main.cc:456
|
||||
#: src/main.cc:468
|
||||
msgid "specify at least one URL"
|
||||
msgstr "一個以上の URL を指定してください."
|
||||
|
@ -27,7 +27,9 @@
|
||||
#include <fcntl.h>
|
||||
#include "DlAbortEx.h"
|
||||
#include "File.h"
|
||||
#ifdef HAVE_LIBSSL
|
||||
#include <openssl/evp.h>
|
||||
#endif // HAVE_LIBSSL
|
||||
#include "Util.h"
|
||||
|
||||
AbstractDiskWriter::AbstractDiskWriter():fd(0) {}
|
||||
@ -82,6 +84,7 @@ int AbstractDiskWriter::readDataInternal(char* data, int len) {
|
||||
}
|
||||
|
||||
string AbstractDiskWriter::sha1Sum(long long int offset, long long int length) {
|
||||
#ifdef HAVE_LIBSSL
|
||||
EVP_MD_CTX ctx;
|
||||
EVP_MD_CTX_init(&ctx);
|
||||
EVP_DigestInit_ex(&ctx, EVP_sha1(), NULL);
|
||||
@ -112,6 +115,9 @@ string AbstractDiskWriter::sha1Sum(long long int offset, long long int length) {
|
||||
EVP_MD_CTX_cleanup(&ctx);
|
||||
throw new DlAbortEx(strerror(errno));
|
||||
}
|
||||
#else
|
||||
return "";
|
||||
#endif // HASHVALUE
|
||||
}
|
||||
|
||||
void AbstractDiskWriter::seek(long long int offset) {
|
||||
|
@ -214,6 +214,7 @@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
YACC = @YACC@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
|
@ -23,15 +23,20 @@
|
||||
#include "Util.h"
|
||||
|
||||
ShaVisitor::ShaVisitor() {
|
||||
#ifdef HAVE_LIBSSL
|
||||
EVP_MD_CTX_init(&ctx);
|
||||
EVP_DigestInit_ex(&ctx, EVP_sha1(), NULL);
|
||||
#endif // HAVE_LIBSSL
|
||||
}
|
||||
|
||||
ShaVisitor::~ShaVisitor() {
|
||||
#ifdef HAVE_LIBSSL
|
||||
EVP_MD_CTX_cleanup(&ctx);
|
||||
#endif // HAVE_LIBSSL
|
||||
}
|
||||
|
||||
void ShaVisitor::visit(const Data* d) {
|
||||
#ifdef HAVE_LIBSSL
|
||||
if(d->isNumber()) {
|
||||
EVP_DigestUpdate(&ctx, "i", 1);
|
||||
} else {
|
||||
@ -43,9 +48,11 @@ void ShaVisitor::visit(const Data* d) {
|
||||
if(d->isNumber()) {
|
||||
EVP_DigestUpdate(&ctx, "e", 1);
|
||||
}
|
||||
#endif // HAVE_LIBSSL
|
||||
}
|
||||
|
||||
void ShaVisitor::visit(const Dictionary* d) {
|
||||
#ifdef HAVE_LIBSSL
|
||||
EVP_DigestUpdate(&ctx, "d", 1);
|
||||
const vector<string>& v = d->getOrder();
|
||||
for(vector<string>::const_iterator itr = v.begin(); itr != v.end(); itr++) {
|
||||
@ -57,14 +64,17 @@ void ShaVisitor::visit(const Dictionary* d) {
|
||||
this->visit(e);
|
||||
}
|
||||
EVP_DigestUpdate(&ctx, "e", 1);
|
||||
#endif // HAVE_LIBSSL
|
||||
}
|
||||
|
||||
void ShaVisitor::visit(const List* l) {
|
||||
#ifdef HAVE_LIBSSL
|
||||
EVP_DigestUpdate(&ctx, "l", 1);
|
||||
for(MetaList::const_iterator itr = l->getList().begin(); itr != l->getList().end(); itr++) {
|
||||
this->visit(*itr);
|
||||
}
|
||||
EVP_DigestUpdate(&ctx, "e", 1);
|
||||
#endif // HAVE_LIBSSL
|
||||
}
|
||||
|
||||
void ShaVisitor::visit(const MetaEntry* e) {
|
||||
@ -78,5 +88,7 @@ void ShaVisitor::visit(const MetaEntry* e) {
|
||||
}
|
||||
|
||||
void ShaVisitor::getHash(unsigned char* hashValue, int& len) {
|
||||
#ifdef HAVE_LIBSSL
|
||||
EVP_DigestFinal_ex(&ctx, hashValue, (unsigned int*)&len);
|
||||
#endif // HAVE_LIBSSL
|
||||
}
|
||||
|
@ -27,11 +27,15 @@
|
||||
#include "Dictionary.h"
|
||||
#include "List.h"
|
||||
#include "common.h"
|
||||
#ifdef HAVE_LIBSSL
|
||||
#include <openssl/evp.h>
|
||||
#endif // HAVE_LIBSSL
|
||||
|
||||
class ShaVisitor : public MetaEntryVisitor {
|
||||
private:
|
||||
#ifdef HAVE_LIBSSL
|
||||
EVP_MD_CTX ctx;
|
||||
#endif // HAVE_LIBSSL
|
||||
public:
|
||||
ShaVisitor();
|
||||
~ShaVisitor();
|
||||
|
14
src/main.cc
14
src/main.cc
@ -178,11 +178,13 @@ void showUsage() {
|
||||
cout << _(" --ftp-via-http-proxy=METHOD Use HTTP proxy in FTP. METHOD is either 'get' or\n"
|
||||
" 'tunnel'.\n"
|
||||
" Default: tunnel") << endl;
|
||||
#ifdef HAVE_LIBSSL
|
||||
cout << _(" --torrent-file=TORRENT_FILE The file path to .torrent file.") << endl;
|
||||
cout << _(" --follow-torrent=true|false Setting this option to false prevents aria2 to\n"
|
||||
" enter BitTorrent mode even if the filename of\n"
|
||||
" downloaded file ends with .torrent.\n"
|
||||
" Default: true") << endl;
|
||||
#endif // HAVE_LIBSSL
|
||||
cout << _(" -v, --version Print the version number and exit.") << endl;
|
||||
cout << _(" -h, --help Print this message and exit.") << endl;
|
||||
cout << endl;
|
||||
@ -199,9 +201,13 @@ void showUsage() {
|
||||
cout << " aria2c http://AAA.BBB.CCC/file.zip http://DDD.EEE.FFF/GGG/file.zip" << 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 << _(" Download a torrent") << endl;
|
||||
#ifdef HAVE_LIBSSL
|
||||
cout << _(" Download a torrent:") << endl;
|
||||
cout << " aria2c -o test.torret http://AAA.BBB.CCC/file.torrent" << endl;
|
||||
cout << _(" Download a torrent using local .torrent file:") << endl;
|
||||
cout << " aria2c --torrent-file test.torrent" << endl;
|
||||
cout << endl;
|
||||
#endif // HAVE_LIBSSL
|
||||
printf(_("Reports bugs to %s"), "<tujikawa at users dot sourceforge dot net>");
|
||||
cout << endl;
|
||||
}
|
||||
@ -221,7 +227,11 @@ int main(int argc, char* argv[]) {
|
||||
bool daemonMode = false;
|
||||
string referer;
|
||||
string torrentFile;
|
||||
#ifdef HAVE_LIBSSL
|
||||
bool followTorrent = true;
|
||||
#else
|
||||
bool followTorrent = false;
|
||||
#endif // HAVE_LIBSSL
|
||||
|
||||
int c;
|
||||
Option* op = new Option();
|
||||
@ -262,8 +272,10 @@ int main(int argc, char* argv[]) {
|
||||
{ "ftp-via-http-proxy", required_argument, &lopt, 12 },
|
||||
{ "min-segment-size", required_argument, &lopt, 13 },
|
||||
{ "http-proxy-method", required_argument, &lopt, 14 },
|
||||
#ifdef HAVE_LIBSSL
|
||||
{ "torrent-file", required_argument, &lopt, 15 },
|
||||
{ "follow-torrent", required_argument, &lopt, 16 },
|
||||
#endif // HAVE_LIBSSL
|
||||
{ "version", no_argument, NULL, 'v' },
|
||||
{ "help", no_argument, NULL, 'h' },
|
||||
{ 0, 0, 0, 0 }
|
||||
|
@ -154,6 +154,7 @@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
YACC = @YACC@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
|
Loading…
Reference in New Issue
Block a user