summaryrefslogtreecommitdiff
path: root/lib/socks_sspi.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2011-08-08 11:10:17 +0200
committerDaniel Stenberg <daniel@haxx.se>2011-08-08 11:23:31 +0200
commit3dcc0df5ccac15275f612f5c275ea320f5f41cd4 (patch)
tree72a6ccfc4ba892b952328d43f2140dffad117113 /lib/socks_sspi.c
parentda3ae20da56676361e959d07956dddc641a4a6a7 (diff)
downloadcurl-3dcc0df5ccac15275f612f5c275ea320f5f41cd4.tar.gz
SOCKS: fix the connect timeout
The connect timeout logic when using SOCKS was done wrong Bug: http://curl.haxx.se/mail/lib-2011-07/0177.html Reported by: "Spoon Man"
Diffstat (limited to 'lib/socks_sspi.c')
-rw-r--r--lib/socks_sspi.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/socks_sspi.c b/lib/socks_sspi.c
index 5b9376211..d96a82e8a 100644
--- a/lib/socks_sspi.c
+++ b/lib/socks_sspi.c
@@ -160,7 +160,6 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
ssize_t actualread;
ssize_t written;
int result;
- long timeout;
/* Needs GSSAPI authentication */
SECURITY_STATUS sspi_major_status, sspi_minor_status=0;
unsigned long sspi_ret_flags=0;
@@ -179,9 +178,6 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
unsigned char socksreq[4]; /* room for gssapi exchange header only */
char *service = data->set.str[STRING_SOCKS5_GSSAPI_SERVICE];
- /* get timeout */
- timeout = Curl_timeleft(data, NULL, TRUE);
-
/* GSSAPI request looks like
* +----+------+-----+----------------+
* |VER | MTYP | LEN | TOKEN |
@@ -337,8 +333,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
* +----+------+-----+----------------+
*/
- result=Curl_blockread_all(conn, sock, (char *)socksreq, 4,
- &actualread, timeout);
+ result=Curl_blockread_all(conn, sock, (char *)socksreq, 4, &actualread);
if(result != CURLE_OK || actualread != 4) {
failf(data, "Failed to receive SSPI authentication response.");
free(service_name);
@@ -383,8 +378,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
return CURLE_OUT_OF_MEMORY;
}
result = Curl_blockread_all(conn, sock, (char *)sspi_recv_token.pvBuffer,
- sspi_recv_token.cbBuffer,
- &actualread, timeout);
+ sspi_recv_token.cbBuffer, &actualread);
if(result != CURLE_OK || actualread != us_length) {
failf(data, "Failed to receive SSPI authentication token.");
@@ -585,8 +579,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
s_pSecFn->FreeContextBuffer(sspi_send_token.pvBuffer);
}
- result=Curl_blockread_all(conn, sock, (char *)socksreq, 4,
- &actualread, timeout);
+ result=Curl_blockread_all(conn, sock, (char *)socksreq, 4, &actualread);
if(result != CURLE_OK || actualread != 4) {
failf(data, "Failed to receive SSPI encryption response.");
s_pSecFn->DeleteSecurityContext(&sspi_context);
@@ -619,8 +612,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
}
result=Curl_blockread_all(conn, sock, (char *)sspi_w_token[0].pvBuffer,
- sspi_w_token[0].cbBuffer,
- &actualread, timeout);
+ sspi_w_token[0].cbBuffer, &actualread);
if(result != CURLE_OK || actualread != us_length) {
failf(data, "Failed to receive SSPI encryption type.");