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: https://github.com/KeepSafe/aiohttp/blob/50b1d30f4128abd895532022c726e97993987c7c/aiohttp/client_reqrep.py#L668-L672

* Update mjpeg.py
This commit is contained in:
St. John Johnson authored and Paulus Schoutsen committed 2017-01-09 10:35:38 +01:00
1 parent f87016afe6
commit 9fdefa5a1d
1 file changed
+1 -1
+1 -1
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()