aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/connect.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/connect.c b/lib/connect.c
index ece6cf3f6..88041dd80 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -1242,10 +1242,10 @@ curl_socket_t Curl_getconnectinfo(struct SessionHandle *data,
}
/* Minix 3.1 doesn't support any flags on recv; just assume socket is OK */
#ifdef MSG_PEEK
- else {
+ else if(sockfd != CURL_SOCKET_BAD) {
/* use the socket */
char buf;
- if(recv((RECV_TYPE_ARG1)c->sock[FIRSTSOCKET], (RECV_TYPE_ARG2)&buf,
+ if(recv((RECV_TYPE_ARG1)sockfd, (RECV_TYPE_ARG2)&buf,
(RECV_TYPE_ARG3)1, (RECV_TYPE_ARG4)MSG_PEEK) == 0) {
return CURL_SOCKET_BAD; /* FIN received */
}