From: Joshua C. Colp Date: Mon, 25 Apr 2022 23:39:10 +0000 (-0300) Subject: manager: Terminate session on write error. X-Git-Tag: 18.12.0-rc1~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae1373d12d0f774fffa3c965c542c9f0b137fe95;p=thirdparty%2Fasterisk.git manager: Terminate session on write error. On a write error to an AMI session a flag was set to indicate that the write error had occurred, with the expected result being that the session be terminated. This was not actually happening and instead writing would continue to be attempted. This change adds a check for the write error and causes the session to actually terminate. ASTERISK-29948 Change-Id: Icaf5d413d4c0d5dc78292a17287fecc8720a31a5 --- diff --git a/main/manager.c b/main/manager.c index 76a6611a24..4c55823a77 100644 --- a/main/manager.c +++ b/main/manager.c @@ -6242,7 +6242,7 @@ static int process_events(struct mansession *s) (s->session->readperm & eqe->category) == eqe->category && (s->session->send_events & eqe->category) == eqe->category) { if (match_filter(s, eqe->eventdata)) { - if (send_string(s, eqe->eventdata) < 0) + if (send_string(s, eqe->eventdata) < 0 || s->write_error) ret = -1; /* don't send more */ } }