fix compiler warning: end-of-loop code not reached

This commit is contained in:
Yang Tse 2009-09-25 13:05:36 +00:00
parent 37489a855f
commit c7c84e7420

View File

@ -2300,6 +2300,7 @@ ossl_connect_common(struct connectdata *conn,
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
curl_socket_t sockfd = conn->sock[sockindex];
long timeout_ms;
int what;
if(ssl_connect_1==connssl->connecting_state) {
/* Find out how much more time we're allowed */
@ -2337,12 +2338,13 @@ ossl_connect_common(struct connectdata *conn,
curl_socket_t readfd = ssl_connect_2_reading==
connssl->connecting_state?sockfd:CURL_SOCKET_BAD;
while(1) {
int what = Curl_socket_ready(readfd, writefd,
what = Curl_socket_ready(readfd, writefd,
nonblocking?0:(int)timeout_ms);
if(what > 0)
/* readable or writable, go loop in the outer loop */
break;
if(what < 0) {
/* fatal error */
failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO);
return CURLE_SSL_CONNECT_ERROR;
}
else if(0 == what) {
if(nonblocking) {
*done = FALSE;
@ -2354,15 +2356,9 @@ ossl_connect_common(struct connectdata *conn,
return CURLE_OPERATION_TIMEDOUT;
}
}
else {
/* anything that gets here is fatally bad */
failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO);
return CURLE_SSL_CONNECT_ERROR;
}
} /* while()-loop for the select() */
/* socket is readable or writable */
}
/* get the timeout from step2 to avoid computing it twice. */
retcode = ossl_connect_step2(conn, sockindex);
if(retcode)
return retcode;