From 72e192fc42c90f367195fdff8be932e57e6f0f0c Mon Sep 17 00:00:00 2001 From: Automerge script Date: Wed, 15 Feb 2006 01:04:13 +0000 Subject: [PATCH] automerge commit git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@10136 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- funcs/func_enum.c | 2 +- res/res_agi.c | 24 +++++++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/funcs/func_enum.c b/funcs/func_enum.c index fa291a42e3..07655a789b 100644 --- a/funcs/func_enum.c +++ b/funcs/func_enum.c @@ -55,7 +55,7 @@ static char *function_enum(struct ast_channel *chan, char *cmd, char *data, char { int res=0; char tech[80]; - char dest[80] = ""; + char dest[256] = ""; char *zone; char *options; struct localuser *u; diff --git a/res/res_agi.c b/res/res_agi.c index 155722e803..1838f555bd 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 * @@ -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 */