mirror of https://github.com/aria2/aria2
Make Socket::initiateSecureConnection an empty method when HAVE_LIBSSL
is undefinedpull/1/head
parent
2c732211f4
commit
8a70369dcf
|
@ -36,12 +36,9 @@ HttpRequestCommand::~HttpRequestCommand() {}
|
||||||
|
|
||||||
bool HttpRequestCommand::executeInternal(Segment seg) {
|
bool HttpRequestCommand::executeInternal(Segment seg) {
|
||||||
socket->setNonBlockingMode();
|
socket->setNonBlockingMode();
|
||||||
#ifdef HAVE_LIBSSL
|
|
||||||
// for SSL
|
|
||||||
if(req->getProtocol() == "https") {
|
if(req->getProtocol() == "https") {
|
||||||
socket->initiateSecureConnection();
|
socket->initiateSecureConnection();
|
||||||
}
|
}
|
||||||
#endif // HAVE_LIBSSL
|
|
||||||
HttpConnection httpConnection(cuid, socket, e->option, e->logger);
|
HttpConnection httpConnection(cuid, socket, e->option, e->logger);
|
||||||
// set seg to request in order to remember the request range
|
// set seg to request in order to remember the request range
|
||||||
req->seg = seg;
|
req->seg = seg;
|
||||||
|
|
|
@ -81,9 +81,6 @@ void Socket::peekData(char* data, int& len, int timeout) {
|
||||||
core->peekData(data, len, timeout);
|
core->peekData(data, len, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBSSL
|
|
||||||
// for SSL
|
|
||||||
void Socket::initiateSecureConnection() {
|
void Socket::initiateSecureConnection() {
|
||||||
core->initiateSecureConnection();
|
core->initiateSecureConnection();
|
||||||
}
|
}
|
||||||
#endif // HAVE_LIBSSL
|
|
||||||
|
|
|
@ -76,10 +76,11 @@ public:
|
||||||
// this socket.
|
// this socket.
|
||||||
void peekData(char* data, int& len, int timeout = 5);
|
void peekData(char* data, int& len, int timeout = 5);
|
||||||
|
|
||||||
#ifdef HAVE_LIBSSL
|
/**
|
||||||
// for SSL
|
* Makes this socket secure.
|
||||||
|
* If the system has not OpenSSL, then this method do nothing.
|
||||||
|
*/
|
||||||
void initiateSecureConnection();
|
void initiateSecureConnection();
|
||||||
#endif // HAVE_LIBSSL
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _D_SOCKET_H_
|
#endif // _D_SOCKET_H_
|
||||||
|
|
|
@ -193,9 +193,9 @@ void SocketCore::peekData(char* data, int& len, int timeout) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBSSL
|
|
||||||
// for SSL
|
|
||||||
void SocketCore::initiateSecureConnection() {
|
void SocketCore::initiateSecureConnection() {
|
||||||
|
#ifdef HAVE_LIBSSL
|
||||||
|
// for SSL
|
||||||
if(!secure) {
|
if(!secure) {
|
||||||
sslCtx = SSL_CTX_new(SSLv23_client_method());
|
sslCtx = SSL_CTX_new(SSLv23_client_method());
|
||||||
if(sslCtx == NULL) {
|
if(sslCtx == NULL) {
|
||||||
|
@ -215,5 +215,6 @@ void SocketCore::initiateSecureConnection() {
|
||||||
}
|
}
|
||||||
secure = true;
|
secure = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif // HAVE_LIBSSL
|
#endif // HAVE_LIBSSL
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,12 +84,11 @@ public:
|
||||||
// this socket.
|
// this socket.
|
||||||
void peekData(char* data, int& len, int timeout = 5);
|
void peekData(char* data, int& len, int timeout = 5);
|
||||||
|
|
||||||
#ifdef HAVE_LIBSSL
|
|
||||||
/**
|
/**
|
||||||
* Makes this socket SSL endpoint
|
* Makes this socket secure.
|
||||||
|
* If the system has not OpenSSL, then this method do nothing.
|
||||||
*/
|
*/
|
||||||
void initiateSecureConnection();
|
void initiateSecureConnection();
|
||||||
#endif // HAVE_LIB_SSL
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _D_SOCKET_CORE_H_
|
#endif // _D_SOCKET_CORE_H_
|
||||||
|
|
Loading…
Reference in New Issue