[asterisk-commits] branch 1.2 r10108 - /branches/1.2/res/res_agi.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue Feb 14 17:36:58 MST 2006
Author: kpfleming
Date: Tue Feb 14 18:36:57 2006
New Revision: 10108
URL: http://svn.digium.com/view/asterisk?rev=10108&view=rev
Log:
ensure that FastAGI launcher can handle system call interruption (issue #6449)
Modified:
branches/1.2/res/res_agi.c
Modified: branches/1.2/res/res_agi.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/res/res_agi.c?rev=10108&r1=10107&r2=10108&view=diff
==============================================================================
--- branches/1.2/res/res_agi.c (original)
+++ branches/1.2/res/res_agi.c Tue Feb 14 18:36:57 2006
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
*
* Mark Spencer <markster at digium.com>
*
@@ -189,17 +189,23 @@
close(s);
return -1;
}
+
pfds[0].fd = s;
pfds[0].events = POLLOUT;
- if (poll(pfds, 1, MAX_AGI_CONNECT) != 1) {
- ast_log(LOG_WARNING, "Connect to '%s' failed!\n", agiurl);
- close(s);
- return -1;
- }
- if (write(s, "agi_network: yes\n", strlen("agi_network: yes\n")) < 0) {
- ast_log(LOG_WARNING, "Connect to '%s' failed: %s\n", agiurl, strerror(errno));
- close(s);
- return -1;
+ while (poll(pfds, 1, MAX_AGI_CONNECT) != 1) {
+ if (errno != EINTR) {
+ ast_log(LOG_WARNING, "Connect to '%s' failed: %s\n", agiurl, strerror(errno));
+ close(s);
+ return -1;
+ }
+ }
+
+ while (write(s, "agi_network: yes\n", strlen("agi_network: yes\n")) < 0) {
+ if (errno != EINTR) {
+ ast_log(LOG_WARNING, "Connect to '%s' failed: %s\n", agiurl, strerror(errno));
+ close(s);
+ return -1;
+ }
}
/* If we have a script parameter, relay it to the fastagi server */
More information about the asterisk-commits
mailing list