This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 89000d084d59a18c157a65041ac5e242905d85ae
Author: Marco Casaroli <[email protected]>
AuthorDate: Mon Nov 2 11:18:45 2026 +0100

    examples/xmlrpc: Do not die of SIGPIPE when a client closes.
    
    The server writes the "not implemented" response with write().  When
    the client closed the connection, the write fails with EPIPE.  A write
    to a stream socket whose peer is gone also raises SIGPIPE, and with
    CONFIG_SIG_SIGPIPE_ACTION the default action ends the server for all
    clients.
    
    Send with MSG_NOSIGNAL.  The server then closes the connection, as
    before.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 examples/xmlrpc/xmlrpc_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/xmlrpc/xmlrpc_main.c b/examples/xmlrpc/xmlrpc_main.c
index 595cb84eb..287e96326 100644
--- a/examples/xmlrpc/xmlrpc_main.c
+++ b/examples/xmlrpc/xmlrpc_main.c
@@ -261,7 +261,7 @@ static void xmlrpc_handler(int fd)
     }
   else
     {
-      write(fd, notimplemented, strlen(notimplemented));
+      send(fd, notimplemented, strlen(notimplemented), MSG_NOSIGNAL);
     }
 }
 

Reply via email to