diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-09-27 16:06:34 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-09-27 16:06:34 +0000 |
| commit | e9e215dc1f37827fabd87d6fb7ed99afa843d53a (patch) | |
| tree | 6d469623c5b8a706f835aaebef53769736523eb9 /src/HttpRequestCommand.cc | |
| parent | 080fcd5fb81793cf53e5b5af8193df9440196ee1 (diff) | |
2008-09-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that HTTPS download fails.
* src/AbstractCommand.cc
* src/AbstractCommand.h
* src/DownloadCommand.cc
* src/FtpConnection.cc
* src/HttpConnection.cc
* src/HttpRequestCommand.cc
* src/HttpResponseCommand.cc
* src/HttpSkipResponseCommand.cc
* src/MSEHandshake.cc
* src/PeerConnection.cc
* src/SocketCore.cc
* src/SocketCore.h
Fixed the bug that aria2 doesn't download whole content body and
cannot
reuse connection if chunked transfer encoding and gzip content
encoding
are set.
* src/DownloadCommand.cc
* src/HttpSkipResponseCommand.cc
Diffstat (limited to 'src/HttpRequestCommand.cc')
| -rw-r--r-- | src/HttpRequestCommand.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/HttpRequestCommand.cc b/src/HttpRequestCommand.cc index af1bddcc..7e65a4b0 100644 --- a/src/HttpRequestCommand.cc +++ b/src/HttpRequestCommand.cc @@ -99,11 +99,17 @@ createHttpRequest(const SharedHandle<Request>& req, bool HttpRequestCommand::executeInternal() { //socket->setBlockingMode(); + if(req->getProtocol() == Request::PROTO_HTTPS) { + socket->prepareSecureConnection(); + if(!socket->initiateSecureConnection()) { + setReadCheckSocketIf(socket, socket->wantRead()); + setWriteCheckSocketIf(socket, socket->wantWrite()); + e->commands.push_back(this); + return false; + } + } if(_httpConnection->sendBufferIsEmpty()) { checkIfConnectionEstablished(socket); - if(req->getProtocol() == Request::PROTO_HTTPS) { - socket->initiateSecureConnection(); - } if(_segments.empty()) { HttpRequestHandle httpRequest @@ -134,7 +140,8 @@ bool HttpRequestCommand::executeInternal() { e->commands.push_back(command); return true; } else { - setWriteCheckSocket(socket); + setReadCheckSocketIf(socket, socket->wantRead()); + setWriteCheckSocketIf(socket, socket->wantWrite()); e->commands.push_back(this); return false; } |
