This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author giampaolo.rodola
Recipients giampaolo.rodola, janssen, josiah.carlson, josiahcarlson
Date 2008-09-17.20:35:50
SpamBayes Score 7.73298e-06
Marked as misclassified No
Message-id <1221683752.69.0.81133093826.issue3890@psf.upfronthosting.co.za>
In-reply-to
Content
As discussed on the python-dev ml I noticed something in the ssl.py code
which seems to be wrong. This is the ssl.SSLSocket.recv() method:

    def recv (self, buflen=1024, flags=0): 
        if self._sslobj: 
            if flags != 0: 
                raise ValueError( 
                    "non-zero flags not allowed in calls to sendall() 
on %s" % 
                    self.__class__) 
            while True: 
                try: 
                    return self.read(buflen) 
                except SSLError, x: 
                    if x.args[0] == SSL_ERROR_WANT_READ: 
                        continue 
                    else: 
                        raise x 
        else: 
            return socket.recv(self, buflen, flags) 

I don't know the low levels but that while statement which continues 
in case of SSL_ERROR_WANT_READ seems to be wrong (blocking), at least 
when dealing with non-blocking sockets. I think the proper way of 
doing recv() here is letting SSL_ERROR_WANT_READ propagate and let the 
upper application (e.g. asyncore) deal with it.
History
Date User Action Args
2008-09-17 20:35:53giampaolo.rodolasetrecipients: + giampaolo.rodola, josiahcarlson, janssen, josiah.carlson
2008-09-17 20:35:52giampaolo.rodolasetmessageid: <1221683752.69.0.81133093826.issue3890@psf.upfronthosting.co.za>
2008-09-17 20:35:51giampaolo.rodolalinkissue3890 messages
2008-09-17 20:35:50giampaolo.rodolacreate