summaryrefslogtreecommitdiff
path: root/test/HttpRequestTest.cc
Commit message (Collapse)AuthorAgeFilesLines
* 2007-12-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-12-081-1/+0
| | | | | | | | | | Fixed compilation warnings * test/DataTest.cc * test/HttpRequestTest.cc * test/MetaFileUtilTest.cc * test/RequestTest.cc
* 2007-10-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-10-301-52/+51
| | | | | | | | | | | | | | | | | | | | 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-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-10-291-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use File::renameTo() * src/DefaultBtProgressInfoFile.cc Added --no-file-allocation-limit command-line option. * src/version_usage.cc * src/option_processing.cc * src/OptionHandlerFactory.cc * src/RequestGroup.{h, cc} * src/BtCheckIntegrityEntry.cc * src/StreamCheckIntegrityEntry.cc * src/prefs.h * doc/aria2c.1.txt * doc/aria2c.1 Now prealloc is the default value for --file-allocation option. * src/version_usage.cc * src/option_processing.cc * doc/aria2c.1.txt * doc/aria2c.1 Don't URL-encode user-agent. * src/HttpRequest.cc Updated translations * po/LINGUAS: Added nl for Dutch translation. * po/nl.po: Added Dutch translation, thanks to A. Bram Neijt. * po/de.po: Updated German translation, thanks to Patrick Ruckstuhl. * po/POTFILES.in: Updated.
* 2007-10-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-10-171-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-10-111-1/+0
| | | | | | | | | Do not send referer when redirected. * src/Request.cc (redirectUrl) * test/RequestTest.cc * test/HttpRequestTest.cc
* 2007-10-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-10-111-25/+43
| | | | | | | | | | Implemented BitTorrent/http/ftp integrated download. I've rewritten lots of files and now some headers have forward class declarations to reduce compile time. The implementation is extremely alpha stage, I recommend to use this for testing purpose only.
* (no commit message)Tatsuhiro Tsujikawa2007-06-101-4/+4
|
* 2007-06-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-06-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-03-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-03-291-4/+4
| | | | | | | | | * src/HttpRequest.cc (createRequest): url-encode user-agent * src/main.cc: Fixed the bug that prevents download if .netrc doesn't exist.
* 2007-03-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-03-271-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To add the command-line option which disables netrc support: * src/OptionHandlerFactory.cc (createOptionHandlers): Added PREF_NO_NETRC. * src/main.cc: Added -n option. * src/prefs.h (PREF_NO_NETRC): New definition. * src/RequestFactory.cc: Do not use netrc in ftp if PREF_NO_NETRC is V_TRUE. Note that netrc is not used in http, http proxy even if PREF_NO_NETRC is V_FALSE. This may get configurable in the future release. To clear peer's error status by time basis: * src/PeerAbstractCommand.cc (onAbort): Call Peer::startBadCondition(). * src/Peer.h, src/Peer.cc (error): Removed. (_badConditionStartTime): New variable. (_badConditionInterval): New variable. Initialized to 10 seconds. (startBadCondition): New function. (isGood): New function. * src/DefaultPeerStorage.cc (addPeer): Use Peer::isGood(). (FindFinePeer): Use Peer::isGood(). Always include port number in http request header: * src/HttpRequest.cc (getHostText): Always include port number in http request header.
* 2007-03-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-03-211-55/+31
| | | | | | | | | | | | | | | * 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-19 Tatsuhiro Tsujikawa <tujikawa at valkyrie dot rednoah com>Tatsuhiro Tsujikawa2007-03-181-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-03-151-0/+474
To handle Segment as SegmentHandle: * src/AbstractCommand.cc (execute): Rewritten. * src/SegmentMan.h: Segment -> SegmentHandle Introducded HttpResponse class, HttpRequest class to improve code extensiveness and make it clear: * src/HttpDownloadCommand.cc: transfer encoders are now managed by HttpResponse class. * src/HttpRequest.h, src/HttpRequest.cc: New class. * src/HttpResponse.h, src/HttpResponse.cc: New class. * src/HttpConnection.cc: Contruction of http request were moved to HttpRequest class. * src/HttpResponseCommand.h, src/HttpResponseCommand.cc: Refactored. * src/HttpRequestCommand.cc (executeInternal): Rewritten. * src/HttpAuthConfig.h: New class. * src/Range.h: New class. To make FtpTunnel{Request, Response}Command and HttpProxy{Request, Response}Command derived from AbstractProxy{Request, Response}Command: * src/FtpTunnelResponseCommand.h, src/FtpTunnelResponseCommand.cc: Derived from AbstractProxyRequestCommand class. * src/FtpTunnelRequestCommand.h, src/FtpTunnelRequestCommand.cc: Derived from AbstractProxyResponseCommand class. * src/HttpProxyRequestCommand.h, src/HttpProxyRequestCommand.cc: Derived from AbstractProxyRequestCommand class. * src/HttpProxyResponseCommand.h, src/HttpProxyResponseCommand.cc: Derived from AbstractProxyResponseCommand class. * src/AbstractProxyRequestCommand.h, src/AbstractProxyRequestCommand.cc : New class. * src/AbstractProxyResponseCommand.h, src/AbstractProxyResponseCommand.cc: New class. To add netrc support: * src/Netrc.h, src/Netrc.cc: New class. * src/Util.h, src/Util.cc (split): New function. * src/HttpHeader.cc (getRange): Fixed so that it inspects "Content-Range" header instead of "Range" header. * src/HttpHeader.h (getStatus): Removed. (setStatus): Removed. * src/Segment.h (getPositionToWrite): New function.