aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-20 16:41:59 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-20 16:41:59 +0000
commit01027dd92ce393ab723ebccd9fbebcfadaa0caee (patch)
tree26d72edb7f999094b24a5efa7d5c118a09c8b89f /main
parentd202d8ad8082a4d2605269a699d9e195c694e027 (diff)
Merged revisions 207361 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r207361 | russell | 2009-07-20 11:36:15 -0500 (Mon, 20 Jul 2009) | 16 lines Merged revisions 207360 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r207360 | russell | 2009-07-20 11:26:24 -0500 (Mon, 20 Jul 2009) | 9 lines Only do the chan->fdno check in ast_read() in a developer build. I changed this check to only happen in a dev-mode build. I also added a comment explaining what is going on. I also made it so that detection of this situation does not affect ast_read() operation. (closes issue #14723) Reported by: seadweller ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@207364 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/channel.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/main/channel.c b/main/channel.c
index 4f748af0a..c46e99082 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -2605,15 +2605,20 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
goto done;
}
- if (chan->fdno == -1) {
#ifdef AST_DEVMODE
+ /*
+ * The ast_waitfor() code records which of the channel's file descriptors reported that
+ * data is available. In theory, ast_read() should only be called after ast_waitfor()
+ * reports that a channel has data available for reading. However, there still may be
+ * some edge cases throughout the code where ast_read() is called improperly. This can
+ * potentially cause problems, so if this is a developer build, make a lot of noise if
+ * this happens so that it can be addressed.
+ */
+ if (chan->fdno == -1) {
ast_log(LOG_ERROR, "ast_read() called with no recorded file descriptor.\n");
-#else
- ast_debug(2, "ast_read() called with no recorded file descriptor.\n");
-#endif
- f = &ast_null_frame;
- goto done;
}
+#endif
+
prestate = chan->_state;
/* Read and ignore anything on the alertpipe, but read only