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

Fix proxy issue #82

Closed
asvetlov opened this issue Jun 24, 2014 · 4 comments
Closed

Fix proxy issue #82

asvetlov opened this issue Jun 24, 2014 · 4 comments
Assignees
Labels

Comments

@asvetlov
Copy link
Member

Code to reproduce:

import aiohttp
import asyncio


@asyncio.coroutine
def go():
    connector = aiohttp.ProxyConnector('https://37.44.192.55:8888')
    resp = yield from aiohttp.request(
        'get',
        'https://httpbin.org/cookies/set?k1=v1&k2=v2',
        connector=connector)
    body = yield from resp.read_and_close()
    print(body)


asyncio.get_event_loop().run_until_complete(go())
@popravich popravich self-assigned this Jun 24, 2014
@popravich
Copy link
Member

I will look into

@popravich
Copy link
Member

Exception happend there because in a "send request - read response" cycle there are many generators and they don't switch to asyncio loop enough times.
I mean that when first response is read its headers are read at first (read transfering control to asyncio to receive data) then headers are parsed and checked that redirect is received and new request is created and sent through the same connection and new response is read -- here again the control is transfered to asyncio and thats where EOF for previous response is received.

Hopefully I clarified this)

asvetlov added a commit that referenced this issue Jul 2, 2014
@fafhrd91
Copy link
Member

fafhrd91 commented Jul 2, 2014

We need to add check if all data gets consumed from parser to response's close method and close connection if data is not consumed—
Sent from Mailbox

On Wed, Jul 2, 2014 at 6:39 AM, Alexey Popravka [email protected]
wrote:

Closed #82 via 1d391bf.

Reply to this email directly or view it on GitHub:
#82 (comment)

@lock
Copy link

lock bot commented Oct 29, 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.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 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

3 participants