mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
Merge branch 'fix/example_socket_len' into 'master'
fix(examples): Fix socket example incorrect len/error handling Closes IDFGH-17113 See merge request espressif/esp-idf!47199
This commit is contained in:
@@ -96,7 +96,10 @@ static int socket_send(const char *tag, const int sock, const char * data, const
|
||||
int to_write = len;
|
||||
while (to_write > 0) {
|
||||
int written = send(sock, data + (len - to_write), to_write, 0);
|
||||
if (written < 0 && errno != EINPROGRESS && errno != EAGAIN && errno != EWOULDBLOCK) {
|
||||
if (written < 0) {
|
||||
if (errno == EINPROGRESS || errno == EAGAIN || errno == EWOULDBLOCK) {
|
||||
continue;
|
||||
}
|
||||
log_socket_error(tag, sock, errno, "Error occurred during sending");
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user