GnuTLS handshake: fix timeout
authorDaniel Stenberg <daniel@haxx.se>
Wed, 18 May 2011 18:48:42 +0000 (20:48 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 18 May 2011 18:48:42 +0000 (20:48 +0200)
Commit cbf4961bf3e garbled the timeout handling while doing SSL
handshaking (in an attempt at fixing another bug). This puts sanity
back.

Bug: http://curl.haxx.se/mail/lib-2011-05/0167.html
Reported by: Ethan Glasser Camp

lib/gtls.c

index 32d81d4..bb2ee10 100644 (file)
@@ -255,7 +255,8 @@ static CURLcode handshake(struct connectdata *conn,
         connssl->connecting_state?sockfd:CURL_SOCKET_BAD;
 
       what = Curl_socket_ready(readfd, writefd,
-                               nonblocking?0:(int)timeout_ms?1000:timeout_ms);
+                               nonblocking?0:
+                               ((int)timeout_ms?timeout_ms:1000));
       if(what < 0) {
         /* fatal error */
         failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO);