diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2015-12-27 18:39:47 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2015-12-27 18:40:08 +0900 |
| commit | b1132d6b10cd3791b9529d7031d723fd0e2d8215 (patch) | |
| tree | 9ce465b42bf09372118335c7c619bb2b41869eaf /src/DHTPingTask.cc | |
| parent | 4abad2f64c9ff80144a61c5a9c2bea144852b883 (diff) | |
make clang-format using clang-format-3.6
Diffstat (limited to 'src/DHTPingTask.cc')
| -rw-r--r-- | src/DHTPingTask.cc | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/src/DHTPingTask.cc b/src/DHTPingTask.cc index cfb12356..6daf096e 100644 --- a/src/DHTPingTask.cc +++ b/src/DHTPingTask.cc @@ -44,29 +44,26 @@ namespace aria2 { -DHTPingTask::DHTPingTask -(const std::shared_ptr<DHTNode>& remoteNode, int numMaxRetry): - remoteNode_(remoteNode), - numMaxRetry_(numMaxRetry), - numRetry_(0), - pingSuccessful_(false), - timeout_(DHT_MESSAGE_TIMEOUT) -{} +DHTPingTask::DHTPingTask(const std::shared_ptr<DHTNode>& remoteNode, + int numMaxRetry) + : remoteNode_(remoteNode), + numMaxRetry_(numMaxRetry), + numRetry_(0), + pingSuccessful_(false), + timeout_(DHT_MESSAGE_TIMEOUT) +{ +} DHTPingTask::~DHTPingTask() {} void DHTPingTask::addMessage() { - getMessageDispatcher()->addMessageToQueue - (getMessageFactory()->createPingMessage(remoteNode_), - timeout_, - make_unique<DHTPingReplyMessageCallback<DHTPingTask>>(this)); + getMessageDispatcher()->addMessageToQueue( + getMessageFactory()->createPingMessage(remoteNode_), timeout_, + make_unique<DHTPingReplyMessageCallback<DHTPingTask>>(this)); } -void DHTPingTask::startup() -{ - addMessage(); -} +void DHTPingTask::startup() { addMessage(); } void DHTPingTask::onReceived(const DHTPingReplyMessage* message) { @@ -77,17 +74,15 @@ void DHTPingTask::onReceived(const DHTPingReplyMessage* message) void DHTPingTask::onTimeout(const std::shared_ptr<DHTNode>& node) { ++numRetry_; - if(numRetry_ >= numMaxRetry_) { + if (numRetry_ >= numMaxRetry_) { pingSuccessful_ = false; setFinished(true); - } else { + } + else { addMessage(); } } -bool DHTPingTask::isPingSuccessful() const -{ - return pingSuccessful_; -} +bool DHTPingTask::isPingSuccessful() const { return pingSuccessful_; } } // namespace aria2 |
