diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-06-22 01:10:38 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-06-22 01:10:38 +0900 |
| commit | 07d270c87e6f9184aea4ca17eb26e466712e8db2 (patch) | |
| tree | 2dfbaa2e0d2ad0f38cb73098608f7d67a64320f8 /src/InitiateConnectionCommand.cc | |
| parent | 126a4bde612eb0e6c48cf2f13ebe3eac45cc71a8 (diff) | |
Require -std=c++11 and use std::shared_ptr instead of SharedHandle
Diffstat (limited to 'src/InitiateConnectionCommand.cc')
| -rw-r--r-- | src/InitiateConnectionCommand.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/InitiateConnectionCommand.cc b/src/InitiateConnectionCommand.cc index 98cae3b4..069a5a8f 100644 --- a/src/InitiateConnectionCommand.cc +++ b/src/InitiateConnectionCommand.cc @@ -58,8 +58,8 @@ namespace aria2 { InitiateConnectionCommand::InitiateConnectionCommand (cuid_t cuid, - const SharedHandle<Request>& req, - const SharedHandle<FileEntry>& fileEntry, + const std::shared_ptr<Request>& req, + const std::shared_ptr<FileEntry>& fileEntry, RequestGroup* requestGroup, DownloadEngine* e) : AbstractCommand(cuid, req, fileEntry, requestGroup, e) @@ -76,7 +76,7 @@ InitiateConnectionCommand::~InitiateConnectionCommand() {} bool InitiateConnectionCommand::executeInternal() { std::string hostname; uint16_t port; - SharedHandle<Request> proxyRequest = createProxyRequest(); + std::shared_ptr<Request> proxyRequest = createProxyRequest(); if(!proxyRequest) { hostname = getRequest()->getHost(); port = getRequest()->getPort(); @@ -120,23 +120,23 @@ bool InitiateConnectionCommand::executeInternal() { } void InitiateConnectionCommand::setConnectedAddrInfo -(const SharedHandle<Request>& req, +(const std::shared_ptr<Request>& req, const std::string& hostname, - const SharedHandle<SocketCore>& socket) + const std::shared_ptr<SocketCore>& socket) { std::pair<std::string, uint16_t> peerAddr; socket->getPeerInfo(peerAddr); req->setConnectedAddrInfo(hostname, peerAddr.first, peerAddr.second); } -SharedHandle<BackupConnectInfo> +std::shared_ptr<BackupConnectInfo> InitiateConnectionCommand::createBackupIPv4ConnectCommand (const std::string& hostname, const std::string& ipaddr, uint16_t port, Command* mainCommand) { // Prepare IPv4 backup connection attemp in "Happy Eyeballs" // fashion. - SharedHandle<BackupConnectInfo> info; + std::shared_ptr<BackupConnectInfo> info; char buf[sizeof(in6_addr)]; if(inetPton(AF_INET6, ipaddr.c_str(), &buf) == -1) { return info; @@ -152,7 +152,7 @@ InitiateConnectionCommand::createBackupIPv4ConnectCommand BackupIPv4ConnectCommand* command = new BackupIPv4ConnectCommand (getDownloadEngine()->newCUID(), *i, port, info, mainCommand, getRequestGroup(), getDownloadEngine()); - A2_LOG_INFO(fmt("Issue backup connection command CUID#%"PRId64 + A2_LOG_INFO(fmt("Issue backup connection command CUID#%" PRId64 ", addr=%s", command->getCuid(), (*i).c_str())); getDownloadEngine()->addCommand(command); return info; @@ -165,7 +165,7 @@ void InitiateConnectionCommand::setupBackupConnection (const std::string& hostname, const std::string& addr, uint16_t port, ConnectCommand* c) { - SharedHandle<BackupConnectInfo> backupConnectInfo + std::shared_ptr<BackupConnectInfo> backupConnectInfo = createBackupIPv4ConnectCommand(hostname, addr, port, c); if(backupConnectInfo) { c->setBackupConnectInfo(backupConnectInfo); |
