mirror of https://github.com/aria2/aria2
Fix compile error without SSL/TLS lib
parent
2e39fd6273
commit
5e245c3397
|
@ -570,10 +570,12 @@ void SocketCore::setBlockingMode()
|
||||||
|
|
||||||
void SocketCore::closeConnection()
|
void SocketCore::closeConnection()
|
||||||
{
|
{
|
||||||
|
#ifdef ENABLE_SSL
|
||||||
if(tlsSession_) {
|
if(tlsSession_) {
|
||||||
tlsSession_->closeConnection();
|
tlsSession_->closeConnection();
|
||||||
tlsSession_.reset();
|
tlsSession_.reset();
|
||||||
}
|
}
|
||||||
|
#endif // ENABLE_SSL
|
||||||
if(sockfd_ != (sock_t) -1) {
|
if(sockfd_ != (sock_t) -1) {
|
||||||
shutdown(sockfd_, SHUT_WR);
|
shutdown(sockfd_, SHUT_WR);
|
||||||
CLOSE(sockfd_);
|
CLOSE(sockfd_);
|
||||||
|
@ -743,6 +745,7 @@ ssize_t SocketCore::writeData(const void* data, size_t len)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
#ifdef ENABLE_SSL
|
||||||
ret = tlsSession_->writeData(data, len);
|
ret = tlsSession_->writeData(data, len);
|
||||||
if(ret < 0) {
|
if(ret < 0) {
|
||||||
if(ret == TLS_ERR_WOULDBLOCK) {
|
if(ret == TLS_ERR_WOULDBLOCK) {
|
||||||
|
@ -757,6 +760,7 @@ ssize_t SocketCore::writeData(const void* data, size_t len)
|
||||||
tlsSession_->getLastErrorString().c_str()));
|
tlsSession_->getLastErrorString().c_str()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // ENABLE_SSL
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -781,6 +785,7 @@ void SocketCore::readData(void* data, size_t& len)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
#ifdef ENABLE_SSL
|
||||||
ret = tlsSession_->readData(data, len);
|
ret = tlsSession_->readData(data, len);
|
||||||
if(ret < 0) {
|
if(ret < 0) {
|
||||||
if(ret == TLS_ERR_WOULDBLOCK) {
|
if(ret == TLS_ERR_WOULDBLOCK) {
|
||||||
|
@ -795,6 +800,7 @@ void SocketCore::readData(void* data, size_t& len)
|
||||||
tlsSession_->getLastErrorString().c_str()));
|
tlsSession_->getLastErrorString().c_str()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // ENABLE_SSL
|
||||||
}
|
}
|
||||||
len = ret;
|
len = ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue