diff options
author | Valentin Bartenev <vbart@nginx.com> | 2020-07-21 20:27:37 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2020-07-21 20:27:37 +0300 |
commit | f46ef1b121e421eb4b773dd9a3a951bb021b66ff (patch) | |
tree | d10a418f1928afa0836109b5a8b517d2d3633e31 /src | |
parent | f69d4707527da8c48e93cb49f85c71c890ae8edd (diff) | |
download | unit-f46ef1b121e421eb4b773dd9a3a951bb021b66ff.tar.gz unit-f46ef1b121e421eb4b773dd9a3a951bb021b66ff.tar.bz2 |
PHP: fixed incorrect time in interpreter error log messages.
Previously, the log message callback used a generic log function, that relied on the process time cache.
Since there were no time update calls in the application processes, all log lines were printed with the
same time, usually correlated with the process start.
Now, a non-cached logging function from libunit is used.
Diffstat (limited to 'src')
-rw-r--r-- | src/nxt_php_sapi.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nxt_php_sapi.c b/src/nxt_php_sapi.c index 7ae8484d..ab888f57 100644 --- a/src/nxt_php_sapi.c +++ b/src/nxt_php_sapi.c @@ -251,9 +251,9 @@ NXT_EXPORT nxt_app_module_t nxt_app_module = { static nxt_php_target_t *nxt_php_targets; static nxt_int_t nxt_php_last_target = -1; -static nxt_task_t *nxt_php_task; +static nxt_unit_ctx_t *nxt_php_unit_ctx; #if defined(ZTS) && PHP_VERSION_ID < 70400 -static void ***tsrm_ls; +static void ***tsrm_ls; #endif @@ -277,8 +277,6 @@ nxt_php_start(nxt_task_t *task, nxt_process_data_t *data) static nxt_str_t user_str = nxt_string("user"); static nxt_str_t admin_str = nxt_string("admin"); - nxt_php_task = task; - conf = data->app; c = &conf->u.php; @@ -405,6 +403,8 @@ nxt_php_start(nxt_task_t *task, nxt_process_data_t *data) return NXT_ERROR; } + nxt_php_unit_ctx = unit_ctx; + nxt_unit_run(unit_ctx); nxt_unit_done(unit_ctx); @@ -1277,5 +1277,6 @@ static void nxt_php_log_message(char *message TSRMLS_DC) #endif { - nxt_log(nxt_php_task, NXT_LOG_NOTICE, "php message: %s", message); + nxt_unit_log(nxt_php_unit_ctx, NXT_UNIT_LOG_NOTICE, + "php message: %s", message); } |