Commit Graph

625 Commits (06644332c2cc5b229ef41857ceed73f7caf2775f)

Author SHA1 Message Date
Tatsuhiro Tsujikawa 06644332c2 2008-06-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Applied Ross's aria2-0.13.2+1-mingw-3.patch.
	* test/HttpHeaderTest.cc: Casted to off_t where it should.
	* test/HttpRequestTest.cc: Casted to off_t where it should.
2008-06-16 11:27:52 +00:00
Tatsuhiro Tsujikawa b559054701 2008-06-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Applied Ross's aria2-0.13.2+1-mingw.patch and
	aria2-0.13.2+1-mingw-2.patch.
	* src/ConsoleStatCalc.cc: Added HAVE_TERMIOUS_H directive for 
the
	systems	which don't have termious.h. I moved the directive 
inside of
	if(isTTY) { ... clause so that line is wiped out without 
termious.h.
	I also removed HAVE_ASCTIME_R clause because asctime_r is 
provided
	anyway.
	* src/asctime_r.h
	* src/asctime_r.c: Added for the systems don't have asctime_r 
function.
	I added 2nd argument to the prototype declaration.
	* src/StringFormat.cc: Get rid of vasprintf.
	* src/getaddrinfo.h: Fixed constants.
	* configure.ac: Added the check for asctime_r function.
	* src/Makefile.am: Added conditional based on HAVE_ASCTIME_R
2008-06-16 11:19:45 +00:00
Tatsuhiro Tsujikawa e32eb83c99 2008-06-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added writable test for Socket when the sending message is in 
progress.
	Usually the sending message is piece message. Without wriable 
check,
	upload latency is dropped to more than 1sec.
	* src/PeerInteractionCommand.cc
2008-06-15 16:27:12 +00:00
Tatsuhiro Tsujikawa 2f8e184fe5 2008-06-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Create only requested files and files which shares a piece with
	requested file in multi-torrent downloads. Directory structures 
are
	also created in the same rule.
	MultiDiskAdaptor::fileExists() now uses FileEntry instead of
	DiskWriterEntry as in the previous implementation.
	* src/MultiDiskWriter.cc
	* src/MultiFileAllocationIterator.cc
	* src/MultiFileAllocationIterator.h
	* test/MultiFileAllocationIteratorTest.cc
2008-06-15 16:19:06 +00:00
Tatsuhiro Tsujikawa f9988a4ef6 2008-06-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Commented out -lprofiler
	* src/Makefile.am
2008-06-13 15:47:54 +00:00
Tatsuhiro Tsujikawa 95ca33bba3 2008-06-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Bump up version number to 0.14.0b.
	* src/configure.ac
2008-06-10 14:31:08 +00:00
Tatsuhiro Tsujikawa 46627da9a8 2008-06-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Actively establish connection to peers in seeding, when peer 
cache
	is not full and max upload speed limit is not reached.
	* src/ActivePeerConnectionCommand.cc
	* src/ActivePeerConnectionCommand.h
2008-06-10 11:31:35 +00:00
Tatsuhiro Tsujikawa 7a74971caa 2008-06-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Always remove a peer from cache in 
DefaultPeerStorage::returnPeer(),
	to make room more fleshy, recently found peers.
	Peer::_badConditionStartTime is not used anymore. Consider to 
remove
	it.
	* src/DefaultPeerStorage.cc
	* test/DefaultPeerStorageTest.cc
2008-06-10 11:29:10 +00:00
Tatsuhiro Tsujikawa 811649149d 2008-06-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Returns cached data only when the previous receiveHandshake() is 
called
	with peek = true.
	* src/PeerConnection.cc (receiveHandshake)
	* src/PeerConnection.h (receiveHandshake)
2008-06-09 14:55:12 +00:00
Tatsuhiro Tsujikawa de9605815d 2008-06-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed default value of -s option from 1 to 5.
	Also max value of -s option is changed from 5 to 16.
	* src/HelpItemFactory.cc
	* src/OptionHandlerFactory.cc
	* src/option_processing.cc
	* src/usage_text.h
2008-06-09 13:10:24 +00:00
Tatsuhiro Tsujikawa 32edb40d7d 2008-06-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed -s options behavior. Now it means the number of 
connections
	made simultaneously in each http/ftp download.
	If 1 URL is specified, the behavior is the same with old 
implementation.
	If -s N is given and more than N URLs are specified, first N 
URLs are
	used and remaining URLs are used for backup. If less than N URLs 
are
	specified, some of URLs are used more than once so that totally 
N
	connections are made simultaneously.
	* src/main.cc
2008-06-09 13:08:17 +00:00
Tatsuhiro Tsujikawa b68fa9ea33 2008-06-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Included missing iosfwd or ostream header.
	* src/RequestGroupMan.cc
	* src/TaggedItem.cc
	* src/TaggedItem.h
	* src/Util.cc
2008-06-09 11:47:19 +00:00
Tatsuhiro Tsujikawa 8de7cff9f4 2008-06-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/HttpHeaderProcessor.cc: Rewritten using std::string as a 
buffer.
	* src/HttpHeaderProcessor.h: Rewritten using std::string as a 
buffer.
	* src/HttpConnection.cc: Included missing sstream.
2008-06-08 13:12:24 +00:00
Tatsuhiro Tsujikawa cf71523fe2 2008-06-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added --bt-max-open-files option.
	* src/DefaultPieceStorage.cc
	* src/HelpItemFactory.cc
	* src/MultiDiskAdaptor.cc
	* src/MultiDiskAdaptor.h
	* src/OptionHandlerFactory.cc
	* src/option_processing.cc
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
2008-06-08 12:34:36 +00:00
Tatsuhiro Tsujikawa b4e5ba2779 2008-06-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that aria2 aborts when a path to a directory is 
given
	in command-line.
	* src/ProtocolDetector.cc
2008-06-08 12:07:17 +00:00
Tatsuhiro Tsujikawa 2ad5df249e 2008-06-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Limited the number files opened in each BitTorrent download. The 
default
	value is 100. The option to change this value will be added.
	* src/MultiDiskAdaptor.cc
	* src/MultiDiskAdaptor.h
	* src/MultiFileAllocationIterator.cc
2008-06-08 10:47:00 +00:00
Tatsuhiro Tsujikawa 23294a746e 2008-06-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that HTTP downloads don't start with old 
libraries.
	* src/HttpHeaderProcessor.cc
2008-06-08 10:32:10 +00:00
Tatsuhiro Tsujikawa 49409fa7ad 2008-06-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Use empty() instead of size() > 0.
	* src/HttpConnection.cc
2008-06-08 10:29:13 +00:00
Tatsuhiro Tsujikawa 725f68b0c6 2008-06-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Drop connection if the incoming peer ID is the same with 
localhost's
	one. The previous implementation drops connection when incoming 
peer's
	IP address is the same with localhost's one.
	* src/PeerListenCommand.cc
	* src/DefaultBtInteractive.cc
2008-06-08 10:27:57 +00:00
Tatsuhiro Tsujikawa 249194ba8d 2008-06-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Returns cached data without checking whether socket is readable
	if the cache is available.
	* src/PeerConnection.cc (receiveHandshake)
2008-06-08 10:16:38 +00:00
Tatsuhiro Tsujikawa 5cbab84b65 2008-06-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Included stdint.h
	* src/common.h
2008-06-06 14:02:33 +00:00
Tatsuhiro Tsujikawa ad045fea44 2008-06-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed duplicate HAVE_GETTIMEOFDAY
	* src/Makefile.am
	* src/Makefile.in
2008-06-06 14:01:33 +00:00
Tatsuhiro Tsujikawa faed68cc06 2008-06-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Use interval as a minInterval when minInterval is not supplied.
	* src/DefaultBtAnnounce.cc
2008-06-05 15:47:23 +00:00
Tatsuhiro Tsujikawa 74d35644fb 2008-06-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Made DEFAULT_ANNOUNCE_INTERVAL 120, so that if first tracker 
request
	attempt is failed, then 2nd attempt get kicked out more quickly.
	And it is now static const member of DefaultBtAnnounce.
	* src/DefaultBtAnnounce.h
2008-06-05 13:21:35 +00:00
Tatsuhiro Tsujikawa d773613e93 2008-06-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Renamed BtRuntime::lessThanMinPeers() and 
BtRuntime::lessThanEqMinPeers.
	Made MAX_PEERS and MIN_PEERS static const members of BtRuntime.
	* src/ActivePeerConnectionCommand.cc
	* src/BtConstants.h
	* src/BtRuntime.h
	* src/DHTGetPeersCommand.cc
	* src/DefaultBtAnnounce.cc
	* src/DefaultPeerStorage.cc: Calculate maxPeerListSize based on
	BtRuntime::MAX_PEERS.
	* src/DefaultPeerStorage.h
	* src/InitiatorMSEHandshakeCommand.cc
	* src/PeerInitiateConnectionCommand.cc
	* src/PeerInteractionCommand.cc
	* src/PeerReceiveHandshakeCommand.cc
	* src/TrackerWatcherCommand.cc
2008-06-05 13:17:46 +00:00
Tatsuhiro Tsujikawa 4a454e94b7 2008-06-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Always Connect to _numNewConnection 
	* src/ActivePeerConnectionCommand.cc
2008-06-05 13:02:49 +00:00
Tatsuhiro Tsujikawa ba158dbfc1 2008-06-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Made `begin' unsigned int.
	* src/GrowSegment.h
	* src/Piece.cc
	* src/Piece.h
	* src/PiecedSegment.cc
	* src/PiecedSegment.h
	* src/Segment.h
2008-06-05 12:53:30 +00:00
Tatsuhiro Tsujikawa 7d63daed22 2008-06-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Calculate piece hash when data is arrived if the data is arrived 
in
	order. This removes additional read operation for hash 
calculation.
	If the data is arrived in out of order, the hash is calucated 
when the
	piece is completed. This is the same behavior as the old 
implementation.
	* src/BtPieceMessage.cc
	* src/DefaultBtProgressInfoFile.cc
	* src/DefaultPieceStorage.cc
	* src/DownloadCommand.cc
	* src/DownloadCommand.h
	* src/DownloadEngine.cc
	* src/GrowSegment.cc
	* src/GrowSegment.h
	* src/Piece.cc
	* src/Piece.h
	* src/PiecedSegment.cc
	* src/PiecedSegment.h
	* src/Segment.h
	* test/PieceTest.cc
2008-06-04 16:28:16 +00:00
Tatsuhiro Tsujikawa 20f5fcfc0f 2008-06-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Try to keep the ordering of outgoing piece message.
	* src/DefaultBtMessageDispatcher.cc
	(DefaultBtMessageDispatcher::sendMessages)
2008-06-04 15:53:47 +00:00
Tatsuhiro Tsujikawa bc5319081b 2008-06-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed busy loop when error/hup epoll events occur.
	* src/AbstractCommand.cc
	* src/PeerAbstractCommand.cc
2008-06-04 15:27:58 +00:00
Tatsuhiro Tsujikawa fc0725002d 2008-06-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added --bt-request-peer-speed-limit option, which was a constant
	SLOW_SPEED_THRESHOLD.
	* src/ActivePeerConnectionCommand.cc
	* src/ActivePeerConnectionCommand.h
	* src/BtConstants.h
	* src/HelpItemFactory.cc
	* src/OptionHandlerFactory.cc
	* src/PeerReceiveHandshakeCommand.cc
	* src/option_processing.cc
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
2008-06-04 10:14:48 +00:00
Tatsuhiro Tsujikawa 0c22b9faf0 2008-06-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed repeated call of getTopDirPath(). Instead, call it once 
and
	cache the result.
	* src/MultiDiskAdaptor.cc
	* src/MultiDiskAdaptor.h
	(mkdir, openFile, initAndOpenFile, openExistingFile)
2008-06-03 14:30:52 +00:00
Tatsuhiro Tsujikawa 1f084fc5dc 2008-06-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed compile error on debian etch.
	The libc6 shipped with debian etch doesn't define ULLONG_MAX 
properly
	even if _GNU_SOURCE is defined. So define ULLONG_MAX in case 
when
	it is undefined.
	* src/Util.cc (ULLONG_MAX)
2008-06-01 08:23:32 +00:00
Tatsuhiro Tsujikawa 54ee6c4627 2008-05-31 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added epoll support. Use epoll if it is available. If not, use 
select.
	When async dns is enabled in compile time, epoll support is 
enabled
	only when aria2 is built with c-ares. This condition statement 
is
	defined in a2io.h.
	Currently aria2 supports both c-ares and ares, but ares is 
maintained
	for quite a while and debian already has c-ares package, ares 
support
	will be dropped in the future version.
	* configure.ac
	* src/AbstractCommand.cc
	* src/AsyncNameResolver.cc
	* src/AsyncNameResolver.h
	* src/Command.cc
	* src/Command.h
	* src/DownloadEngine.cc
	* src/DownloadEngine.h
	* src/PeerAbstractCommand.cc
	* src/SocketCore.cc
	* src/SocketCore.h
	* src/a2io.h
2008-05-31 10:31:07 +00:00
Tatsuhiro Tsujikawa 242267028d 2008-05-31 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* test/MetalinkEntryTest.cc: Added missing `defined' keyword to 
#if
	directive.
2008-05-31 10:27:21 +00:00
Tatsuhiro Tsujikawa 31a01bd0a6 2008-05-31 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Do not do write operation to /dev/null file.
	* src/LogFactory.cc
	* src/SimpleLogger.cc

	Replaced vasprintf with vsnprintf
	* src/SimpleLogger.cc (SimpleLogger::writeLog)
2008-05-31 05:56:12 +00:00
Tatsuhiro Tsujikawa 405c46277f 2008-05-31 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/BtRequestMessage.cc
	(BtRequestMessage::onQueue): Given piece to RequestSlot. This is 
a fix
	for segmentation fault caused by previous commit.
2008-05-31 05:49:28 +00:00
Tatsuhiro Tsujikawa 1d7b5e6f4a 2008-05-31 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Reduced the usage of gettimeofday().
	* src/DefaultBtMessageDispatcher.cc
	
(DefaultBtMessageDispatcher::checkRequestSlotAndDoNecessaryThing)
	(class FindStaleRequestSlot, class ProcessStaleRequestSlot)
	* src/RequestSlot.cc
	* src/RequestSlot.h
	(RequestSlot::isTimeout)
	
	Made RequestSlot have a reference to Piece object to avoid find
	Piece repeatedly.
	* src/DefaultBtMessageDispatcher.cc
	(class FindStaleRequestSlot, class ProcessStaleRequestSlot)
	* src/RequestSlot.cc
	* src/RequestSlot.h
	(RequestSlot::getPiece)
	* test/DefaultBtMessageDispatcherTest.cc
2008-05-31 05:46:16 +00:00
Tatsuhiro Tsujikawa f771b42e53 2008-05-31 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/TimeA2.cc
	* src/TimeA2.h
	(Time::difference): New function.
	(Time::elapsed): Done optimization.
2008-05-31 05:36:59 +00:00
Tatsuhiro Tsujikawa 78dbc71960 2008-05-31 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/HelpItemFactory.cc: Added missing `defined' keyword to #if
	directive.
2008-05-31 05:32:49 +00:00
Tatsuhiro Tsujikawa 82b2e5d069 2008-05-31 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/option_processing.cc: Added missing `defined' keyword to 
#if
	directive.
2008-05-31 05:32:09 +00:00
Tatsuhiro Tsujikawa 4a0c657d8b 2008-05-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Bump up version number to 0.13.2+1
	* src/configure.ac
2008-05-27 15:34:45 +00:00
Tatsuhiro Tsujikawa 20cb017357 2008-05-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Refactored broken outstanding piece handling.
	* src/DefaultPieceStorage.cc
	* src/DefaultPieceStorage.h
	* src/Piece.cc
	* src/Piece.h
2008-05-27 15:07:39 +00:00
Tatsuhiro Tsujikawa 27102091ad 2008-05-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed compile error on Mac OS X 10.3.9. This error was caused by 
the
	name collision of static variable and predefined macro.
	* src/BtContext.cc
	* src/BtContext.h
	* src/CookieBoxFactory.cc
	* src/CookieBoxFactory.h
	* src/CookieParser.cc
	* src/CookieParser.h
	* src/DefaultBtContext.cc
2008-05-27 14:55:20 +00:00
Tatsuhiro Tsujikawa e40ae31748 2008-05-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/RequestGroup.cc
	(RequestGroup::createInitialCommand): Use empty() instead of 
size().
2008-05-27 14:44:55 +00:00
Tatsuhiro Tsujikawa 5699567aea 2008-05-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* Release 0.13.2
2008-05-25 01:46:30 +00:00
Tatsuhiro Tsujikawa 8f90b6092c 2008-05-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Updated fr.po(thanks to Sebastien) and ja.po. ThanksDone make 
update-po
	* po/fr.po
	* po/ja.po
	* po/aria2c.pot
	* po/*.po
	* po/*.gmo
2008-05-25 01:43:22 +00:00
Tatsuhiro Tsujikawa 19ec823a7a 2008-05-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Bump up version number to 0.13.2
	* src/configure.ac
2008-05-25 01:19:00 +00:00
Tatsuhiro Tsujikawa eacb3fa04f 2008-05-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Refactord.
	* src/RequestGroupMan.cc
	(removeStoppedGroup)
	(fillRequestGroupFromReserver)
2008-05-24 12:00:51 +00:00
Tatsuhiro Tsujikawa 5d8c2c0890 2008-05-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed compile error on Ubuntu.
	* src/BtPieceMessage.cc
	* src/MessageDigestHelper.cc
	* src/Util.cc
2008-05-24 11:56:24 +00:00