From 1c29a2e8e81d844760b6edf2199b069a51f3c4f3 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 29 Mar 2021 17:30:14 +0900 Subject: [PATCH] net/tcp/tcp_send_buffered.c: Fix non-blocking I/O My recent changes to buffered tcp send broke this. [1] One of my local apps using non-blocking tcp is working again with this fix. [1] ``` commit 837e1a72a47b4e5a874124e316192b2172301d30 Author: YAMAMOTO Takashi Date: Mon Mar 15 16:19:42 2021 +0900 tcp_send_buffered.c: improve tcp write buffering ``` --- net/tcp/tcp_send_buffered.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/tcp/tcp_send_buffered.c b/net/tcp/tcp_send_buffered.c index 762a3a2d9f..a4c4777aa9 100644 --- a/net/tcp/tcp_send_buffered.c +++ b/net/tcp/tcp_send_buffered.c @@ -1259,6 +1259,11 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR const void *buf, if (chunk_result == 0) { DEBUGASSERT(nonblock); + if (result == 0) + { + result = -EAGAIN; + } + break; }