Added FTP EPSV and EPRT command support. aria2 issues these
commands when address family of local socket is AF_INET6.
* src/FtpConnection.cc
* src/FtpConnection.h
* src/FtpNegotiationCommand.cc
* src/FtpNegotiationCommand.h
* src/SocketCore.cc
* src/SocketCore.h
* test/FtpConnectionTest.cc
In SocketCore::isReadable()/isWritable(), use poll() if it is
available otherwise use select(). Removed epoll/port from there
because poll() does the good enough job for single socket event
notification.
* src/SocketCore.cc
* src/SocketCore.h
* src/main.cc
Supported poll() for socket event notification. --event-poll can
take value "poll". Fixed the bug that timeout for
SocketCore::isReadable()/isWritable() is ignored when epoll is
used.
* src/OptionHandlerFactory.cc
* src/a2io.h
* src/prefs.h
* src/SocketCore.h
* src/Makefile.am
* src/main.cc
* src/PollEventPoll.h
* src/SocketCore.cc
* src/DownloadEngineFactory.cc
* src/PollEventPoll.cc
* src/prefs.cc
* configure.ac
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
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
Use AI_ADDRCONFIG flag if it is available. Refactored so that
getaddrinfo calls are not scattered around. Unset AI_ADDRCONFIG
when conducting unit tests because they fail if networking
interface is not configured with IPv4 address.
* src/NameResolver.cc
* src/SocketCore.cc
* src/SocketCore.h
* src/a2netcompat.h
* test/AllTest.cc
Added --xml-rpc-listen-all option. If true is given to this
option, aria2 listens incoming XML-RPC requests on all network
interfaces. If false is given, listens only on local loopback
interface. The default value is false.
* src/HttpListenCommand.cc
* src/OptionHandlerFactory.cc
* src/SocketCore.cc
* src/SocketCore.h
* src/prefs.cc
* src/prefs.h
* src/usage_text.h
Added static member _protocolFamily to SocketCore. By default,
SocketCore uses AF_UNSPEC for getaddrinfo hints to resolve
address. Sometime SocketCore::bind() and
SocketCore::establishConnection() use difference protocl family
and latter cannot connect to former. To avoid this situation, we
limit protocol family to AF_INET for unit tests.
* src/SocketCore.cc
* src/SocketCore.h
* test/AllTest.cc
Fixed compile error when HAVE_EPOLL is not defined.
Fixed linker error on bigendian systems.
* src/SocketCore.cc
* src/SocketCore.h
* test/DefaultBtProgressInfoFileTest.cc
Added --event-poll option to select the method for polling
events.
The available methods are "select" and "epoll". "epoll" is
available on Linux only. The earlier release has the compile
option to choose from these methods.
* configure.ac
* src/RequestGroupMan.cc
* src/OptionHandlerFactory.cc
* src/EpollEventPoll.h
* src/StreamFileAllocationEntry.cc
* src/a2io.h
* src/SelectEventPoll.h
* src/option_processing.cc
* src/prefs.h
* src/EpollEventPoll.cc
* src/EventPoll.h
* src/SocketCore.h
* src/Makefile.am
* src/main.cc
* src/DownloadEngine.h
* src/SelectEventPoll.cc
* src/DownloadEngine.cc
* src/SocketCore.cc
* src/DownloadEngineFactory.cc
* src/Makefile.in
* src/prefs.cc
* src/usage_text.h
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
Introduced TLSContext that holds TLS related data that can be
shared with multiple SSL connections.
* src/DownloadEngineFactory.cc
* src/LibgnutlsTLSContext.cc
* src/LibgnutlsTLSContext.h
* src/LibsslTLSContext.cc
* src/LibsslTLSContext.h
* src/Makefile.am
* src/SocketCore.cc
* src/SocketCore.h
* src/TLSContext.h
* src/message.h
Fixed compile error with debian mingw32 cross compiler(4.2.1).
The configuration is minimum: no torrent, no metalink, so there
may be
other compile error on their code.
* src/a2netcompat.h
* src/File.cc
* src/File.h
* src/SocketCore.cc
* src/SocketCore.h
Applied Ross's aria2-0.13.2+1-mingw-5.patch, which changes the
type of
socket from int to sock_t as sockets are unsigned in Windows.
For AsyncNameResolver, DownloadEngine, I did additional
modification
for the portion of the code changed according to epoll support.
I defined sock_t in a2netcompat.h to use sock_t without
including
SocketCore.h.
* src/AsyncNameResolver.cc
* src/AsyncNameResolver.h
* src/DownloadEngine.cc
* src/DownloadEngine.h
* src/SocketCore.cc
* src/SocketCore.h
* src/a2netcompat.h
Added epoll support. Use epoll if it is available. If not, use
select.
When async dns is enabled in compile time, epoll support is
enabled
only when aria2 is built with c-ares. This condition statement
is
defined in a2io.h.
Currently aria2 supports both c-ares and ares, but ares is
maintained
for quite a while and debian already has c-ares package, ares
support
will be dropped in the future version.
* configure.ac
* src/AbstractCommand.cc
* src/AsyncNameResolver.cc
* src/AsyncNameResolver.h
* src/Command.cc
* src/Command.h
* src/DownloadEngine.cc
* src/DownloadEngine.h
* src/PeerAbstractCommand.cc
* src/SocketCore.cc
* src/SocketCore.h
* src/a2io.h
IPv6 support for SocketCore class.
TODO: In SocketCore::establishConnection(), this is insufficient
to
determin the failure of connect() here because the socket is
non-blocking state. The next addresses should be tried after
select().
TODO: NameResolver still uses c-ares(<= 1.4)
ares_gethostbyname().
If c-ares 1.5 or newer is installed, ares_getaddrinfo() should
be used
instead which address family independent.
TODO: DHTRoutingTable{Deserializer,Serializer} currently saves
peer
information in a compact peer format which is for IPv4 only.
Some BitTorrent functions in PeerMessageUtil still depends on
IPv4 but
this is a spec of BitTorrent protocol.
* src/SocketCore.{h, cc}
* src/PeerMessageUtil.cc
* test/SocketCoreTest.cc
* test/PeerMessageUtilTest.cc
* test/DHTConnectionImplTest.cc
Handle IPv4-mapped addresses.
* src/DHTNode.cc: Now identity is determined by node id.
* src/DHTMessageTrackerEntry.cc
Because now PeerMessageUtil::unpackcompact() could fail, the
caller
should handle it.
* src/DHTRoutingTableDeserializer.cc
* src/DHTMessageFactoryImpl.cc
Added DHT functionality, compatible with mainline.
DHT is disabled by default. To enable it, give --enable-dht to
aria2c.
You may need to specify entry point to DHT network using
--dht-entry-point. DHT uses UDP port to listen incoming message.
Use --dht-listen-port to specify port number. Make sure that
your
firewall configuration can pass through UDP traffic to the port.
The routing table is saved in $HOME/.aria2/dht.dat.
* src/DHT*
* src/BNode.{h, cc}
* src/PeerInteractionCommand.cc: enable DHT functionality for a
particular torrent.
* src/Data.cc: Rewritten ctor.
* src/OptionHandlerFactory.cc: Added --enable-dht,
--dht-listen-port,
--dht-entry-point.
* src/DefaultBtInteractive.cc: Send port message if dht is
enabled.
* src/RequestGroup.cc: Initialize DHT functionality. When
download
ends, remove BtContext from DHTPeerAnnounceStorage.
* src/BtPortMessage.{h, cc}: Rewritten.
* src/message.h
* src/OptionHandlerImpl.cc
* src/option_processing.cc: Added --enable-dht,
--dht-listen-port,
--dht-entry-point.
* src/Dictionary.{h, cc} (remove): New function.
* src/prefs.h
* src/DefaultBtMessageFactory.h
* src/BtHandshakeMessage.cc
* src/ActivePeerConnectionCommand.cc
* src/SocketCore.{h, cc}: Added datagram socket support.
* src/DefaultBtMessageFactory.cc
* src/BtSetup.cc: Add BtContext to DHTPeerAnnounceStorage here.
Create DHT commands.
* src/BtMessageFactory.h
* src/PeerMessageUtil.{h, cc}
Implemented BitTorrent/http/ftp integrated download.
I've rewritten lots of files and now some headers have forward
class declarations to reduce compile time.
The implementation is extremely alpha stage, I recommend to use this
for testing purpose only.
Make a2netcompat.h include a2io.h to fix compilation error:
* src/a2netcompat.h
* src/SocketCore.cc: Removed include of a2io.h
* src/Util.cc: Removed include of a2io.h
Gather time related functions to a2time.h:
* src/a2time.h: New file.
* src/DefaultPeerStorage.cc
* src/SimpleLogger.cc
* src/Util.{h, cc}
* src/SimpleRandomizer.h
* src/TimeA2.{h,cc}
* src/DownloadCommand.cc
* src/main.cc
Removed #ifdef __MINGW32__ since gai_strerror is included in
a2netcompat.h:
* src/NameResolver.cc
Fixed compilation error without openssl:
* src/SocketCore.{h,cc}: Moved include of openssl/err.h to
SocketCore.h
Added default block to suppress compiler warnings:
* src/MetalinkRequestInfo.cc (AccumulateNonP2PUrl::operator())
2007-07-26 Ross Smith II <aria2spam at smithii dot com>
MinGW build enhancements. The following files are added:
* src/gai_strerror.{c,h}
* src/gettimeofday.{c,h}
Changes to support the above new files:
* configure.ac
* src/Makefile.am
* src/a2netcompat.h
* src/TimeA2.cc
* src/DefaultPeerStorage.cc
* src/NameResolver.cc: removed mingw_strerror() function.
* src/SocketCore.cc: removed mingw_strerror() function.
Miscellaneous MinGW build fixes.
* src/a2io.h: Use _lseeki64() instead of lseek()
* src/common.h
* src/DefaultFileAllocator.cc
* src/GlowFileAllocator.cc
* src/main.cc: Moved #include "prefs.h" to quiet compile error.
* src/NameResolver.cc
(callback): Changed int32_t to int.
(resolve): Changed int32_t to int.
* src/Platform.cc
* src/Platform.h
* test/MultiDiskWriterTest.cc
* test/PeerMessageUtilTest.cc
* src/localtime_r.c: Add DeleteCriticalSection() and at exit().
Other enhancements and fixes.
* src/HttpRequestCommand.cc
(executeInternal) Use non-blocking socket for HTTPS (MinGW
only).
* src/SocketCore.cc:
(error): New function to abstract errno/WSAGetLastError().
(errorMsg): New function to abstract errno/WSAGetLastError().
(initiateSecureConnection): Added more detailed error reporting.
* src/SocketCore.h: Added private variable blocking, to allow
proper handling of OpenSSL psuedo-errors.
* src/message.h
(EX_SSL_INIT_FAILURE)
(EX_SSL_IO_ERROR)
(EX_SSL_PROTOCOL_ERROR)
(EX_SSL_UNKNOWN_ERROR)
(EX_SSL_CONNECT_ERROR)
(EX_SOCKET_BLOCKING)
(EX_SOCKET_NONBLOCKING)
(EX_SOCKET_UNKNOWN_ERROR)
* src/Util.cc
(setGlobalSignalHandler): Renamed signal to sig as signal is a
reserved name.
(httpGMT): Fixed typo.
* src/PeerMessage.h
(Piece.h): Included.
(SharedHandle.h): Included.
(invalidate): New variable.
(uploading): New variable.
(isInvalidate): New function.
(isUploading): New function.
(onPush): New function.
(onChoked): New function.
(onCanceled): New function.
(onAbortPiece): New function.
(PeerMessageHandle): New type definition.
* src/PeerMessage.cc
(PeerMessage): Added the initialization for invalidate and
uploading.
* src/CancelMessage.h
(CancelMessage): Rewritten.
* src/RejectMessage.h
(RejectMessage): Rewritten.
* src/Metalinker.h
(operator=): Defined.
* src/MetaEntry.h
(operator=): Defined.
* src/MetalinkResource.h
(operator=): Defined.
* src/AllowedFastMessage.h
(AllowedFastMessage): Rewritten.
* src/HandshakeMessage.h
(HandshakeMessage): New function(overload).
* src/HandshakeMessage.cc
(HandshakeMessage): Rewritten.
(init): New function.
* src/HaveMessage.h
(HaveMessage): Rewritten.
* src/Time.h
(operator=): Defined the function body here.
* src/Time.cc
(operator=): Removed.
* src/SocketCore.h
(operator==): Defined here.
(operator!=): Defined here.
(operator<): Defined here.
* src/SocketCore.cc
(operator==): Removed.
(operator<): Removed.
* src/BitfieldMan.h
(operator=): Defined the function body here.
* src/BitfieldMan.cc
(operator=): Removed.
* src/TorrentMan.h
(deleteErrorPeer): Removed.
(deleteUnusedPeer); New function.
* src/TorrentMan.cc
(addPeer): Call deleteUnusedPeer.
(deleteErrorPeer): Removed.
(deleteUnusedPeer): New function.
* src/PeerAbstractCommand.h
(setNoCheck): New function.
(noCheck): New variable.
* src/PeerAbstractCommand.cc
(PeerAbstractCommand): Added the initialization of noCheck.
(execute): Added a check for noCheck.
(setNoCheck): New function.
* src/Util.h
(stdio.h): Included.
* src/Util.cc
(unistd.h): Included.
* src/DefaultDiskWriter.cc
(unistd.h): Included.
* src/Peer.h
(operator==): Defined the function body here.
(operator!=): Defined the function body here.
* src/Peer.cc
(operator==): Removed.
(operator!=): Removed.
* src/Piece.h
(Piece): Defined the function body here(copy constructor).
(operator=): Defined the function body here.
(operator==): Defined the function body here.
* src/Piece.cc
(Piece): Removed(copy constructor).
(operator=): Removed.
(operator==): Removed.
* src/PeerMessageUtil.h
(ChokeMessage.h): Removed.
(UnchokeMessage.h): Removed.
(InterestedMessage.h): Removed.
(NotInterestedMessage.h): Removed.
(HaveMessage.h): Removed.
(BitfieldMessage.h): Removed.
(RequestMessage.h): Removed.
(CancelMessage.h): Removed.
(PieceMessage.h): Removed.
(HandshakeMessage.h): Removed.
(KeepAliveMessage.h): Removed.
(PortMessage.h): Removed.
(HaveAllMessage.h): Removed.
(HaveNoneMessage.h): Removed.
(PeerConnection.h): Removed.
(HandshakeMessage.h): Included.
* src/BitfieldMessage.h
(init): New function.
(BitfieldMessage): Rewritten.
(BitfieldMessage): New function(overload).
* src/RequestSlot.h
(operator=): Defined the function body here.
(operator==): Defined the function body here.
* src/RequestSlot.cc
(operator=): Removed.
(operator==): Removed.
To remove the dependency on the PeerMessage subclass from
PeerInteraction:
* src/PeerMessageFactory.h: New class.
* src/PeerMessageFactory.cc: New class.
* src/SimplePeerMessage.cc
(send): If invalidate is true then do nothing.
* src/PeerInteractionCommand.cc
(HandshakeMessage.h): Included.
(KeepAliveMessage.h): Included.
(ChokeMessage.h): Included.
(UnchokeMessage.h): Included.
(HaveMessage.h): Included.
(executeInternal): Call setNoCheck().
Removed setWriteCheckSocket(socket).
* src/PeerInteraction.h
(ChokeMessage.h): Removed.
(UnchokeMessage.h): Removed.
(InterestedMessage.h): Removed.
(NotInterestedMessage.h): Removed.
(HaveMessage.h): Removed.
(BitfieldMessage.h): Removed.
(RequestMessage.h): Removed.
(CancelMessage.h): Removed.
(PieceMessage.h): Removed.
(HandshakeMessage.h): Removed.
(KeepAliveMessage.h): Removed.
(PortMessage.h): Removed.
(HaveAllMessage.h): Removed.
(HaveNoneMessage.h): Removed.
(RejectMessage.h): Removed.
(AllowedFastMessage.h): Removed.
(SuggestPieceMessage.h): Removed.
(PeerMessageFactory.h): Included.
(PeerMessageHandle): Removed typedef of PeerMessageHandle.
(HandshakeMessageHandle): Removed typedef of
HandshakeMessageHandle.
(PeerMessageFactory): New variable.
(createPeerMessage): Removed.
(createHandshakeMessage): Removed.
(setPeerMessageCommonProperty): Removed.
(addRequestSlot): New function.
(receiveHandshake): Changed the return value type to
PeerMessageHandle.
(getPeerMessageFactory): New function.
(createRequestMessage): Removed.
(createCancelMessage): Removed.
(createPieceMessage): Removed.
(createHaveMessage): Removed.
(createChokeMessage): Removed.
(createUnchokeMessage): Removed.
(createInterestedMessage): Removed.
(createNotInterestedMessage): Removed.
(createBitfieldMessage): Removed.
(createKeepAliveMessage): Removed.
(createHaveAllMessage): Removed.
(createHaveNoneMessage): Removed.
(createRejectMessage): Removed.
(createAllowedFastMessage): Removed.
* src/PeerInteraction.cc
(PeerInteraction): Allocate PeerMessageFactory here.
(~PeerInteraction): Deallocate PeerMessageFactory here.
(sendMessages): Use msg->isUploading() instead of msg->getId()
==
PieceMessage::ID.
(addMessage): Simplified by using PeerMessage::onPush().
(addRequestSlot): New function.
(rejectAllPieceMessageInQueue): Simplified by using
PeerMessage::onChoked().
(rejectPieceMessageInQueue): Simplified by using
PeerMessage::onCanceled().
(abortPiece): Simplified by using PeerMessage::abortPiece().
(receiveHandshake): Changed the return value type to
PeerMessageHandle.
(createHandshakeMessage): Removed.
(createPeerMessage): Removed.
(sendHandshake): Call
PeerMessageFactory::createHandshakeMessage().
(setPeerMessageCommonProperty): Removed.
(createRequestMessage): Removed.
(createCancelMessage): Removed.
(createPieceMessage): Removed.
(createHaveMessage): Removed.
(createChokeMessage): Removed.
(createUnchokeMessage): Removed.
(createInterestedMessage): Removed.
(createNotInterestedMessage): Removed.
(createBitfieldMessage): Removed.
(createKeepAliveMessage): Removed.
(createHaveAllMessage): Removed.
(createHaveNoneMessage): Removed.
(createRejectMessage): Removed.
(createAllowedFastMessage): Removed.
* src/PieceMessage.h
(createRejectMessage): New function.
(PieceMessage): Rewritten.
(onChoked): New function.
(onCanceled): New function.
* src/PieceMessage.cc
(send): If invalidate is true then do nothing, just return.
(createRejectMessage): New function.
(onChoked): New function.
(onCanceled): New function.
* src/RequestMessage.h
(RequestMessage): Rewritten.
(onPush): New function.
(onAbortPiece): New function.
* src/RequestMessage.cc
(onPush): New function.
(onAbortPiece): New function.
Update fd_set when a socket is added or deleted in order to
improve
performance:
* src/DownloadEngine.h
(rfdset): New variable.
(wfdset): New variable.
(updateFdSet): New function.
* src/DownloadEngine.cc
(SetDescriptor::operator()): Use SockCmdMap::value_type.
(AccumulateActiveCommandUuid::operator()): Use
SockCmdMap::value_type.
(waitData): Copy rfdset and wfdset.
(updateFdSet): New function.
(addSocket): Call updateFdSet.
(deleteSocket): Call updateFdSet.