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.
Removed SharedHandle::isNull(). Instead we added operator* and
operator unspecified_bool_type. Removed use of WeakHandle and
replaced with raw pointer.
Made public member variable in Metalinker private
* src/MetalinkParserController.cc
* src/Metalinker.cc
* src/Metalinker.h
* test/MetalinkParserControllerTest.cc
* test/MetalinkProcessorTest.cc
* test/MetalinkerTest.cc
Left only IANA hash function textual name in messageDigest.cc.
Assign only IANA hash function textual name to Checksum and
ChunkChecksum. Fixed the value of MessageDigestContext::MD5.
* src/Checksum.h
* src/MetalinkParserController.cc
* src/messageDigest.cc
* src/messageDigest.h
* test/IteratableChecksumValidatorTest.cc
* test/IteratableChunkChecksumValidatorTest.cc
* test/MessageDigestHelperTest.cc
* test/Metalink2RequestGroupTest.cc
* test/MetalinkProcessorTest.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
Now the constructor of AbstractDiskWriter takes filename as an
argument and filename argument is removed from openFile(),
initAndOpenFile(), openExistingFile() interface. storeDir
member and its accessor functions are removed from DiskAdaptor
because it is not used anymore. size() member function of
DefaultDiskWriter, DirectDiskAdaptor and MultiDiskAdaptor now
can be called without opening file.
* src/AbstractDiskWriter.cc
* src/AbstractDiskWriter.h
* src/AbstractSingleDiskAdaptor.cc
* src/AbstractSingleDiskAdaptor.h
* src/ByteArrayDiskWriter.cc
* src/ByteArrayDiskWriter.h
* src/ByteArrayDiskWriterFactory.cc
* src/ByteArrayDiskWriterFactory.h
* src/DefaultDiskWriter.cc
* src/DefaultDiskWriter.h
* src/DefaultDiskWriterFactory.cc
* src/DefaultDiskWriterFactory.h
* src/DefaultPieceStorage.cc
* src/DirectDiskAdaptor.cc
* src/DirectDiskAdaptor.h
* src/DiskAdaptor.h
* src/DiskWriter.h
* src/DiskWriterFactory.h
* src/MessageDigestHelper.cc
* src/MultiDiskAdaptor.cc
* src/RequestGroup.cc
* src/UnknownLengthPieceStorage.cc
* src/Util.cc
* test/DefaultDiskWriterTest.cc
* test/DirectDiskAdaptorTest.cc
* test/FallocFileAllocationIteratorTest.cc
* test/MessageDigestHelperTest.cc
* test/MetalinkProcessorTest.cc
* test/MultiDiskAdaptorTest.cc
* test/MultiFileAllocationIteratorTest.cc
* test/SingleFileAllocationIteratorTest.cc
* test/UtilTest.cc
Removed MetalinkProcessorFactory. Since we don't use both
libxml2 and expat simultaneously, MetalinkProcessor is now not
base class and it is directly implemented in
XML2SAXMetalinkProcessor and ExpatMetalinkProcessor.
* src/ExpatMetalinkProcessor.cc
* src/ExpatMetalinkProcessor.h
* src/Makefile.am
* src/MetalinkHelper.cc
* src/MetalinkProcessor.h
* src/MetalinkProcessorFactory.cc: Removed.
* src/MetalinkProcessorFactory.h: Removed
* src/XML2SAXMetalinkProcessor.cc
* src/XML2SAXMetalinkProcessor.h
* test/MetalinkProcessorTest.cc
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.
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
Fixed possible memory leak when an exception is thrown.
* src/XML2SAXMetalinkProcessor.cc
Added Expat support. If both libxml2 and Expat are installed,
then
libxml2 is used by default.
MetalinkProcessorFactory chooses from XML2SAXMetalinkProcessor
and
ExpatMetalinkProcessor according to the configuration.
* src/ExpatMetalinkProcessor.{h, cc}
* src/main.cc: Removed libxml2 specific header and init/free
function.
* src/MetalinkProcessorFactory.{h, cc}
* src/MetalinkHelper.cc
* src/Metalinker.h: Removed unnecessary libxml2 header.
* src/MetalinkProcessor.h
* test/XML2SAXMetalinkProcessorTest.cc: Removed because
MetalinkProcessorTest is used instead.
* test/MetalinkProcessorTest.cc: Added. It is actually the same
with
XML2SAXMetalinkProcessor, replaced XML2SAXMetalinkProcessor with
MetalinkProcessorFactory::newInstance().
* m4/libexpat.m4
* configure.ac: Added configuration options for libexpat.