[svn-commits] tilghman: branch 1.6.0 r116319 - in /branches/1.6.0: ./ apps/app_externalivr.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed May 14 12:01:54 CDT 2008


Author: tilghman
Date: Wed May 14 12:01:53 2008
New Revision: 116319

URL: http://svn.digium.com/view/asterisk?view=rev&rev=116319
Log:
Merged revisions 116298 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r116298 | tilghman | 2008-05-14 11:53:23 -0500 (Wed, 14 May 2008) | 15 lines

Merged revisions 116296 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r116296 | tilghman | 2008-05-14 11:46:48 -0500 (Wed, 14 May 2008) | 2 lines

Detect another way for a connection to have gone away.
(closes issue #12618)
 Reported by: ctooley
 Patches: 
       1.4-externalivr-test_fd.diff uploaded by ctooley (license 136)
       trunk-externalivr-test_fd.diff uploaded by ctooley (license 136)

........

................

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/apps/app_externalivr.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_externalivr.c?view=diff&rev=116319&r1=116318&r2=116319
==============================================================================
--- branches/1.6.0/apps/app_externalivr.c (original)
+++ branches/1.6.0/apps/app_externalivr.c Wed May 14 12:01:53 2008
@@ -432,6 +432,7 @@
  	struct ast_channel *rchan;
  	char *command;
  	int res = -1;
+	int test_available_fd = -1;
   
  	FILE *eivr_commands = NULL;
  	FILE *eivr_errors = NULL;
@@ -451,6 +452,8 @@
  			goto exit;
  		}
  	}
+
+	test_available_fd = open("/dev/null", O_RDONLY);
  
  	setvbuf(eivr_events, NULL, _IONBF, 0);
  	setvbuf(eivr_commands, NULL, _IONBF, 0);
@@ -522,7 +525,7 @@
  		} else if (ready_fd == eivr_commands_fd) {
  			char input[1024];
  
- 			if (exception || feof(eivr_commands)) {
+ 			if (exception || (dup2(eivr_commands_fd, test_available_fd) == -1) || feof(eivr_commands)) {
  				ast_chan_log(LOG_WARNING, chan, "Child process went away\n");
  				res = -1;
   				break;
@@ -633,7 +636,11 @@
  
 exit:
  
- 	if (eivr_events)
+	if (test_available_fd > -1) {
+		close(test_available_fd);
+	}
+
+	if (eivr_events)
  		fclose(eivr_events);
  
  	if (eivr_commands)




More information about the svn-commits mailing list