[asterisk-commits] trunk r31195 - in /trunk: ./ res/res_agi.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed May 31 16:51:39 MST 2006


Author: russell
Date: Wed May 31 18:51:39 2006
New Revision: 31195

URL: http://svn.digium.com/view/asterisk?rev=31195&view=rev
Log:
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

........

Modified:
    trunk/   (props changed)
    trunk/res/res_agi.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: trunk/res/res_agi.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_agi.c?rev=31195&r1=31194&r2=31195&view=diff
==============================================================================
--- trunk/res/res_agi.c (original)
+++ trunk/res/res_agi.c Wed May 31 18:51:39 2006
@@ -149,6 +149,7 @@
 	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 @@
 
 	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;
 		}



More information about the asterisk-commits mailing list