Commit Graph

15 Commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa
b1132d6b10 make clang-format using clang-format-3.6 2015-12-27 18:40:08 +09:00
Tatsuhiro Tsujikawa
d485c8e767 Rewrite AuthConfig objects using std::unique_ptr 2013-06-26 21:45:29 +09:00
Tatsuhiro Tsujikawa
07d270c87e Require -std=c++11 and use std::shared_ptr instead of SharedHandle 2013-06-22 01:10:38 +09:00
Tatsuhiro Tsujikawa
0ba6f8c352 Use same domain-match algorithm for no-proxy and netrc.
Now "example.org" does not domain-match ".example.org" in both
functions.
2011-10-29 00:16:46 +09:00
Tatsuhiro Tsujikawa
3ee6784b76 Made `make distcheck' pass.
We added 2 macros A2_TEST_DIR and A2_TEST_OUT_DIR to pass tests in
`make distcheck`.  A2_TEST_DIR refers to test directory.  All output
files by unit tests are now created under A2_TEST_OUT_DIR directory.
2010-12-02 22:52:35 +09:00
Tatsuhiro Tsujikawa
93e5dbed32 2010-11-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed SharedHandle::isNull(). Instead we added operator* and
	operator unspecified_bool_type. Removed use of WeakHandle and
	replaced with raw pointer.
2010-11-12 12:48:48 +00:00
Tatsuhiro Tsujikawa
939e4b2038 2010-08-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added test for previous change
	* test/NetrcTest.cc
2010-08-31 11:54:44 +00:00
Tatsuhiro Tsujikawa
c342bde962 2010-02-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use vector instead of deque for containers which is used for
	mostly read-only purpose.
2010-02-28 12:30:11 +00:00
Tatsuhiro Tsujikawa
10e371c25a 2009-10-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that Netrc::parse() cannot recognize comment line.
	* src/Netrc.cc
	* src/Util.h
	* test/NetrcTest.cc
	* test/sample.netrc
2009-10-17 13:11:03 +00:00
Tatsuhiro Tsujikawa
1ef99931e1 2008-04-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Rewritten Exception class. Throw exception object, not its pointer and
	catch by reference, so that remove problematic delete operator for
	catched exception.
	* src/Exception.cc
	* src/Exception.h
	* test/ExceptionTest.cc
	* src/*: All files throwing/catching exception.
	* test/*: All files throwing/catching exception.
2008-04-27 02:22:14 +00:00
Tatsuhiro Tsujikawa
3505201f33 2008-04-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
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-04-20 00:50:22 +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
729d566678 Fixed typo: threw -> thrown 2007-08-09 14:54:36 +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
11907c175d 2007-03-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
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.
2007-03-15 15:07:18 +00:00