File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -479,6 +479,7 @@ def connection_lost(self, exc):
479
479
self ._loop .call_soon (self ._app_protocol .connection_lost , exc )
480
480
self ._transport = None
481
481
self ._app_transport = None
482
+ self ._wakeup_waiter (exc )
482
483
483
484
def pause_writing (self ):
484
485
"""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):
85
85
# Restore error logging.
86
86
log .logger .setLevel (log_level )
87
87
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
+
88
98
if __name__ == '__main__' :
89
99
unittest .main ()
You can’t perform that action at this time.
0 commit comments