File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -480,6 +480,7 @@ def connection_lost(self, exc):
480480 self ._loop .call_soon (self ._app_protocol .connection_lost , exc )
481481 self ._transport = None
482482 self ._app_transport = None
483+ self ._wakeup_waiter (exc )
483484
484485 def pause_writing (self ):
485486 """Called when the low-level transport's buffer goes over
Original file line number Diff line number Diff line change @@ -85,5 +85,15 @@ def test_fatal_error_no_name_error(self):
8585 # Restore error logging.
8686 log .logger .setLevel (log_level )
8787
88+ def test_connection_lost (self ):
89+ # From issue #472.
90+ # yield from waiter hang if lost_connection was called.
91+ waiter = asyncio .Future (loop = self .loop )
92+ ssl_proto = self .ssl_protocol (waiter )
93+ self .connection_made (ssl_proto )
94+ ssl_proto .connection_lost (ConnectionAbortedError )
95+ test_utils .run_briefly (self .loop )
96+ self .assertIsInstance (waiter .exception (), ConnectionAbortedError )
97+
8898if __name__ == '__main__' :
8999 unittest .main ()
Original file line number Diff line number Diff line change @@ -44,6 +44,10 @@ Library
4444 now when the grp module cannot be imported, as for example on Android
4545 platforms.
4646
47+ - Issue #28990: Fix SSL hanging if connection is closed before handshake
48+ completed.
49+ (Patch by HoHo-Ho)
50+
4751Windows
4852-------
4953
You can’t perform that action at this time.
0 commit comments