From 5e245c33971c557f1291ceb44356584098757178 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 14 Apr 2013 18:43:16 +0900 Subject: [PATCH] Fix compile error without SSL/TLS lib --- src/SocketCore.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/SocketCore.cc b/src/SocketCore.cc index b7ed9d85..02659fc9 100644 --- a/src/SocketCore.cc +++ b/src/SocketCore.cc @@ -570,10 +570,12 @@ void SocketCore::setBlockingMode() void SocketCore::closeConnection() { +#ifdef ENABLE_SSL if(tlsSession_) { tlsSession_->closeConnection(); tlsSession_.reset(); } +#endif // ENABLE_SSL if(sockfd_ != (sock_t) -1) { shutdown(sockfd_, SHUT_WR); CLOSE(sockfd_); @@ -743,6 +745,7 @@ ssize_t SocketCore::writeData(const void* data, size_t len) } } } else { +#ifdef ENABLE_SSL ret = tlsSession_->writeData(data, len); if(ret < 0) { if(ret == TLS_ERR_WOULDBLOCK) { @@ -757,6 +760,7 @@ ssize_t SocketCore::writeData(const void* data, size_t len) tlsSession_->getLastErrorString().c_str())); } } +#endif // ENABLE_SSL } return ret; } @@ -781,6 +785,7 @@ void SocketCore::readData(void* data, size_t& len) } } } else { +#ifdef ENABLE_SSL ret = tlsSession_->readData(data, len); if(ret < 0) { if(ret == TLS_ERR_WOULDBLOCK) { @@ -795,6 +800,7 @@ void SocketCore::readData(void* data, size_t& len) tlsSession_->getLastErrorString().c_str())); } } +#endif // ENABLE_SSL } len = ret; }