From: Volker Lendecke Date: Wed, 15 Dec 2004 12:05:48 +0000 (+0000) Subject: r4217: Fix open_any_socket_out. X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~5497 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7230cb87eba2c296217bb0255893c55ae5d695d3;p=thirdparty%2Fsamba.git r4217: Fix open_any_socket_out. This was a missing merge from HEAD or rather a commit to 3_0 from the wrong source. Fixed slightly over HEAD, HEAD merge will follow. Deal with connection refused according to the specs. Volker --- diff --git a/source/lib/util_sock.c b/source/lib/util_sock.c index c09e4579c4d..58bc5ed6fe4 100644 --- a/source/lib/util_sock.c +++ b/source/lib/util_sock.c @@ -810,7 +810,7 @@ BOOL open_any_socket_out(struct sockaddr_in *addrs, int num_addrs, int *sockets; BOOL good_connect; - fd_set wr_fds; + fd_set r_fds, wr_fds; struct timeval tv; int maxfd; @@ -840,6 +840,9 @@ BOOL open_any_socket_out(struct sockaddr_in *addrs, int num_addrs, for (i=0; imaxfd) maxfd = sockets[i]; } @@ -875,7 +886,7 @@ BOOL open_any_socket_out(struct sockaddr_in *addrs, int num_addrs, tv.tv_sec = 0; tv.tv_usec = connect_loop; - res = sys_select(maxfd+1, NULL, &wr_fds, NULL, &tv); + res = sys_select(maxfd+1, &r_fds, &wr_fds, NULL, &tv); if (res < 0) goto done; @@ -885,21 +896,24 @@ BOOL open_any_socket_out(struct sockaddr_in *addrs, int num_addrs, for (i=0; i