]> granicus.if.org Git - curl/commitdiff
polarssl: fix possible handshake timeout issue in multi.
authorGaël PORTAY <gael.portay@gmail.com>
Wed, 19 Mar 2014 14:56:13 +0000 (15:56 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 19 Mar 2014 15:10:18 +0000 (16:10 +0100)
Because of the socket is unblocking, PolarSSL does need call to getsock to
get the action to perform in multi environment.

In some cases, it might happen we have not received yet all data to perform
the handshake. ssh_handshake returns POLARSSL_ERR_NET_WANT_READ, the state
is updated but because of the getsock has not the proper #define macro to,
the library never prevents to select socket for input thus the socket will
never be awaken when last data is available. Thus it leads to timeout.

lib/http.c

index 4ec38735a87be63476f1d5397dc9d5fb5bcb05e3..558699967d6372532481920c2845f4b1e69db823 100644 (file)
@@ -1361,8 +1361,8 @@ static CURLcode https_connecting(struct connectdata *conn, bool *done)
 #endif
 
 #if defined(USE_SSLEAY) || defined(USE_GNUTLS) || defined(USE_SCHANNEL) || \
-    defined(USE_DARWINSSL)
-/* This function is for OpenSSL, GnuTLS, darwinssl, and schannel only.
+    defined(USE_DARWINSSL) || defined(USE_POLARSSL)
+/* This function is for OpenSSL, GnuTLS, darwinssl, schannel and polarssl only.
    It should be made to query the generic SSL layer instead. */
 static int https_getsock(struct connectdata *conn,
                          curl_socket_t *socks,