summaryrefslogtreecommitdiff
path: root/test/HttpRequestTest.cc
Commit message (Collapse)AuthorAgeFilesLines
* 2009-02-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-02-191-1/+2
| | | | | | | | | | | | | | | | | | | | | Added --http-auth-challenge option. If it is set to true(by default), aria2 sends HTTP authorization header only when it is requested by the server. If false is set, then authorization header is always sent to the server. This is useful for servers that don't respond 401 code when authentication is required. There is an exception: if username and password are embedded in URI, authorization header is always sent to the server regardless of this option. * src/AuthConfigFactory.cc * src/HttpSkipResponseCommand.cc * src/OptionHandlerFactory.cc * src/prefs.cc * src/prefs.h * src/usage_text.h * test/AuthConfigFactoryTest.cc * test/HttpRequestTest.cc
* 2009-01-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-01-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Send HTTP Authorization header only if it is requested by the server(response 401). There are some exceptions. The authorization header for proxy is always sent if it is available without request by the server. If username/password is specified in the URI, it is immediately sent to the server without request by the server. AbstractAuthResolver::_defaultAuthConfig is now initialized as SharedHandle<AuthConfig>(). NetrcAuthResolver::resolveAuthConfig() returns SharedHandle<AuthConfig>() if no AuthConfig is available. * src/AbstractAuthResolver.cc * src/AbstractProxyRequestCommand.cc * src/AuthConfigFactory.cc * src/AuthConfigFactory.h * src/HttpConnection.cc * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc * test/AuthConfigFactoryTest.cc * test/HttpRequestTest.cc * test/HttpResponseTest.cc
* 2008-11-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2008-11-231-0/+22
| | | | | | | | | | | | | | | | | | Use HEAD method to get file size from HTTP server for segmented downloading. The request to the BitTorrent Tracker always uses GET method because the response of the tracker is small and it doesn't need segmented download. * src/FtpNegotiationCommand.cc * src/HttpRequest.cc * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/RequestGroup.cc * src/RequestGroup.h * src/TrackerWatcherCommand.cc * test/HttpRequestTest.cc
* 2008-11-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-11-051-5/+5
| | | | | | | | | | | | | | | | | | | | | | Added the ability to pool proxy connection. The conneciton in FTP with proxy-method=GET is not pooled. Proxy-Connection header will not be sent when sending CONNECT method. * src/DownloadEngine.cc * src/DownloadEngine.h * src/FtpFinishDownloadCommand.cc * src/FtpInitiateConnectionCommand.cc * src/FtpNegotiationCommand.cc * src/HttpDownloadCommand.cc * src/HttpInitiateConnectionCommand.cc * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpSkipResponseCommand.cc * test/HttpRequestTest.cc * test/HttpResponseTest.cc
* 2008-11-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-11-041-63/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deprecated --http-proxy-user and --http-proxy-passwd options. Added --https-proxy, --ftp-proxy and --all-proxy options. Above 3 options and --http-proxy option can handle proxy in URL format like: http://user:passwd@host:port. If a proxy requires user/password, they must be specified in a URL. Deprecated --ftp-via-http-proxy option. Use --http-proxy-method option instead. * src/AbstractCommand.cc * src/AbstractCommand.h * src/AbstractProxyRequestCommand.cc * src/AbstractProxyRequestCommand.h * src/AuthConfigFactory.cc * src/AuthConfigFactory.h * src/FtpFinishDownloadCommand.cc * src/FtpInitiateConnectionCommand.cc * src/FtpInitiateConnectionCommand.h * src/FtpNegotiationCommand.cc * src/FtpTunnelRequestCommand.cc * src/FtpTunnelRequestCommand.h * src/HttpDownloadCommand.cc * src/HttpInitiateConnectionCommand.cc * src/HttpInitiateConnectionCommand.h * src/HttpProxyRequestCommand.cc * src/HttpProxyRequestCommand.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpRequestCommand.cc * src/HttpRequestCommand.h * src/HttpSkipResponseCommand.cc * src/InitiateConnectionCommand.cc * src/InitiateConnectionCommand.h * src/OptionHandlerFactory.cc * src/OptionHandlerImpl.h * src/Request.cc * src/option_processing.cc * src/prefs.cc * src/prefs.h * src/usage_text.h * test/AuthConfigFactoryTest.cc * test/HttpRequestTest.cc * test/OptionHandlerTest.cc
* 2008-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-11-031-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | AuthConfigFactory is now part of DownloadEngine. * src/AbstractProxyRequestCommand.cc * src/AuthConfigFactory.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/FtpConnection.cc * src/FtpConnection.h * src/FtpNegotiationCommand.cc * src/HttpConnection.cc * src/HttpRequest.cc * src/HttpRequest.h * src/HttpRequestCommand.cc * src/HttpResponse.cc * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/MultiUrlRequestInfo.cc * src/main.cc * test/FtpConnectionTest.cc * test/HttpRequestTest.cc * test/HttpResponseTest.cc
* 2008-09-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-09-251-2/+6
| | | | | | | | | | | | | 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 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-09-251-49/+41
| | | | | | | | | | | | | | | | | | | | Use netrc for HTTP. Now FTP user/password is sent in Authorization header when --ftp-via-http-proxy=get is given. * src/AuthConfigFactory.cc * src/HttpRequest.cc * src/HttpRequest.h * src/NetrcAuthResolver.cc * src/NetrcAuthResolver.h * src/OptionHandlerFactory.cc * src/option_processing.cc * src/prefs.cc * src/prefs.h * test/AuthConfigFactoryTest.cc * test/HttpRequestTest.cc * test/NetrcAuthResolverTest.cc
* 2008-09-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-09-011-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use CookieStorage class instead of CookieBox class. Now CookieStorage accepts cookies from numeric host such as 192.168.1.1. * src/AbstractProxyRequestCommand.cc * src/CookieStorage.cc * src/DownloadEngine.cc * src/DownloadEngine.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpRequestCommand.cc * src/HttpResponse.cc * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/Makefile.am * src/MultiUrlRequestInfo.cc * src/Request.cc * src/Request.h * src/main.cc * test/AllTest.cc * test/CookieStorageTest.cc * test/CookieTest.cc * test/HttpRequestTest.cc * test/HttpResponseTest.cc * test/Makefile.am * test/NsCookieParserTest.cc * test/Sqlite3MozCookieParserTest.cc * test/nscookietest.txt
* 2008-06-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-06-291-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added gzip, deflate decoding support in HTTP using libz. If compiled with this feature, aria2 sends "Accept-Encoding: deflate, gzip" header to a HTTP server. If a server returns "Content-Encoding: gzip" or "Content-Encoding: deflate" then, aria2 decodes the response body on the fly and writes decoded data to a local disk. * README * README.html * configure.ac * m4/aria2_arg.m4: Added ARIA2_ARG_WITH and ARIA2_ARG_ENABLE, they are wrapper function for AC_ARG_WITH and AC_ARG_ENABLE respectively. * m4/libz.m4 * src/Decoder.h * src/DownloadCommand.cc * src/DownloadCommand.h * src/Exception.h * src/GZipDecoder.cc * src/GZipDecoder.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponse.h * src/HttpResponseCommand.cc * src/Makefile.am * test/GZipDecoderTest.cc * test/HttpRequestTest.cc * test/HttpResponseTest.cc * test/Makefile.am * test/Makefile.in * test/gzip_decode_test.gz
* 2008-06-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-06-161-6/+6
| | | | | | | | 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-05-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-05-081-3/+2
| | | | | | | | | | Set _supportsPersistentConnection to true by default. * src/Request.cc * src/RequestGroup.cc * test/HttpRequestTest.cc * test/RequestTest.cc
* 2008-05-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-05-051-0/+27
| | | | | | | | | | | | | Reimplemented transparent metalink using Accept request header. * src/HttpRequest.cc * src/HttpRequest.h * src/HttpRequestCommand.cc * src/Metalink2RequestGroup.cc * src/RequestGroup.cc * src/RequestGroup.h * test/HttpRequestTest.cc
* 2008-04-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-04-271-0/+22
| | | | | | | | | | | | | | | 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-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-04-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | Added build-in "Accept-Feature" support. For now only "metalink" is used in this header field. This "metalink" value is removed from the list when connecting URLs fed by metalink file to avoid loop in "transparent" metlaink. * src/HttpRequest.cc * src/HttpRequest.h: Renamed _userHeaders as _headers. Accept-Feature header is also held in this variable. Also renamed setUserHeaders as addHeader and it was rewritten to add header not just to clear the old value. * src/HttpRequestCommand.cc * src/Metalink2RequestGroup.cc: Added the code to remove "metalink" from "Accept-Feature" list. * src/RequestGroup.cc: Added "metalink" to "Accept-Feature" by default. * src/RequestGroup.h * src/TaggedItem.cc: Moved Concat class to a2functional.h. * src/a2functional.h: Included <string> because Concat class depends on it. * test/HttpRequestTest.cc
* 2008-04-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-04-221-14/+51
| | | | | | | | | | | | | | | | | | 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-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-04-201-0/+26
| | | | | | | | | | | | | | | | | | | | Added --header option. You can specify any number of additional HTTP headers like: aria2 --header="X-A: 300" --header="X-B: 900" http://host/file Unlike other commad-line option, you can use --header option multiple times. * src/HelpItemFactory.cc * src/HttpRequest.{cc, h} * src/HttpRequestCommand.cc * src/OptionHandlerFactory.cc * src/OptionHandlerImpl.h * src/option_processing.cc * src/prefs.h * src/usage_text.h * test/HttpRequestTest.cc (testUserHeaders)
* 2008-04-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-04-201-30/+45
| | | | | | | | | | | | | | | Rewritten SharedHandle. Now copy constructor taking raw pointer has keyword explicit and SharedHandle's default constructor initializes its internal obj to null, old implementation initializes it using obj's default constructor. To assign null, write SharedHandle<T> x(...); x.reset(); TODO: test/SharedHandleTest.cc needs more tests. * src/SharedHandle.h
* 2008-03-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-03-111-10/+10
| | | | | | | | | | | | | | | | | | | | Added summary log for peer announce storage. * src/DHTPeerAnnounceStorage.cc (handleTimeout) Removed cast * src/DefaultPeerStorage.cc (addPeer) Log exception message * src/DHTMessageTracker.cc (handleTimeout) Fixed casting * test/HttpRequestTest.cc * test/MetalinkProcessorTest.cc * test/PieceTest.cc * test/MetalinkEntryTest.cc * test/SequenceTest.cc
* 2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-02-081-29/+35
| | | | | | | | | Removed "using namespace std;" from all sources. Appended std:: prefix to c++ standard classes. Included string.h where mem* function are used.
* 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.