mirror of https://github.com/aria2/aria2
Perform SSL/TLS handshake after checking whether connection is established
parent
c904aa50fe
commit
841395f332
|
@ -122,6 +122,12 @@ createHttpRequest(const SharedHandle<Request>& req,
|
||||||
|
|
||||||
bool HttpRequestCommand::executeInternal() {
|
bool HttpRequestCommand::executeInternal() {
|
||||||
//socket->setBlockingMode();
|
//socket->setBlockingMode();
|
||||||
|
if(httpConnection_->sendBufferIsEmpty()) {
|
||||||
|
if(!checkIfConnectionEstablished
|
||||||
|
(getSocket(), getRequest()->getConnectedHostname(),
|
||||||
|
getRequest()->getConnectedAddr(), getRequest()->getConnectedPort())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if(getRequest()->getProtocol() == "https") {
|
if(getRequest()->getProtocol() == "https") {
|
||||||
if(!getSocket()->tlsConnect(getRequest()->getHost())) {
|
if(!getSocket()->tlsConnect(getRequest()->getHost())) {
|
||||||
setReadCheckSocketIf(getSocket(), getSocket()->wantRead());
|
setReadCheckSocketIf(getSocket(), getSocket()->wantRead());
|
||||||
|
@ -130,13 +136,6 @@ bool HttpRequestCommand::executeInternal() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(httpConnection_->sendBufferIsEmpty()) {
|
|
||||||
if(!checkIfConnectionEstablished
|
|
||||||
(getSocket(), getRequest()->getConnectedHostname(),
|
|
||||||
getRequest()->getConnectedAddr(), getRequest()->getConnectedPort())) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(getSegments().empty()) {
|
if(getSegments().empty()) {
|
||||||
SharedHandle<HttpRequest> httpRequest
|
SharedHandle<HttpRequest> httpRequest
|
||||||
(createHttpRequest(getRequest(),
|
(createHttpRequest(getRequest(),
|
||||||
|
|
Loading…
Reference in New Issue