1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-11 20:15:03 -05:00

Oops. I broke the flow with the previous commit.

This commit is contained in:
Daniel Stenberg 2004-02-09 11:40:00 +00:00
parent 08e286ed68
commit 2d0b2f294f

View File

@ -216,7 +216,7 @@ static CURLcode bindlocal(struct connectdata *conn,
int sockfd) int sockfd)
{ {
#ifdef HAVE_INET_NTOA #ifdef HAVE_INET_NTOA
bool bindworked = FALSE;
struct SessionHandle *data = conn->data; 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) { if( bind(sockfd, addr->ai_addr, addr->ai_addrlen) >= 0) {
/* we succeeded to bind */ /* we succeeded to bind */
struct sockaddr_in6 add; struct sockaddr_in6 add;
bindworked = TRUE;
size = sizeof(add); size = sizeof(add);
if(getsockname(sockfd, (struct sockaddr *) &add, if(getsockname(sockfd, (struct sockaddr *) &add,
@ -306,6 +308,8 @@ static CURLcode bindlocal(struct connectdata *conn,
/* we succeeded to bind */ /* we succeeded to bind */
struct sockaddr_in add; struct sockaddr_in add;
bindworked = TRUE;
size = sizeof(add); size = sizeof(add);
if(getsockname(sockfd, (struct sockaddr *) &add, if(getsockname(sockfd, (struct sockaddr *) &add,
(socklen_t *)&size)<0) { (socklen_t *)&size)<0) {
@ -315,7 +319,7 @@ static CURLcode bindlocal(struct connectdata *conn,
} }
} }
#endif #endif
else { if(!bindworked) {
switch(errno) { switch(errno) {
case EBADF: case EBADF:
failf(data, "Invalid descriptor: %d", errno); failf(data, "Invalid descriptor: %d", errno);