aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/socks.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/socks.c b/lib/socks.c
index fb6f7fe25..3319e697e 100644
--- a/lib/socks.c
+++ b/lib/socks.c
@@ -71,25 +71,29 @@ static int blockread_all(struct connectdata *conn, /* connection data */
conntime = Curl_tvdiff(tvnow, conn->created);
if(conntime > conn_timeout) {
/* we already got the timeout */
- return -1;
+ result = ~CURLE_OK;
+ break;
}
if(Curl_select(sockfd, CURL_SOCKET_BAD,
(int)(conn_timeout - conntime)) <= 0) {
- return -1;
+ result = ~CURLE_OK;
+ break;
}
result = Curl_read(conn, sockfd, buf, buffersize, &nread);
if(result)
- return result;
+ break;
if(buffersize == nread) {
allread += nread;
*n = allread;
- return CURLE_OK;
+ result = CURLE_OK;
+ break;
}
buffersize -= nread;
buf += nread;
allread += nread;
} while(1);
+ return result;
}
/*