Opened 5 years ago
Closed 5 years ago
#1582 closed defect (invalid)
func ngx_proxy_protocol_read encounter an incomplete line
|Reported by:||Owned by:|
|Keywords:||proxy protocol incomplete line||Cc:|
|uname -a:||2.6.32-642.6.2.el6.x86_64 #1 SMP Wed Oct 26 06:52:09 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux|
nginx version: nginx/1.10.1
built by clang 7.3.0 (clang-703.0.31)
configure arguments: --with-stream --prefix=output
when I read the source code of nginx, i found this in file :http/ngx_http_request.c
if we set proxy_protol like this:
[listen 80 proxy_protocol;],
and then in func ngx_http_wait_request_handler, we will call
n = c->recv(c, b->last, size);
p = ngx_proxy_protocol_read(c, b->pos, b->last);
to see if this is an legal proxy_protocol message.
there is condition that if data in b is not an complete line of proxy_protocol message, ngx_proxy_protocol_read will set p to NULL instead of adding rev to event loop, and this will case a failure.
I'm wondering if is reasonable here to read proxy_protocol message only once for we may get an incomplete line and case an error(I have tried and it failed indeed)
Change History (1)
comment:1 by , 5 years ago
|Status:||new → closed|
Quoting PROXY protocol specification:
That's what nginx does, and this is in line with the specification.