diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-03-26 17:12:52 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-03-26 17:20:27 +0900 |
| commit | d64089632e82a2548752c7a6baaa68365a795a74 (patch) | |
| tree | 57fc7b85a8c1290975d58fa4761b04a7695bf7e3 /src/AbstractProxyResponseCommand.cc | |
| parent | c81b1321122e8509b55c94c0cbca0d8d6d319f0c (diff) | |
| parent | a7cd943a06b1a5ff4515b57060b84037f8d01f9f (diff) | |
Merge branch 'master' into random-webseeding
Diffstat (limited to 'src/AbstractProxyResponseCommand.cc')
| -rw-r--r-- | src/AbstractProxyResponseCommand.cc | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/AbstractProxyResponseCommand.cc b/src/AbstractProxyResponseCommand.cc index 14461ea7..90a11244 100644 --- a/src/AbstractProxyResponseCommand.cc +++ b/src/AbstractProxyResponseCommand.cc @@ -50,27 +50,28 @@ namespace aria2 { -AbstractProxyResponseCommand::AbstractProxyResponseCommand -(cuid_t cuid, - const std::shared_ptr<Request>& req, - const std::shared_ptr<FileEntry>& fileEntry, - RequestGroup* requestGroup, - const std::shared_ptr<HttpConnection>& httpConnection, - DownloadEngine* e, - const std::shared_ptr<SocketCore>& s) - :AbstractCommand(cuid, req, fileEntry, requestGroup, e, s), - httpConnection_(httpConnection) {} +AbstractProxyResponseCommand::AbstractProxyResponseCommand( + cuid_t cuid, const std::shared_ptr<Request>& req, + const std::shared_ptr<FileEntry>& fileEntry, RequestGroup* requestGroup, + const std::shared_ptr<HttpConnection>& httpConnection, DownloadEngine* e, + const std::shared_ptr<SocketCore>& s) + : AbstractCommand(cuid, req, fileEntry, requestGroup, e, s), + httpConnection_(httpConnection) +{ +} AbstractProxyResponseCommand::~AbstractProxyResponseCommand() {} -bool AbstractProxyResponseCommand::executeInternal() { - std::shared_ptr<HttpResponse> httpResponse = httpConnection_->receiveResponse(); - if(!httpResponse) { +bool AbstractProxyResponseCommand::executeInternal() +{ + std::shared_ptr<HttpResponse> httpResponse = + httpConnection_->receiveResponse(); + if (!httpResponse) { // the server has not responded our request yet. addCommandSelf(); return false; } - if(httpResponse->getStatusCode() != 200) { + if (httpResponse->getStatusCode() != 200) { throw DL_RETRY_EX(EX_PROXY_CONNECTION_FAILED); } getDownloadEngine()->addCommand(getNextCommand()); |
