From 15b207a53eaede393699c089ac0707796add8095 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 29 Apr 2006 11:23:39 +0000 Subject: [PATCH] * 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. --- ChangeLog | 15 ++++++++++++++- configure | 20 ++++++++++---------- configure.ac | 2 +- po/Makefile.in | 2 +- po/ja.gmo | Bin 21398 -> 22315 bytes po/ja.po | 9 ++++++--- src/SendMessageQueue.cc | 3 --- src/Socket.cc | 16 ++++++++-------- src/Socket.h | 8 ++++---- src/SocketCore.cc | 6 +++--- src/SocketCore.h | 12 +++--------- src/TorrentDownloadEngine.cc | 4 ++-- src/main.cc | 6 +++--- 13 files changed, 55 insertions(+), 48 deletions(-) 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 253907d353c01e29a1c4d7dfe8450295626dc710..5ea5ef32c32af1e6977d1e090c62871d26d4567d 100644 GIT binary patch delta 3620 zcmZ|R32;@_9mny15Ril{AVMG-xP&Dvc}W3-5Ksw*JrY_L!KF3JgG9o6A@9W)sC}9M zMeQ<*rFNz=rQ8=RShY=C%upL342gCcXr~tHk`9hjYpqiOX=hsP^!vN_W=1;GGyLD@ zoO746-?0C1%F!2768$#}{*I9zCvGNc2Ag%^3&Z#!JwM!RBK`e&1#4`NujbzP58xhLLizhxLi_eEnLSkG zGOP%?xClq(n9ap?n8u5rMAh%V$@e@?q&${sTZSc=hpkwMNu*EqdmN7+;1nE|YxXo2 z;$+&llVtA2KVvE`=I$|Ajts`C@eXW3Zm~|JZ99(>@Jdh~MS-zc5vqPUKk85|-i}YA zX7F{Kg*guMKbcH9nW?xPnQeO(Sq(dix8SR&`!1t8n9Z=Y_7hPJRG^lq5$9uP;1!%n zImAtKa1*NhP0ZJQdCdO|G8d`fpQTUor>F?kz_CG<*it;H#((e1JnSmzy=v$x{;kl-)`N`^nZI8`Nr0GZ06X&Gw+y@({9d?UmsA zYp8?r7HaC>3+g{Zwu@ykt#U@-64b~aKrO}I1eq_8xquAHQn{+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rWj#M6YX=ZTGkmTLmhhtRd0aC98_(79{H2h9C1 zR|RSl>a6qCbiaPJm_gJK+leYd*8-xOTk^gI<&+EkdY$jXBvD}xS|!n0>p$PWI|*5O z_uIS)*^llu$d}FHUdmV(q9ZZVZSgi>HRYZ}JTZ*mAi0;0+jL?Lv6;}Nqw8I~EtL|d zhyM(EJN#wu&VPT|@a~C-!o|b@;u%7x<5glU5h4D)I#5_atR&|6jgxUap>M^iBQ;@AoxD 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 {