Merged revisions 50895 via svnmerge from
authorJoshua Colp <jcolp@digium.com>
Mon, 15 Jan 2007 16:40:48 +0000 (16:40 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 15 Jan 2007 16:40:48 +0000 (16:40 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r50895 | file | 2007-01-15 11:36:07 -0500 (Mon, 15 Jan 2007) | 2 lines

Move event processing into do_message so that it gets executed again when events are tripped.

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@50896 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/manager.c

index 88d8e26..a071283 100644 (file)
@@ -2135,6 +2135,9 @@ static int do_message(struct mansession *s)
        int res;
 
        for (;;) {
+               /* Check if any events are pending and do them if needed */
+               if (process_events(s))
+                       return -1;
                res = get_input(s, header_buf);
                if (res == 0) {
                        continue;
@@ -2195,8 +2198,7 @@ static void *session_do(void *data)
        astman_append(s, "Asterisk Call Manager/1.0\r\n");      /* welcome prompt */
        ast_mutex_unlock(&s->__lock);
        for (;;) {
-               res = do_message(s);
-               if ((res < 0) || (process_events(s)))
+               if ((res = do_message(s)) < 0)
                        break;
        }
        /* session is over, explain why and terminate */