mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
automerge commit
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@31224 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -140,6 +140,7 @@ static int launch_netscript(char *agiurl, char *argv[], int *fds, int *efd, int
|
|||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin;
|
||||||
struct hostent *hp;
|
struct hostent *hp;
|
||||||
struct ast_hostent ahp;
|
struct ast_hostent ahp;
|
||||||
|
int res;
|
||||||
|
|
||||||
host = ast_strdupa(agiurl + 6); /* Remove agi:// */
|
host = ast_strdupa(agiurl + 6); /* Remove agi:// */
|
||||||
if (!host)
|
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].fd = s;
|
||||||
pfds[0].events = POLLOUT;
|
pfds[0].events = POLLOUT;
|
||||||
while (poll(pfds, 1, MAX_AGI_CONNECT) != 1) {
|
while ((res = poll(pfds, 1, MAX_AGI_CONNECT)) != 1) {
|
||||||
if (errno != EINTR) {
|
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);
|
close(s);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user