summaryrefslogtreecommitdiff
path: root/src/DHTPingTask.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-07-02 22:58:20 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-07-02 22:58:20 +0900
commit1a5d75e819604a46b72d1f07401ac5017c96ad15 (patch)
treea8aec0ebdb53f2207cbabe0abee8ff9c36ef7193 /src/DHTPingTask.cc
parent4f7d1c395bf7fd8826c235c69edf8328e71917a5 (diff)
Use std::unique_ptr to store DHTMessages instead of std::shared_ptr
Diffstat (limited to 'src/DHTPingTask.cc')
-rw-r--r--src/DHTPingTask.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/DHTPingTask.cc b/src/DHTPingTask.cc
index f0aaed64..cfb12356 100644
--- a/src/DHTPingTask.cc
+++ b/src/DHTPingTask.cc
@@ -40,6 +40,7 @@
#include "DHTConstants.h"
#include "DHTPingReplyMessageCallback.h"
#include "DHTQueryMessage.h"
+#include "DHTPingMessage.h"
namespace aria2 {
@@ -56,11 +57,10 @@ DHTPingTask::~DHTPingTask() {}
void DHTPingTask::addMessage()
{
- std::shared_ptr<DHTMessage> m =
- getMessageFactory()->createPingMessage(remoteNode_);
- std::shared_ptr<DHTMessageCallback> callback
- (new DHTPingReplyMessageCallback<DHTPingTask>(this));
- getMessageDispatcher()->addMessageToQueue(m, timeout_, callback);
+ getMessageDispatcher()->addMessageToQueue
+ (getMessageFactory()->createPingMessage(remoteNode_),
+ timeout_,
+ make_unique<DHTPingReplyMessageCallback<DHTPingTask>>(this));
}
void DHTPingTask::startup()