Merged revisions 50602 via svnmerge from
authorJoshua Colp <jcolp@digium.com>
Fri, 12 Jan 2007 16:47:20 +0000 (16:47 +0000)
committerJoshua Colp <jcolp@digium.com>
Fri, 12 Jan 2007 16:47:20 +0000 (16:47 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r50602 | file | 2007-01-12 11:42:33 -0500 (Fri, 12 Jan 2007) | 2 lines

We need to check for res being 0 in do_message itself, otherwise our headers will get lost.

........

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

main/manager.c

index b154402..53b34dd 100644 (file)
@@ -2136,7 +2136,9 @@ static int do_message(struct mansession *s)
 
        for (;;) {
                res = get_input(s, header_buf);
-               if (res > 0) {
+               if (res == 0) {
+                       continue;
+               } else if (res > 0) {
                        /* Strip trailing \r\n */
                        if (strlen(header_buf) < 2)
                                continue;
@@ -2198,10 +2200,8 @@ static void *session_do(void *data)
        ast_mutex_unlock(&s->__lock);
        for (;;) {
                res = do_message(s);
-               
-               if (res == 0) {
-                       continue;
-               } else if (process_events(s))
+
+               if (process_events(s))
                        break;
        }
        /* session is over, explain why and terminate */