Question about source code: Any need to call ngx_event_pipe_remove_shadow_links in ngx_event_pipe_read_upstream?
J.J J
jujj603 at gmail.com
Sun May 17 06:36:08 UTC 2015
Hi, all:
nginx code version: 1.7.9 ( I have checked v1.9.0, no change about this)
The bufs used to invoke ngx_event_pipe_remove_shadow_links in
ngx_event_pipe_read_upstream come from p->preread_bufs or p->free_raw_bufs
or new allocated buf.
Both p->preread_bufs and new allocated buf have no shadow link.
p->preread_bufs is inited to be NULL, and there are two places which will
add free buffer into it: ngx_event_pipe_write_chain_to_temp_file and
ngx_event_pipe_write_to_downstream.
In both places, shadow links are cleared by ngx_event_pipe_add_free_buf or
by ngx_event_pipe_remove_shadow_links.
So, there is no need to call ngx_event_pipe_remove_shadow_links
in ngx_event_pipe_read_upstream at all, for shadow link will always be NULL.
Am I missing something ? Or just lack of code review ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20150517/c710c6cb/attachment.html>
More information about the nginx
mailing list