[PATCH] Fixing buffer over-read when accepting unix domain sockets

2013-07-09 Thread Yichun Zhang (agentzh)
Hello! I've found a heap buffer over-read issue in the Nginx core via clang's AddressSanitizer tool when Nginx is accepting a unix domain socket in ngx_event_accept. At least on Linux, accept and accept4 syscalls always return a socket length of 2 for unix domain sockets, which makes later access

Re: handle NGX_AGAIN properly

2013-07-09 Thread Yichun Zhang (agentzh)
Hello! On Tue, Jul 9, 2013 at 5:12 PM, Julien Zefi wrote: > But if in some triggered callback by the timer the > ngx_http_output_filter(..) returns NGX_AGAIN *i assume* NginX will send that > chain as soon as the socket becomes available again. This assumption is not correct. Nginx will only flus

handle NGX_AGAIN properly

2013-07-09 Thread Julien Zefi
hi, i understand that NGX_AGAIN is returned when a chain could not be send because more data cannot be buffered on that socket. I need to understand the following: in my case, when i receive a request, i start a timer every 10ms and send out some data, then i create a new timer every10ms until i