From: Wayne Davison Date: Sun, 11 Nov 2007 15:03:24 +0000 (+0000) Subject: My improved version of a connection-timeout patch. X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/commitdiff_plain/e9d4ab8849c465e766a494765b29e26564f284d0 My improved version of a connection-timeout patch. --- diff --git a/contimeout.diff b/contimeout.diff new file mode 100644 index 0000000..f8cc519 --- /dev/null +++ b/contimeout.diff @@ -0,0 +1,108 @@ +This patch adds a connection timeout option, --contimeout. + +To use this patch, run these commands for a successful build: + + patch -p1 ai_addr, res->ai_addrlen) < 0) { ++ if (connect_timeout > 0) { ++ SIGACTION(SIGALRM, contimeout_handler); ++ alarm(connect_timeout); ++ } ++ ++ while (connect(s, res->ai_addr, res->ai_addrlen) < 0) { ++ if (connect_timeout < 0) ++ exit_cleanup(RERR_CONTIMEOUT); ++ if (errno == EINTR) ++ continue; + close(s); + s = -1; +- continue; ++ break; + } ++ ++ if (connect_timeout > 0) ++ alarm(0); ++ ++ if (s < 0) ++ continue; ++ + if (proxied + && establish_proxy_connection(s, host, port, + proxy_user, proxy_pass) != 0) {