aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/proxy/ngx_http_proxy_cache.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-11-05 17:03:41 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-11-05 17:03:41 +0000
commite8732b06b94ea5f8a25fa3e71cece7d93f5ac0b8 (patch)
tree2164e718d78644f6593c228b7b7f2e73d0032ddf /src/http/modules/proxy/ngx_http_proxy_cache.c
parent9cc1acef18220cfc3b66d0a761f1f7c39e0b5c29 (diff)
downloadnginx-e8732b06b94ea5f8a25fa3e71cece7d93f5ac0b8.tar.gz
nginx-e8732b06b94ea5f8a25fa3e71cece7d93f5ac0b8.zip
nginx-0.0.1-2003-11-05-20:03:41 import
Diffstat (limited to 'src/http/modules/proxy/ngx_http_proxy_cache.c')
-rw-r--r--src/http/modules/proxy/ngx_http_proxy_cache.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/http/modules/proxy/ngx_http_proxy_cache.c b/src/http/modules/proxy/ngx_http_proxy_cache.c
index e8e3b5280..0bc7c6159 100644
--- a/src/http/modules/proxy/ngx_http_proxy_cache.c
+++ b/src/http/modules/proxy/ngx_http_proxy_cache.c
@@ -216,6 +216,30 @@ static int ngx_http_proxy_process_cached_header(ngx_http_proxy_ctx_t *p)
}
+#if 0
+
+static void ngx_http_proxy_cache_busy_lock(ngx_http_proxy_ctx_t *p)
+{
+ rc = ngx_http_busy_lock(p->lcf->busy_lock, p->cache->ctx.md5);
+
+ if (rc == NGX_OK) {
+ ngx_http_proxy_request_upstream(p);
+ }
+
+ if (rc == NGX_AGAIN) {
+ if (p->busy_lock_time) {
+ ngx_add_timer(p->request->connection->read, 1000);
+ return;
+ }
+ }
+
+ rc == NGX_ERROR
+ check waitn
+}
+
+#endif
+
+
int ngx_http_proxy_send_cached_response(ngx_http_proxy_ctx_t *p)
{
int rc, len, i;
@@ -428,10 +452,21 @@ int ngx_http_proxy_is_cachable(ngx_http_proxy_ctx_t *p)
int ngx_http_proxy_update_cache(ngx_http_proxy_ctx_t *p)
{
+ ngx_event_pipe_t *ep;
+
if (p->cache == NULL) {
return NGX_OK;
}
+ ep = p->upstream->event_pipe;
+
+ if (p->cache->ctx.length == -1) {
+ /* TODO: test rc */
+ ngx_write_file(&ep->temp_file->file,
+ (char *) &ep->read_length, sizeof(off_t),
+ offsetof(ngx_http_cache_header_t, length));
+ }
+
return ngx_http_cache_update_file(p->request, &p->cache->ctx,
- &p->upstream->event_pipe->temp_file->file.name);
+ &ep->temp_file->file.name);
}