summaryrefslogtreecommitdiff
path: root/src/FileAllocationCommand.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/FileAllocationCommand.cc
parent4abad2f64c9ff80144a61c5a9c2bea144852b883 (diff)
make clang-format using clang-format-3.6
Diffstat (limited to 'src/FileAllocationCommand.cc')
-rw-r--r--src/FileAllocationCommand.cc31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/FileAllocationCommand.cc b/src/FileAllocationCommand.cc
index d15b3389..36ba57d1 100644
--- a/src/FileAllocationCommand.cc
+++ b/src/FileAllocationCommand.cc
@@ -52,12 +52,13 @@
namespace aria2 {
-FileAllocationCommand::FileAllocationCommand
-(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e,
- FileAllocationEntry* fileAllocationEntry)
- : RealtimeCommand{cuid, requestGroup, e},
- fileAllocationEntry_{fileAllocationEntry}
-{}
+FileAllocationCommand::FileAllocationCommand(
+ cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e,
+ FileAllocationEntry* fileAllocationEntry)
+ : RealtimeCommand{cuid, requestGroup, e},
+ fileAllocationEntry_{fileAllocationEntry}
+{
+}
FileAllocationCommand::~FileAllocationCommand()
{
@@ -66,11 +67,11 @@ FileAllocationCommand::~FileAllocationCommand()
bool FileAllocationCommand::executeInternal()
{
- if(getRequestGroup()->isHaltRequested()) {
+ if (getRequestGroup()->isHaltRequested()) {
return true;
}
fileAllocationEntry_->allocateChunk();
- if(fileAllocationEntry_->finished()) {
+ if (fileAllocationEntry_->finished()) {
A2_LOG_DEBUG(fmt(MSG_ALLOCATION_COMPLETED,
static_cast<long int>(
std::chrono::duration_cast<std::chrono::seconds>(
@@ -81,7 +82,8 @@ bool FileAllocationCommand::executeInternal()
getDownloadEngine()->addCommand(std::move(commands));
getDownloadEngine()->setNoWait(true);
return true;
- } else {
+ }
+ else {
getDownloadEngine()->addCommand(std::unique_ptr<Command>(this));
return false;
}
@@ -89,13 +91,10 @@ bool FileAllocationCommand::executeInternal()
bool FileAllocationCommand::handleException(Exception& e)
{
- A2_LOG_ERROR_EX(fmt(MSG_FILE_ALLOCATION_FAILURE,
- getCuid()),
- e);
- A2_LOG_ERROR
- (fmt(MSG_DOWNLOAD_NOT_COMPLETE,
- getCuid(),
- getRequestGroup()->getDownloadContext()->getBasePath().c_str()));
+ A2_LOG_ERROR_EX(fmt(MSG_FILE_ALLOCATION_FAILURE, getCuid()), e);
+ A2_LOG_ERROR(
+ fmt(MSG_DOWNLOAD_NOT_COMPLETE, getCuid(),
+ getRequestGroup()->getDownloadContext()->getBasePath().c_str()));
return true;
}