Unverified Commit 394f7218 authored by Bert Melis's avatar Bert Melis Committed by GitHub

fix set/getSocketOption inheritance (#7480)

parent 05e55d87
...@@ -84,7 +84,7 @@ public: ...@@ -84,7 +84,7 @@ public:
return !this->operator==(rhs); return !this->operator==(rhs);
}; };
int fd() const; virtual int fd() const;
int setSocketOption(int option, char* value, size_t len); int setSocketOption(int option, char* value, size_t len);
int setSocketOption(int level, int option, const void* value, size_t len); int setSocketOption(int level, int option, const void* value, size_t len);
......
...@@ -376,16 +376,9 @@ int WiFiClientSecure::setTimeout(uint32_t seconds) ...@@ -376,16 +376,9 @@ int WiFiClientSecure::setTimeout(uint32_t seconds)
return 0; return 0;
} }
} }
int WiFiClientSecure::setSocketOption(int option, char* value, size_t len)
{
return setSocketOption(SOL_SOCKET, option, (const void*)value, len);
}
int WiFiClientSecure::setSocketOption(int level, int option, const void* value, size_t len) int WiFiClientSecure::fd() const
{ {
int res = setsockopt(sslclient->socket, level, option, value, len); return sslclient->socket;
if(res < 0) {
log_e("fail on %d, errno: %d, \"%s\"", sslclient->socket, errno, strerror(errno));
}
return res;
} }
...@@ -80,8 +80,7 @@ public: ...@@ -80,8 +80,7 @@ public:
const mbedtls_x509_crt* getPeerCertificate() { return mbedtls_ssl_get_peer_cert(&sslclient->ssl_ctx); }; const mbedtls_x509_crt* getPeerCertificate() { return mbedtls_ssl_get_peer_cert(&sslclient->ssl_ctx); };
bool getFingerprintSHA256(uint8_t sha256_result[32]) { return get_peer_fingerprint(sslclient, sha256_result); }; bool getFingerprintSHA256(uint8_t sha256_result[32]) { return get_peer_fingerprint(sslclient, sha256_result); };
int setTimeout(uint32_t seconds); int setTimeout(uint32_t seconds);
int setSocketOption(int option, char* value, size_t len); int fd() const;
int setSocketOption(int level, int option, const void* value, size_t len);
operator bool() operator bool()
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment