summaryrefslogtreecommitdiff
path: root/src/a2functional.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove deprecated std::unary_function and std::binary_functionTatsuhiro Tsujikawa2023-09-161-2/+1
|
* Use std::make_unique if C++14 is usedTatsuhiro Tsujikawa2016-01-301-0/+4
|
* make clang-format using clang-format-3.6Tatsuhiro Tsujikawa2015-12-271-53/+29
|
* Use user-defined literal for k, m, and g (powers of 1024)Tatsuhiro Tsujikawa2015-06-211-0/+17
|
* Use user-defined literals for time unitsTatsuhiro Tsujikawa2015-06-211-0/+21
|
* Rewrite auto_deleter_r with defer function templateTatsuhiro Tsujikawa2014-09-161-22/+15
|
* Fix array version make_unique is invoked for 1 size_t arg accidentallyTatsuhiro Tsujikawa2013-07-041-2/+4
|
* Use std::unique_ptr instead of array_ptrTatsuhiro Tsujikawa2013-07-031-0/+6
|
* Remove auto_delete in favor of std::unique_ptrTatsuhiro Tsujikawa2013-06-221-27/+0
|
* Cleanup a2functional.hTatsuhiro Tsujikawa2013-06-221-123/+0
| | | | | | Remove mem_fun_sh in favor of std::mem_fun. Remove unused functions. Use std::mem_fn instead of mem_fun_sh
* Use std::unique_ptr instead of std::shared_ptrTatsuhiro Tsujikawa2013-06-221-0/+6
|
* Require -std=c++11 and use std::shared_ptr instead of SharedHandleTatsuhiro Tsujikawa2013-06-221-10/+10
|
* Remove Append and StringAppendTatsuhiro Tsujikawa2013-01-151-17/+0
|
* Include common.h from a2algo.h and a2functional.hTatsuhiro Tsujikawa2012-04-081-0/+2
|
* Use std::set instead of std::deque if the elements are sorted andTatsuhiro Tsujikawa2012-03-231-0/+6
| | | | insertions and deletions are frequent.
* Added JSON-RPC over WebSocket.Tatsuhiro Tsujikawa2012-03-201-0/+8
| | | | Wslay library must be placed under deps/wslay.
* Removed strappendTatsuhiro Tsujikawa2011-11-121-57/+0
|
* Removed strconcatTatsuhiro Tsujikawa2011-11-121-103/+0
|
* Rewritten ExpatMetalinkProcessor using BufferedFile.Tatsuhiro Tsujikawa2011-08-071-0/+13
|
* Rewritten DefaultBtProgressInfoFile using stdio instead of stream.Tatsuhiro Tsujikawa2011-08-051-0/+14
|
* 2010-11-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-111-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To match the behavior of friend operator functions in SharedHandle.h to std::tr1::shared_ptr, we intentionally broke these functions and modified code so that our code does not depend on old behavior. * src/AbstractCommand.cc * src/DHTAbstractNodeLookupTask.h * src/DHTBucket.cc * src/DHTMessageReceiver.cc * src/DHTNodeLookupEntry.cc * src/DHTRoutingTable.cc * src/DefaultBtRequestFactory.cc * src/DefaultPeerStorage.cc * src/DefaultPieceStorage.cc * src/DownloadContext.cc * src/EpollEventPoll.cc * src/Event.h * src/HttpConnection.cc * src/KqueueEventPoll.cc * src/MultiDiskAdaptor.cc * src/PeerAbstractCommand.cc * src/PieceStatMan.cc * src/PollEventPoll.cc * src/PortEventPoll.cc * src/SegmentMan.cc * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStatMan.cc * src/SharedHandle.h * src/UnknownLengthPieceStorage.cc * src/a2functional.h * src/option_processing.cc * src/version_usage.cc * test/BNodeTest.cc * test/DHTAnnouncePeerMessageTest.cc * test/DHTBucketTest.cc * test/DHTFindNodeMessageTest.cc * test/DHTGetPeersMessageTest.cc * test/DHTIDCloserTest.cc * test/DHTMessageFactoryImplTest.cc * test/DHTPingMessageTest.cc * test/DefaultBtRequestFactoryTest.cc * test/DefaultPeerStorageTest.cc * test/SequentialPickerTest.cc * test/SingletonHolderTest.cc
* 2010-10-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-10-311-3/+3
| | | | | | Made #include guard consistent for c++ header files.
* 2010-10-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-10-301-2/+0
| | | | | | | Removed unnecessary unnamed namespace * src/a2functional.h
* 2010-10-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-10-091-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewritten Cookie class and Cookie parser based on http://tools.ietf.org/html/draft-ietf-httpstate-cookie-14 with some modifications. When parsing cookie date, match time first so that it parses asctime() format. The request-path must be ends with '/' so that request-path '/foo/' path-matches cookie-path '/foo' and '/foo/' in the proposed algorithm. * src/Cookie.cc * src/Cookie.h * src/CookieParser.cc: Removed * src/CookieParser.h: Removed * src/CookieStorage.cc * src/CookieStorage.h * src/HttpResponse.cc * src/Makefile.am * src/Makefile.in * src/MultiUrlRequestInfo.cc * src/NsCookieParser.cc * src/NsCookieParser.h * src/Sqlite3CookieParser.cc * src/Sqlite3CookieParser.h * src/a2functional.h * src/cookie_helper.cc * src/cookie_helper.h * src/util.cc * src/util.h * test/CookieBoxFactoryTest.cc: Removed * test/CookieHelperTest.cc * test/CookieParserTest.cc: Removed * test/CookieStorageTest.cc * test/CookieTest.cc * test/HttpRequestTest.cc * test/Makefile.am * test/Makefile.in * test/NsCookieParserTest.cc * test/Sqlite3CookieParserTest.cc * test/TestUtil.cc * test/TestUtil.h * test/a2functionalTest.cc * test/chromium_cookies.sqlite * test/cookies.sqlite * test/nscookietest.txt
* 2010-06-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-211-16/+16
| | | | | | | Changed naming standards for class member variable: now it looks like var_ instead of _var.
* 2010-06-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-201-1/+17
| | | | | | | | | | | | | Use auto_delete_container to delete created Command when exception is thrown rather than deleting them in catch block. * src/AbstractCommand.cc * src/CheckIntegrityCommand.cc * src/DHTSetup.cc * src/FileAllocationCommand.cc * src/TrackerWatcherCommand.cc * src/a2functional.h
* 2010-04-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-04-031-0/+19
| | | | | | | | | | | Fixed the bug that web-seed URI is not percent-encoded. * src/a2functional.h * src/bittorrent_helper.cc * test/BittorrentHelperTest.cc * test/url-list-multiFile.torrent * test/url-list-singleFileEndsWithSlash.torrent
* 2010-01-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-01-281-0/+9
| | | | | | | | | | | | | | | | | | Rewritten Cookie storage. * src/Cookie.cc * src/Cookie.h * src/CookieParser.cc * src/CookieStorage.cc * src/CookieStorage.h * src/a2functional.h * test/CookieParserTest.cc * test/CookieStorageTest.cc * test/CookieTest.cc * test/HttpResponseTest.cc * test/TestUtil.h * test/a2functionalTest.cc
* 2010-01-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-01-051-42/+42
| | | | | | | | | Untabify. Fixed one line in copyright which is longer than 80 columns. * src * test
* 2009-06-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-06-071-18/+26
| | | | | | | | Rewritten strconcat and strappend using operator+ instead of append(). * src/a2functional.h
* 2009-06-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-06-061-12/+17
| | | | | | | | Added strjoin function template. Use it in pathJoin() * src/Util.h * src/a2functional.h
* 2009-06-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-06-061-0/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid intermediate object during string concatenation. Replaced post-increment unary operator with pre-increment one in for loop. * src/AdaptiveURISelector.cc * src/AnnounceList.cc * src/AuthConfig.h * src/BtBitfieldMessage.cc * src/BtExtendedMessage.cc * src/BtHandshakeMessage.cc * src/BtPieceMessage.cc * src/BtPortMessage.cc * src/Cookie.cc * src/DHTAnnouncePeerMessage.cc * src/DHTAutoSaveCommand.cc * src/DHTGetPeersReplyMessage.cc * src/DHTNode.cc * src/DHTQueryMessage.cc * src/DHTResponseMessage.cc * src/DHTUnknownMessage.cc * src/DefaultBtAnnounce.cc * src/DefaultBtContext.cc * src/DefaultBtInteractive.cc * src/DefaultBtProgressInfoFile.cc * src/DefaultPeerStorage.cc * src/DownloadEngine.cc * src/FeatureConfig.cc * src/File.cc * src/FtpConnection.cc * src/FtpNegotiationCommand.cc * src/HandshakeExtensionMessage.cc * src/HttpConnection.cc * src/HttpRequest.cc * src/HttpResponseCommand.cc * src/HttpServer.cc * src/IndexBtMessage.cc * src/Metalink2RequestGroup.cc * src/OptionHandlerImpl.h * src/PStringBuildVisitor.cc * src/Peer.cc * src/PeerListenCommand.cc * src/Piece.cc * src/RangeBtMessage.cc * src/Request.cc * src/Request.h * src/RequestGroup.cc * src/RequestGroupMan.cc * src/ServerStat.cc * src/ServerStatMan.cc * src/UTPexExtensionMessage.cc * src/Util.cc * src/a2functional.h * src/download_helper.cc * src/messageDigest.cc
* 2009-04-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-04-211-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewritten event dispatch in BtMessage. Removed BtEventListener, BtEvent. * src/AbstractBtEventListener.h: Removed. * src/AbstractBtMessage.cc * src/AbstractBtMessage.h * src/BtAbortOutstandingRequestEvent.h * src/BtCancelSendingPieceEvent.h * src/BtChokedEvent.h: Removed. * src/BtChokingEvent.h * src/BtEvent.h: Removed * src/BtEventListener.h: Removed. * src/BtMessage.h * src/BtPieceMessage.cc * src/BtPieceMessage.h * src/BtRequestMessage.cc * src/BtRequestMessage.h * src/DefaultBtMessageDispatcher.cc * src/Makefile.am * src/a2functional.h * test/BtPieceMessageTest.cc * test/BtRequestMessageTest.cc * test/DefaultBtMessageDispatcherTest.cc * test/MockBtMessage.h
* 2008-11-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2008-11-091-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | Added the ability to verify peer in SSL/TLS using given CA certificates. The CA certificates are specified in --ca-certificate option. By default, the verification is disabled. Use --check-certificate option to enable it. * src/HttpRequestCommand.cc * src/LibgnutlsTLSContext.cc * src/LibgnutlsTLSContext.h * src/LibsslTLSContext.cc * src/LibsslTLSContext.h * src/MultiUrlRequestInfo.cc * src/OptionHandlerFactory.cc * src/SocketCore.cc * src/SocketCore.h * src/a2functional.h * src/message.h * src/option_processing.cc * src/prefs.cc * src/prefs.h * src/usage_text.h
* 2008-05-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-05-131-1/+2
| | | | | | | | | | | Replaced "" with static const variable A2STR::NIL. Replaced string comparison against "" with std::string::empty(). Added PROTO_* to Request class and use them as a protocol string constant. Made "started", "stopped", "completed" static const variable in AnnounceList class.
* 2008-05-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-05-121-0/+17
| | | | | | | | Rewritten Accept-Features handling. * src/HttpRequestCommand.cc (createHttpRequest) * src/a2functional.h
* 2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-05-111-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass std::deque<Command*> by reference to avoid unnecessary coping. * src/AbstractCommand.cc * src/BtCheckIntegrityEntry.cc * src/BtCheckIntegrityEntry.h * src/BtFileAllocationEntry.cc * src/BtFileAllocationEntry.h * src/BtSetup.cc * src/BtSetup.h * src/CheckIntegrityCommand.cc * src/CheckIntegrityEntry.h * src/ChecksumCheckIntegrityEntry.cc * src/ChecksumCheckIntegrityEntry.h * src/DHTSetup.cc * src/DHTSetup.h * src/DownloadEngine.cc * src/FileAllocationCommand.cc * src/FileAllocationEntry.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/StreamCheckIntegrityEntry.cc * src/StreamCheckIntegrityEntry.h * src/StreamFileAllocationEntry.cc * src/StreamFileAllocationEntry.h * src/TrackerWatcherCommand.cc * src/a2functional.h
* 2008-04-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-04-251-0/+13
| | | | | | | | | | | | | | | | | | | | | | | 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-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-02-081-13/+30
| | | | | | | | | Removed "using namespace std;" from all sources. Appended std:: prefix to c++ standard classes. Included string.h where mem* function are used.
* 2007-11-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-11-271-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewritten to add content-type support. * src/DownloadHandler.{h, cc} * src/BtPostDownloadHandler.{h, cc} * test/BtPostDownloadHandlerTest.cc * src/MetalinkPostDownloadHandler.{h, cc} * test/MetalinkPostDownloadHandlerTest.cc * src/PostDownloadHandler.{h, cc} * src/DownloadHandlerConstants.{h, cc} * src/RequestGroup.cc * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc * src/SingleFileDownloadContext.{h, cc} * src/RequestGroup.h * src/RequestGroupCriteria.h * src/ContentTypeRequestGroupCriteria.h Added 'mem' option value for --follow-metalink, --follow-torrent. If it is give, metalink/torrent file is not written to the disk, but just is kept in memory. Parsing is occurred on memory. * src/MetalinkHelper.{h, cc} * src/MetalinkProcessor.h * src/Xml2MetalinkProcessor.{h, cc} * test/Xml2MetalinkProcessorTest.cc * src/DownloadHandlerFactory.{h, cc} * test/DownloadHandlerFactoryTest.cc * src/PreDownloadHandler.{h, cc} * src/OptionHandlerFactory.cc * src/DefaultBtContext.{h, cc} * test/DefaultBtContextTest.cc * src/version_usage.cc * src/Metalink2RequestGroup.{h, cc} * src/RequestGroup.{h, cc} * src/a2functional.h * test/a2functionalTest.cc * src/MemoryBufferPreDownloadHandler.{h, cc} * src/OptionHandlerImpl.h * src/prefs.h * src/Util.{h, cc} * test/UtilTest.cc Keep DownloadResult rather than RequestGroup after downloads to reduce memory usage. * src/RequestGroupMan.{h, cc} * src/DownloadEngine.cc * src/BtDependency.{h, cc}: Changed the type of dependee from WeakHandle to SharedHandle because WeakHandle could be null. * src/RequestGroup.{h, cc} * src/DownloadEngineFactory.cc * src/DownloadResult.h Set totalLength after download finished * src/UnknownLengthPieceStorage.{h, cc} Keep torrent file specified in metalink in memory. * src/Metalink2RequestGroup.cc * src/BtDependency.cc * src/TrueRequestGroupCriteria.h Fixed the bug: seekg is used where seekp should be used. * src/ByteArrayDiskWriter.cc * test/ByteArraydiskWriterTest.cc
* 2007-11-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-11-071-0/+109
Reflect the download length of in-flight pieces. It makes the download length readout more precise. * src/DefaultPieceStorage.{h, cc} * test/DefaultPieceStorageTest.cc * src/a2functional.h * test/a2functionalTest.cc Lower CPU load when --max-download-limit is used. There is up and down in speed indicator when enabling http-pipelining but a download goes well. I think the problem is that because http-pipelining is enabled, DownloadCommand is created for each segment and in its constructor, PeerStat::downloadStart() is called. In PeerStat::downloadStart(), speed calculation object is reseted, which makes download speed zero. * src/DownloadCommand.cc Rewritten using accumulate. * src/RequestGroupMan.cc (calculateStat) Code clearnup. * src/FtpNegotiationCommand.cc * src/HttpResponseCommand.cc