Issue 1353269: poplib.POP3_SSL() class incompatible with socket.timeout (original) (raw)

Issue1353269

Created on 2005-11-10 16:34 by melicertes, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg26832 - (view) Author: Charles (melicertes) Date: 2005-11-10 16:34
If you call socket.setdefaulttimeout() to enable timeout mode, then create a POP3-over-SSL connection by instantiating a poplib.POP3_SSL() object, the resulting connection can hang because the underlying socket.ssl() object doesn't work when timeouts are enabled. If, after creating the POP3_SSL object, you call object.conn.sock.setblocking(1), the hangs will not happen. This is exactly the same bug as happened with IMAP SSL connections, as I reported in bug #977680. The Python documentation still does not mention that socket SSL support is not compatible with socket timeout support.
msg26833 - (view) Author: Arkadiusz Miśkiewicz (arekm) Date: 2005-12-14 22:59
Logged In: YES user_id=139606 It's just broken in _ssl.c. In PySSL_SSLread() there is: sockstate = check_socket_and_wait_for_timeout(self->Socket, 0); It hangs here because that function waits for new data on the socket but SSL layer could already read that data.
msg26834 - (view) Author: Arkadiusz Miśkiewicz (arekm) Date: 2005-12-14 23:31
Logged In: YES user_id=139606 btw. please test this patch: https://sourceforge.net/tracker /index.php?func=detail&aid=1380952&group_id=5470&atid=305470
msg26835 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-03-31 18:02
Logged In: YES user_id=849994 Fixed with said patch.
History
Date User Action Args
2022-04-11 14:56:14 admin set github: 42577
2005-11-10 16:34:29 melicertes create