summaryrefslogtreecommitdiff
path: root/lib/connect.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-10-28 22:42:42 +0000
committerSteve Holme <steve_holme@hotmail.com>2014-10-28 22:45:32 +0000
commit085081fc6e7da0b43c2bc1930c643dd7efb7f2cc (patch)
tree54cb71294c863add2b8c19f77ed1108b8905087d /lib/connect.c
parentb790bdf46b7b3c9f5269163b25505f7b9ae1e319 (diff)
downloadcurl-085081fc6e7da0b43c2bc1930c643dd7efb7f2cc.tar.gz
code cleanup: We prefer 'CURLcode result'
Diffstat (limited to 'lib/connect.c')
-rw-r--r--lib/connect.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/connect.c b/lib/connect.c
index f62d96530..a8fe83042 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -977,10 +977,9 @@ void Curl_sndbufset(curl_socket_t sockfd)
* singleipconnect() connects to the given IP only, and it may return without
* having connected.
*/
-static CURLcode
-singleipconnect(struct connectdata *conn,
- const Curl_addrinfo *ai,
- curl_socket_t *sockp)
+static CURLcode singleipconnect(struct connectdata *conn,
+ const Curl_addrinfo *ai,
+ curl_socket_t *sockp)
{
struct Curl_sockaddr_ex addr;
int rc;
@@ -988,14 +987,14 @@ singleipconnect(struct connectdata *conn,
bool isconnected = FALSE;
struct SessionHandle *data = conn->data;
curl_socket_t sockfd;
- CURLcode res;
+ CURLcode result;
char ipaddress[MAX_IPADR_LEN];
long port;
*sockp = CURL_SOCKET_BAD;
- res = Curl_socket(conn, ai, &addr, &sockfd);
- if(res)
+ result = Curl_socket(conn, ai, &addr, &sockfd);
+ if(result)
/* Failed to create the socket, but still return OK since we signal the
lack of socket as well. This allows the parent function to keep looping
over alternative addresses/socket families etc. */
@@ -1038,15 +1037,16 @@ singleipconnect(struct connectdata *conn,
}
/* possibly bind the local end to an IP, interface or port */
- res = bindlocal(conn, sockfd, addr.family);
- if(res) {
+ result = bindlocal(conn, sockfd, addr.family);
+ if(result) {
Curl_closesocket(conn, sockfd); /* close socket and bail out */
- if(res == CURLE_UNSUPPORTED_PROTOCOL) {
+ if(result == CURLE_UNSUPPORTED_PROTOCOL) {
/* The address family is not supported on this interface.
We can continue trying addresses */
return CURLE_OK;
}
- return res;
+
+ return result;
}
/* set socket non-blocking */
@@ -1084,7 +1084,7 @@ singleipconnect(struct connectdata *conn,
case EAGAIN:
#endif
#endif
- res = CURLE_OK;
+ result = CURLE_OK;
break;
default:
@@ -1095,14 +1095,14 @@ singleipconnect(struct connectdata *conn,
/* connect failed */
Curl_closesocket(conn, sockfd);
- res = CURLE_COULDNT_CONNECT;
+ result = CURLE_COULDNT_CONNECT;
}
}
- if(!res)
+ if(!result)
*sockp = sockfd;
- return res;
+ return result;
}
/*