/* */ #ifndef D_HTTP_INITIATE_CONNECTION_COMMAND_H #define D_HTTP_INITIATE_CONNECTION_COMMAND_H #include "InitiateConnectionCommand.h" namespace aria2 { // HttpInitiateConnectionCommand determines remote host to connect and // resolves IP address from that hostname and creates subsequent // command. Usually, remote host is the host in URI. If proxy is // used, remote host becomes proxy server. This command searches // pooled socket using resolved IP addresses and use pooled socket if // available. The following chart shows what Command is followed // after this command based on conditions. // // HttpInitiateConnectionCommand // | // | proxy is used? // +----------------+ // | | // | | pooled socket? // | +------------> HttpRequestCommand // | | tunnel? // | +------------> HttpProxyRequestCommand // | | otherwise // | +------------> HttpRequestCommand // | direct connection // +-----------------------------> HttpRequestCommand class HttpInitiateConnectionCommand : public InitiateConnectionCommand { protected: virtual Command* createNextCommand (const std::string& hostname, const std::string& addr, uint16_t port, const std::vector& resolvedAddresses, const SharedHandle& proxyRequest); public: HttpInitiateConnectionCommand(cuid_t cuid, const SharedHandle& req, const SharedHandle& fileEntry, RequestGroup* requestGroup, DownloadEngine* e); virtual ~HttpInitiateConnectionCommand(); }; } // namespace aria2 #endif // D_HTTP_INITIATE_CONNECTION_COMMAND_H