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

hotfix for aiohttp v2.2 #341

Merged
merged 1 commit into from
Jun 28, 2017
Merged

hotfix for aiohttp v2.2 #341

merged 1 commit into from
Jun 28, 2017

Conversation

das7pad
Copy link
Contributor

@das7pad das7pad commented Jun 27, 2017

This PR addresses #340 until a resolution of #326 or a fix in aiohttp.

aiohttp version 2.2.0 does not close the aiohttp.ClientSession created in aiohttp.request.

A side effect of this: the log will be spammed with resource warnings on level ERROR as a resource warning is raised on every request to the api endpoints using aiohttp==2.2.0.

aiohttp version 2.2 does not close the ```aiohttp.ClientSession``` created in ```aiohttp.request```.
A side effect of this: the log will be spammed with resource warnings on level ERROR.
@tdryer tdryer merged commit 67cbf5b into tdryer:master Jun 28, 2017
das7pad pushed a commit to das7pad/hangups that referenced this pull request Aug 9, 2017
tdryer pushed a commit that referenced this pull request Sep 10, 2017
* refactor error logging

* remove cookies from the FetchResponse

The cookies of a ``aiohttp.ClientResponse`` are not used outside.

* keep up with the aiohttp changes

``aiohttp.ProxyConnector`` has been dropped.
A proxy must be declared on every request now.

* use a single session to perform http requests

The ``aiohttp.ClientSession`` stores the current cookies and will update them as changes are made by the server. A ``aiohttp.ClientSession`` has an ``aiohttp.TCPConnector`` for connection pooling.

* create a custom ClientSession class

As only one ``aiohttp.ClientSession`` is used for requests from both the ``hangups.Client`` and the ``hangups.channel.Channel`` the argument ``session`` in ``hangups.http_utils.fetch`` is always the same and should be refactored.

* add the proxy to every request internally

make use of the new ``hangups.http_utils.ClientSession`` class to set the proxy for every request by default.

* move the addition of the authorization header into the core request

cleanup cookie functions/property definitions
drop the no more needed private ``_cookie`` property from ``hangups.channel.Channel``

* cleanup

``aiohttp`` not needed since 5c8fe3

* Revert "Merge pull request #347 from tdryer/client_session"

This reverts commit f06c402.

* Revert "Merge pull request #341 from das7pad/hotfix-aiohttp2-2"

This reverts commit 67cbf5b.

* allow graceful cleanup and add documentation

`Client.__del__()` requires a `._session` member, which could have been not set in case of a failed Client init.

* access the public aiohttp.ClientSession API to perform requests

* add the authorization header only to google related requests

limit the domain to `google.com`

* [http_utils] use the public attribute to access the sessions' CookieJar

re #342 (comment)

* [http_utils] refactor the `ClientSession` to a `Session` container

* [client] close the `Session` as soon as the long-polling request returns
@das7pad das7pad deleted the hotfix-aiohttp2-2 branch January 14, 2018 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants