diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/nginx.c | 2 | ||||
-rw-r--r-- | src/core/nginx.h | 4 | ||||
-rw-r--r-- | src/core/ngx_conf_file.c | 5 | ||||
-rw-r--r-- | src/core/ngx_string.c | 35 |
4 files changed, 25 insertions, 21 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c index 19feb0700..f21e77d30 100644 --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -649,7 +649,7 @@ ngx_exec_new_binary(ngx_cycle_t *cycle, char *const *argv) if (ngx_rename_file(ccf->oldpid.data, ccf->pid.data) != NGX_OK) { ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, ngx_rename_file_n " %s back to %s failed after " - "the try to execute the new binary process \"%s\"", + "an attempt to execute new binary process \"%s\"", ccf->oldpid.data, ccf->pid.data, argv[0]); } } diff --git a/src/core/nginx.h b/src/core/nginx.h index 3e147dcb7..ca777f6d5 100644 --- a/src/core/nginx.h +++ b/src/core/nginx.h @@ -9,8 +9,8 @@ #define _NGINX_H_INCLUDED_ -#define nginx_version 1001019 -#define NGINX_VERSION "1.1.19" +#define nginx_version 1002000 +#define NGINX_VERSION "1.2.0" #define NGINX_VER "nginx/" NGINX_VERSION #define NGINX_VAR "NGINX" diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c index 6d998a5f0..892fa4719 100644 --- a/src/core/ngx_conf_file.c +++ b/src/core/ngx_conf_file.c @@ -465,7 +465,7 @@ ngx_conf_read_token(ngx_conf_t *cf) if (cf->conf_file->file.offset >= file_size) { - if (cf->args->nelts > 0) { + if (cf->args->nelts > 0 || !last_space) { if (cf->conf_file->file.fd == NGX_INVALID_FILE) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, @@ -1481,7 +1481,8 @@ ngx_conf_check_num_bounds(ngx_conf_t *cf, void *post, void *data) } ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "value must be equal or more than %i", bounds->low); + "value must be equal to or greater than %i", + bounds->low); return NGX_CONF_ERROR; } diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c index 1dec96cc4..8aaa1d2ed 100644 --- a/src/core/ngx_string.c +++ b/src/core/ngx_string.c @@ -146,12 +146,12 @@ ngx_vslprintf(u_char *buf, u_char *last, const char *fmt, va_list args) { u_char *p, zero; int d; - double f, scale; + double f; size_t len, slen; int64_t i64; - uint64_t ui64; + uint64_t ui64, frac; ngx_msec_t ms; - ngx_uint_t width, sign, hex, max_width, frac_width, n; + ngx_uint_t width, sign, hex, max_width, frac_width, scale, n; ngx_str_t *v; ngx_variable_value_t *vv; @@ -365,28 +365,31 @@ ngx_vslprintf(u_char *buf, u_char *last, const char *fmt, va_list args) } ui64 = (int64_t) f; - - buf = ngx_sprintf_num(buf, last, ui64, zero, 0, width); + frac = 0; if (frac_width) { - if (buf < last) { - *buf++ = '.'; + scale = 1; + for (n = frac_width; n; n--) { + scale *= 10; } - scale = 1.0; + frac = (uint64_t) ((f - (double) ui64) * scale + 0.5); - for (n = frac_width; n; n--) { - scale *= 10.0; + if (frac == scale) { + ui64++; + frac = 0; } + } - /* - * (int64_t) cast is required for msvc6: - * it cannot convert uint64_t to double - */ - ui64 = (uint64_t) ((f - (int64_t) ui64) * scale + 0.5); + buf = ngx_sprintf_num(buf, last, ui64, zero, 0, width); + + if (frac_width) { + if (buf < last) { + *buf++ = '.'; + } - buf = ngx_sprintf_num(buf, last, ui64, '0', 0, frac_width); + buf = ngx_sprintf_num(buf, last, frac, '0', 0, frac_width); } fmt++; |