[Asterisk-cvs] asterisk/channels chan_zap.c,1.110,1.111

markster at lists.digium.com markster at lists.digium.com
Tue Oct 14 04:30:43 CDT 2003


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv22859/channels

Modified Files:
	chan_zap.c 
Log Message:
Properly handle events during reads


Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -d -r1.110 -r1.111
--- chan_zap.c	8 Oct 2003 21:57:43 -0000	1.110
+++ chan_zap.c	14 Oct 2003 09:56:46 -0000	1.111
@@ -3322,16 +3322,19 @@
 	ast->blocking = 0;
 	/* Check for hangup */
 	if (res < 0) {
+		f = NULL;
 		if (res == -1)  {
 			if (errno == EAGAIN) {
 				/* Return "NULL" frame if there is nobody there */
 				ast_mutex_unlock(&p->lock);
 				return &p->subs[index].f;
+			} else if (errno == ELAST) {
+				f = zt_handle_event(ast);
 			} else
 				ast_log(LOG_WARNING, "zt_rec: %s\n", strerror(errno));
 		}
 		ast_mutex_unlock(&p->lock);
-		return NULL;
+		return f;
 	}
 	if (res != (p->subs[index].linear ? READ_SIZE * 2 : READ_SIZE)) {
 		ast_log(LOG_DEBUG, "Short read (%d/%d), must be an event...\n", res, p->subs[index].linear ? READ_SIZE * 2 : READ_SIZE);




More information about the svn-commits mailing list