summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2006-02-17 19:04:22 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2006-02-17 19:04:22 +0000
commit8a70369dcf39adeb3fa6f3f4e0aaaa764ed6fc0d (patch)
tree2f081a4ab095afe84b454c95ded7a499171ef646
parent2c732211f45b4caea3f569971905f176887b4a4a (diff)
Make Socket::initiateSecureConnection an empty method when HAVE_LIBSSL
is undefined
-rw-r--r--src/HttpRequestCommand.cc3
-rw-r--r--src/Socket.cc3
-rw-r--r--src/Socket.h7
-rw-r--r--src/SocketCore.cc7
-rw-r--r--src/SocketCore.h5
5 files changed, 10 insertions, 15 deletions
diff --git a/src/HttpRequestCommand.cc b/src/HttpRequestCommand.cc
index 078b11f1..caa8413a 100644
--- a/src/HttpRequestCommand.cc
+++ b/src/HttpRequestCommand.cc
@@ -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;
diff --git a/src/Socket.cc b/src/Socket.cc
index 9a53cd67..bf9a04f1 100644
--- a/src/Socket.cc
+++ b/src/Socket.cc
@@ -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
diff --git a/src/Socket.h b/src/Socket.h
index 45f2d298..a4624801 100644
--- a/src/Socket.h
+++ b/src/Socket.h
@@ -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_
diff --git a/src/SocketCore.cc b/src/SocketCore.cc
index 07b4b3c1..94b986ed 100644
--- a/src/SocketCore.cc
+++ b/src/SocketCore.cc
@@ -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
+}
+
diff --git a/src/SocketCore.h b/src/SocketCore.h
index f7a75b43..ba5fb7af 100644
--- a/src/SocketCore.h
+++ b/src/SocketCore.h
@@ -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_