[Python-checkins] r79453 - in python/branches/release31-maint: Misc/NEWS Modules/_ssl.c

antoine.pitrou python-checkins at python.org
Fri Mar 26 20:38:11 CET 2010


Author: antoine.pitrou
Date: Fri Mar 26 20:38:11 2010
New Revision: 79453

Log:
Merged revisions 79449,79452 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k

................
  r79449 | antoine.pitrou | 2010-03-26 20:32:24 +0100 (ven., 26 mars 2010) | 12 lines
  
  Merged revisions 79448 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/trunk
  
  ........
    r79448 | antoine.pitrou | 2010-03-26 20:27:16 +0100 (ven., 26 mars 2010) | 6 lines
    
    Issue #8222: Enable the SSL_MODE_AUTO_RETRY flag on SSL sockets, so that blocking
    reads and writes are always retried by OpenSSL itself.
    
    (this is a followup to issue #3890)
  ........
................
  r79452 | antoine.pitrou | 2010-03-26 20:36:14 +0100 (ven., 26 mars 2010) | 3 lines
  
  Add NEWS entry for r79449.
................


Modified:
   python/branches/release31-maint/   (props changed)
   python/branches/release31-maint/Misc/NEWS
   python/branches/release31-maint/Modules/_ssl.c

Modified: python/branches/release31-maint/Misc/NEWS
==============================================================================
--- python/branches/release31-maint/Misc/NEWS	(original)
+++ python/branches/release31-maint/Misc/NEWS	Fri Mar 26 20:38:11 2010
@@ -28,7 +28,9 @@
   didn't support chflags() (for example ZFS under FreeBSD).  The error is
   now silenced.
 
-- Issue #3890: Fix recv() and recv_into() on non-blocking SSL sockets.
+- Issue #3890, #8222: Fix recv() and recv_into() on non-blocking SSL sockets.
+  Also, enable the SSL_MODE_AUTO_RETRY flag on SSL sockets, so that blocking
+  reads and writes are always retried by OpenSSL itself.
 
 - Issue #6716/2: Backslash-replace error output in compilall.
 

Modified: python/branches/release31-maint/Modules/_ssl.c
==============================================================================
--- python/branches/release31-maint/Modules/_ssl.c	(original)
+++ python/branches/release31-maint/Modules/_ssl.c	Fri Mar 26 20:38:11 2010
@@ -9,8 +9,6 @@
    directly.
 
    XXX should partial writes be enabled, SSL_MODE_ENABLE_PARTIAL_WRITE?
-
-   XXX what about SSL_MODE_AUTO_RETRY?
 */
 
 #include "Python.h"
@@ -371,6 +369,7 @@
 	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 */
+	SSL_set_mode(self->ssl, SSL_MODE_AUTO_RETRY);
 
 	/* If the socket is in non-blocking mode or timeout mode, set the BIO
 	 * to non-blocking mode (blocking is the default)


More information about the Python-checkins mailing list