diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/http/modules/proxy/ngx_http_proxy_cache.c | 4 | ||||
-rw-r--r-- | src/http/modules/proxy/ngx_http_proxy_handler.c | 29 | ||||
-rw-r--r-- | src/http/ngx_http_busy_lock.c | 3 |
3 files changed, 29 insertions, 7 deletions
diff --git a/src/http/modules/proxy/ngx_http_proxy_cache.c b/src/http/modules/proxy/ngx_http_proxy_cache.c index 958471b76..05fec3a19 100644 --- a/src/http/modules/proxy/ngx_http_proxy_cache.c +++ b/src/http/modules/proxy/ngx_http_proxy_cache.c @@ -252,6 +252,8 @@ void ngx_http_proxy_cache_busy_lock(ngx_http_proxy_ctx_t *p) rc = ngx_http_busy_lock_cachable(p->lcf->busy_lock, &p->busy_lock, p->try_busy_lock); +ngx_log_debug(p->request->connection->log, "LOCK CACHABLE: %d" _ rc); + if (rc == NGX_OK) { if (p->try_busy_lock) { p->busy_locked = 1; @@ -344,7 +346,7 @@ static void ngx_http_proxy_cache_look_complete_request(ngx_http_proxy_ctx_t *p) rc = ngx_http_cache_open_file(ctx, ngx_file_uniq(&p->cache->ctx.file.info)); - if (rc == NGX_HTTP_CACHE_THE_SAME) { + if (rc == NGX_DECLINED || rc == NGX_HTTP_CACHE_THE_SAME) { p->try_busy_lock = 1; p->busy_lock.time = 0; ngx_http_proxy_cache_busy_lock(p); diff --git a/src/http/modules/proxy/ngx_http_proxy_handler.c b/src/http/modules/proxy/ngx_http_proxy_handler.c index b7487f833..25f5b3371 100644 --- a/src/http/modules/proxy/ngx_http_proxy_handler.c +++ b/src/http/modules/proxy/ngx_http_proxy_handler.c @@ -448,8 +448,11 @@ void ngx_http_proxy_busy_lock_handler(ngx_event_t *rev) void ngx_http_proxy_finalize_request(ngx_http_proxy_ctx_t *p, int rc) { - ngx_log_debug(p->request->connection->log, - "finalize http proxy request"); + ngx_http_request_t *r; + + r = p->request; + + ngx_log_debug(r->connection->log, "finalize http proxy request"); if (p->upstream && p->upstream->peer.connection) { ngx_http_proxy_close_connection(p); @@ -462,11 +465,27 @@ void ngx_http_proxy_finalize_request(ngx_http_proxy_ctx_t *p, int rc) } if (p->saved_ctx) { - p->request->connection->log->data = p->saved_ctx; - p->request->connection->log->handler = p->saved_handler; + r->connection->log->data = p->saved_ctx; + r->connection->log->handler = p->saved_handler; + } + + if (p->upstream && p->upstream->event_pipe) { +ngx_log_debug(r->connection->log, "TEMP FD: %d" _ + p->upstream->event_pipe->temp_file->file.fd); + } + + if (p->cache) { +ngx_log_debug(r->connection->log, "CACHE FD: %d" _ p->cache->ctx.file.fd); + } + + if (p->upstream && p->upstream->event_pipe) { + r->file.fd = p->upstream->event_pipe->temp_file->file.fd; + + } else if (p->cache) { + r->file.fd = p->cache->ctx.file.fd; } - ngx_http_finalize_request(p->request, rc); + ngx_http_finalize_request(r, rc); } diff --git a/src/http/ngx_http_busy_lock.c b/src/http/ngx_http_busy_lock.c index 172e15eb0..901407824 100644 --- a/src/http/ngx_http_busy_lock.c +++ b/src/http/ngx_http_busy_lock.c @@ -59,7 +59,8 @@ int ngx_http_busy_lock_cachable(ngx_http_busy_lock_t *bl, rc = ngx_http_busy_lock_look_cachable(bl, bc, lock); -ngx_log_debug(bc->event->log, "BUSYLOCK: %d" _ rc); +ngx_log_debug(bc->event->log, "BUSYLOCK: %d %d:%d" _ + rc _ bl->waiting _ bl->max_waiting); if (rc == NGX_OK) { /* no the same request, there's free slot */ return NGX_OK; |