From 576e1136a3e4c0de12bdbe94136063432cb33e89 Mon Sep 17 00:00:00 2001 From: Edmond <1571649+edmonddantes@users.noreply.github.com> Date: Sun, 23 Aug 2026 16:08:13 +0000 Subject: [PATCH] async: report a failed write on the io handle (ABI 0.26.0) A write submitted without an awaiter gets no status of its own: its completion is a free_cb that takes the handle and the user pointer, nothing else. The consumer was left to infer the failure from the read side, where a peer that merely shut its write half down looks exactly like one that is gone. ZEND_ASYNC_IO_WRITE_FAILED is that report. The reactor sets it on the handle when a write completes with an error and never clears it, so a consumer can tell "this connection can no longer be written to" from "this peer has stopped sending". It says nothing about the read side. --- Zend/zend_async_API.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Zend/zend_async_API.h b/Zend/zend_async_API.h index e97cfa953382..a515b5b45ec8 100644 --- a/Zend/zend_async_API.h +++ b/Zend/zend_async_API.h @@ -21,9 +21,9 @@ #include "zend_globals.h" #include "zend_stream.h" -#define ZEND_ASYNC_API "TrueAsync ABI v0.25.0" +#define ZEND_ASYNC_API "TrueAsync ABI v0.26.0" #define ZEND_ASYNC_API_VERSION_MAJOR 0 -#define ZEND_ASYNC_API_VERSION_MINOR 25 +#define ZEND_ASYNC_API_VERSION_MINOR 26 #define ZEND_ASYNC_API_VERSION_PATCH 0 #define ZEND_ASYNC_API_VERSION_NUMBER \ @@ -122,6 +122,12 @@ typedef enum { #define ZEND_ASYNC_IO_APPEND (1 << 4) #define ZEND_ASYNC_IO_PRESERVE_FD (1 << 5) #define ZEND_ASYNC_IO_OWNS_FD (1 << 6) /* reactor owns crt_fd and must close it on dispose */ +/* A write on this handle completed with an error. The reactor sets it and + * never clears it, which is the only report a consumer gets for a write it did + * not await: the completion of such a write carries no status. It says + * nothing about the read side — a peer that shut its write half down keeps + * reading. */ +#define ZEND_ASYNC_IO_WRITE_FAILED (1 << 7) typedef struct _zend_async_io_s zend_async_io_t; typedef struct _zend_async_io_req_s zend_async_io_req_t;