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
(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 */
}
}