fix non-ssl build

This commit is contained in:
John
2023-11-11 10:19:03 +01:00
parent bceeb5f4f9
commit 15de49cab1
6 changed files with 24 additions and 17 deletions
+6 -6
View File
@@ -344,11 +344,11 @@ bool HttpClient::parseUrl(const string& url, string* proto, string* host, uint16
if (!isSsl && *proto != "http") {
return false;
}
#else
#else // HAVE_SSL
if (*proto != "http") {
return false;
}
#endif
#endif // HAVE_SSL
size_t pos = url.find('/', hostPos);
if (pos == hostPos) {
return false;
@@ -387,12 +387,12 @@ bool HttpClient::connect(const string& host, const uint16_t port, bool https, co
#ifdef HAVE_SSL
m_socket = SSLSocket::connect(host, port, https, timeout, s_caFile, s_caPath);
m_https = https;
#else
#else // HAVE_SSL
if (https) {
return false;
}
m_socket = TCPSocket::connect(host, port, timeout);
#endif
#endif // HAVE_SSL
if (!m_socket) {
return false;
}
@@ -410,9 +410,9 @@ bool HttpClient::reconnect() {
}
#ifdef HAVE_SSL
m_socket = SSLSocket::connect(m_host, m_port, m_https, m_timeout, s_caFile, s_caPath);
#else
#else // HAVE_SSL
m_socket = TCPSocket::connect(m_host, m_port, m_timeout);
#endif
#endif // HAVE_SSL
if (!m_socket) {
return false;
}