rendered paste bodyIndex: res/res_agi.c
===================================================================
--- res/res_agi.c (revision 31175)
+++ res/res_agi.c (working copy)
@@ -140,6 +140,7 @@
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,11 @@
pfds[0].fd = s;
pfds[0].events = POLLOUT;
- while (poll(pfds, 1, MAX_AGI_CONNECT) != 1) {
- if (errno != EINTR) {
- ast_log(LOG_WARNING, "Connect to '%s' failed: %s\n", agiurl, strerror(errno));
+ while ((res = poll(pfds, 1, MAX_AGI_CONNECT)) != 1) {
+ if (!res)
+ ast_log(LOG_NOTICE, "FastAGI connection timed out to '%s'\n", agiurl);
+ else if (errno != EINTR) {
+ ast_log(LOG_WARNING, "FastAGI connection to '%s' failed: %s\n", agiurl, strerror(errno));
close(s);
return -1;
}