summaryrefslogtreecommitdiff
path: root/src/BtAllowedFastMessage.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2015-12-27 18:39:47 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2015-12-27 18:40:08 +0900
commitb1132d6b10cd3791b9529d7031d723fd0e2d8215 (patch)
tree9ce465b42bf09372118335c7c619bb2b41869eaf /src/BtAllowedFastMessage.cc
parent4abad2f64c9ff80144a61c5a9c2bea144852b883 (diff)
make clang-format using clang-format-3.6
Diffstat (limited to 'src/BtAllowedFastMessage.cc')
-rw-r--r--src/BtAllowedFastMessage.cc30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/BtAllowedFastMessage.cc b/src/BtAllowedFastMessage.cc
index 9922a624..364d2a23 100644
--- a/src/BtAllowedFastMessage.cc
+++ b/src/BtAllowedFastMessage.cc
@@ -42,22 +42,24 @@ namespace aria2 {
const char BtAllowedFastMessage::NAME[] = "allowed fast";
-BtAllowedFastMessage::BtAllowedFastMessage(size_t index):
- IndexBtMessage(ID, NAME, index) {}
+BtAllowedFastMessage::BtAllowedFastMessage(size_t index)
+ : IndexBtMessage(ID, NAME, index)
+{
+}
-std::unique_ptr<BtAllowedFastMessage> BtAllowedFastMessage::create
-(const unsigned char* data, size_t dataLength)
+std::unique_ptr<BtAllowedFastMessage>
+BtAllowedFastMessage::create(const unsigned char* data, size_t dataLength)
{
return IndexBtMessage::create<BtAllowedFastMessage>(data, dataLength);
}
-void BtAllowedFastMessage::doReceivedAction() {
- if(!getPeer()->isFastExtensionEnabled()) {
- throw DL_ABORT_EX
- (fmt("%s received while fast extension is disabled",
- toString().c_str()));
+void BtAllowedFastMessage::doReceivedAction()
+{
+ if (!getPeer()->isFastExtensionEnabled()) {
+ throw DL_ABORT_EX(fmt("%s received while fast extension is disabled",
+ toString().c_str()));
}
- if(isMetadataGetMode()) {
+ if (isMetadataGetMode()) {
return;
}
getPeer()->addPeerAllowedIndex(getIndex());
@@ -65,11 +67,13 @@ void BtAllowedFastMessage::doReceivedAction() {
namespace {
struct ThisProgressUpdate : public ProgressUpdate {
- ThisProgressUpdate(std::shared_ptr<Peer> peer, size_t index)
- : peer(std::move(peer)), index(index) {}
+ ThisProgressUpdate(std::shared_ptr<Peer> peer, size_t index)
+ : peer(std::move(peer)), index(index)
+ {
+ }
virtual void update(size_t length, bool complete) CXX11_OVERRIDE
{
- if(complete) {
+ if (complete) {
peer->addAmAllowedIndex(index);
}
}