diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-07-06 22:55:00 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2013-07-07 23:28:51 +0900 |
| commit | cf8cfeefbcfff1eebc2b5fde9f14ff3efff8d6e3 (patch) | |
| tree | 8765972ce2cec3a77454a42cefb927dfe119ee19 /src/DHTSetup.cc | |
| parent | fc6318d23f58827427be8ccbdab1a82da2a1c9bf (diff) | |
DHTInteractionCommand: Use std::unique_ptr for DHTConnection
Remove DHTConnection from DHTMessageReceiver because it is not used.
Diffstat (limited to 'src/DHTSetup.cc')
| -rw-r--r-- | src/DHTSetup.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/DHTSetup.cc b/src/DHTSetup.cc index c65baf97..89fff38a 100644 --- a/src/DHTSetup.cc +++ b/src/DHTSetup.cc @@ -111,7 +111,7 @@ std::vector<std::unique_ptr<Command>> DHTSetup::setup } uint16_t port; - auto connection = std::make_shared<DHTConnectionImpl>(family); + auto connection = make_unique<DHTConnectionImpl>(family); { port = e->getBtRegistry()->getUdpPort(); const std::string& addr = @@ -156,7 +156,6 @@ std::vector<std::unique_ptr<Command>> DHTSetup::setup dispatcher->setTimeout(messageTimeout); - receiver->setConnection(connection); receiver->setMessageFactory(factory.get()); receiver->setRoutingTable(routingTable.get()); @@ -210,7 +209,7 @@ std::vector<std::unique_ptr<Command>> DHTSetup::setup command->setMessageReceiver(receiver.get()); command->setTaskQueue(taskQueue.get()); command->setReadCheckSocket(connection->getSocket()); - command->setConnection(connection); + command->setConnection(std::move(connection)); command->setUDPTrackerClient(udpTrackerClient); tempCommands.push_back(std::move(command)); } |
