diff options
Diffstat (limited to 'src/http')
-rw-r--r-- | src/http/modules/proxy/ngx_http_proxy_parse.c | 4 | ||||
-rw-r--r-- | src/http/modules/proxy/ngx_http_proxy_upstream.c | 8 | ||||
-rw-r--r-- | src/http/ngx_http_core_module.c | 2 | ||||
-rw-r--r-- | src/http/ngx_http_parse.c | 9 | ||||
-rw-r--r-- | src/http/ngx_http_request.c | 37 |
5 files changed, 50 insertions, 10 deletions
diff --git a/src/http/modules/proxy/ngx_http_proxy_parse.c b/src/http/modules/proxy/ngx_http_proxy_parse.c index 1729542d0..a69795850 100644 --- a/src/http/modules/proxy/ngx_http_proxy_parse.c +++ b/src/http/modules/proxy/ngx_http_proxy_parse.c @@ -185,6 +185,10 @@ int ngx_http_proxy_parse_status_line(ngx_http_proxy_ctx_t *p) return NGX_HTTP_PROXY_PARSE_NO_HEADER; } break; + + /* suppress warning */ + case sw_done: + break; } } diff --git a/src/http/modules/proxy/ngx_http_proxy_upstream.c b/src/http/modules/proxy/ngx_http_proxy_upstream.c index 9d442cd4a..1b1ca4493 100644 --- a/src/http/modules/proxy/ngx_http_proxy_upstream.c +++ b/src/http/modules/proxy/ngx_http_proxy_upstream.c @@ -936,6 +936,14 @@ static void ngx_http_proxy_send_response(ngx_http_proxy_ctx_t *p) p->header_sent = 1; + if (p->cache && p->cache->ctx.file.fd != NGX_INVALID_FILE) { + if (ngx_close_file(p->cache->ctx.file.fd) == NGX_FILE_ERROR) { + ngx_log_error(NGX_LOG_ALERT, r->connection->log, ngx_errno, + ngx_close_file_n " \"%s\" failed", + p->cache->ctx.file.name.data); + } + } + if (p->cachable) { header = (ngx_http_cache_header_t *) p->header_in->start; diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index e06198ea0..086e57dd4 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -662,7 +662,7 @@ static char *ngx_server_block(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy) return rv; } - ngx_qsort(cscf->locations.elts, cscf->locations.nelts, + ngx_qsort(cscf->locations.elts, (size_t) cscf->locations.nelts, sizeof(void *), ngx_cmp_locations); return rv; diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c index fa037ddff..07da10d33 100644 --- a/src/http/ngx_http_parse.c +++ b/src/http/ngx_http_parse.c @@ -392,6 +392,10 @@ int ngx_http_parse_request_line(ngx_http_request_t *r) return NGX_HTTP_PARSE_INVALID_REQUEST; } break; + + /* suppress warning */ + case sw_done: + break; } } @@ -595,6 +599,11 @@ int ngx_http_parse_header_line(ngx_http_request_t *r, ngx_hunk_t *h) return NGX_HTTP_PARSE_INVALID_HEADER; } break; + + /* suppress warning */ + case sw_done: + case sw_header_done: + break; } } diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index ccaa73f7d..1a6485fa8 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -1116,10 +1116,20 @@ static void ngx_http_set_keepalive(ngx_http_request_t *r) wev = c->write; wev->event_handler = ngx_http_empty_handler; - if ((ngx_event_flags & NGX_USE_LEVEL_EVENT) && wev->active) { - if (ngx_del_event(wev, NGX_WRITE_EVENT, 0) == NGX_ERROR) { - ngx_http_close_connection(c); - return; + if (wev->active) { + if (ngx_event_flags & NGX_HAVE_KQUEUE_EVENT) { + if (ngx_del_event(wev, NGX_WRITE_EVENT, NGX_DISABLE_EVENT) + == NGX_ERROR) + { + ngx_http_close_connection(c); + return; + } + + } else if (ngx_event_flags & NGX_USE_LEVEL_EVENT) { + if (ngx_del_event(wev, NGX_WRITE_EVENT, 0) == NGX_ERROR) { + ngx_http_close_connection(c); + return; + } } } @@ -1218,11 +1228,20 @@ static void ngx_http_set_lingering_close(ngx_http_request_t *r) wev = c->write; wev->event_handler = ngx_http_empty_handler; - if ((ngx_event_flags & NGX_USE_LEVEL_EVENT) && wev->active) { - if (ngx_del_event(wev, NGX_WRITE_EVENT, 0) == NGX_ERROR) { - ngx_http_close_request(r, 0); - ngx_http_close_connection(c); - return; + if (wev->active) { + if (ngx_event_flags & NGX_HAVE_KQUEUE_EVENT) { + if (ngx_del_event(wev, NGX_WRITE_EVENT, NGX_DISABLE_EVENT) + == NGX_ERROR) + { + ngx_http_close_connection(c); + return; + } + + } else if (ngx_event_flags & NGX_USE_LEVEL_EVENT) { + if (ngx_del_event(wev, NGX_WRITE_EVENT, 0) == NGX_ERROR) { + ngx_http_close_connection(c); + return; + } } } |