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.

classification
Title: Handle keyboard interrupts in SSL module
Type: Stage:
Components: Extension Modules Versions: Python 2.3
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: loewis Nosy List: jacobs99, loewis
Priority: normal Keywords: patch

Created on 2003-06-10 13:36 by jacobs99, last changed 2022-04-10 16:09 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
ssl.diff jacobs99, 2003-06-10 13:36 Patch to add interrupt checking and fixes to timeout code
Messages (3)
msg43932 - (view) Author: Kevin Jacobs (jacobs99) Date: 2003-06-10 13:36
As of Python 2.3 beta 1 (and current CVS), the
SSL module does not check to see if a keyboard
interrupt occurred after waiting on connections,
reads, and writes.  This results in long
delays (seconds or even minutes) before the
KeyboardInterrupt is finally raised, causing
problematic pauses for interactive processes.  This
does not happen in Python 2.2.2, though I have not
looked into what has changed.

My next step is to look into httplib, the use-case that
brought this to my attention, since some of the
buffering code is not exception safe.  i.e., a
KeyboardInterrupt can cause data to be lost on
subsequent reads.  I suspect that it is also possible
to lose data on due to socket timeouts as well, so I
consider this issue a distinct bug.

I did not include a new unit test, since it is a little
tricky to produce.  It requires a large SSL transfer and
a network timing-sensitive threshold test to detect.

Also included in the attached patch are some error
handling fixes and cleanups related to time-out
operations that I happened to notice.  This module
deserves more attention, since the timeout changes
don't look like they were integrated as carefully
as they could have been and other similar errors are
possible.
msg43933 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-06-17 21:04
Logged In: YES 
user_id=21627

The patch looks fine to me.
msg43934 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-06-28 07:40
Logged In: YES 
user_id=21627

Thanks for the patch. Applied as _ssl.c 1.12
History
Date User Action Args
2022-04-10 16:09:07adminsetgithub: 38621
2003-06-10 13:36:26jacobs99create