diff --git a/ChangeLog b/ChangeLog index 3c0a00b3..08f85fa9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,7 +8,20 @@ (unfoldSubRange): New function * src/main.cc (showUsage): Added help message. - (main): Added --select-file command-line option. + (main): Added --select-file command-line option. Updated the layout of + file listing. + * src/common.h + (Integers): New definition. + + * src/SocketCore.cc + (writeData): Removed timeout argument. + (readData): Removed timeout argument. + (peekData): Removed timeout argument. + * src/Socket.cc + (writeData): Removed timeout argument. + (readData): Removed timeout argument. + (peekData): Removed timeout argument. + 2006-04-28 Tatsuhiro Tsujikawa diff --git a/configure b/configure index da453670..e6ad1769 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for aria2c 0.4.0. +# Generated by GNU Autoconf 2.59 for aria2c 0.4.1. # # Report bugs to . # @@ -269,8 +269,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='aria2c' PACKAGE_TARNAME='aria2c' -PACKAGE_VERSION='0.4.0' -PACKAGE_STRING='aria2c 0.4.0' +PACKAGE_VERSION='0.4.1' +PACKAGE_STRING='aria2c 0.4.1' PACKAGE_BUGREPORT='tujikawa@rednoah.com' ac_unique_file="src/Socket.h" @@ -788,7 +788,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures aria2c 0.4.0 to adapt to many kinds of systems. +\`configure' configures aria2c 0.4.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -854,7 +854,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of aria2c 0.4.0:";; + short | recursive ) echo "Configuration of aria2c 0.4.1:";; esac cat <<\_ACEOF @@ -994,7 +994,7 @@ fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -aria2c configure 0.4.0 +aria2c configure 0.4.1 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -1008,7 +1008,7 @@ cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by aria2c $as_me 0.4.0, which was +It was created by aria2c $as_me 0.4.1, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1651,7 +1651,7 @@ fi # Define the identity of the package. PACKAGE='aria2c' - VERSION='0.4.0' + VERSION='0.4.1' cat >>confdefs.h <<_ACEOF @@ -11529,7 +11529,7 @@ _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by aria2c $as_me 0.4.0, which was +This file was extended by aria2c $as_me 0.4.1, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -11592,7 +11592,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -aria2c config.status 0.4.0 +aria2c config.status 0.4.1 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.ac b/configure.ac index 47ad6137..b9f39335 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. # AC_PREREQ(2.59) -AC_INIT(aria2c, 0.4.0, tujikawa@rednoah.com) +AC_INIT(aria2c, 0.4.1, tujikawa@rednoah.com) AM_INIT_AUTOMAKE() AM_PATH_CPPUNIT(1.10.2) AC_CONFIG_SRCDIR([src/Socket.h]) diff --git a/po/Makefile.in b/po/Makefile.in index 3c256007..73884307 100644 --- a/po/Makefile.in +++ b/po/Makefile.in @@ -9,7 +9,7 @@ # General Public License and is *not* in the public domain. PACKAGE = aria2c -VERSION = 0.4.0 +VERSION = 0.4.1 SHELL = /bin/sh diff --git a/po/ja.gmo b/po/ja.gmo index 253907d3..5ea5ef32 100644 Binary files a/po/ja.gmo and b/po/ja.gmo differ diff --git a/po/ja.po b/po/ja.po index dbbdc4f1..305ca82b 100644 --- a/po/ja.po +++ b/po/ja.po @@ -705,9 +705,12 @@ msgid "" "\".\n" " ',' and '-' can be used together.\n" msgstr "" -" --select-file=INDEX... インデックスでダウンロード対象ファイルを指定しま\n" -" す. インデックスは --show-files オプションで知る\n" -" ことができます. 複数のインデックスを ',' で区切っ\n" +" --select-file=INDEX... インデックスでダウンロード対象ファイルを指定し" +"ま\n" +" す. インデックスは --show-files オプションで知" +"る\n" +" ことができます. 複数のインデックスを ',' で区" +"切っ\n" " て指定できます: \"3,6\"\n" " また, '-' を使って範囲指定もできます: \"1-5\"\n" " ',' と '-' は組み合わせて使うことができます.\n" diff --git a/src/SendMessageQueue.cc b/src/SendMessageQueue.cc index 4b88d3ea..fd052037 100644 --- a/src/SendMessageQueue.cc +++ b/src/SendMessageQueue.cc @@ -35,14 +35,12 @@ SendMessageQueue::~SendMessageQueue() { } void SendMessageQueue::send(int uploadSpeed) { - //logger->debug("SendMessageQueue:send start"); int size = pendingMessages.size(); for(int i = 0; i < size; i++) { PendingMessage msg = pendingMessages.front(); pendingMessages.pop_front(); if(uploadLimit != 0 && uploadSpeed >= uploadLimit*1024 && msg.getPeerMessageId() == PeerMessage::PIECE && !msg.isInProgress()) { - //logger->debug("upload speed limiter enabled, uploadSpeed=%d", uploadSpeed); pendingMessages.push_back(msg); } else { if(!msg.processMessage()) { @@ -51,7 +49,6 @@ void SendMessageQueue::send(int uploadSpeed) { } } } - //logger->debug("SendMessageQueue:send end"); } void SendMessageQueue::addPendingMessage(const PendingMessage& pendingMessage) { diff --git a/src/Socket.cc b/src/Socket.cc index 881e6bbc..a7840642 100644 --- a/src/Socket.cc +++ b/src/Socket.cc @@ -89,20 +89,20 @@ bool Socket::isReadable(int timeout) const { return core->isReadable(timeout); } -void Socket::writeData(const char* data, int len, int timeout) const { - core->writeData(data, len, timeout); +void Socket::writeData(const char* data, int len) const { + core->writeData(data, len); } -void Socket::writeData(const string& str, int timeout) const { - core->writeData(str.c_str(), str.size(), timeout); +void Socket::writeData(const string& str) const { + core->writeData(str.c_str(), str.size()); } -void Socket::readData(char* data, int& len, int timeout) const { - core->readData(data, len, timeout); +void Socket::readData(char* data, int& len) const { + core->readData(data, len); } -void Socket::peekData(char* data, int& len, int timeout) const { - core->peekData(data, len, timeout); +void Socket::peekData(char* data, int& len) const { + core->peekData(data, len); } void Socket::initiateSecureConnection() const { diff --git a/src/Socket.h b/src/Socket.h index d9686285..5667f207 100644 --- a/src/Socket.h +++ b/src/Socket.h @@ -96,22 +96,22 @@ public: /** * @see SocketCore::writeData() */ - void writeData(const char* data, int len, int timeout = 5) const; + void writeData(const char* data, int len) const; /** * A covenient function that can take string class parameter and * internally calls SocketCore::writeData(). */ - void writeData(const string& str, int timeout = 5) const; + void writeData(const string& str) const; /** * @see SocketCore::readData() */ - void readData(char* data, int& len, int timeout = 5) const; + void readData(char* data, int& len) const; /** * @see SocketCore::peekData() */ - void peekData(char* data, int& len, int timeout = 5) const; + void peekData(char* data, int& len) const; /** * @see SocketCore::initiateSecureConnection() diff --git a/src/SocketCore.cc b/src/SocketCore.cc index 9002dc1b..2a8b54eb 100644 --- a/src/SocketCore.cc +++ b/src/SocketCore.cc @@ -262,7 +262,7 @@ bool SocketCore::isReadable(int timeout) const { } } -void SocketCore::writeData(const char* data, int len, int timeout) { +void SocketCore::writeData(const char* data, int len) { int ret = 0; if(!secure && (ret = send(sockfd, data, (size_t)len, 0)) != len #ifdef HAVE_LIBSSL @@ -288,7 +288,7 @@ void SocketCore::writeData(const char* data, int len, int timeout) { } } -void SocketCore::readData(char* data, int& len, int timeout) { +void SocketCore::readData(char* data, int& len) { int ret = 0; if(!secure && (ret = recv(sockfd, data, (size_t)len, 0)) < 0 #ifdef HAVE_LIBSSL @@ -315,7 +315,7 @@ void SocketCore::readData(char* data, int& len, int timeout) { len = ret; } -void SocketCore::peekData(char* data, int& len, int timeout) { +void SocketCore::peekData(char* data, int& len) { int ret = 0; if(!secure && (ret = recv(sockfd, data, (size_t)len, MSG_PEEK)) < 0 #ifdef HAVE_LIBSSL diff --git a/src/SocketCore.h b/src/SocketCore.h index 7c2a2634..e1b54464 100644 --- a/src/SocketCore.h +++ b/src/SocketCore.h @@ -139,10 +139,8 @@ public: * for this method call. * @param data data to write * @param len length of data - * @param timeout the amount of time elapsed before isWritable() - * are timed out. */ - void writeData(const char* data, int len, int timeout = 0); + void writeData(const char* data, int len); /** * Reads up to len bytes from this socket. @@ -155,10 +153,8 @@ public: * @param data holder to store data. * @param len the maximum size data can store. This method assigns * the number of bytes read to len. - * @param timeout the amount of time elapsed before isReadable() are timed - * out. */ - void readData(char* data, int& len, int timeout = 0); + void readData(char* data, int& len); /** * Reads up to len bytes from this socket, but bytes are not removed from @@ -168,10 +164,8 @@ public: * @param data holder to store data. * @param len the maximum size data can store. This method assigns * the number of bytes read to len. - * @param timeout the amount of time elapsed before isReadable() are timed - * out. */ - void peekData(char* data, int& len, int timeout = 0); + void peekData(char* data, int& len); /** * Makes this socket secure. diff --git a/src/TorrentDownloadEngine.cc b/src/TorrentDownloadEngine.cc index cfd6e57c..48038b6d 100644 --- a/src/TorrentDownloadEngine.cc +++ b/src/TorrentDownloadEngine.cc @@ -96,10 +96,10 @@ void TorrentDownloadEngine::calculateStatistics() { totalLength = torrentMan->getTotalLength(); } + downloadSpeed = calculateSpeed(sessionDownloadLengthArray[currentCp], elapsed); + uploadSpeed = calculateSpeed(sessionUploadLengthArray[currentCp], elapsed); if(elapsed-lastElapsed >= 1) { - downloadSpeed = calculateSpeed(sessionDownloadLengthArray[currentCp], elapsed); - uploadSpeed = calculateSpeed(sessionUploadLengthArray[currentCp], elapsed); avgSpeed = calculateSpeed(sessionDownloadLength, Util::difftvsec(now, startup)); if(avgSpeed < 0) { diff --git a/src/main.cc b/src/main.cc index e08d8c84..0dec5554 100644 --- a/src/main.cc +++ b/src/main.cc @@ -670,13 +670,13 @@ int main(int argc, char* argv[]) { te->torrentMan->readFileEntryFromMetaInfoFile(targetTorrentFile); cout << _("Files:") << endl; cout << "idx|path/length" << endl; - cout << "===============================================================================" << endl; + cout << "===+===========================================================================" << endl; int count = 1; for(FileEntries::const_iterator itr = fileEntries.begin(); itr != fileEntries.end(); count++, itr++) { - printf("%3d %s\n %s Bytes\n", count, itr->path.c_str(), + printf("%3d|%s\n |%s Bytes\n", count, itr->path.c_str(), Util::llitos(itr->length, true).c_str()); - cout << "-------------------------------------------------------------------------------" << endl; + cout << "---+---------------------------------------------------------------------------" << endl; } exit(0); } else {