mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
Fixed a bug where http manager sessions prevented the eventq from being cleaned out because http manager sessions do not have a valid file descriptor.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1976,19 +1976,25 @@ static int process_events(struct mansession *s)
|
||||
struct eventqent *eqe;
|
||||
int ret = 0;
|
||||
ast_mutex_lock(&s->__lock);
|
||||
if (s->fd > -1) {
|
||||
if (!s->eventq)
|
||||
s->eventq = master_eventq;
|
||||
while(s->eventq->next) {
|
||||
eqe = s->eventq->next;
|
||||
if ((s->authenticated && (s->readperm & eqe->category) == eqe->category) &&
|
||||
((s->send_events & eqe->category) == eqe->category)) {
|
||||
if (!s->eventq)
|
||||
s->eventq = master_eventq;
|
||||
while(s->eventq->next) {
|
||||
eqe = s->eventq->next;
|
||||
if ((s->authenticated && (s->readperm & eqe->category) == eqe->category) &&
|
||||
((s->send_events & eqe->category) == eqe->category)) {
|
||||
if (s->fd > -1) {
|
||||
if (!ret && ast_carefulwrite(s->fd, eqe->eventdata, strlen(eqe->eventdata), s->writetimeout) < 0)
|
||||
ret = -1;
|
||||
} else {
|
||||
if (!s->outputstr && !(s->outputstr = ast_calloc(1, sizeof(*s->outputstr)))) {
|
||||
ast_mutex_unlock(&s->__lock);
|
||||
return;
|
||||
}
|
||||
ast_dynamic_str_append(&s->outputstr, 0, "%s", buf->str);
|
||||
}
|
||||
unuse_eventqent(s->eventq);
|
||||
s->eventq = eqe;
|
||||
}
|
||||
}
|
||||
unuse_eventqent(s->eventq);
|
||||
s->eventq = eqe;
|
||||
}
|
||||
ast_mutex_unlock(&s->__lock);
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user