diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/nginx.c | 12 | ||||
| -rw-r--r-- | src/core/nginx.h | 19 | ||||
| -rw-r--r-- | src/core/ngx_connection.c | 4 | ||||
| -rw-r--r-- | src/core/ngx_connection.h | 10 |
4 files changed, 33 insertions, 12 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c index 34f204f43..005417ced 100644 --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -203,6 +203,15 @@ int main(int argc, char *const *argv, char **envp) ccf->pid.data = NGINX_PID; ccf->newpid.len = sizeof(NGINX_NEW_PID) - 1; ccf->newpid.data = NGINX_NEW_PID; + + } else { + ccf->newpid.len = ccf->pid.len + sizeof(NGINX_NEW_PID_EXT); + if (!(ccf->newpid.data = ngx_alloc(ccf->newpid.len, cycle->log))) { + return 1; + } + + ngx_memcpy(ngx_cpymem(ccf->newpid.data, ccf->pid.data, ccf->pid.len), + NGINX_NEW_PID_EXT, sizeof(NGINX_NEW_PID_EXT)); } len = ngx_snprintf(pid, /* STUB */ 10, PID_T_FMT, ngx_getpid()); @@ -785,7 +794,7 @@ static ngx_int_t ngx_getopt(ngx_master_ctx_t *ctx, ngx_cycle_t *cycle) } } - if (cycle->conf_file.len == NULL) { + if (cycle->conf_file.data == NULL) { cycle->conf_file.len = sizeof(NGINX_CONF) - 1; cycle->conf_file.data = NGINX_CONF; } @@ -814,6 +823,7 @@ static ngx_int_t ngx_core_module_init(ngx_cycle_t *cycle) /* set by pcalloc() * * ccf->pid = NULL; + * ccf->newpid = NULL; */ ccf->daemon = NGX_CONF_UNSET; ccf->master = NGX_CONF_UNSET; diff --git a/src/core/nginx.h b/src/core/nginx.h index 99423d32a..eb7fe93ad 100644 --- a/src/core/nginx.h +++ b/src/core/nginx.h @@ -2,19 +2,20 @@ #define _NGINX_H_INCLUDED_ -#define NGINX_VER "nginx/0.0.2" -#define NGINX_CONF "nginx.conf" -#define NGINX_PID "nginx.pid" -#define NGINX_NEW_PID NGINX_PID ".newbin" +#define NGINX_VER "nginx/0.0.2" +#define NGINX_CONF "nginx.conf" +#define NGINX_PID "nginx.pid" +#define NGINX_NEW_PID_EXT ".newbin" +#define NGINX_NEW_PID NGINX_PID NGINX_NEW_PID_EXT -#define NGINX_VAR "NGINX=" -#define NGINX_VAR_LEN (sizeof(NGINX_VAR) - 1) +#define NGINX_VAR "NGINX=" +#define NGINX_VAR_LEN (sizeof(NGINX_VAR) - 1) -extern ngx_module_t ngx_core_module; +extern ngx_module_t ngx_core_module; -extern ngx_uint_t ngx_connection_counter; +extern ngx_uint_t ngx_connection_counter; -extern ngx_int_t ngx_process; +extern ngx_int_t ngx_process; #endif /* _NGINX_H_INCLUDED_ */ diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c index e0b24fa63..115748432 100644 --- a/src/core/ngx_connection.c +++ b/src/core/ngx_connection.c @@ -243,14 +243,14 @@ ngx_int_t ngx_connection_error(ngx_connection_t *c, ngx_err_t err, char *text) ngx_int_t level; if (err == NGX_ECONNRESET - && c->read->log_error == NGX_ERROR_IGNORE_ECONNRESET) + && c->log_error == NGX_ERROR_IGNORE_ECONNRESET) { return 0; } if (err == NGX_ECONNRESET || err == NGX_EPIPE || err == NGX_ENOTCONN) { - switch (c->read->log_error) { + switch (c->log_error) { case NGX_ERROR_INFO: level = NGX_LOG_INFO; diff --git a/src/core/ngx_connection.h b/src/core/ngx_connection.h index 6f87fd2d8..835f5e1cb 100644 --- a/src/core/ngx_connection.h +++ b/src/core/ngx_connection.h @@ -52,6 +52,14 @@ typedef struct { } ngx_listening_t; +typedef enum { + NGX_ERROR_CRIT = 0, + NGX_ERROR_ERR, + NGX_ERROR_INFO, + NGX_ERROR_IGNORE_ECONNRESET +} ngx_connection_log_error_e; + + struct ngx_connection_s { void *data; ngx_event_t *read; @@ -84,6 +92,8 @@ struct ngx_connection_s { ngx_int_t number; + unsigned log_error:2; /* ngx_connection_log_error_e */ + unsigned pipeline:1; unsigned unexpected_eof:1; signed tcp_nopush:2; |
