Commit 93a56ed5375 for php

commit 93a56ed537502c860a207ff5e7887716d919ef1f
Author: Ryosuke Ishibashi <mpyw628@gmail.com>
Date:   Sat Oct 10 15:05:37 2026 +0800

    Fix GH-24229: Use SHUT_WR when closing FastCGI connections (#24230)

    fcgi_close() must shut down the write side before draining any remaining
    request data. The literal 1 matches SHUT_WR on supported platforms, but
    POSIX does not require that value. On WASI, 1 is SHUT_RD and SHUT_WR is 2.
    Shutting down reads makes the drain loop end immediately, so closing the
    socket with unread FCGI_STDIN data can reset the connection and discard
    the response.

    Use SHUT_WR from sys/socket.h in the non-Windows path. The Windows path
    continues to use 1, which is the correct value for SD_SEND.

    Closes #24230

diff --git a/NEWS b/NEWS
index 05dc5a7c733..d4ed9198fe3 100644
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,10 @@ PHP                                                                        NEWS
   . Fixed bug GH-23352 (UAF reading an attribute value node retained across
     DOMDocument::adoptNode()). (David Carlier)

+- FPM:
+  . Fixed bug GH-24229 (fcgi_close() passes shutdown() a literal 1, which is
+    SHUT_RD in WASI). (Ryosuke Ishibashi)
+
 - Opcache:
   . Fixed bug GH-20890 (Segfault in zval_undefined_cv with non-simple property
     hook with minimal tracing JIT). (ndossche)
diff --git a/main/fastcgi.c b/main/fastcgi.c
index d1355d17fbe..f63210a59d9 100644
--- a/main/fastcgi.c
+++ b/main/fastcgi.c
@@ -1290,7 +1290,7 @@ void fcgi_close(fcgi_request *req, int force, int destroy)
 		if (!force) {
 			char buf[8];

-			shutdown(req->fd, 1);
+			shutdown(req->fd, SHUT_WR);
 			/* read any remaining data, it may be omitted */
 			while (recv(req->fd, buf, sizeof(buf), 0) > 0) {}
 		}