Fix #5188 by Closing the stream instead of Releasing it (#5235)

* Fix #5188 by Closing the stream instead of Releasing it

Closing just terminates the connection, release attempts to download all the contents before closing.  Since the MJPEG stream is infinite, it loads and loads content until the python script runs out of memory.

Source: 50b1d30f41/aiohttp/client_reqrep.py (L668-L672)

* Update mjpeg.py
pull/4283/merge
St. John Johnson 2017-01-09 01:35:38 -08:00 committed by Paulus Schoutsen
parent f87016afe6
commit 9fdefa5a1d
1 changed files with 1 additions and 1 deletions

View File

@ -126,7 +126,7 @@ class MjpegCamera(Camera):
finally:
if stream is not None:
self.hass.async_add_job(stream.release())
yield from stream.close()
if response is not None:
yield from response.write_eof()