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 broken wsgi.py due to sockname info size #716

Closed
wants to merge 1 commit into from

Conversation

merrellb
Copy link

@merrellb merrellb commented Jan 3, 2016

Addresses issue introduced by cccb9cb

@merrellb
Copy link
Author

merrellb commented Jan 3, 2016

This failed immediately on any request when using aiobottle. Not sure how their codepath differs from existing wsgi tests.

@redixin
Copy link
Contributor

redixin commented Jan 3, 2016

getsockname may return more then 2 values, e.g. in case of AF_INET6 (host, port, flowinfo, scopeid)

Probably we should check the address family and call appropriate code to fill in variables.

@merrellb
Copy link
Author

merrellb commented Jan 3, 2016

On my OSX box I do get back the four part tuple. I can't say I am familiar with flowinfo or scopeid so it isn't clear how helpful they would be to detect and add them to the 'environ' variable. Given the move to tuple unpacking in the earlier commit, this seemed like the quickest way to get wsgi working again :-)

@asvetlov
Copy link
Member

asvetlov commented Jan 4, 2016

I'm with @redixin
We should explicitly process 3 address families: AF_INET, AF_INET6 and AF_UNIX without relying on presence of peername or length of address tuple.

@redixin
Copy link
Contributor

redixin commented Jan 4, 2016

@asvetlov I've made a patch, but it adds one extra call get_extra_info('socket') to query address family. The problem is this will be called at every request, but may be called once at start of the daemon. Could you please give me a glue how this can be done?

@asvetlov
Copy link
Member

asvetlov commented Jan 4, 2016

get_extra_info(socket) is a dictionary lookup, not a syscall.
socket.family is not a syscall also.
Feel free to get the info on every request.

@redixin
Copy link
Contributor

redixin commented Jan 4, 2016

@asvetlov @merrellb please take a look #718

@asvetlov asvetlov added this to the 0.21 milestone Jan 5, 2016
@asvetlov asvetlov added the bug label Jan 5, 2016
@asvetlov
Copy link
Member

asvetlov commented Jan 5, 2016

Fixed by #718

@asvetlov asvetlov closed this Jan 5, 2016
@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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants