[Asterisk-code-review] manager: Terminate session on write error. (asterisk[19])

Joshua Colp asteriskteam at digium.com
Tue Apr 26 05:00:36 CDT 2022


Joshua Colp has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/18427 )


Change subject: manager: Terminate session on write error.
......................................................................

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
---
M main/manager.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/27/18427/1

diff --git a/main/manager.c b/main/manager.c
index 76a6611..4c55823 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -6242,7 +6242,7 @@
 			    (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 */
 					}
 			}

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18427
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 19
Gerrit-Change-Id: Icaf5d413d4c0d5dc78292a17287fecc8720a31a5
Gerrit-Change-Number: 18427
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220426/fd2b2a26/attachment-0001.html>


More information about the asterisk-code-review mailing list