Commit Graph

171 Commits (ba87268d1ce4ec0fa1104d08c5fd01934e94d574)

Author SHA1 Message Date
Tatsuhiro Tsujikawa 500e978628 * src/main.cc (main): Fixed typo.
* src/message.h: Fixed typo.

	* po/de.po: Added German translation, thanks to Hermann J. 
Beckers.
2006-05-06 01:08:42 +00:00
Tatsuhiro Tsujikawa 75deb4e605 2006-04-29 17:41:49 +00:00
Tatsuhiro Tsujikawa 15b207a53e * 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-29 11:23:39 +00:00
Tatsuhiro Tsujikawa df2364b1db 2006-04-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
To add --select-file command-line option:
	
	* src/Util.cc
	(unfoldRange): New function.
	(getNum): New function.
	(unfoldSubRange): New function
	* src/main.cc
	(showUsage): Added help message.
	(main): Added --select-file command-line option.
	
2006-04-28  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>

	To deploy upload rate based choking algorithm:
	
	* src/PeerInteractionCommand.cc
	(PeerInteractionCommand): Add peer to TorrentMan::activePeers to 
track
	peer currently used.
	(decideChoking): Deleted the choke/unchoke decision algorithm 
when
	download completes. Simplified.
	(receiveMessage): Updated.
	* src/TorrentMan.h
	(activePeers): New variable.
	(addActivePeer): New function.
	(getActivePeers): New function.
	(deleteActivePeer): New function.
	* src/TorrentMan.cc
	(addPeer): deleteOldErrorPeers is moved to the begining of the 
function
	* src/PeerAbstractCommand.cc
	(onAbort): Use peer->resetStatus().
	* src/main.cc
	(PeerChokeCommand.h): Included.
	(main): Added the instance of ChokingCommand to the command 
queue.
	* src/Peer.h
	(amChoking): Renamed from amChocking
	(chokingRequired): New variable.
	(optUnchoking): New variable.
	(deltaUpload): New variable.
	(deltaDownload): New variable.
	(addDeltaUpload): New function.
	(resetDeltaUpload): New function.
	(addDeltaDownload): New function.
	(resetDeltaDownload): New function.
	(addPeerUpload): Added a call to addDeltaUpload.
	(addPeerDownload): Added a call to addDeltaDownload.
	* src/Peer.cc
	(shouldBeChoking): Renamed from shouldChoke.
	(resetStatus): New function.
	* src/PeerChokeCommand.h: New class.
	* src/PeerChokeCommand.cc: New class.
	
	To add lazy upload speed limiter:

	* src/TorrentConsoleDownloadEngine.h: Moved the variables for
	statistics calculation to TorrentDownloadEngine.
	* src/TorrentConsoleDownloadEngine.cc
	(sendStatistics): Renamed from printStatistics.
	(initStatistics): Removed. Moved to TorrentDownloadEngine.
	(calculateSpeed): Removed. Moved to TorrentDownloadEngine.
	(calculateStatistics): Removed. Moved to TorrentDownloadEngine.
	* src/TorrentDownloadEngine.h: Added the variables for 
statistics
	calculation.
	(sendStatistics): New function as pure virtual function.
	(getUploadSpeed): New function.
	* src/TorrentDownloadEngine.cc
	(initStatistics): New function.
	(calculateSpeed): New function.
	(calculateStatistics): New function.
	* src/SendMessageQueue.h
	(uploadLength): New variable.
	(send): Added an argument.
	(setUploadLimit): New function.
	(getUploadLimit): New function.
	* src/SendMessageQueue.cc
	(send): Added upload speed limiter.
	* src/prefs.h
	(PREF_UPLOAD_LIMIT): New definition.
	* src/PeerInteractionCommand.cc
	(PeerInteractionCommand): Set upload speed limit to 
sendMessageQueue.
	* src/main.cc
	(main): Added --upload-limit option

	For bug fixes:
	
	* src/main.cc
	(showUsage): Corrected --listen-port help

	Other changes:
	
	* src/TorrentMan.cc
	(getPeer): Return nullPeer if connection is grather than
	MAX_PEER_UPDATE(15) in order to leave space for incoming peers.
2006-04-28 15:55:11 +00:00
Tatsuhiro Tsujikawa e6bf2338cf 2006-04-21 13:04:02 +00:00
Tatsuhiro Tsujikawa 5067ad8d48 2006-04-20 16:09:15 +00:00
Tatsuhiro Tsujikawa 536c07488b To add some useful information to the exception message:
* src/SocketCore.cc : Updated messages.
	* src/SegmentMan.cc : 
	* src/TorrentMan.cc : Updated messages.
	* src/MultiDiskWriter.cc : Updated messages.
	* src/Util.cc : Updated messages.
	* src/AbstractDiskWriter.cc : Updated messages.
	* src/PreAllocationDiskWriter.cc : Updated messages.
	* src/message.cc : Added new messages. Updated some messages.

	* src/TrackerWatcherCommand.h (MIN_PEERS): New definition.
	* src/TrackerWatcherCommand.cc (execute): Use MIN_PEERS.
	Updated threshold from 30 to 15.

	* src/AbstractDiskWriter.h (filename): New variable.
	* src/AbstractDiskWriter.cc (openExistingFile): Assigned 
filename.
	(createFile): Assigned filename.
	
	* src/main.cc: Updated the help message for http-auth-scheme.
2006-04-20 15:58:05 +00:00
Tatsuhiro Tsujikawa 8203364972 2006-04-19 17:49:27 +00:00
Tatsuhiro Tsujikawa 19f713b99d 2006-04-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
To add a readout of estimated remaining time to normal HTTP/FTP
	downloads:
	
	* src/ConsoleDownloadEngine.h (startup): New variable.
	(startupLength): New variable.
	(isStartupLengthSet): New variable.
	(avgSpeed): New variable.
	(eta): New variable.
	* src/ConsoleDownloadEngine.cc (sendStatistics): Added a readout 
of
	estimated remaining time.
	(initStatistics): Initialized newly added variables.
	(calculateStatistics): Calculate average speed and estimated 
remaining
	time.

	To decouple TorrentDownloadEngine from HttpResponseCommand:

	* src/TrackerDownloadCommand.h: Removed.
	* src/TrackerDownloadCommand.cc: Removed.
	* src/TrackerInitCommand.h: Removed.
	* src/TrackerInitCommand.cc: Removed.
	* src/TrackerUpdateCommand.h: Removed.
	* src/TrackerUpdateCommand.cc: Removed.
	* src/TrackerWatcherCommand.cc (execute): The construction of 
request
	url written in TrackerInitCommand was moved here. Do not create
	tracker request command if torretnMan->trackers != 0.
	* src/CompactTrackerResponseProcessor.h: New class.
	* src/CompactTrackerResponseProcessor.cc: New class.
	* src/message.h (MSG_TRACKER_WARNING_MESSAGE): Updated.
	* src/HttpResponseCommand.cc (createHttpDownloadCommand):
	Decoupled TorrentDownloadEngine from this.
	* src/SegmentMan.h (init): New function.
	* src/SegmentMan.cc (init): New function.
	* src/TorrentMan.h (responseProcessor): New variable.
	(trackers): New variable.
	(setTrackerResponseProcessor): New function.
	(getTrackerResponseProcessor): New function.
	(processTrackerResponse): New function.
	* src/TorrentMan.cc (Constructor): Initialized new variable 
trackers.
	(processTrackerResponse): New function.
	* src/main.cc (main): Use ByteArrayDiskWriter and
	CompactTrackerResponseProcessor.
	* src/TorrentDownloadEngine.cc (afterEachIteration): Call 
torrentMan->
	processTrackerResponse().
	
	* src/TorrentConsoleDownloadEngine.cc (printStatistics): Updated 
a
	readout.

	* src/TorrentDownloadEngine.cc (afterEachIteration): Added log 
message
	which indicates download has completed.

	* src/AbstractDiskWriter.cc (Destructor): fd >= 0, not fd >0
	(closeFile): fd >= 0, not fd > 0

	* src/main.cc (main): Added short cut for show-files.
	Added short cut for torrent-file.
	Added new command-line option listen-port.
	Updated i18n messages.
2006-04-18 17:06:17 +00:00
Tatsuhiro Tsujikawa 58633887e9 2006-04-12 13:56:02 +00:00
Tatsuhiro Tsujikawa 305aad8690 2006-04-06 12:52:47 +00:00
Tatsuhiro Tsujikawa 8cec3f1153 2006-04-01 14:40:36 +00:00
Tatsuhiro Tsujikawa 4892b40945 2006-03-27 14:48:00 +00:00
Tatsuhiro Tsujikawa 2065b049ab * Request.h: Added AFTER_COMPLETED event.
* TorrentDownloadEngine.cc: Prints "Download complete" message
	instead of downloaded size and progress(%) after download 
completes.
	* PeerInteractionCommand.cc: After download completes, sends 
unchoke
	message to the peer if it is interested in what localhost has
	downloaded.
	* TorrentMan.cc: In single-file mode, copy temporary file to the 
final
	destination instead of just renaming it.
	* TorrentMan.cc: Added deleteTempFile().
	* PeerAbstractCommand.cc: do not stop execution after download
	completes. This makes localhost a seeder.
	* Util.{h,cc}: Added fileCopy().
	* PeerListenCommand.cc: do not stop execution after download 
completes.
	This makes localhost a seeder.
	* main.cc: Do not call TorrentMan::fixFilename() in 
torrentHandler.
	Added TorrentMan::deleteTempFile() to torrentHandler.
	Initialized the variable dir as ".".
	* TorrentMan.h: Changed DEFAULT_ANNOUNCE_INTERVAL to 120 
seconds.
	Deleted renameSingleFile().
	Added copySingleFile(), deleteTempFile().
	* DownloadEngine.h: Added virtual function afterEachIteration().
	* TorrentDownloadEngine.cc: Move a call to 
TorrentMan::fixFilename()
	in onEndOfRun() to afterEachIteration().
	In onEndOfRun(), changed if condition to check whether 
filenameFixed is
	true.
	* Util.cc: Implemented fileCopy() using rangedFileCopy().
	In rangedFileCopy(), added try-catch block to properly close 
file
	descriptors.
	* TorrentDownloadEngine.cc: Added a member variable 
filenameFixed.
	Added afterEachIteration(), isFilenameFixed().
	* Peer.cc: Changed choking strategy.
	* PreAllocationDiskWriter.cc: Drop O_DIRECT flag.
	* TrackerInitCommand.cc: Send completed event only once.
	* DownloadEngine.cc: Added a call to afterEachIteration().
	* TrackerUpdateCommand.cc: Do not stop execution after download
	completes.
	* TorrentMan.h: Defined MAX_PEER_UPDATE as 15. aria2 attempts to
	connect the peers at most MAX_PEER_UPDATE when a peer list is
	received from a tracker.
	* TrackerUpdateCommand.cc: Implemented above mentioned behavior.
	Decreased the number of failure peers to delete to 0(just 
comment out
	the line).
	* Release 0.3.1
2006-03-24 11:59:18 +00:00
Tatsuhiro Tsujikawa 1fcd640d3b * AbstractCommand.cc: casted timeout value to long long int.
* ChunkedEncoding.cc: fixed memory leak.
	* PeerInteractionCommand.cc: casted timeout value to long long 
int.
	* SleepCommand.cc: casted timeout value to long long int.
	* Data.cc: fixed memory leak.
	* Data.cc: fixed toLLInt().
	* BitfieldMan.cc: fixed memory leak.
	* TorrentMan.cc: initialized storeDir to ".".
	* TorrentMan.cc: fixed memory leak.
	* TorrentMan.cc: corrected file paths of splitted files.
	* PeerAbstractCommand.cc: casted timeout to long long int.
	* main.cc: added delete(req) and delete(te->diskWriter).
	* RequestSlot.cc: casted timeout value to long long int.
	* Request.cc: fixed memory leak.
	* PendingMessage.cc: make HAVE messages sent only when peer does 
not
	have the piece.
	* Peer.{h,cc}: added hasPiece(int index).
2006-03-23 10:47:25 +00:00
Tatsuhiro Tsujikawa 01118364a5 2006-03-21 16:07:22 +00:00
Tatsuhiro Tsujikawa df6c7c0385 added bittorrent support(experimental) 2006-03-21 14:12:51 +00:00
Tatsuhiro Tsujikawa 2a1b2c8ab4 2006-03-07 13:58:29 +00:00
Tatsuhiro Tsujikawa a102282ae6 Deleted m4/Makefile, po/Makefile 2006-03-07 13:52:36 +00:00
Tatsuhiro Tsujikawa 8d980589e3 2006-03-05 06:32:01 +00:00
Tatsuhiro Tsujikawa 0276b3bb37 * DownloadEngine.{h, cc}:
* ConsoleDownloadEngine.{h, cc}: Console output message(size, 
speed)
	is now generated by ConsoleDownloadEngine not by DownloadEngine.
	* main.cc: Download complete/abort message is now generated by 
main.
	* Makefile.am (SUBDIRS): Add m4.
	(ACLOCAL_AMFLAGS): New variable.
	(EXTRA_DIST): New variable.
	* configure.in (AC_CONFIG_FILES): Add po/Makefile.in,
	* gettext: added gettext functionality
2006-03-02 10:43:00 +00:00