ESP32S2: Socket.recv_into only took len-1 bytes

This commit is contained in:
Neradoc 2021-02-07 08:57:19 +01:00
parent 8214d67e5f
commit 6be2466d6f

View File

@ -256,7 +256,7 @@ mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self,
timed_out = supervisor_ticks_ms64() - start_ticks >= self->timeout_ms; timed_out = supervisor_ticks_ms64() - start_ticks >= self->timeout_ms;
} }
RUN_BACKGROUND_TASKS; RUN_BACKGROUND_TASKS;
received = lwip_recv(self->num, (void*) buf, len - 1, 0); received = lwip_recv(self->num, (void*) buf, len, 0);
// In non-blocking mode, fail instead of looping // In non-blocking mode, fail instead of looping
if (received == -1 && self->timeout_ms == 0) { if (received == -1 && self->timeout_ms == 0) {