Commit Graph

122 Commits (8fc5cdea02afe9992acb680cf7ecce9f445fc5de)

Author SHA1 Message Date
Tatsuhiro Tsujikawa 8fc5cdea02 Removed unused functions 2012-09-27 01:03:39 +09:00
Tatsuhiro Tsujikawa 89f18dde85 Use nothrow version of parseInt, parseUInt and parseLLInt 2012-09-27 00:45:32 +09:00
Tatsuhiro Tsujikawa f133091a9e Made BufferedFile ctor take const char* args 2012-09-25 23:44:41 +09:00
Tatsuhiro Tsujikawa f1017d5def Don't percent-decode filename value in Content-Disposition.
We only percent-decode filename* value in Content-Disposition because
the encoding is fully specified. But since filename value is not, so
we just accept it as is.
2012-06-28 23:18:50 +09:00
Tatsuhiro Tsujikawa 0a9abd89c6 Rewritten TLS hostname check based on RFC 6125. 2012-03-30 23:49:14 +09:00
Tatsuhiro Tsujikawa 25ef6677e9 Added hostname check described in RFC 2818 with OpenSSL. 2012-03-28 23:28:22 +09:00
Tatsuhiro Tsujikawa 3b1834e633 Avoid strlen in util::streq, util::strieq, util::startsWith and util::istartsWith 2012-01-11 01:50:35 +09:00
Tatsuhiro Tsujikawa 9331f6a43d Removed static const char[] as much as possible.
Provided convenient functions for streq, strieq, startsWith,
istartsWith, endsWith, iendsWith to support this move.
2012-01-11 01:03:38 +09:00
Tatsuhiro Tsujikawa 12988e5282 Replaced uint64_t with off_t or int64_t.
Since off_t is int64_t with LFS, we cannot take advantage of extra
capacity of uint64_t.
2011-12-09 21:39:43 +09:00
Tatsuhiro Tsujikawa c42dd7e755 Changed format of ETA.
Now no leading 0 is used. If hour part and/or min part is non-zero,
and sec part is 0, sec part is omitted, like this "1h3m".
2011-11-13 20:59:15 +09:00
Tatsuhiro Tsujikawa db5cc4db27 Don't append character to std::string. 2011-11-12 21:27:24 +09:00
Tatsuhiro Tsujikawa 2f4393d17c Rewritten parse*Int 2011-11-12 01:06:52 +09:00
Tatsuhiro Tsujikawa d17ea2837b HttpHeader::fill() now stores header name in lowercase.
Find methods in HttpHeader won't lowercase argument, so use lowercase
letters to get HTTP header field.
2011-11-11 22:50:18 +09:00
Tatsuhiro Tsujikawa 30fdb08f40 Rewritten parametered URI handling routine. 2011-11-06 16:37:02 +09:00
Tatsuhiro Tsujikawa 0c162dfbfb Made util::fromHex and base32::decode function template 2011-11-05 18:05:23 +09:00
Tatsuhiro Tsujikawa d1d4903665 Rewritten bencode2::decode functions 2011-11-05 12:01:57 +09:00
Tatsuhiro Tsujikawa 5c88f61269 Added util::istartsWith() 2011-11-05 00:33:35 +09:00
Tatsuhiro Tsujikawa 79876af88f Removed util::endsWith(a, b). Added util::iendsWith() 2011-11-05 00:25:24 +09:00
Tatsuhiro Tsujikawa 601ec0f44a Removed util::startsWith(a, b) 2011-11-04 23:43:32 +09:00
Tatsuhiro Tsujikawa f84d2253b2 Rewritten util::split and added its iterator version.
Iterator based functions util::startsWith, util::endsWith,
util::streq, util::strieq were added.
2011-11-04 22:27:58 +09:00
Tatsuhiro Tsujikawa 6267676e8b util::divide now takes iterators as arguments. 2011-11-03 23:09:03 +09:00
Tatsuhiro Tsujikawa 118626afc4 util::percentDecode now takes iterators as arguments. 2011-11-03 19:27:29 +09:00
Tatsuhiro Tsujikawa 9bb914b76e Changed parse*Int functions so that it accepts iterators. 2011-11-03 18:51:31 +09:00
Tatsuhiro Tsujikawa f884ad8339 Rewritten parseIndexPath. Renamed createIndexPathMap as createIndexPaths. 2011-11-02 00:18:39 +09:00
Tatsuhiro Tsujikawa 4a455b5afe Removed IntSequence and Sequence<T> 2011-10-30 15:08:44 +09:00
Tatsuhiro Tsujikawa 5749647ae5 Use SegList<int> instead of IntSequence in DownloadContext::setFileFilter() 2011-10-29 23:33:48 +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 74e5aa0ace Rewritten util::inSameCidrBlock() to support IPv6 address.
We also introduced union sockaddr_union in a2netcompat.h.
2011-10-19 23:14:13 +09:00
Tatsuhiro Tsujikawa a743bef220 Fixed output file path of tests. 2011-08-25 00:26:36 +09:00
Tatsuhiro Tsujikawa a10cda2f17 Use global::cout to output string to stdout.
In MinGW32 build, global::cout is WinConsoleFile. When outputing to
console, it uses WriteConsoleW, so Unicode characters are written.
Fixed memory leak in WChar<->MultiByte conversion functions.  The
portion of code which uses std::cout is rewritten to use global::cout.
2011-08-09 23:33:55 +09:00
Tatsuhiro Tsujikawa 7c317de4e7 Added Metalink/HTTP Link and Digest header field parser. 2011-07-26 23:41:21 +09:00
Tatsuhiro Tsujikawa e7d7233d54 Moved joinUri from util namespace to uri namespace. 2011-05-06 23:20:43 +09:00
Tatsuhiro Tsujikawa 1122e55a35 Handle "..", "." in util::joinUri() 2011-04-30 22:42:10 +09:00
Tatsuhiro Tsujikawa 871819af59 Added util::joinUri() 2011-04-30 00:15:27 +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 d8d159ccd8 2010-11-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced HttpHeader::responseStatus_ with HttpHeader::statusCode_.
	statusCode_ is of type int.
	* src/AbstractProxyResponseCommand.cc
	* src/FtpNegotiationCommand.cc
	* src/HttpHeader.cc
	* src/HttpHeader.h
	* src/HttpHeaderProcessor.cc
	* src/HttpResponse.cc
	* src/HttpResponse.h
	* src/HttpResponseCommand.cc
	* src/HttpSkipResponseCommand.cc
	* src/util.cc
	* src/util.h
	* test/HttpHeaderProcessorTest.cc
	* test/HttpHeaderTest.cc
	* test/HttpResponseTest.cc
	* test/UtilTest.cc
2010-11-15 12:52:03 +00:00
Tatsuhiro Tsujikawa 0abd4a2f7b 2010-10-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten util::split()
	* src/util.h
	* test/UtilTest.cc
2010-10-10 06:58:31 +00:00
Tatsuhiro Tsujikawa 1875d7382f 2010-10-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced util::split(a,b,c) and util::split(a,b) with
	util::divide()
	* src/ExpatMetalinkProcessor.cc
	* src/FtpConnection.cc
	* src/HttpHeader.cc
	* src/HttpResponse.cc
	* src/HttpServer.cc
	* src/OptionParser.cc
	* src/ParameterizedStringParser.cc
	* src/ServerStatMan.cc
	* src/magnet.cc
	* src/util.cc
	* src/util.h
	* test/UtilTest.cc
2010-10-10 03:39:00 +00:00
Tatsuhiro Tsujikawa 8e059b66fa 2010-10-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added util::lowercase() and util::uppercase().
	* src/cookie_helper.cc
	* src/util.cc
	* src/util.h
	* test/UtilTest.cc
2010-10-10 02:51:38 +00:00
Tatsuhiro Tsujikawa 788679f0df 2010-10-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added test cases for util::parseUIntNoThrow() and
	util::parseLLIntNoThrow().
	* test/UtilTest.cc
2010-10-09 16:58:58 +00:00
Tatsuhiro Tsujikawa 1505671e7b 2010-10-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use util::strip() instead of util::trim()
	* src/ExpatXmlRpcRequestProcessor.cc
	* src/FeatureConfig.cc
	* src/HttpHeader.cc
	* src/MetalinkParserStateV3Impl.cc
	* src/OptionHandlerImpl.h
	* src/ServerStatMan.cc
	* src/UriListParser.cc
	* src/Xml2XmlRpcRequestProcessor.cc
	* src/bittorrent_helper.cc
	* src/cookie_helper.cc
	* src/messageDigest.cc
	* src/util.cc
	* src/util.h
	* test/FeatureConfigTest.cc
	* test/HttpRequestTest.cc
	* test/UriListParserTest.cc
	* test/UtilTest.cc
2010-10-09 16:49:02 +00:00
Tatsuhiro Tsujikawa dbea00fa9d 2010-10-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added util::strip()
	* src/util.cc
	* src/util.h
	* test/UtilTest.cc
2010-10-09 16:22:56 +00:00
Tatsuhiro Tsujikawa d5e0046f29 2010-10-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten util::escapePath(). Now it does not replace bad chars:it
	performs percent-encode against them.  util::fixTaintedBasename()
	now replaces "/" with "%2F".  Added 0x7f as bad chars in
	util::detectDirTraversal().
	* src/util.cc
	* test/UtilTest.cc
2010-10-02 08:20:10 +00:00
Tatsuhiro Tsujikawa d956ea0b70 2010-10-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Non-UTF8 filenames are now percent-encoded.  For example, filename
	for http://example.org/%90%A2%8AE will be %90%A2%8AE because it is
	Shift_JIS. The comments and name in .torrent file in XML-RPC
	response are percent-encoded if they are not UTF-8.
	* src/FtpNegotiationCommand.cc
	* src/HttpRequestCommand.cc
	* src/HttpResponseCommand.cc
	* src/XmlRpcMethodImpl.cc
	* src/bittorrent_helper.cc
	* src/util.cc
	* src/util.h
	* test/BittorrentHelperTest.cc
	* test/UtilTest.cc
2010-10-02 07:54:43 +00:00
Tatsuhiro Tsujikawa 769783dab4 2010-06-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Made test code not use /tmp
	* test/CookieStorageTest.cc
	* test/DirectDiskAdaptorTest.cc
	* test/FallocFileAllocationIteratorTest.cc
	* test/FileEntryTest.cc
	* test/FileTest.cc
	* test/GZipDecoderTest.cc
	* test/MultiDiskAdaptorTest.cc
	* test/MultiFileAllocationIteratorTest.cc
	* test/RequestGroupManTest.cc
	* test/SignatureTest.cc
	* test/SingleFileAllocationIteratorTest.cc
	* test/UtilTest.cc
2010-06-22 12:28:37 +00:00
Tatsuhiro Tsujikawa 2bcf648102 2010-05-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that if filename in Content-Disposition header
	includes ';', aria2 cuts filename after ';'.
	* src/util.cc
	* test/UtilTest.cc
2010-05-06 12:49:50 +00:00
Tatsuhiro Tsujikawa f15d22b619 2010-03-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added vbegin() and vend() for fixed sized array.
	* src/DownloadHandlerConstants.cc
	* src/FeatureConfig.cc
	* src/OptionHandlerFactory.cc
	* src/ServerStat.cc
	* src/TimeA2.cc
	* src/XmlRpcMethod.cc
	* src/array_fun.h
	* src/download_helper.cc
	* src/messageDigest.cc
	* src/util.cc
	* test/BittorrentHelperTest.cc
	* test/DHTRoutingTableDeserializerTest.cc
	* test/DHTRoutingTableSerializerTest.cc
	* test/DefaultBtAnnounceTest.cc
	* test/DefaultBtProgressInfoFileTest.cc
	* test/DownloadContextTest.cc
	* test/DownloadHelperTest.cc
	* test/FeatureConfigTest.cc
	* test/FeedbackURISelectorTest.cc
	* test/HttpRequestTest.cc
	* test/InOrderURISelectorTest.cc
	* test/MSEHandshakeTest.cc
	* test/MultiDiskAdaptorTest.cc
	* test/MultiFileAllocationIteratorTest.cc
	* test/PriorityPieceSelectorTest.cc
	* test/RequestGroupManTest.cc
	* test/UtilTest.cc
	* test/XmlRpcMethodTest.cc
	* test/a2algoTest.cc
	* test/array_funTest.cc
2010-03-25 13:51:10 +00:00
Tatsuhiro Tsujikawa 4951142346 2010-03-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Accept IPv4 network address with CIDR block in --no-proxy option
	and no_proxy environment variable.  Current implementation does
	not resolve hostname in URI to compare network address. So it is
	only effecive if URI has numeric IP addresses.
	* doc/aria2c.1.txt
	* src/AbstractCommand.cc
	* src/OptionHandlerFactory.cc
	* src/bitfield.h
	* src/usage_text.h
	* src/util.cc
	* src/util.h
	* test/UtilTest.cc
	* test/bitfieldTest.cc
2010-03-19 08:56:17 +00:00
Tatsuhiro Tsujikawa 3ecf6e4b6f 2010-03-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Ignore filename parameter if it contains directory traversal
	directives.
	* src/util.cc
	* test/UtilTest.cc
2010-03-07 15:06:48 +00:00
Tatsuhiro Tsujikawa 41b7b9428f 2010-03-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
urldecode -> percentDecode
	* src/FtpConnection.cc
	* src/FtpNegotiationCommand.cc
	* src/HttpResponse.cc
	* src/Request.cc
	* src/magnet.cc
	* src/util.cc
	* src/util.h
	* test/UtilTest.cc
2010-03-07 14:29:40 +00:00