mirror of https://github.com/aria2/aria2
FTP PASV: fixed IPv6 support.
If fake FTP URI cannot be parsed (this should not happen), throw exception.pull/4/head
parent
d5ffa2532d
commit
413b61c316
|
@ -718,13 +718,14 @@ bool FtpNegotiationCommand::sendTunnelRequest()
|
||||||
SharedHandle<Request> req(new Request());
|
SharedHandle<Request> req(new Request());
|
||||||
// Construct fake URI in order to use HttpRequest
|
// Construct fake URI in order to use HttpRequest
|
||||||
std::pair<std::string, uint16_t> dataAddr;
|
std::pair<std::string, uint16_t> dataAddr;
|
||||||
int family = getSocket()->getPeerInfo(dataAddr);
|
|
||||||
uri::UriStruct us;
|
uri::UriStruct us;
|
||||||
us.protocol = "ftp";
|
us.protocol = "ftp";
|
||||||
us.host = getRequest()->getHost();
|
us.host = getRequest()->getHost();
|
||||||
us.port = pasvPort_;
|
us.port = pasvPort_;
|
||||||
us.ipv6LiteralAddress = (family == AF_INET6);
|
us.ipv6LiteralAddress = getRequest()->isIPv6LiteralAddress();
|
||||||
req->setUri(uri::construct(us));
|
if(!req->setUri(uri::construct(us))) {
|
||||||
|
throw DL_RETRY_EX("Something wrong with FTP URI");
|
||||||
|
}
|
||||||
httpRequest->setRequest(req);
|
httpRequest->setRequest(req);
|
||||||
httpRequest->setProxyRequest(createProxyRequest());
|
httpRequest->setProxyRequest(createProxyRequest());
|
||||||
http_->sendProxyRequest(httpRequest);
|
http_->sendProxyRequest(httpRequest);
|
||||||
|
|
Loading…
Reference in New Issue