picow: if initial write fails, write at most 1 TCP MSS of data

This commit is contained in:
Jeff Epler 2022-10-17 17:25:40 -05:00
parent 1975742d9f
commit 861b22730e
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE

View File

@ -504,6 +504,11 @@ STATIC mp_uint_t lwip_tcp_send(socketpool_socket_obj_t *socket, const byte *buf,
if (err != ERR_MEM) {
break;
}
if (err == ERR_MEM && write_len > TCP_MSS) {
// Try writing just one MSS worth of data
write_len = TCP_MSS;
continue;
}
err = tcp_output(socket->pcb.tcp);
if (err != ERR_OK) {
break;