[asterisk-commits] branch 1.2 r31194 - /branches/1.2/res/res_agi.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed May 31 16:50:01 MST 2006


Author: russell
Date: Wed May 31 18:50:00 2006
New Revision: 31194

URL: http://svn.digium.com/view/asterisk?rev=31194&view=rev
Log:
if the connection to a FastAGI server fails because of a timeout, log a more
informative log message

Modified:
    branches/1.2/res/res_agi.c

Modified: branches/1.2/res/res_agi.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/res/res_agi.c?rev=31194&r1=31193&r2=31194&view=diff
==============================================================================
--- branches/1.2/res/res_agi.c (original)
+++ branches/1.2/res/res_agi.c Wed May 31 18:50:00 2006
@@ -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,13 @@
 
 	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;
 		}



More information about the asterisk-commits mailing list