diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/ngx_cycle.c | 20 | ||||
-rw-r--r-- | src/http/ngx_http_headers.c | 2 |
2 files changed, 8 insertions, 14 deletions
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c index 7fcc67908..4e61a5476 100644 --- a/src/core/ngx_cycle.c +++ b/src/core/ngx_cycle.c @@ -226,20 +226,14 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle) } } -#if (WIN32) -#if 0 - /* TODO: TEST */ -fprintf(stderr, "BEFORE\n"); - CloseHandle(GetStdHandle(STD_ERROR_HANDLE)); - SetStdHandle(STD_ERROR_HANDLE, cycle->log->file->fd); -fprintf(stderr, "AFTER\n"); -#endif -#else +#if !(WIN32) + if (dup2(cycle->log->file->fd, STDERR_FILENO) == NGX_ERROR) { ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "dup2(STDERR) failed"); failed = 1; } + #endif if (failed) { @@ -454,15 +448,13 @@ void ngx_reopen_files(ngx_cycle_t *cycle, ngx_uid_t user) file[i].fd = fd; } -#if (WIN32) - /* TODO: TEST */ - CloseHandle(GetStdHandle(STD_ERROR_HANDLE)); - SetStdHandle(STD_ERROR_HANDLE, cycle->log->file->fd); -#else +#if !(WIN32) + if (dup2(cycle->log->file->fd, STDERR_FILENO) == -1) { ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, "dup2(STDERR) failed"); } + #endif } diff --git a/src/http/ngx_http_headers.c b/src/http/ngx_http_headers.c index 128744917..1820ea768 100644 --- a/src/http/ngx_http_headers.c +++ b/src/http/ngx_http_headers.c @@ -19,8 +19,10 @@ ngx_http_header_t ngx_http_headers_in[] = { { ngx_string("If-Range"), offsetof(ngx_http_headers_in_t, if_range) }, #endif +#if (NGX_HTTP_GZIP) { ngx_string("Accept-Encoding"), offsetof(ngx_http_headers_in_t, accept_encoding) }, +#endif { ngx_string("Authorization"), offsetof(ngx_http_headers_in_t, authorization) }, |