Commit Graph

291 Commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa
8d84d9f97c Update ja.po 2007-07-23 13:08:14 +00:00
Tatsuhiro Tsujikawa
380e3f0187 2007-07-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Merged Ross's win32 patch(manually)
	In the course of merging, following files are added.
	* src/strptime.{h,c}
	* src/libgen.{h,c}
	* src/inet_aton.{h,c}
	* src/Platform.{h,cc}
	* src/localtime_r.{h,c}
	* src/getaddrinfo.{h,c}
	I've gethered network related things, and put them to following 
file:
	* src/a2netcompat.h
	Also io related things are put to following file:
	* src/a2io.h
	
	Changed %lld to %s because mingw32 doesn't recognize %lld.
	* src/message.h
	(MSG_ALLOCATION_COMPLETED)
	(EX_TOO_LARGE_FILE)
	(EX_SIZE_MISMATCH)
	(EX_FILE_OFFSET_OUT_OF_RANGE)
	(EX_INVALID_CHUNK_CHECKSUM)
	(EX_INVALID_RANGE_HEADER)
	* src/FileAllocationCommand.cc
	* src/HttpResponse.cc
	* src/RequestGroup.cc
	* src/MultiDiskAdaptor.cc
	* src/OptionHandlerImpl.h
	* src/HttpResponseCommand.cc
	* src/FtpNegotiateCommand.cc
	* src/IteratableChecksumValidator.cc
	* src/SegmentMan.cc
	* src/ChunkChecksumValidator.cc
	
	Added Randomizer::getRandomNumber(long int)
	* src/Randomizer.h (getRandomNumber)
	* src/SimpleRandomizer.h (getRandomNumber)
	* src/BitfieldMan.cc (getMissingIndexRandomly): Use this new 
function.
	* src/Util.cc (randomAlpha): Use this new function.
2007-07-23 13:04:48 +00:00
Tatsuhiro Tsujikawa
6574e44f88 2007-07-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Converted int's to in32_t. long long int's are also converted to
	int64_t
2007-07-21 08:56:16 +00:00
Tatsuhiro Tsujikawa
cd6b6e3591 2007-07-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that prevents cookies from being sent to the 
server
	if the domain of cookie is FQDN and starts with ".".
	* src/Cookie.cc (match)

	To add the ability to change peer id.
	* src/DefaultBtContext.h
	(_peerIdPrefix): New variable
	(setPeerIdPrefix): New function.
	* src/torrentRequestInfo.cc
	(execute): Set the option value of PREF_PEER_ID_PREFIX to
	DefaultBtContext.
	* src/main.cc (main): Added peer-id-prefix command-line option.
	The usage message is not added yet.
	* src/DefaultBtContext.cc
	(generatePeerId): Use _peerIdPrefix.
	* src/prefs.h (PREF_PEER_ID_PREFIX): New definition.
2007-07-20 17:06:21 +00:00
Tatsuhiro Tsujikawa
6e7893c848 2007-07-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that prevents cookies from being sent to the 
server
	if the domain of cookie is FQDN and starts with ".".
	* src/Cookie.cc (match)
2007-07-20 13:49:32 +00:00
Tatsuhiro Tsujikawa
247b1f2a4f 2007-07-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that prevents filename in content-disposition from
	being retrieved when filename is not quoted.
	* src/Util.cc (getContentDispositionFilename)

	Fixed the bug that causes infinate loop and memory leak when 
file open
	operation failed.
	* src/HttpResponseCommand.cc (handleDefaultEncoding)
2007-07-18 11:36:41 +00:00
Tatsuhiro Tsujikawa
18480a08df Updated po files 2007-07-10 00:05:16 +00:00
Tatsuhiro Tsujikawa
6303da136a Fixed examples for metalink 2007-07-09 13:30:45 +00:00
Tatsuhiro Tsujikawa
77a3820920 2007-07-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that causes segfault when all URIs specified are
	unsupported.
	* src/RequestGroupMan.cc (getInitialCommands)
	Check if RequestGroup::createNextCommand() returns empty list of
	commands.
	* src/RequestGroup.cc (createNextCommand)
	Change log level from info to error so that users can notice 
that
	an error occurred.

	Fixed the bug that causes segfault when a zero-sized file is
	downloaded.
	* src/BitfieldMan.cc (isAllBitSet)
	Return true if bitfieldLength is 0.
2007-07-09 12:54:19 +00:00
Tatsuhiro Tsujikawa
eab047dfba 2007-07-08 03:24:24 +00:00
Tatsuhiro Tsujikawa
444bf5495d 2007-07-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/main.cc
	(showUsage): Added 3 usage examples for metalink download.

	Replace MetalinkChunkChecksum with ChunkChecksum.
	* src/MetalinkChunkChecksum.h: Removed.
	* src/MetalinkEntry.h: MetalinkChunkChecksum -> ChunkChecksum.
	* src/Xml2MetalinkProcessor.h: MetalinkChunkChecksum -> 
ChunkChecksum.
	* src/Xml2MetalinkProcessor.cc
	(getPieceHash): Use ChunkChecksum instead of 
MetalinkChunkChecksum.
	* src/MetalinkRequestInfo.cc (execute)
2007-07-08 03:22:37 +00:00
Tatsuhiro Tsujikawa
823056f0dd * src/main.cc (main): Use StreamUriListParser and
FileUriListParser
	instead of UriFileListParser.
	(showUsage): Added 3 usage examples for metalink download.
2007-07-08 02:33:46 +00:00
Tatsuhiro Tsujikawa
94834d6735 Update doc 2007-07-08 02:00:15 +00:00
Tatsuhiro Tsujikawa
759c3fbf48 Updated man page 2007-07-05 16:06:31 +00:00
Tatsuhiro Tsujikawa
43af7c99f2 2007-07-05 15:46:36 +00:00
Tatsuhiro Tsujikawa
8559ef6b03 Added 2 test classes. 2007-07-05 15:45:37 +00:00
Tatsuhiro Tsujikawa
d80d7faac9 2007-07-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Reads URIs from stdin when "-i -" is specified.
	* src/UriFileListParser.h, src/UriFileListParser.cc: Removed.
	* src/UriListParser.h, src/UriListParser.cc: New class.
	* src/StreamUriListParser.h: New class.
	* src/FileUriListParser.h: New class.
	* src/main.cc (main): Use StreamUriListParser and 
FileUriListParser
	instead of UriFileListParser.
2007-07-05 15:45:03 +00:00
Tatsuhiro Tsujikawa
e52e0fa01f Fixed invalid connection count 2007-07-05 15:14:00 +00:00
Tatsuhiro Tsujikawa
800bc3a6c3 Fixed compile error when message digest is not available. 2007-07-04 16:04:57 +00:00
Tatsuhiro Tsujikawa
e5e46914d1 2007-07-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Made console readout more readable.
	* src/ConsoleDownloadEngine.cc (sendStatistics)
2007-07-03 15:24:36 +00:00
Tatsuhiro Tsujikawa
583f6c9c22 2007-07-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fix the bug that causes -s option not to work.
	* src/main.cc (main)
	* src/a2algo.h: New file.
2007-07-02 12:40:40 +00:00
Tatsuhiro Tsujikawa
a90e103ab1 Updated TODO 2007-07-01 14:20:07 +00:00
Tatsuhiro Tsujikawa
a19cf91f9b 2007-07-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Create directory structure specified in metalink file.
	* src/RequestGroup.h, src/RequestGroup.cc
	(initAndOpenFile): Create a directory to store files if it does 
not
	exist.
	(getDir): New function.

	Added ETA and download speed for an individual file to readout.
	* src/ConsoleDownloadEngine.cc (sendStatistics)
	* src/RequestGroup.h
	(calculateDownloadSpeed): New function.
2007-07-01 14:19:15 +00:00
Tatsuhiro Tsujikawa
055c9e0b21 2007-07-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Create directory structure specified in metalink file.
	* src/RequestGroup.h, src/RequestGroup.cc
	(initAndOpenFile): Create a directory to store files if it does 
not
	exist.
	(getDir): New function.
2007-07-01 10:40:30 +00:00
Tatsuhiro Tsujikawa
7e99d4d2a1 New class. 2007-06-30 09:54:03 +00:00
Tatsuhiro Tsujikawa
e36a3de0f4 2007-06-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Made -S option work with metalink file and provided selective 
download
	to metalink.
	* src/MetalinkEntry.h, src/MetalinkEntry.cc
	(filename): Removed.
	(file): New variable.
	(size): Removed.
	(operator=): Updated.
	(getPath): New function.
	(getLength): New function.
	(toFileEntry): New function.
	* src/TorrentRequestInfo.h, src/TorrentRequestInfo.cc
	(execute): Use toStream.
	(showFileEntry): Removed.
	* src/MetalinkRequestInfo.h
	(targetFiles): New variable.
	(setTargetFiles): New variable.
	* src/MetalinkRequestInfo.cc
	(execute): Added the ability to print file information included 
in
	a metalink file.
	Added selective download mode to metalink.
	* src/main.cc
	(showUsage): Updated to denote that -S and --select-file options 
are
	applicable to metalink.
	* src/FileEntry.h
	(operator=): New function.
	(getBasename): New function.
	(getDirname): New function.
	* src/Util.h, src/Util.cc
	(toStream): New function.
	* src/Xml2MetalinkProcessor.cc: Updated.
	
	Made aria2 work with metalink with directory structure.
	* src/File.h, src/File.cc
	(getBasename): New function.
	(getDirname): New function.
	* src/RequestGroup.h, src/RequestGroup.cc
	(_topDir): New variable.
	(setTopDir): New function.
	(initSegmentMan): A directory structure is added to 
_segmentMan->dir.
	
	Rewrote HTTP header parsing with stringstream.
	* src/HttpConnection.h, src/HttpConnection.cc
	(HttpRequestEntry): New class.
	(headerBuf): Removed.
	(headerBufLength): Removed.
	(outstandingHttpRequests): Now its element type is
	HttpRequestEntryHandle.
	(findEndOfHeader): Removed.
	(receiveResponse): Rewritten.
	
	Updated doc for -j option to notice that it should be used with 
-i
	option.
	* src/main.cc (showUsage)

	Removed unused classes.
	* src/RequestInfo.h
	(FileInfo): Removed.
	(checksum): Removed.
	(fileInfo): Removed.
	(setChecksum): Removed.
	(getChecksum): Removed.
	(getFileInfo): Removed.

	Use ISO units.
	* src/ConsoleDownloadEngine.cc
	* src/TorrentConsoleDownloadEngine.cc
	* src/Util.cc (abbrevSize)
2007-06-30 09:52:39 +00:00
Tatsuhiro Tsujikawa
50b4cf67e0 2007-06-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added the default listening ports to the help message.
	* src/main.cc (showUsage)
2007-06-23 06:25:12 +00:00
Tatsuhiro Tsujikawa
d7155e8f6c 2007-06-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Reduce the number of calls to gettimeofday to lower CPU load.
	* src/TimeA2.h, src/TimeA2.cc (differenceInMillis): New 
function.
	* src/SpeedCalc.h, src/SpeedCalc.cc (calculateSpeed): New 
function.
	* src/Peer.h (calculateUploadSpeed): New function.
	(calculateDownloadSpeed): New function.
	* src/DefaultPeerStorage.cc
	(CalculateStat): Added _now variable.
	In operator(), call Peer::calculateDownloadSpeed(const struct 
timeval&)
	and Peer::calculateUploadSpeed(const struct timeval&)
	
	Drop connection if no request or piece message is exchanged in
	a certain interval.
	* src/DefaultBtInteractive.h
	(btRuntime): New variable.
	(inactiveCheckPoint): New variable.
	(checkActiveInteraction): New function.
	* src/DefaultBtInteractive.cc (receiveMessages): Reset timer 
when
	request or piece message is received.
	(checkActiveInteraction): New function.
	(doInteractionProcessing): Call checkActiveInteraction.

	Fixed the bug that causes remote Metalink and Torrent files are 
not
	processed.
	* src/MultiUrlRequestInfo.cc (createNextRequestInfo): Fixed the 
bug.
2007-06-20 14:43:34 +00:00
Tatsuhiro Tsujikawa
be9dec8535 Updated po files 2007-06-12 10:53:46 +00:00
Tatsuhiro Tsujikawa
ba6e5ac7e5 2007-06-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed format of log file.
	* src/SimpleLogger.cc
2007-06-12 10:50:40 +00:00
Tatsuhiro Tsujikawa
cdbfde719e Set GID to RequestGroup.
Print GID in console readout.
Hide the part of log header when writing it to console
2007-06-10 15:22:36 +00:00
Tatsuhiro Tsujikawa
0db7f62553 Updated abbrevSize 2007-06-10 13:50:54 +00:00
Tatsuhiro Tsujikawa
090a77a319 2007-06-10 12:14:45 +00:00
Tatsuhiro Tsujikawa
9e6c0329fe 2007-06-10 12:02:09 +00:00
Tatsuhiro Tsujikawa
6f96fdc587 Show 1/10 unit in size 2007-06-10 12:01:32 +00:00
Tatsuhiro Tsujikawa
db41dfac20 Updated po files 2007-06-10 08:42:15 +00:00
Tatsuhiro Tsujikawa
1b35f2f8c8 Show download rate in fixed notation 2007-06-10 08:40:01 +00:00
Tatsuhiro Tsujikawa
649830316e Fixed the bug that caused -c command-line option did not work properly. 2007-06-10 08:29:56 +00:00
Tatsuhiro Tsujikawa
d5bb035642 2007-06-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/AbstractCommand.cc
	(execute): Changed log level of MSG_RESTARTING_DOWNLOAD and
	MSG_MAX_TRY from error to info.
	Added MSG_DOWNLOAD_ABORTED after MSG_MAX_TRY.

	* src/message.h
	(MSG_TORRENT_DOWNLOAD_ABORTED): New definition.
	(MSG_DOWNLOAD_ABORTED): Added %s.
	(MSG_RESTARTING_DOWNLOAD): Added %s.
	(MSG_DOWNLOAD_ALREADY_COMPLETED): Updated.
	
	* src/PeerAbstractCommand.cc
	(execute): MSG_DOWNLOAD_ABORTED -> MSG_TORRENT_DOWNLOAD_ABORTED
	
	* src/Request.h
	(cookieBox): Made ShardHandle.
	
	* src/RequestGroup.h, src/RequestGroup.cc
	(createNextCommandWithAdj): New function.
	* src/FileAllocationCommand.cc
	(executeInternal): Use createNextCommandWithAdj().
	* src/CheckIntegrityCommand.cc
	(executeInternal): Use createNextCommandWithAdj().

	Added --load-cookies command-option.
	* src/OptionHandlerFactory.cc
	(createOptionHandlers): Added PREF_LOAD_COOKIES.
	* src/CookieBox.h, src/CookieBox.cc: Rwritten using CookieParser.
	Now aria2 can handle cookie's expiration date.
	* src/Cookie.h (expires): Changed its type to time_t.
	* src/main.cc: Added --load-cookies command-line option.
	* src/prefs.h (PREF_LOAD_COOKIES): New definition.
	* src/Util.h, src/Util.cc (httpGMT): New function.
	* src/Request.cc (Request): Initialize cookieBox using
	CookieBoxFactory.
	* src/CookieBoxFactory.h, src/CookieBoxFactory.cc: New class.
	* src/CookieParser.h, src/CookieParser.cc: New class.
	
	* src/main.cc: Chagned the default value of --metalink-servers to 5.

	* src/HttpResponseCommand.cc
	(handleOtherEncoding): Call RequestGroup::shouldCancelDownloadForSafety
2007-06-10 07:55:43 +00:00
Tatsuhiro Tsujikawa
aa7cbf60ba 2007-06-09 10:37:17 +00:00
Tatsuhiro Tsujikawa
2d522cf6b7 2007-06-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added -j command-line option.
	* src/OptionHandlerFactory.cc (createOptionHandlers)
	* src/main.cc

	* src/ByteArrayDiskWriter.h, src/ByteArrayDiskWriter.cc
	Rewritten using stringstream.
	* src/TrackerUpdateCommand.h, src/TrackerUpdateCommand.cc
	Rewritten using stringstream.
2007-06-09 10:06:53 +00:00
Tatsuhiro Tsujikawa
c7fbedfa0a Added for test 2007-06-05 14:46:23 +00:00
Tatsuhiro Tsujikawa
acccec67be Fixed compilation error. 2007-06-05 14:32:09 +00:00
Tatsuhiro Tsujikawa
2d71034e03 Removed SingleUrlRequestInfo.{h,cc} 2007-06-05 14:11:50 +00:00
Tatsuhiro Tsujikawa
1e8b472ea2 2007-06-05 14:04:30 +00:00
Tatsuhiro Tsujikawa
2b07d13be3 2007-06-05 14:03:26 +00:00
Tatsuhiro Tsujikawa
2722c0591f 2007-06-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Make download size shown in MB, KB.
	* src/ConsoleDownloadEngine.h (sendStatistics)
	* src/Util.h, srcUtil.cc (abbrevSize): New function.
2007-06-05 11:37:25 +00:00
Tatsuhiro Tsujikawa
3dd06aacfb 2007-06-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Accept incoming connections if download rate is low.
	* src/PeerListenCommand.h, src/PeerListenCommand.cc:
	(_lowestSpeedLimit): New variable.
	(setLowestSpeedLimit): New function.
	(execute): Accept incoming connections if download rate is low.
	MAX_PEERS is ignored in this case.

	Disable PREF_OUT in multiple concurrent download:
	* src/RequestGroup.h, src/RequestGroup.cc
	(setUserDefinedFilename): New function.
	* src/DownloadEngineFactory.cc
	(newConsoleEngine): Do not set PREF_OUT to requestGroup in 
multiple
	concurrent download.
	* src/DefaultSegmentManFactory.cc
	(createNewInstance): Comment out the line: segmentMan->ufilename 
= ...
2007-06-04 12:52:57 +00:00
Tatsuhiro Tsujikawa
47ce21a469 2007-06-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Accept incoming connections if download rate is low.
	* src/PeerListenCommand.h, src/PeerListenCommand.cc:
	(_lowestSpeedLimit): New variable.
	(setLowestSpeedLimit): New function.
	(execute): Accept incoming connections if download rate is low.
	MAX_PEERS is ignored in this case.
2007-06-04 12:33:29 +00:00
Tatsuhiro Tsujikawa
453e2f10dd 2007-06-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
RequestGroup::getNextCommand() was renamed to 
createNextCommand().
	Added its overloaded method.
	* src/RequestGroup.h 
	(_numConcurrentCommand): New variable.
	(setNumConcurrentCommand): New function.
	* src/RequestGroup.cc
	
	Abort download if same file is being downloaded concurrently.
	* src/RequestGroup.h, src/RequestGroupMan.cc
	(isSameFileBeingDownloaded): New function.
	* src/HttpResponseCommand.cc (executeInternal)
	* src/FtpNegotiateCommand.cc (recvSize)
	* src/message.h (EX_DUPLICATE_FILE_DOWNLOAD): New definition.
	
	* main.cc: Added help message for -i option.
2007-06-03 14:24:37 +00:00