[Python-checkins] cpython (merge 3.4 -> default): Issue #21430: additions to the description of non-blocking SSL sockets

antoine.pitrou python-checkins at python.org
Sun May 18 00:57:03 CEST 2014


http://hg.python.org/cpython/rev/077e64b23592
changeset:   90742:077e64b23592
parent:      90739:060cfd049d14
parent:      90741:b820b1b282b2
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Sun May 18 00:56:53 2014 +0200
summary:
  Issue #21430: additions to the description of non-blocking SSL sockets

files:
  Doc/library/ssl.rst |  8 +++++++-
  1 files changed, 7 insertions(+), 1 deletions(-)


diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
--- a/Doc/library/ssl.rst
+++ b/Doc/library/ssl.rst
@@ -1631,8 +1631,14 @@
   and :meth:`SSLSocket.send` failures, and retry after another call to
   :func:`~select.select`.
 
+- Conversely, since the SSL layer has its own framing, a SSL socket may
+  still have data available for reading without :func:`~select.select`
+  being aware of it.  Therefore, you should first call
+  :meth:`SSLSocket.recv` to drain any potentially available data, and then
+  only block on a :func:`~select.select` call if still necessary.
+
   (of course, similar provisions apply when using other primitives such as
-  :func:`~select.poll`)
+  :func:`~select.poll`, or those in the :mod:`selectors` module)
 
 - The SSL handshake itself will be non-blocking: the
   :meth:`SSLSocket.do_handshake` method has to be retried until it returns

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list