Skip to content

Commit 5a0a2cb

Browse files
author
Veijo Pesonen
authored
Merge pull request #70 from ARMmbed/fix_would_block_causing_disconnect
Fix would block causing disconnect
2 parents 0418c61 + 2cd0ddd commit 5a0a2cb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ESP8266/ESP8266.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ void ESP8266::_packet_handler()
370370
struct packet *packet = (struct packet*)malloc(
371371
sizeof(struct packet) + amount);
372372
if (!packet) {
373-
debug("Could not allocate memory for RX data");
373+
debug("Could not allocate memory for RX data\n");
374374
return;
375375
}
376376

ESP8266Interface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ int ESP8266Interface::socket_recv(void *handle, void *data, unsigned size)
381381
int32_t recv;
382382
if (socket->proto == NSAPI_TCP) {
383383
recv = _esp.recv_tcp(socket->id, data, size);
384-
if (recv <= 0) {
384+
if (recv <= 0 && recv != NSAPI_ERROR_WOULD_BLOCK) {
385385
socket->connected = false;
386386
}
387387
} else {

0 commit comments

Comments
 (0)