aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_agi.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-31 23:51:39 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-31 23:51:39 +0000
commit58dec5d37c8ac7ee9e1f2a52821ae40861b37626 (patch)
tree41656d8a924d1257fd8c6c5a5be4bf08fb664b7a /res/res_agi.c
parent3b582a5de81aa3b55220a7f5aeb15e2b3b03439a (diff)
Merged revisions 31194 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r31194 | russell | 2006-05-31 19:50:00 -0400 (Wed, 31 May 2006) | 3 lines 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/trunk@31195 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_agi.c')
-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 5fd7da33d..baae496cb 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -149,6 +149,7 @@ static enum agi_result launch_netscript(char *agiurl, char *argv[], int *fds, in
struct sockaddr_in sin;
struct hostent *hp;
struct ast_hostent ahp;
+ int res;
/* agiusl is "agi://host.domain[:port][/script/name]" */
host = ast_strdupa(agiurl + 6); /* Remove agi:// */
@@ -200,9 +201,13 @@ static enum agi_result launch_netscript(char *agiurl, char *argv[], int *fds, in
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 AGI_RESULT_FAILURE;
}