summaryrefslogtreecommitdiff
path: root/src/AbstractProxyRequestCommand.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/AbstractProxyRequestCommand.cc
parent4abad2f64c9ff80144a61c5a9c2bea144852b883 (diff)
make clang-format using clang-format-3.6
Diffstat (limited to 'src/AbstractProxyRequestCommand.cc')
-rw-r--r--src/AbstractProxyRequestCommand.cc38
1 files changed, 18 insertions, 20 deletions
diff --git a/src/AbstractProxyRequestCommand.cc b/src/AbstractProxyRequestCommand.cc
index 3dd01adf..74d23142 100644
--- a/src/AbstractProxyRequestCommand.cc
+++ b/src/AbstractProxyRequestCommand.cc
@@ -49,20 +49,15 @@
namespace aria2 {
-AbstractProxyRequestCommand::AbstractProxyRequestCommand
-(cuid_t cuid,
- const std::shared_ptr<Request>& req,
- const std::shared_ptr<FileEntry>& fileEntry,
- RequestGroup* requestGroup,
- DownloadEngine* e,
- const std::shared_ptr<Request>& proxyRequest,
- const std::shared_ptr<SocketCore>& s)
- :
- AbstractCommand(cuid, req, fileEntry, requestGroup, e, s),
- proxyRequest_(proxyRequest),
- httpConnection_
- (std::make_shared<HttpConnection>
- (cuid, s, std::make_shared<SocketRecvBuffer>(s)))
+AbstractProxyRequestCommand::AbstractProxyRequestCommand(
+ cuid_t cuid, const std::shared_ptr<Request>& req,
+ const std::shared_ptr<FileEntry>& fileEntry, RequestGroup* requestGroup,
+ DownloadEngine* e, const std::shared_ptr<Request>& proxyRequest,
+ const std::shared_ptr<SocketCore>& s)
+ : AbstractCommand(cuid, req, fileEntry, requestGroup, e, s),
+ proxyRequest_(proxyRequest),
+ httpConnection_(std::make_shared<HttpConnection>(
+ cuid, s, std::make_shared<SocketRecvBuffer>(s)))
{
setTimeout(std::chrono::seconds(getOption()->getAsInt(PREF_CONNECT_TIMEOUT)));
disableReadCheckSocket();
@@ -71,22 +66,25 @@ AbstractProxyRequestCommand::AbstractProxyRequestCommand
AbstractProxyRequestCommand::~AbstractProxyRequestCommand() {}
-bool AbstractProxyRequestCommand::executeInternal() {
- //socket->setBlockingMode();
- if(httpConnection_->sendBufferIsEmpty()) {
+bool AbstractProxyRequestCommand::executeInternal()
+{
+ // socket->setBlockingMode();
+ if (httpConnection_->sendBufferIsEmpty()) {
auto httpRequest = make_unique<HttpRequest>();
httpRequest->setUserAgent(getOption()->get(PREF_USER_AGENT));
httpRequest->setRequest(getRequest());
httpRequest->setProxyRequest(proxyRequest_);
httpConnection_->sendProxyRequest(std::move(httpRequest));
- } else {
+ }
+ else {
httpConnection_->sendPendingData();
}
- if(httpConnection_->sendBufferIsEmpty()) {
+ if (httpConnection_->sendBufferIsEmpty()) {
getDownloadEngine()->addCommand(getNextCommand());
return true;
- } else {
+ }
+ else {
setWriteCheckSocket(getSocket());
addCommandSelf();
return false;