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/LpdDispatchMessageCommand.cc | |
| parent | 4abad2f64c9ff80144a61c5a9c2bea144852b883 (diff) | |
make clang-format using clang-format-3.6
Diffstat (limited to 'src/LpdDispatchMessageCommand.cc')
| -rw-r--r-- | src/LpdDispatchMessageCommand.cc | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/LpdDispatchMessageCommand.cc b/src/LpdDispatchMessageCommand.cc index f1b4f152..79abf57b 100644 --- a/src/LpdDispatchMessageCommand.cc +++ b/src/LpdDispatchMessageCommand.cc @@ -45,43 +45,43 @@ namespace aria2 { -LpdDispatchMessageCommand::LpdDispatchMessageCommand -(cuid_t cuid, - const std::shared_ptr<LpdMessageDispatcher>& dispatcher, - DownloadEngine* e) - : Command(cuid), - dispatcher_(dispatcher), - e_(e), - tryCount_(0) -{} +LpdDispatchMessageCommand::LpdDispatchMessageCommand( + cuid_t cuid, const std::shared_ptr<LpdMessageDispatcher>& dispatcher, + DownloadEngine* e) + : Command(cuid), dispatcher_(dispatcher), e_(e), tryCount_(0) +{ +} LpdDispatchMessageCommand::~LpdDispatchMessageCommand() {} bool LpdDispatchMessageCommand::execute() { - if(btRuntime_->isHalt()) { + if (btRuntime_->isHalt()) { return true; } - if(dispatcher_->isAnnounceReady()) { + if (dispatcher_->isAnnounceReady()) { try { A2_LOG_INFO(fmt("Dispatching LPD message for infohash=%s", util::toHex(dispatcher_->getInfoHash()).c_str())); - if(dispatcher_->sendMessage()) { + if (dispatcher_->sendMessage()) { A2_LOG_INFO("Sending LPD message is complete."); dispatcher_->resetAnnounceTimer(); tryCount_ = 0; - } else { + } + else { ++tryCount_; - if(tryCount_ >= 5) { - A2_LOG_INFO(fmt("Sending LPD message %u times but all failed.", - tryCount_)); + if (tryCount_ >= 5) { + A2_LOG_INFO( + fmt("Sending LPD message %u times but all failed.", tryCount_)); dispatcher_->resetAnnounceTimer(); tryCount_ = 0; - } else { + } + else { A2_LOG_INFO("Could not send LPD message, retry shortly."); } } - } catch(RecoverableException& e) { + } + catch (RecoverableException& e) { A2_LOG_INFO_EX("Failed to send LPD message.", e); dispatcher_->resetAnnounceTimer(); tryCount_ = 0; |
