]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Move where fdno is set to the default value to *after* the read callback of the chann...
authorJoshua Colp <jcolp@digium.com>
Tue, 3 Mar 2009 14:38:09 +0000 (14:38 +0000)
committerJoshua Colp <jcolp@digium.com>
Tue, 3 Mar 2009 14:38:09 +0000 (14:38 +0000)
We have to do this as the underlying channel driver may need the fdno value to determine what to read.

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

main/channel.c

index 8275456d41ae7b78276b87ba3ca1d657839e7835..58861add9c92327594659edc5b881d36e5d5fd68 100644 (file)
@@ -2061,12 +2061,6 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
        }
        prestate = chan->_state;
 
-       /* 
-        * Reset the recorded file descriptor that triggered this read so that we can
-        * easily detect when ast_read() is called without properly using ast_waitfor().
-        */
-       chan->fdno = -1;
-
        /* Read and ignore anything on the alertpipe, but read only
           one sizeof(blah) per frame that we send from it */
        if (chan->alertpipe[0] > -1) {
@@ -2191,6 +2185,12 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
                        ast_log(LOG_WARNING, "No read routine on channel %s\n", chan->name);
        }
 
+        /*
+        * Reset the recorded file descriptor that triggered this read so that we can
+        * easily detect when ast_read() is called without properly using ast_waitfor().
+        */
+       chan->fdno = -1;
+
        if (f) {
                /* if the channel driver returned more than one frame, stuff the excess
                   into the readq for the next ast_read call (note that we can safely assume