aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-02-09 11:40:00 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-02-09 11:40:00 +0000
commit2d0b2f294f51d1f759b1c25d53ee23477740741f (patch)
tree4fcbb119a4d84ccd04d02c003a06eef7fd146def /lib
parent08e286ed68eaa294c6c295013bc8f561a4e1ec70 (diff)
Oops. I broke the flow with the previous commit.
Diffstat (limited to 'lib')
-rw-r--r--lib/connect.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/connect.c b/lib/connect.c
index e6bfbdae9..9c140c9f9 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -216,7 +216,7 @@ static CURLcode bindlocal(struct connectdata *conn,
int sockfd)
{
#ifdef HAVE_INET_NTOA
-
+ bool bindworked = FALSE;
struct SessionHandle *data = conn->data;
/*************************************************************
@@ -284,6 +284,8 @@ static CURLcode bindlocal(struct connectdata *conn,
if( bind(sockfd, addr->ai_addr, addr->ai_addrlen) >= 0) {
/* we succeeded to bind */
struct sockaddr_in6 add;
+
+ bindworked = TRUE;
size = sizeof(add);
if(getsockname(sockfd, (struct sockaddr *) &add,
@@ -306,6 +308,8 @@ static CURLcode bindlocal(struct connectdata *conn,
/* we succeeded to bind */
struct sockaddr_in add;
+ bindworked = TRUE;
+
size = sizeof(add);
if(getsockname(sockfd, (struct sockaddr *) &add,
(socklen_t *)&size)<0) {
@@ -315,7 +319,7 @@ static CURLcode bindlocal(struct connectdata *conn,
}
}
#endif
- else {
+ if(!bindworked) {
switch(errno) {
case EBADF:
failf(data, "Invalid descriptor: %d", errno);