summaryrefslogtreecommitdiff
path: root/src/DownloadEngine.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-09-24 17:01:57 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-09-24 17:01:57 +0000
commit6bc233f414b74bf3acf4abf5d5655c236e78ae41 (patch)
tree3458e27259263587e4219c0c0da2f7c270f96d83 /src/DownloadEngine.h
parentd717ffb1d00511958234d1eb4df1d60382297374 (diff)
2008-09-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Issue PWD command first and get working directory and use it as a prefix for CWD command. * src/DownloadEngine.cc * src/DownloadEngine.h * src/FtpConnection.cc * src/FtpConnection.h * src/FtpFinishDownloadCommand.cc * src/FtpInitiateConnectionCommand.cc * src/FtpNegotiationCommand.cc * src/FtpNegotiationCommand.h * test/FtpConnectionTest.cc
Diffstat (limited to 'src/DownloadEngine.h')
-rw-r--r--src/DownloadEngine.h33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/DownloadEngine.h b/src/DownloadEngine.h
index 61b64bfb..8a20493e 100644
--- a/src/DownloadEngine.h
+++ b/src/DownloadEngine.h
@@ -44,6 +44,7 @@
#ifdef ENABLE_ASYNC_DNS
# include "AsyncNameResolver.h"
#endif // ENABLE_ASYNC_DNS
+#include <string>
#include <deque>
#include <map>
#ifdef HAVE_EPOLL
@@ -261,11 +262,14 @@ private:
private:
SharedHandle<SocketCore> _socket;
+ std::map<std::string, std::string> _options;
+
time_t _timeout;
Time _registeredTime;
public:
SocketPoolEntry(const SharedHandle<SocketCore>& socket,
+ const std::map<std::string, std::string>& option,
time_t timeout);
~SocketPoolEntry();
@@ -273,11 +277,15 @@ private:
bool isTimeout() const;
SharedHandle<SocketCore> getSocket() const;
+
+ const std::map<std::string, std::string>& getOptions() const;
};
// key = IP address:port, value = SocketPoolEntry
std::multimap<std::string, SocketPoolEntry> _socketPool;
+ Time _lastSocketPoolScan;
+
bool _noWait;
std::deque<Command*> _routineCommands;
@@ -294,6 +302,13 @@ private:
void onEndOfRun();
void afterEachIteration();
+
+ void poolSocket(const std::string& ipaddr,
+ uint16_t port,
+ const SocketPoolEntry& entry);
+
+ std::multimap<std::string, SocketPoolEntry>::iterator
+ findSocketPoolEntry(const std::string& ipaddr, uint16_t port);
public:
std::deque<Command*> commands;
SharedHandle<RequestGroupMan> _requestGroupMan;
@@ -364,15 +379,31 @@ public:
void addRoutineCommand(Command* command);
void poolSocket(const std::string& ipaddr, uint16_t port,
- const SharedHandle<SocketCore>& sock, time_t timeout = 15);
+ const SharedHandle<SocketCore>& sock,
+ const std::map<std::string, std::string>& options,
+ time_t timeout = 15);
+ void poolSocket(const std::string& ipaddr, uint16_t port,
+ const SharedHandle<SocketCore>& sock,
+ time_t timeout = 15);
+
SharedHandle<SocketCore> popPooledSocket(const std::string& ipaddr,
uint16_t port);
+ SharedHandle<SocketCore> popPooledSocket
+ (std::map<std::string, std::string>& options,
+ const std::string& ipaddr,
+ uint16_t port);
SharedHandle<SocketCore>
popPooledSocket(const std::deque<std::string>& ipaddrs, uint16_t port);
+ SharedHandle<SocketCore>
+ popPooledSocket
+ (std::map<std::string, std::string>& options,
+ const std::deque<std::string>& ipaddrs,
+ uint16_t port);
+
SharedHandle<CookieStorage> getCookieStorage() const;
};