diff options
author | root <root@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-02-15 01:04:13 +0000 |
---|---|---|
committer | root <root@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-02-15 01:04:13 +0000 |
commit | d1bc038da6491fc71ac9b8c021ad98236ac8d34c (patch) | |
tree | cd6a12c1993d9e8bc7216915a9f98ce14690a3aa /res | |
parent | 0c6de9924da5838b0e06ac72b52a043c8adefcda (diff) |
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@10136 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_agi.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/res/res_agi.c b/res/res_agi.c index 155722e80..1838f555b 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -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@digium.com> * @@ -189,17 +189,23 @@ static int launch_netscript(char *agiurl, char *argv[], int *fds, int *efd, int 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; + 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; + } } - 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 (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 */ |