Commit Graph

34 Commits (6ce44b001de112ee1fb08ea77ed9dc7f045cf4c8)

Author SHA1 Message Date
Tatsuhiro Tsujikawa 01fc3204f2 2010-02-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Remove fragment from redirected URI.
	* src/Request.cc
	* test/RequestTest.cc
2010-02-03 13:49:22 +00:00
Tatsuhiro Tsujikawa 60c16887e6 2010-01-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Handle redirected URI which is not properly percent encoded.
	* src/Request.cc
	* test/RequestTest.cc
2010-01-26 12:39:22 +00:00
Tatsuhiro Tsujikawa 4db349c1f3 2010-01-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Untabify. Fixed one line in copyright which is longer than 80
	columns.
	* src
	* test
2010-01-05 16:01:46 +00:00
Tatsuhiro Tsujikawa f11adceba7 2009-11-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added testSetUrl20()
	* test/RequestTest.cc
2009-11-15 13:00:23 +00:00
Tatsuhiro Tsujikawa 7a94ae6af2 2009-11-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten Request::parseUrl()
	* src/Request.cc
	* test/RequestTest.cc
2009-11-12 14:50:23 +00:00
Tatsuhiro Tsujikawa ce25b54cfe 2009-08-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added support for IPv6 literal address in URI. Now aria2 can
	handle URI such as http://[::1]/
	* src/HttpRequest.cc
	* src/HttpRequest.h
	* src/Request.cc
	* src/Request.h
	* test/HttpRequestTest.cc
	* test/OptionHandlerTest.cc
	* test/RequestTest.cc
2009-08-30 15:05:30 +00:00
Tatsuhiro Tsujikawa 5a639a3d1e 2008-12-16 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that causes corrupted downloads if HTTP pipelining
	is enabled and the server doesn't support keep-alive.
	* src/AbstractCommand.cc
	* src/DownloadCommand.cc
	* src/HttpDownloadCommand.cc
	* src/HttpDownloadCommand.h
	* src/HttpResponseCommand.cc
	* src/Request.cc
	* src/Request.h
	* test/RequestTest.cc
2008-12-15 15:38:07 +00:00
Tatsuhiro Tsujikawa b3aa7cef1d 2008-11-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
RFC3986 complied Percent-Encoding(urlencode).
	Use uppercase hexadecimal digits for encoded text instead of
	lowercase ones.
	* src/Request.cc
	* src/Util.cc
	* src/Util.h
	* test/BtHandshakeMessageTest.cc
	* test/DefaultBtAnnounceTest.cc
	* test/DefaultBtContextTest.cc
	* test/RequestTest.cc
	* test/UtilTest.cc
2008-11-27 15:29:15 +00:00
Tatsuhiro Tsujikawa 931bd985db 2008-11-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Do not urlencode Request::url in setUrl() because we want
	unmodified URL using Request::getUrl()
	* src/Request.cc
	* src/Request.h
	* test/RequestTest.cc
2008-11-18 15:10:47 +00:00
Tatsuhiro Tsujikawa 1605b39a10 2008-10-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that last character in URI is not encoded.
	* src/Request.cc
	* test/RequestTest.cc
2008-10-08 16:06:27 +00:00
Tatsuhiro Tsujikawa 22af8b4b22 2008-10-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that referer header field contains fragment.
	Now Request class removes fragment part of URI and encodes it
	in Request::setUri() and setReferer().
	* src/Request.h
	* src/Request.cc
	* test/RequestTest.cc
2008-10-08 15:35:52 +00:00
Tatsuhiro Tsujikawa 87a5bb50c2 2008-09-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Reverted previous change.
	Insert username+'@' to URI(after ftp://) when URI is FTP scheme 
and
	username is not in URI.
	* src/HttpRequest.cc
	* src/Request.cc
	* test/HttpRequestTest.cc
	* test/RequestTest.cc
2008-09-25 16:06:29 +00:00
Tatsuhiro Tsujikawa 789e1926cb 2008-09-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Now colon is required for username and password in FTP URL, 
like:
	ftp://username:password@host.
	If colon is not there, aria2 don't parse it as a username. For 
example,
	aria2 don't retrieve username from ftp://username@host.
	This fix was made in order to login FTP server via 
non-transparent ftp
	proxy.
	* src/Request.cc
	* test/RequestTest.cc
2008-09-25 14:48:38 +00:00
Tatsuhiro Tsujikawa 5d2651c5ed 2008-07-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Supported absolute/relative path in Location header field.
	* src/AbstractCommand.cc: Call resetUrl() when DlRetryEx is 
caught.
	* src/HttpHeader.cc
	* src/HttpHeader.h
	* src/HttpResponse.cc
	* src/HttpSkipResponseCommand.cc
	* src/Request.cc
	* test/HttpHeaderTest.cc
	* test/HttpResponseTest.cc
	* test/RequestTest.cc
2008-07-18 15:20:52 +00:00
Tatsuhiro Tsujikawa d4b29c84fc 2008-06-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Cancel download if http redirect is bounded more than 20 times.
	* src/AbstractCommand.cc
	* src/HttpSkipResponseCommand.cc
	* src/Request.cc
	* src/Request.h
	* test/RequestTest.cc
2008-06-17 09:09:31 +00:00
Tatsuhiro Tsujikawa 5ea933fed1 2008-05-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Set _supportsPersistentConnection to true by default.
	* src/Request.cc
	* src/RequestGroup.cc
	* test/HttpRequestTest.cc
	* test/RequestTest.cc
2008-05-08 13:20:15 +00:00
Tatsuhiro Tsujikawa 4663902500 2008-04-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed query part from filename in HTTP download. The query part means
	the substring after "?" in URL. Firefox seems do the same thing.
	A query part is sometimes very long and not suitable to filename,
	so I think it is better to remove it from filename.
	* src/HttpRequest.cc
	* src/HttpRequest.h
	* src/Request.cc
	* src/Request.h
	* test/HttpRequestTest.cc
	* test/RequestTest.cc
2008-04-27 04:09:08 +00:00
Tatsuhiro Tsujikawa 1c7c6f9898 2008-04-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Rewritten HTTP keep-alive and pipelining routine.
	* src/AbstractCommand.cc
	* src/HttpConnection.cc
	* src/HttpDownloadCommand.cc
	* src/HttpRequest.cc
	* src/HttpRequestCommand.cc
	* src/HttpResponseCommand.cc
	* src/Request.cc
	* src/Request.h
	* src/RequestGroup.cc
	* test/HttpRequestTest.cc
	* test/HttpResponseTest.cc
	* test/RequestTest.cc
2008-04-22 07:15:35 +00:00
Tatsuhiro Tsujikawa 032c7c2808 2008-03-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
type cleanup for allmost all remaining files.
2008-03-09 12:24:01 +00:00
Tatsuhiro Tsujikawa 1b7c198289 2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed "using namespace std;" from all sources. Appended std:: 
prefix to c++
	standard classes.
	Included string.h where mem* function are used.
2008-02-08 15:53:45 +00:00
Tatsuhiro Tsujikawa 4b5ad58219 2007-12-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed compilation warnings
	* test/DataTest.cc
	* test/HttpRequestTest.cc
	* test/MetaFileUtilTest.cc
	* test/RequestTest.cc
2007-12-08 16:57:32 +00:00
Tatsuhiro Tsujikawa 4f59dc84bf 2007-11-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
urlencode the given url inside Request::parseUrl(...)
	* src/Request.{h, cc}
	* src/Util.{h, cc}
	* test/RequestTest.cc

	Removed #!metalink3! notation support because it is deleted from
	the metalink specification.
	* src/Request.{h, cc}
	* test/RequestTest.cc
2007-11-11 04:25:56 +00:00
Tatsuhiro Tsujikawa 6b7df851d3 2007-10-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added ftp://USER:PASSWD@Servername automatic parsing.
	* src/Request.{h, cc}: Removed AuthResolvers. Added _username 
and
	_password. Recognize username and password in URI.
	* src/main.cc: Use AuthConfigFactory instead of RequestFactory.
	* src/RequestGroup.cc: Use AuthConfigFactory instead of 
RequestFactory.
	* src/RequestFactory.{h, cc}: Removed.
	* src/AuthConfigFactory.{h, cc}: New class.
	* src/FtpConnection.cc: Use AuthConfigFactory.
	* src/HttpRequest.cc: Use AuthConfigFactory.
	* test/HttpRequestTest.cc: Updated.
	* test/RequestTest.cc: Updated.
	* test/AuthConfigFactoryTest.cc: New class.
	* test/RequestFactoryTest.cc: Removed.
2007-10-30 12:48:01 +00:00
Tatsuhiro Tsujikawa 884a139e72 2007-10-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added HTTP/1.1 keep alive and pipelining support.
	See --enable-http-keep-alive and --enable-http-pipelining 
option.
	* src/AbstractCommand.{h, cc}: Now it has one-to-many relation 
to
	Segment.
	* src/HttpDownloadCommand.{h, cc}
	* src/OptionHandlerFactory.cc
	* src/HttpConnection.{h, cc}
	* src/version_usage.cc
	* src/HttpInitiateConnectionCommand.cc
	* src/FtpInitiateConnectionCommand.cc
	* src/Segment.h
	* src/HttpRequestCommand.{h, cc}
	* src/option_processing.cc
	* src/prefs.h
	* src/HttpResponseCommand.cc
	* src/SegmentMan.{h, cc}
	* src/FtpNegotiateCommand.cc
	* src/HttpProxyResponseCommand.cc
	* src/Request.cc
	* src/HttpRequest.cc
	* src/DownloadCommand.cc
	* test/HttpRequestTest.cc
	* test/RequestTest.cc
2007-10-17 16:26:51 +00:00
Tatsuhiro Tsujikawa c0b467273c 2007-10-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/Request.cc (parseUrl): Removed unnecessary slashes around 
dir.
2007-10-14 16:29:05 +00:00
Tatsuhiro Tsujikawa 1d5834a6ca 2007-10-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Do not send referer when redirected.
	* src/Request.cc (redirectUrl)
	* test/RequestTest.cc
	* test/HttpRequestTest.cc
2007-10-11 17:04:53 +00:00
Tatsuhiro Tsujikawa 3cc1ed5e09 2007-08-10 Ross Smith II <aria2spam at smithii dot com>
gcc 3.4.4 support:
	* src/DefaultBtContext.cc: int32_t -> int
	* src/main.cc: int -> int32_t, int32_t -> int
	* src/messageDigest.h: uint32_t -> unsigned int
	* src/NameResolver.h: int32_t -> int
	* src/PeerConnection.cc: int -> int32_t
	* src/SpeedCalc.cc: int32_t -> int
	* src/TrackerUpdateCommand.h: int -> int32_t
	* src/Util.cc: int32_t -> int
	* src/Util.h: int32_t -> int
	* src/Xml2MetalinkProcessor.cc: int -> uint32_t, int64_t -> 
uint64_t
	* test/AnnounceListTest.cc: int -> int32_t
	* test/ChunkedEncodingTest.cc: int -> int32_t
	* test/DataTest.cc: int -> int32_t
	* test/DefaultBtRequestFactoryTest.cc: int -> int32_t
	* test/DefaultPeerListProcessorTest.cc: int -> int32_t
	* test/DefaultPieceStorageTest.cc: int -> int32_t
	* test/FeatureConfigTest.cc: int -> int32_t
	* test/MetalinkEntryTest.cc: int -> int32_t
	* test/MockBtRequestFactory.h: int -> int32_t
	* test/MockPieceStorage.h: int -> int32_t
	* test/OptionTest.cc: int -> int32_t
	* test/RequestTest.cc: int -> int32_t
	* test/SegmentManTest.cc: int -> int32_t
	* test/Xml2MetalinkProcessorTest.cc: int -> int32_t
2007-08-15 15:11:01 +00:00
Tatsuhiro Tsujikawa e85f9ccfd6 2007-08-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
MessageDigestHelper is introduced in order to simplify the use
	of message digest. Removed repeated code.
	The message digest algorithm is now specified by string, like 
"sha1",
	"md5".
	* src/messageDigest.{h, cc}
	* src/MessageDigestHelper.{h, cc}: New class.
	* src/DefaultPieceStorage.cc
	* src/DefaultBtContext.{h, cc}
	(computeFastSet): New function.
	(setInfoHash): Added for unit testing.
	(setNumPieces): Added for unit testing.
	* src/DefaultBtInteractive.cc
	* src/BtPieceMessage.cc
	* src/Peer.cc
	* src/Checksum.h
	* src/message.h
	* src/IteratableChecksumValidator.h
	* src/ChunkChecksumValidator.{h, cc}: Use 
IteratableChecksumValidator
	inside it.
	* src/SegmentMan.{h, cc}
	(checkIntegrity): Removed.
	* src/IteratableChunkChecksumValidator.{h, cc}
	* src/Util.h
	(sha1Sum): Removed.
	(simpleMessageDigest): Removed.
	(fileChecksum): Removed.
	(computeFastSet): Removed.
	* src/ShaVisitor.cc
	* src/ChunkChecksum.h
	* src/DownloadCommand.cc

	Removed messageDigest virtual functions.
	* src/MultiDiskAdaptor.{h, cc}
	* src/DiskAdaptor.h
	* src/ByteArrayDiskWriter.h
	* src/DiskWriter.h
	* src/DiskAdaptorWriter.h
	* src/AbstractSingleDiskAdaptor.{h, cc}
	* src/AbstractDiskWriter.{h, cc}
	
	Fixed comilation error when message digest is disabled.
	* src/MetalinkEntry.{h, cc}
	* src/MetalinkRequestInfo.cc
	
	Removed srandom and random.
	* src/SimpleRandomizer.h

	Added size() virtual function to DiskAdaptor
	* src/MultiDiskAdaptor.h

	Fixed the bug that causes that files are not opened correctly in
	multi-file torrent.
	* src/TorrentRequestInfo.cc
	* src/MultiDiskAdaptor.cc
	
	Added SHA256 support
	* src/messageDigest.cc
	* src/Xml2MetalinkProcessor.cc

	Show supported message digest algorithms
	* src/main.cc

	Updated contact info.
	* src/main.cc
2007-08-08 14:40:11 +00:00
Tatsuhiro Tsujikawa 5649cf6cda 2007-03-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/Request.h: Use AuthResolver to get authentication 
information.
	* src/main.cc: Made RequestFactory a singleton object. Netrc is 
now
	set to RequestFactory object.
	* src/AuthConfigItem.h, src/AuthConfigItem.cc: Removed.
	* src/AuthConfig.h, src/AuthConfig.cc: Rewritten.
	* src/TrackerWatcherComand.cc: Use RequestFactorySingletonHolder 
to
	create Request object.
2007-03-21 10:19:23 +00:00
Tatsuhiro Tsujikawa 7ff627079f 2007-03-19 Tatsuhiro Tsujikawa <tujikawa at valkyrie dot rednoah com>
To integrate Netrc into exsiting classes:
	* src/Request.h
	(_userDefinedAuthConfig): New variable.
	(findNetrcAuthenticator): New function.
	(segment): Removed.
	(setUserDefinedAuthConfig): New function.
	(resolveHttpAuthConfigItem): New function.
	(resolveFtpAuthConfigItem): New function.
	(resolveHttpProxyAuthConfigItem): New function.
	* src/HttpRequest.h
	(authConfig): Removed.
	(proxyAuthConfig): Removed.
	(setAuthConfig): Removed.
	(setProxyAuthConfig): Removed.
	* src/UrlRequest.h
	(getHeadResult): Added a parameter: authConfigHandle
	* src/common.h
	(SingletonHolder.h): New include.
	* src/main.cc
	(Netrc.h): New include.
	(main): Removed initial values of PREF_FTP_USER, 
PREF_FTP_PASSWD.
	Added initial value of PREF_NETRC_PATH.
	Added the initialization of netrc.
	* src/AuthConfig.h: New class.
	* src/prefs.h
	(PREF_NETRC_PATH): New definition.
	* src/HttpAuthConfig.h: Removed.
	* src/Netrc.cc
	(getRequiredNextToken): New function.
	(skipMacdef): New function.
	(parse): Rewritten.
	* src/Netrc.h
	(getRequiredNextToken): New function.
	(skipMacdef): New function.
	* src/Util.h, src/Util.cc
	(getHomeDir): New function.
	* src/TrackerWatcherComand.cc
	(createRequestCommand): Use AuthConfig.
	* src/FtpConnection.cc
	(sendUser): Use Request::resolveFtpAuthConfigItem().
	(sendPass): Use Request::resolveFtpAuthConfigItem().
	* src/Request.cc
	(findNetrcAuthenticator): New function.
	(resolveHttpAuthConfigItem): New function.
	(resolveFtpAuthConfigItem): New function.
	(resolveHttpProxyAuthConfigItem): New function.
	* src/UrlRequestInfo.cc: Use AuthConfig.
	* src/HttpRequest.cc
	(createRequest): Use authConfig.
	(getProxyAuthString): Use authConfig.
	(configure): Removed PREF_HTTP_USER, PREF_HTTP_PASSWD,
	PREF_HTTP_PROXY_USER, PREF_HTTP_PROXY_PASSWD.
2007-03-18 15:42:34 +00:00
Tatsuhiro Tsujikawa 7db2b0596d 2006-07-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
To add the support for Metalink3.0 backward compatible links:
	
	* src/Request.h
	(SAFE_CHARS): Added '#'.
	(METALINK_MARK): New definition.
	* src/Request.cc
	(parseUrl): Added the support for Metalink3.0 backward 
compatible
	links.

	etc

	* src/PeerInteraction.cc
	(MsgPushBack): Removed.
	(sendMessages): Use STL copy and back_inserter.
	(rejectAllPieceMessageInQueue): Use STL copy and back_inserter.
	(rejectPieceMessageInQueue): Use STL copy and back_inserter.
	* src/TorrentMan.h
	(MAX_PEER_LIST_SIZE): Changed to 100 from 250.
2006-07-20 15:48:12 +00:00
Tatsuhiro Tsujikawa 70ff0c0b3b 2006-06-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/TorrentMan.cc (setupInternal1): Fixed peerId generation 
bug.

	* src/SimpleLogger.h (writeHeader): New function.
	* src/SimpleLogger.cc (writeHeader): New function.
	(writeLog): Fixed the bug that causes segfaults if exception 
message
	contains an unescaped "%" character.

	* src/TrackerWatcherCommand.cc (execute): Added a short sleep
	when a tracker request fails.

	* src/Request.cc (parseUrl): Query string is now handled 
properly.
2006-06-18 09:23:25 +00:00
Tatsuhiro Tsujikawa 62d3659410 Added Referer support 2006-02-18 03:59:26 +00:00
Tatsuhiro Tsujikawa 52634627bc Initial import 2006-02-17 13:35:04 +00:00