fix set/getSocketOption inheritance (#7480)
This commit is contained in:
parent
05e55d8716
commit
394f7218ba
3 changed files with 5 additions and 13 deletions
|
|
@ -84,7 +84,7 @@ public:
|
|||
return !this->operator==(rhs);
|
||||
};
|
||||
|
||||
int fd() const;
|
||||
virtual int fd() const;
|
||||
|
||||
int setSocketOption(int option, char* 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)
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
int WiFiClientSecure::setSocketOption(int option, char* value, size_t len)
|
||||
|
||||
int WiFiClientSecure::fd() const
|
||||
{
|
||||
return setSocketOption(SOL_SOCKET, option, (const void*)value, len);
|
||||
return sslclient->socket;
|
||||
}
|
||||
|
||||
int WiFiClientSecure::setSocketOption(int level, int option, const void* value, size_t len)
|
||||
{
|
||||
int res = setsockopt(sslclient->socket, level, option, value, len);
|
||||
if(res < 0) {
|
||||
log_e("fail on %d, errno: %d, \"%s\"", sslclient->socket, errno, strerror(errno));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,8 +80,7 @@ public:
|
|||
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); };
|
||||
int setTimeout(uint32_t seconds);
|
||||
int setSocketOption(int option, char* value, size_t len);
|
||||
int setSocketOption(int level, int option, const void* value, size_t len);
|
||||
int fd() const;
|
||||
|
||||
operator bool()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue