commit 416f211c0ea482b59d1dda06ac6b2965cd2d3a75 parent 799c1cea25ece7266260d0357c1a92bd0351ffc6 Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev> Date: Mon, 8 Dec 2025 21:42:29 +0100 HTTP2: make sure that connection error is always processed when detected Diffstat:
| M | src/mhd2/conn_data_process.c | | | 7 | ++++++- |
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/mhd2/conn_data_process.c b/src/mhd2/conn_data_process.c @@ -168,6 +168,10 @@ mhd_conn_process_recv_send_data (struct MHD_Connection *restrict c) buffers should have some space as sending was performed before receiving or has not been performed yet. */ use_send = (0 != (mhd_SOCKET_NET_STATE_SEND_READY & c->sk.ready)); + + /* Do not try to send if connection is broken when receiving */ + use_send = use_send && (mhd_SOCKET_ERR_NO_ERROR == c->sk.state.discnt_err); + if (! mhd_C_IS_HTTP2 (c)) { use_send = use_send || @@ -201,7 +205,8 @@ mhd_conn_process_recv_send_data (struct MHD_Connection *restrict c) } if (! data_processed || - mhd_C_IS_HTTP2 (c)) + mhd_C_IS_HTTP2 (c) || + (mhd_SOCKET_ERR_NO_ERROR != c->sk.state.discnt_err)) return mhd_conn_process_data (c); return true;