summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-04-26 13:19:08 +0100
committerDamien George <damien.p.george@gmail.com>2016-04-26 13:19:08 +0100
commit45ac5a85d524d30384cc99944897b5d8d5cf1efb (patch)
treedac0a130854835d62394f76974631ef3959495f2
parenta63542387d1689f05bb102eef83baa2235e6d1e6 (diff)
downloadmicropython-45ac5a85d524d30384cc99944897b5d8d5cf1efb.tar.gz
micropython-45ac5a85d524d30384cc99944897b5d8d5cf1efb.zip
extmod/modlwip: Workaround esp8266 sendto issue where 1 is returned.
-rw-r--r--extmod/modlwip.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/extmod/modlwip.c b/extmod/modlwip.c
index 9502018a58..aa375410ec 100644
--- a/extmod/modlwip.c
+++ b/extmod/modlwip.c
@@ -379,7 +379,10 @@ STATIC mp_uint_t lwip_udp_send(lwip_socket_obj_t *socket, const byte *buf, mp_ui
pbuf_free(p);
- if (err != ERR_OK) {
+ // udp_sendto can return 1 on occasion for ESP8266 port. It's not known why
+ // but it seems that the send actually goes through without error in this case.
+ // So we treat such cases as a success until further investigation.
+ if (err != ERR_OK && err != 1) {
*_errno = error_lookup_table[-err];
return -1;
}