mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-10 01:33:53 +00:00
Allow use of OpenSSL 1.1.1, fix compile errors
This commit is contained in:
parent
bcf0c32245
commit
98d16eb836
14
httplib.h
14
httplib.h
@ -1696,7 +1696,7 @@ inline std::string decode_url(const std::string &s) {
|
|||||||
int val = 0;
|
int val = 0;
|
||||||
if (from_hex_to_i(s, i + 1, 2, val)) {
|
if (from_hex_to_i(s, i + 1, 2, val)) {
|
||||||
// 2 digits hex codes
|
// 2 digits hex codes
|
||||||
result += val;
|
result += static_cast<char>(val);
|
||||||
i += 2; // '00'
|
i += 2; // '00'
|
||||||
} else {
|
} else {
|
||||||
result += s[i];
|
result += s[i];
|
||||||
@ -1847,7 +1847,7 @@ inline std::string to_lower(const char *beg, const char *end) {
|
|||||||
std::string out;
|
std::string out;
|
||||||
auto it = beg;
|
auto it = beg;
|
||||||
while (it != end) {
|
while (it != end) {
|
||||||
out += ::tolower(*it);
|
out += static_cast<char>(::tolower(*it));
|
||||||
it++;
|
it++;
|
||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
@ -3382,11 +3382,19 @@ private:
|
|||||||
class SSLInit {
|
class SSLInit {
|
||||||
public:
|
public:
|
||||||
SSLInit() {
|
SSLInit() {
|
||||||
|
#if OPENSSL_VERSION_NUMBER >= 0x1010001fL
|
||||||
|
OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
|
||||||
|
#else
|
||||||
SSL_load_error_strings();
|
SSL_load_error_strings();
|
||||||
SSL_library_init();
|
SSL_library_init();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
~SSLInit() { ERR_free_strings(); }
|
~SSLInit() {
|
||||||
|
#if OPENSSL_VERSION_NUMBER < 0x1010001fL
|
||||||
|
ERR_free_strings();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||||
|
Loading…
x
Reference in New Issue
Block a user