aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-31 23:50:00 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-31 23:50:00 +0000
commite68b05a306585a7c3df7d200474f9543b8807de2 (patch)
tree36d52e6a04a37b5ec1ddd5dced4d93a1e9c86f19 /res
parentc4707ba6c9cabde76663702af9cd3856d3e719f8 (diff)
if the connection to a FastAGI server fails because of a timeout, log a more
informative log message git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@31194 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_agi.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index 14713fcc2..ddfabb357 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -140,6 +140,7 @@ static int launch_netscript(char *agiurl, char *argv[], int *fds, int *efd, int
struct sockaddr_in sin;
struct hostent *hp;
struct ast_hostent ahp;
+ int res;
host = ast_strdupa(agiurl + 6); /* Remove agi:// */
if (!host)
@@ -192,9 +193,13 @@ static int launch_netscript(char *agiurl, char *argv[], int *fds, int *efd, int
pfds[0].fd = s;
pfds[0].events = POLLOUT;
- while (poll(pfds, 1, MAX_AGI_CONNECT) != 1) {
+ while ((res = poll(pfds, 1, MAX_AGI_CONNECT)) != 1) {
if (errno != EINTR) {
- ast_log(LOG_WARNING, "Connect to '%s' failed: %s\n", agiurl, strerror(errno));
+ if (!res) {
+ ast_log(LOG_WARNING, "FastAGI connection to '%s' timed out after MAX_AGI_CONNECT (%d) milliseconds.\n",
+ agiurl, MAX_AGI_CONNECT);
+ } else
+ ast_log(LOG_WARNING, "Connect to '%s' failed: %s\n", agiurl, strerror(errno));
close(s);
return -1;
}