diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2009-03-23 13:14:51 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2009-03-23 13:14:51 +0000 |
| commit | 52859f2f1309fc8452f1cf182b712ae2d72bc40c (patch) | |
| tree | f87d424675f857d0dcebdc80ce3828389d75a69b /src/event/ngx_event_pipe.c | |
| parent | 1af7090b5091ebbee1cd9354fe8a702e601a8ce0 (diff) | |
| download | nginx-52859f2f1309fc8452f1cf182b712ae2d72bc40c.tar.gz nginx-52859f2f1309fc8452f1cf182b712ae2d72bc40c.tar.bz2 | |
a prelimiary proxy cache support
Diffstat (limited to 'src/event/ngx_event_pipe.c')
| -rw-r--r-- | src/event/ngx_event_pipe.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/event/ngx_event_pipe.c b/src/event/ngx_event_pipe.c index ca18d7cae..c13d2ea5a 100644 --- a/src/event/ngx_event_pipe.c +++ b/src/event/ngx_event_pipe.c @@ -423,7 +423,7 @@ ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p) size_t bsize; ngx_int_t rc; ngx_uint_t flush, prev_last_shadow; - ngx_chain_t *out, **ll, *cl; + ngx_chain_t *out, **ll, *cl, file; ngx_connection_t *downstream; downstream = p->downstream; @@ -488,6 +488,18 @@ ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p) p->in = NULL; } + if (p->cacheable && p->buf_to_file) { + + file.buf = p->buf_to_file; + file.next = NULL; + + if (ngx_write_chain_to_temp_file(p->temp_file, &file) + == NGX_ERROR) + { + return NGX_ABORT; + } + } + ngx_log_debug0(NGX_LOG_DEBUG_EVENT, p->log, 0, "pipe write downstream done"); |
