]> git.kaiwu.me - nginx.git/commit
Upstream: pipe length and input_filter_init in buffered mode.
authorMaxim Dounin <mdounin@mdounin.ru>
Thu, 15 Sep 2011 19:00:47 +0000 (19:00 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Thu, 15 Sep 2011 19:00:47 +0000 (19:00 +0000)
commita746bab7c113840246159a805e544457161c1d86
tree4760f29304583c13f0bda9962f3cd5df2106cd00
parentffe4f114173468e2eb205448820c66af0863a9db
Upstream: pipe length and input_filter_init in buffered mode.

As long as ngx_event_pipe() has more data read from upstream than specified
in p->length it's passed to input filter even if buffer isn't yet full.  This
allows to process data with known length without relying on connection close
to signal data end.

By default p->length is set to -1 in upstream module, i.e. end of data is
indicated by connection close.  To set it from per-protocol handlers upstream
input_filter_init() now called in buffered mode (as well as in
unbuffered mode).
src/event/ngx_event_pipe.c
src/event/ngx_event_pipe.h
src/http/ngx_http_upstream.c