From 52859f2f1309fc8452f1cf182b712ae2d72bc40c Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 23 Mar 2009 13:14:51 +0000 Subject: a prelimiary proxy cache support --- src/event/ngx_event_pipe.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/event') 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"); -- cgit