Skip to content

Commit 55d2a29

Browse files
committed
Revert "Merge branch 'erase_flash' of https://github.com/PilnyTomas/arduino-esp32 into pr/7043"
This reverts commit 31d0b73, reversing changes made to 3f47a0c.
1 parent bbf8d48 commit 55d2a29

File tree

4 files changed

+9
-17
lines changed

4 files changed

+9
-17
lines changed

libraries/WiFi/src/WiFiClient.cpp

+7-8
Original file line numberDiff line numberDiff line change
@@ -305,21 +305,20 @@ int WiFiClient::connect(const char *host, uint16_t port, int32_t timeout)
305305

306306
int WiFiClient::setSocketOption(int option, char* value, size_t len)
307307
{
308-
return setSocketOption(SOL_SOCKET, option, (const void*)value, len);
309-
}
310-
311-
int WiFiClient::setSocketOption(int level, int option, const void* value, size_t len)
312-
{
313-
int res = setsockopt(fd(), level, option, value, len);
308+
int res = setsockopt(fd(), SOL_SOCKET, option, value, len);
314309
if(res < 0) {
315-
log_e("fail on %d, errno: %d, \"%s\"", fd(), errno, strerror(errno));
310+
log_e("%X : %d", option, errno);
316311
}
317312
return res;
318313
}
319314

320315
int WiFiClient::setOption(int option, int *value)
321316
{
322-
return setSocketOption(IPPROTO_TCP, option, (const void*)value, sizeof(int));
317+
int res = setsockopt(fd(), IPPROTO_TCP, option, (char *) value, sizeof(int));
318+
if(res < 0) {
319+
log_e("fail on fd %d, errno: %d, \"%s\"", fd(), errno, strerror(errno));
320+
}
321+
return res;
323322
}
324323

325324
int WiFiClient::getOption(int option, int *value)

libraries/WiFi/src/WiFiClient.h

-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ class WiFiClient : public ESPLwIPClient
8888
int fd() const;
8989

9090
int setSocketOption(int option, char* value, size_t len);
91-
int setSocketOption(int level, int option, const void* value, size_t len);
9291
int setOption(int option, int *value);
9392
int getOption(int option, int *value);
9493
int setNoDelay(bool nodelay);

libraries/WiFiClientSecure/src/WiFiClientSecure.cpp

+2-7
Original file line numberDiff line numberDiff line change
@@ -389,14 +389,9 @@ void WiFiClientSecure::setAlpnProtocols(const char **alpn_protos)
389389

390390
int WiFiClientSecure::setSocketOption(int option, char* value, size_t len)
391391
{
392-
return setSocketOption(SOL_SOCKET, option, (const void*)value, len);
393-
}
394-
395-
int WiFiClientSecure::setSocketOption(int level, int option, const void* value, size_t len)
396-
{
397-
int res = setsockopt(sslclient->socket, level, option, value, len);
392+
int res = setsockopt(sslclient->socket, SOL_SOCKET, option, value, len);
398393
if(res < 0) {
399-
log_e("fail on %d, errno: %d, \"%s\"", sslclient->socket, errno, strerror(errno));
394+
log_e("%X : %d", option, errno);
400395
}
401396
return res;
402397
}

libraries/WiFiClientSecure/src/WiFiClientSecure.h

-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ class WiFiClientSecure : public WiFiClient
8080
const mbedtls_x509_crt* getPeerCertificate() { return mbedtls_ssl_get_peer_cert(&sslclient->ssl_ctx); };
8181
bool getFingerprintSHA256(uint8_t sha256_result[32]) { return get_peer_fingerprint(sslclient, sha256_result); };
8282
int setSocketOption(int option, char* value, size_t len);
83-
int setSocketOption(int level, int option, const void* value, size_t len);
8483

8584
operator bool()
8685
{

0 commit comments

Comments
 (0)