]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
manager: Terminate session on write error.
authorJoshua C. Colp <jcolp@sangoma.com>
Mon, 25 Apr 2022 23:39:10 +0000 (20:39 -0300)
committerKevin Harwell <kharwell@digium.com>
Tue, 26 Apr 2022 20:36:42 +0000 (15:36 -0500)
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

main/manager.c

index cca477732ad75667b3061699014ecbe1f15ccb6d..3ad33e3769f270d29826f08f4e7e3ab1eec104c8 100644 (file)
@@ -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 */
                                        }
                        }