Skip to content
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

ClientResponse.connection becomes None too early #2205

Closed
asvetlov opened this issue Aug 15, 2017 · 5 comments
Closed

ClientResponse.connection becomes None too early #2205

asvetlov opened this issue Aug 15, 2017 · 5 comments
Labels

Comments

@asvetlov
Copy link
Member

Now ClientResponse._response_eof() cleans up self._connection on getting end of response's BODY.
For relative small bodies the method is called before even very first resp.read().

It works pretty well from content delivery perspective but raises another problem: there is no reliable way to get underlying socket options, in particular we need transport.get_extra_info('peercert').

In theory aiohttp could collect all data before connection releasing but there is no public asyncio API for providing all available transport's keys.
Moreover I could imagine situation where direct call is needed like tr.get_extra_info('socket').getsockopt(...).

I have no good proposal, keeping resp.connection until at least first resp.read() breaks pipelining if I understand correctly.
But I pretty sure the problem should be fixed.

@fafhrd91 please share your opinion.

@asvetlov
Copy link
Member Author

asvetlov commented Aug 15, 2017

@hellysmile ^^^

@fafhrd91
Copy link
Member

I think current implementation works very well, I don't think we should change it.

I see several options:

@asvetlov
Copy link
Member Author

First option is the best maybe. I should find time work working on it.

@asvetlov
Copy link
Member Author

Should be fixed by implementing #2019 proposal

@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs.
If you feel like there's important points made in this discussion, please include those exceprts into that [new issue].
[new issue]: https://github.com/aio-libs/aiohttp/issues/new

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants