Rewritten SocketBuffer. Old implementation uses single std::string
to store data and erase sent data, which is costly. New
implementation uses deque to hold each data to avoid to mutate
string.
* src/SocketBuffer.cc
* src/SocketBuffer.h
Avoid to calculate end() iterator in each loop. std::deque is
particularly slow. Make sure that recalculate end iterator if
element is erased during loop.
Fixed the bug that grouped FileEntry objects are not used but
instead all FileEntry objects are used for each metaurl group.
* src/Metalink2RequestGroup.cc
* test/Metalink2RequestGroupTest.cc
* test/metalink4-groupbymetaurl.xml
Replaced null or control characters in file path with '_'. For
MinGW32 build, additional characters which is not allowed in
Windows kernel are also replaced. util::detectDirTraversal() now
returns true if given string contains null or control characters.
* src/DownloadContext.cc
* src/DownloadContext.h
* src/Metalink2RequestGroup.cc
* src/MetalinkParserController.cc
* src/bittorrent_helper.cc
* src/util.cc
* src/util.h
* test/UtilTest.cc
Discard metalink:file if its name attribute is empty string.
Removed FileEntry instantiation in
MetalinkParserController::setFileLengthOfEntry()
* src/MetalinkParserController.cc
* src/MetalinkParserStateV3Impl.cc
* src/MetalinkParserStateV4Impl.cc
Discard torrent file if path data in it contains directory
traversal directives. Discard metalink:file element in Metalink3
format if its name attribute contains directory traversal
directives. Ignore name attribute of metalink:signature element
in Metalink3 format if it contains directory traversal directives.
* src/MetalinkParserStateV3Impl.cc
* src/bittorrent_helper.cc
* src/message.h
* test/BittorrentHelperTest.cc
* test/Makefile.am
* test/MetalinkProcessorTest.cc
* test/metalink3-dirtraversal.xml
* test/test.xml
Store name attribute of metalink:metaurl element in MetalinkMetaurl.
* src/MetalinkMetaurl.h
* src/MetalinkParserController.cc
* src/MetalinkParserController.h
* src/MetalinkParserStateMachine.cc
* src/MetalinkParserStateMachine.h
* src/MetalinkParserStateV4Impl.cc
* test/MetalinkProcessorTest.cc
* test/metalink4-dirtraversal.xml
Added aiFlags argument to getInterfaceAddress(). Use
AI_NUMERICHOST to find interface specified using
--bt-lpd-interface option to avoid time-consuming address lookup.
* src/BtSetup.cc
* src/SocketCore.cc
* src/SocketCore.h
Return SharedHandle<LpdMessage>(new LpdMessage()) if received data
is bad in LpdMessageReceiver.
* src/LpdMessage.h
* src/LpdMessageReceiver.cc
* src/LpdMessageReceiver.h
* src/LpdReceiveMessageCommand.cc
* test/LpdMessageReceiverTest.cc
Added --bt-lpd-interface option to specify the interface to use
for Local Peer Discovery. LpdMessageDispatcher object now has its
own socket. LpdMessageReceiver's socket is binded to multicast
address to only receive multicast packets.
* src/BtSetup.cc
* src/LpdMessageDispatcher.cc
* src/LpdMessageDispatcher.h
* src/LpdMessageReceiver.cc
* src/LpdMessageReceiver.h
* src/LpdReceiveMessageCommand.cc
* src/LpdReceiveMessageCommand.h
* src/OptionHandlerFactory.cc
* src/SocketCore.cc
* src/SocketCore.h
* src/prefs.cc
* src/prefs.h
* src/usage_text.h
* test/LpdMessageDispatcherTest.cc
* test/LpdMessageReceiverTest.cc
Put the portion of code to get interface addresses in
SocketCore::bindAddress() into newly added getInterfaceAddress().
* src/SocketCore.cc
* src/SocketCore.h
Fixed compile error with mingw32 cross compiler. Defined
a2_sockopt_t as void* for the target systems other than mingw32.
* src/SocketCore.cc
* src/a2netcompat.h
User-defined custom request headers specified by --header option
now override builtin headers if they have same name.
* src/HttpRequest.cc
* src/HttpRequest.h
* test/HttpRequestTest.cc
Added unit tests for util::getContentDispositionFilename() from
http://greenbytes.de/tech/tc2231/ Fixed the function so that added
tests are passed.
* src/util.cc
* test/UtilTest.cc
Support RFC2231 "Parameter Value Character Set and Language
Information" in Content-Disposition header.
* src/HttpResponse.cc
* src/util.cc
* src/util.h
* test/UtilTest.cc
Removed ret == 0 checking for SSL_read(), SSL_write() and
SSL_peek() because the checks are done in the caller. In
SocketBuffer::send(), throw exception if nothing could be written
and socket error was not EWOULDBLOCK
* src/SocketBuffer.cc
* src/SocketCore.cc