summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-04-09 20:38:39 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-04-09 20:38:39 (GMT)
commit92719c546ff24c8b133e09bc0ded108374b2eaec (patch)
tree55c0724770da6ff5a8a2b8ea9ca7bb3a2bf7191e
parent7bc26b9be66e56819f3b3de5898eb8af9e0761b1 (diff)
downloadcpython-92719c546ff24c8b133e09bc0ded108374b2eaec.zip
cpython-92719c546ff24c8b133e09bc0ded108374b2eaec.tar.gz
cpython-92719c546ff24c8b133e09bc0ded108374b2eaec.tar.bz2
SSL_MODE_AUTO_RETRY has been added in OpenSSL 0.9.6. Fix compilation
with earlier versions.
-rw-r--r--Modules/_ssl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 6befbef..986ec46 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -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)