Commit 46a4146a4a for asterisk.org
commit 46a4146a4a51c3d5555cb8e3d98e823f224b9a3c
Author: Jaewoo Kim <chrysaor@naver.com>
Date: Fri Nov 27 00:50:40 2026 +0900
res_aeap: Don't treat input after our own disconnect as a read error.
Since d8df207318 disconnect sends a CLOSE frame instead of dropping the
websocket, so the read thread reads the CLOSE reply and reports it as
an unrecoverable read error. Stop reading once we have disconnected.
AI assistance: Claude Fable 5.1
Fixes: #2352
diff --git a/res/res_aeap/transport_websocket.c b/res/res_aeap/transport_websocket.c
index 86fdf8db28..73b0d6ff29 100644
--- a/res/res_aeap/transport_websocket.c
+++ b/res/res_aeap/transport_websocket.c
@@ -117,10 +117,11 @@ static intmax_t websocket_read(struct aeap_transport *self, void *buf, intmax_t
}
ast_mutex_lock(&transport->base.read_lock);
- if (!transport->ws) {
+ if (!transport->ws || !aeap_transport_is_connected(self)) {
/*
* It's possible the transport was told to disconnect while waiting for input.
- * If so then the websocket will be NULL, so we don't want to continue.
+ * If so then the websocket will be NULL or the transport will no
+ * longer be connected, so we don't want to continue.
*/
return 0;
}