r426: fixed bug noticed by wim.delvaux@adaptiveplanet.com in handling of timeout...
authorAndrew Tridgell <tridge@samba.org>
Fri, 30 Apr 2004 13:58:23 +0000 (13:58 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:51:23 +0000 (10:51 -0500)
(This used to be commit 88278b24de4e3e408ac8a6139bd375a72bc664ce)

source3/lib/util_sock.c

index 845aaa4b13acc506aea57fb58d82da3ee48f7bdd..3984f5e8ac22792d3eeb15a8481bcc3ec6211011 100644 (file)
@@ -741,6 +741,7 @@ int open_socket_out(int type, struct in_addr *addr, int port ,int timeout)
        if (ret < 0 && (errno == EINPROGRESS || errno == EALREADY ||
                        errno == EAGAIN) && (connect_loop < timeout) ) {
                smb_msleep(connect_loop);
+               timeout -= connect_loop;
                connect_loop += increment;
                if (increment < 250) {
                        /* After 8 rounds we end up at a max of 255 msec */