[docs] [issue21430] Document ssl.pending()

Alexey Gorshkov report at bugs.python.org
Tue May 13 12:49:11 CEST 2014


Alexey Gorshkov added the comment:

Ok. As https://docs.python.org/dev/library/ssl.html#notes-on-non-blocking-sockets says: "Calling select() tells you that the OS-level socket can be read from (or written to)", and here is situation: len(select([ssl_socket],[],[], 0.2)[0]) returns 0, but ssl layer has pending data and "SSLWantWriteError or SSLWantReadError instead of BlockingIOError" are not raised, because there is no error.. How should app know what it's need to do another recv() call? Are You suggesting to make loop like this (as for non-blocking socket)?

while True:
    ssl_socket.recv(4096)
    if something:
        break


what I think is: pending() method - is fine solution for knowing needed information about ssl layer status.

SSL_pending(3) is not deprecated in OpenSSL, and I do not see reason why it should be deprecated in python. I do not think it should be deprecated only because it is not used. And it is not need to tell about asyncio, Tornado or Twisted.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21430>
_______________________________________


More information about the docs mailing list