[pypy-issue] [issue1577] SSLSocket.close() doesn't work

Ben Darnell tracker at bugs.pypy.org
Sun Aug 4 18:41:43 CEST 2013


New submission from Ben Darnell <ben at bendarnell.com>:

In pypy 2.1 (but not the pypy3 beta), SSLSocket.close() no longer closes the 
underlying socket.  In the attached test programs, the client should print "read 
from client socket: 'abc'" and "empty read; connection was closed" and then 
exit.  When the server is run with pypy 2.1 (both the final release and the 
first beta), it hangs after the first message.  The test works as expected in 
pypy 2.0, pypy3 2.1b1, and cpython.

I suspect the problem is the refcounting introduced in 
https://bitbucket.org/pypy/pypy/commits/d439d104a6051cdcc5e366b7ea329cc14d304d9e
, and specifically the call to _reuse in the socket constructor.  
ssl.wrap_socket should transfer the reference from the original plaintext socket 
to the ssl one instead of leaving a reference in both objects.

----------
files: test_server.py
messages: 6034
nosy: bdarnell, pypy-issue
priority: bug
status: unread
title: SSLSocket.close() doesn't work

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1577>
________________________________________


More information about the pypy-issue mailing list