@@ -279,7 +279,7 @@ int WiFiClient::setOption(int option, int *value)
279
279
{
280
280
int res = setsockopt (fd (), IPPROTO_TCP, option, (char *) value, sizeof (int ));
281
281
if (res < 0 ) {
282
- log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, esp_err_to_name (errno));
282
+ log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, strerror (errno));
283
283
}
284
284
return res;
285
285
}
@@ -289,7 +289,7 @@ int WiFiClient::getOption(int option, int *value)
289
289
size_t size = sizeof (int );
290
290
int res = getsockopt (fd (), IPPROTO_TCP, option, (char *)value, &size);
291
291
if (res < 0 ) {
292
- log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, esp_err_to_name (errno));
292
+ log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, strerror (errno));
293
293
}
294
294
return res;
295
295
}
@@ -362,7 +362,7 @@ size_t WiFiClient::write(const uint8_t *buf, size_t size)
362
362
}
363
363
}
364
364
else if (res < 0 ) {
365
- log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, esp_err_to_name (errno));
365
+ log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, strerror (errno));
366
366
if (errno != EAGAIN) {
367
367
// if resource was busy, can try again, otherwise give up
368
368
stop ();
@@ -406,7 +406,7 @@ int WiFiClient::read(uint8_t *buf, size_t size)
406
406
int res = -1 ;
407
407
res = _rxBuffer->read (buf, size);
408
408
if (_rxBuffer->failed ()) {
409
- log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, esp_err_to_name (errno));
409
+ log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, strerror (errno));
410
410
stop ();
411
411
}
412
412
return res;
@@ -416,7 +416,7 @@ int WiFiClient::peek()
416
416
{
417
417
int res = _rxBuffer->peek ();
418
418
if (_rxBuffer->failed ()) {
419
- log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, esp_err_to_name (errno));
419
+ log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, strerror (errno));
420
420
stop ();
421
421
}
422
422
return res;
@@ -430,7 +430,7 @@ int WiFiClient::available()
430
430
}
431
431
int res = _rxBuffer->available ();
432
432
if (_rxBuffer->failed ()) {
433
- log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, esp_err_to_name (errno));
433
+ log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, strerror (errno));
434
434
stop ();
435
435
}
436
436
return res;
@@ -452,7 +452,7 @@ void WiFiClient::flush() {
452
452
toRead = (a>WIFI_CLIENT_FLUSH_BUFFER_SIZE)?WIFI_CLIENT_FLUSH_BUFFER_SIZE:a;
453
453
res = recv (fd (), buf, toRead, MSG_DONTWAIT);
454
454
if (res < 0 ) {
455
- log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, esp_err_to_name (errno));
455
+ log_e (" fail on fd %d, errno: %d, \" %s\" " , fd (), errno, strerror (errno));
456
456
stop ();
457
457
break ;
458
458
}
0 commit comments