]> granicus.if.org Git - python/commitdiff
SSL_MODE_AUTO_RETRY has been added in OpenSSL 0.9.6. Fix compilation
authorAntoine Pitrou <solipsis@pitrou.net>
Fri, 9 Apr 2010 20:38:39 +0000 (20:38 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Fri, 9 Apr 2010 20:38:39 +0000 (20:38 +0000)
with earlier versions.

Modules/_ssl.c

index 6befbefc9c0373ee5cebe3da2af4dfb36693ccdc..986ec460c6bee6a4a26a6aca689193e8a3e3326c 100644 (file)
@@ -368,7 +368,9 @@ newPySSLObject(PySocketSockObject *Sock, char *key_file, char *cert_file,
        self->ssl = SSL_new(self->ctx); /* New ssl struct */
        PySSL_END_ALLOW_THREADS
        SSL_set_fd(self->ssl, Sock->sock_fd);   /* Set the socket for SSL */
+#ifdef SSL_MODE_AUTO_RETRY
        SSL_set_mode(self->ssl, SSL_MODE_AUTO_RETRY);
+#endif
 
        /* If the socket is in non-blocking mode or timeout mode, set the BIO
         * to non-blocking mode (blocking is the default)