Skip to content

Commit 861b227

Browse files
committed
picow: if initial write fails, write at most 1 TCP MSS of data
1 parent 1975742 commit 861b227

File tree

1 file changed

+5
-0
lines changed
  • ports/raspberrypi/common-hal/socketpool

1 file changed

+5
-0
lines changed

ports/raspberrypi/common-hal/socketpool/Socket.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,11 @@ STATIC mp_uint_t lwip_tcp_send(socketpool_socket_obj_t *socket, const byte *buf,
504504
if (err != ERR_MEM) {
505505
break;
506506
}
507+
if (err == ERR_MEM && write_len > TCP_MSS) {
508+
// Try writing just one MSS worth of data
509+
write_len = TCP_MSS;
510+
continue;
511+
}
507512
err = tcp_output(socket->pcb.tcp);
508513
if (err != ERR_OK) {
509514
break;

0 commit comments

Comments
 (0)