-
-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Close stream request once we end up with proxy #9110
Conversation
@foxel, thanks for your PR! By analyzing the history of the files in this pull request, we identified @pvizeli, @balloob and @Danielhiversen to be potential reviewers. |
@@ -93,6 +93,8 @@ def async_aiohttp_proxy_web(hass, request, web_coro, buffer_size=102400, | |||
yield from async_aiohttp_proxy_stream(hass, request, req.content, | |||
req.headers.get(CONTENT_TYPE)) | |||
|
|||
req.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use:
try:
yield from async_aiohttp_proxy...
finally:
req.close()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't aiohttp do this automatically? https://github.com/aio-libs/aiohttp/blob/bb646d143cc7bd3b1a614d7c101957b56b11a67f/aiohttp/client_reqrep.py#L500
try: | ||
yield from async_aiohttp_proxy_stream( | ||
hass, | ||
request, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing whitespace
req.headers.get(CONTENT_TYPE)) | ||
try: | ||
yield from async_aiohttp_proxy_stream( | ||
hass, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing whitespace
Thanks! 🎉 🐬 |
* Close stream request once we end up with proxy * Update aiohttp_client.py * Update aiohttp_client.py * Removed trailing whitespace
Description:
Related issue (if applicable): fixes #9108
This closes connection to mjpeg stream once WEB user ends watching the stream in UI