asyncio: Fix SSLProtocol.eof_received()

Wake-up the waiter if it is not done yet.
This commit is contained in:
Victor Stinner 2015-01-29 00:35:56 +01:00
parent a89f5f0492
commit b507cbaac5
2 changed files with 33 additions and 11 deletions

View file

@ -489,6 +489,10 @@ class SSLProtocol(protocols.Protocol):
try:
if self._loop.get_debug():
logger.debug("%r received EOF", self)
if self._waiter is not None and not self._waiter.done():
self._waiter.set_exception(ConnectionResetError())
if not self._in_handshake:
keep_open = self._app_protocol.eof_received()
if keep_open: