]> 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)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Tue, 26 Apr 2022 19:12:49 +0000 (14:12 -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 76a6611a241fd2fb999e88cb86a72fb34d317c08..4c55823a77c34050703812bf560c35d4fc6397f9 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 */
                                        }
                        }