Make Socket::initiateSecureConnection an empty method when HAVE_LIBSSL

is undefined
pull/1/head
Tatsuhiro Tsujikawa 2006-02-17 19:04:22 +00:00
parent 2c732211f4
commit 8a70369dcf
5 changed files with 10 additions and 15 deletions

View File

@ -36,12 +36,9 @@ HttpRequestCommand::~HttpRequestCommand() {}
bool HttpRequestCommand::executeInternal(Segment seg) {
socket->setNonBlockingMode();
#ifdef HAVE_LIBSSL
// for SSL
if(req->getProtocol() == "https") {
socket->initiateSecureConnection();
}
#endif // HAVE_LIBSSL
HttpConnection httpConnection(cuid, socket, e->option, e->logger);
// set seg to request in order to remember the request range
req->seg = seg;

View File

@ -81,9 +81,6 @@ void Socket::peekData(char* data, int& len, int timeout) {
core->peekData(data, len, timeout);
}
#ifdef HAVE_LIBSSL
// for SSL
void Socket::initiateSecureConnection() {
core->initiateSecureConnection();
}
#endif // HAVE_LIBSSL

View File

@ -76,10 +76,11 @@ public:
// this socket.
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();
#endif // HAVE_LIBSSL
};
#endif // _D_SOCKET_H_

View File

@ -193,9 +193,9 @@ void SocketCore::peekData(char* data, int& len, int timeout) {
}
}
#ifdef HAVE_LIBSSL
// for SSL
void SocketCore::initiateSecureConnection() {
#ifdef HAVE_LIBSSL
// for SSL
if(!secure) {
sslCtx = SSL_CTX_new(SSLv23_client_method());
if(sslCtx == NULL) {
@ -215,5 +215,6 @@ void SocketCore::initiateSecureConnection() {
}
secure = true;
}
}
#endif // HAVE_LIBSSL
}

View File

@ -84,12 +84,11 @@ public:
// this socket.
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();
#endif // HAVE_LIB_SSL
};
#endif // _D_SOCKET_CORE_H_