From 085081fc6e7da0b43c2bc1930c643dd7efb7f2cc Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Tue, 28 Oct 2014 22:42:42 +0000 Subject: code cleanup: We prefer 'CURLcode result' --- lib/connect.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'lib/connect.c') 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; } /* -- cgit v1.2.3