[Python-Dev] the new 2.3a1 settimeout() with httplib and SSL
Geoffrey Talvola
gtalvola@nameconnector.com
Tue, 28 Jan 2003 10:30:35 -0500
Ben Laurie [mailto:ben@algroup.co.uk] wrote:
> Guido van Rossum wrote:
> > Hm, from that page it looks like the internal implementation may
> > actually repeatedly read from the socket, until it has processed a
> > full 16K block. But I may be mistaken, since it also refers to a
> > non-blocking underlying "BIO", whatever that is. :-(
>
> BIO is OpenSSL's I/O abstraction - if you have a nonblocking
> one, then
> SSL_read() will return when a read returns nothing, and if you want
> SSL_read() to not block, then you pretty much have to use a
> non-blocking
> BIO (because even if select() says there's data, there may
> not be enough
> to actually return any via SSL_read()).
That's OK, I think, because what we care about with timeouts is detecting
when there is _no_ activity on the socket for more than N seconds, and
select() does detect that situation properly.
> I can help out here if there's still a problem.
If you'd like, you could quickly review the latest checkin here -- I have no
prior experience with OpenSSL so that might be prudent:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/dist/src/Module
s/_ssl.c
But it seems to work fine.
- Geoff