mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-22 20:56:39 +00:00
Use non-blocking socket() and pipe() wrappers
Change-Id: I050ceffe5a133d5add2dab46687209813d58f597
This commit is contained in:
@@ -2071,16 +2071,11 @@ static enum agi_result launch_netscript(char *agiurl, char *argv[], int *fds)
|
||||
ast_sockaddr_set_port(&addrs[i], AGI_PORT);
|
||||
}
|
||||
|
||||
if ((s = socket(addrs[i].ss.ss_family, SOCK_STREAM, IPPROTO_TCP)) < 0) {
|
||||
if ((s = ast_socket_nonblock(addrs[i].ss.ss_family, SOCK_STREAM, IPPROTO_TCP)) < 0) {
|
||||
ast_log(LOG_WARNING, "Unable to create socket: %s\n", strerror(errno));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ast_fd_set_flags(s, O_NONBLOCK)) {
|
||||
close(s);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ast_connect(s, &addrs[i]) && errno == EINPROGRESS) {
|
||||
|
||||
if (handle_connection(agiurl, addrs[i], s)) {
|
||||
|
Reference in New Issue
Block a user