summaryrefslogtreecommitdiff
path: root/src/FtpInitiateConnectionCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-09-09 12:00:42 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-09-09 12:00:42 +0000
commitd687886c24eb0d8325e0568f4a6ed304c4011966 (patch)
treef236533ed580c999a32525392f2261bf02eacb2c /src/FtpInitiateConnectionCommand.cc
parent420500f6bf53e0fafc6660deaa014b425af13fe7 (diff)
2010-09-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Moved connectedHostname, connectedAddr and connectedPort to Request object. Mark cached IP address bad on timeout to allow aria2 to renew IP address cache. * src/AbstractCommand.cc * src/AbstractProxyRequestCommand.cc * src/AbstractProxyRequestCommand.h * src/FtpInitiateConnectionCommand.cc * src/FtpNegotiationCommand.cc * src/FtpNegotiationCommand.h * src/HttpInitiateConnectionCommand.cc * src/HttpRequestCommand.cc * src/HttpRequestCommand.h * src/InitiateConnectionCommand.cc * src/InitiateConnectionCommand.h * src/Request.cc * src/Request.h
Diffstat (limited to 'src/FtpInitiateConnectionCommand.cc')
-rw-r--r--src/FtpInitiateConnectionCommand.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/FtpInitiateConnectionCommand.cc b/src/FtpInitiateConnectionCommand.cc
index 9833a5f8..b45fe8a1 100644
--- a/src/FtpInitiateConnectionCommand.cc
+++ b/src/FtpInitiateConnectionCommand.cc
@@ -100,6 +100,7 @@ Command* FtpInitiateConnectionCommand::createNextCommand
createSocket();
getSocket()->establishConnection(addr, port);
+ getRequest()->setConnectedAddrInfo(hostname, addr, port);
if(proxyMethod == V_GET) {
// Use GET for FTP via HTTP proxy.
getRequest()->setMethod(Request::METHOD_GET);
@@ -110,7 +111,6 @@ Command* FtpInitiateConnectionCommand::createNextCommand
new HttpRequestCommand(getCuid(), getRequest(), getFileEntry(),
getRequestGroup(), hc, getDownloadEngine(),
getSocket());
- c->setConnectedAddr(hostname, addr, port);
c->setProxyRequest(proxyRequest);
command = c;
} else if(proxyMethod == V_TUNNEL) {
@@ -118,13 +118,13 @@ Command* FtpInitiateConnectionCommand::createNextCommand
new FtpTunnelRequestCommand(getCuid(), getRequest(), getFileEntry(),
getRequestGroup(), getDownloadEngine(),
proxyRequest, getSocket());
- c->setConnectedAddr(hostname, addr, port);
command = c;
} else {
// TODO
throw DL_ABORT_EX("ERROR");
}
} else {
+ setConnectedAddrInfo(getRequest(), hostname, pooledSocket);
if(proxyMethod == V_TUNNEL) {
command =
new FtpNegotiationCommand(getCuid(), getRequest(), getFileEntry(),
@@ -168,7 +168,7 @@ Command* FtpInitiateConnectionCommand::createNextCommand
new FtpNegotiationCommand(getCuid(), getRequest(), getFileEntry(),
getRequestGroup(), getDownloadEngine(),
getSocket());
- c->setConnectedAddr(hostname, addr, port);
+ getRequest()->setConnectedAddrInfo(hostname, addr, port);
command = c;
} else {
command =
@@ -177,6 +177,7 @@ Command* FtpInitiateConnectionCommand::createNextCommand
pooledSocket,
FtpNegotiationCommand::SEQ_SEND_CWD_PREP,
options["baseWorkingDir"]);
+ setConnectedAddrInfo(getRequest(), hostname, pooledSocket);
}
}
return command;