-
Notifications
You must be signed in to change notification settings - Fork 38
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
Wrong REMOTE_ADDR/fapws.remote_addr reported #34
Comments
notice the request at port 40363: host:10.20.1.50,port:40363 accept_cb: cli:0x9b20770, input_header:0x9aea200 ** |
Here it is:
inet_ntoa use a static char[] to store the string. So that the remote_addr of each clients has the same address! And will change over time! Please change this line to and free() it after the connection is closed. |
This is linked to the message in the manpages. Correct ? " |
Yes |
I find this problem on a heavily loaded web server running python-bottle 0.10.7-1 on Debian, with fapws3 0.10.dev.
At first I post a bug report at bottle: bottlepy/bottle#290, but then I find it's really a fapws3 bug:
I wrote the simple test script:
!/usr/bin/env python
import fapws._evwsgi as evwsgi
from fapws import base
def start():
evwsgi.start('0.0.0.0', '8000')
evwsgi.set_base_module(base)
evwsgi.wsgi_cb(('/', hello))
if name == 'main':
start()
Then, by frequent execution of curl, I got
~$ curl http://localhost:8000/
127.0.0.1
127.0.0.1
~$ curl http://localhost:8000/
127.0.0.1
127.0.0.1
~$ curl http://localhost:8000/
127.0.0.1
127.0.0.1
~$ curl http://localhost:8000/ & curl http://10.20.1.50:8000
[1] 26257
127.0.0.1
127.0.0.1
127.0.0.1
127.0.0.1
[1]+ DONE curl http://localhost:8000/
and sometimes
~$ curl http://localhost:8000/ & curl http://10.20.1.50:8000
[4] 26331
10.20.1.50
10.20.1.50
10.20.1.50
10.20.1.50
The text was updated successfully, but these errors were encountered: