dovecot-1.0: Reverted previous FreeBSD connect() workaround

dovecot at dovecot.org dovecot at dovecot.org
Wed Nov 28 17:46:43 EET 2007


details:   http://hg.dovecot.org/dovecot-1.0/rev/aad5ff16ce9a
changeset: 5469:aad5ff16ce9a
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Nov 28 17:43:08 2007 +0200
description:
Reverted previous FreeBSD connect() workaround

diffstat:

1 file changed, 2 insertions(+), 18 deletions(-)
src/lib/network.c |   20 ++------------------

diffs (37 lines):

diff -r 046ed83ff29b -r aad5ff16ce9a src/lib/network.c
--- a/src/lib/network.c	Wed Nov 28 16:24:25 2007 +0200
+++ b/src/lib/network.c	Wed Nov 28 17:43:08 2007 +0200
@@ -107,7 +107,7 @@ int net_connect_ip(const struct ip_addr 
 		   const struct ip_addr *my_ip)
 {
 	union sockaddr_union so;
-	int fd, ret, try, opt = 1;
+	int fd, ret, opt = 1;
 
 	if (my_ip != NULL && ip->family != my_ip->family) {
 		i_warning("net_connect_ip(): ip->family != my_ip->family");
@@ -143,23 +143,7 @@ int net_connect_ip(const struct ip_addr 
 	/* connect */
 	sin_set_ip(&so, ip);
 	sin_set_port(&so, port);
-	for (try = 0;;) {
-		ret = connect(fd, &so.sa, SIZEOF_SOCKADDR(so));
-		if (ret != -1 || ++try == 3)
-			break;
-#ifdef __FreeBSD__
-		if (errno == EADDRINUSE) {
-			/* busy, retrying hopefully helps */
-			continue;
-		}
-		if (errno == EACCES) {
-			/* pf may cause this if another connection used
-			   the same port recently. try again. */
-			continue;
-		}
-#endif
-		break;
-	}
+	ret = connect(fd, &so.sa, SIZEOF_SOCKADDR(so));
 
 #ifndef WIN32
 	if (ret < 0 && errno != EINPROGRESS)


More information about the dovecot-cvs mailing list