summaryrefslogtreecommitdiff
path: root/src/HttpServerBodyCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-06-23 21:55:52 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-06-23 21:55:52 +0900
commitfa9f3fb5a3c8912a0a6880ffba9c72f4424ea044 (patch)
treedeb0b47b085a3a689bf386409734bfd3f72f57d2 /src/HttpServerBodyCommand.cc
parentbb5b7eeedb3ce7396007818cbab4f5f5660997a5 (diff)
Wrap Command object in std::unique_ptr
Diffstat (limited to 'src/HttpServerBodyCommand.cc')
-rw-r--r--src/HttpServerBodyCommand.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/HttpServerBodyCommand.cc b/src/HttpServerBodyCommand.cc
index a860e90d..b05b6766 100644
--- a/src/HttpServerBodyCommand.cc
+++ b/src/HttpServerBodyCommand.cc
@@ -142,9 +142,8 @@ void HttpServerBodyCommand::sendJsonRpcBatchResponse
void HttpServerBodyCommand::addHttpServerResponseCommand()
{
- Command* command =
- new HttpServerResponseCommand(getCuid(), httpServer_, e_, socket_);
- e_->addCommand(command);
+ e_->addCommand(make_unique<HttpServerResponseCommand>
+ (getCuid(), httpServer_, e_, socket_));
e_->setNoWait(true);
}
@@ -309,7 +308,7 @@ bool HttpServerBodyCommand::execute()
}
} else {
updateWriteCheck();
- e_->addCommand(this);
+ e_->addCommand(std::unique_ptr<Command>(this));
return false;
}
} else {
@@ -317,7 +316,7 @@ bool HttpServerBodyCommand::execute()
A2_LOG_INFO("HTTP request body timeout.");
return true;
} else {
- e_->addCommand(this);
+ e_->addCommand(std::unique_ptr<Command>(this));
return false;
}
}