summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authoroxpa <iippolitov@gmail.com>2024-03-26 13:57:15 +0000
committeroxpa <iippolitov@gmail.com>2024-03-26 13:57:15 +0000
commit0e79d961bb1ea68674961da1703ffedb1ddf6e43 (patch)
tree19cc39382fb7aebc59e3b989edd50d759e371e60 /src
parentd76761901c4084bcdbc5a449e9bbb47d56b7093c (diff)
parent48d79170596d9923f2612d25e5a62ca0999b4313 (diff)
downloadunit-0e79d961bb1ea68674961da1703ffedb1ddf6e43.tar.gz
unit-0e79d961bb1ea68674961da1703ffedb1ddf6e43.tar.bz2
Merge tag '1.32.1' into packaging1.32.1-1
Unit 1.32.1 release.
Diffstat (limited to '')
-rw-r--r--src/nxt_var.c2
-rw-r--r--src/wasm-wasi-component/src/lib.rs15
2 files changed, 13 insertions, 4 deletions
diff --git a/src/nxt_var.c b/src/nxt_var.c
index 2600371b..57110f66 100644
--- a/src/nxt_var.c
+++ b/src/nxt_var.c
@@ -147,7 +147,7 @@ nxt_var_ref_get(nxt_tstr_state_t *state, nxt_str_t *name, nxt_mp_t *mp)
if (decl != NULL) {
ref->handler = decl->handler;
- ref->cacheable = decl->cacheable;
+ ref->cacheable = (mp == state->pool) ? decl->cacheable : 0;
goto done;
}
diff --git a/src/wasm-wasi-component/src/lib.rs b/src/wasm-wasi-component/src/lib.rs
index 3ee40c4f..b0552e81 100644
--- a/src/wasm-wasi-component/src/lib.rs
+++ b/src/wasm-wasi-component/src/lib.rs
@@ -4,6 +4,7 @@ use http_body_util::combinators::BoxBody;
use http_body_util::{BodyExt, Full};
use std::ffi::{CStr, CString};
use std::mem::MaybeUninit;
+use std::process::exit;
use std::ptr;
use std::sync::OnceLock;
use tokio::sync::mpsc;
@@ -101,7 +102,9 @@ unsafe extern "C" fn start(
task: *mut bindings::nxt_task_t,
data: *mut bindings::nxt_process_data_t,
) -> bindings::nxt_int_t {
- handle_result(task, || {
+ let mut rc: i32 = 0;
+
+ let result = handle_result(task, || {
let config = GLOBAL_CONFIG.get().unwrap();
let state = GlobalState::new(&config)
.context("failed to create initial state")?;
@@ -123,11 +126,17 @@ unsafe extern "C" fn start(
bail!("nxt_unit_init() failed");
}
- bindings::nxt_unit_run(unit_ctx);
+ rc = bindings::nxt_unit_run(unit_ctx);
bindings::nxt_unit_done(unit_ctx);
Ok(())
- })
+ });
+
+ if result != bindings::NXT_OK as bindings::nxt_int_t {
+ return result;
+ }
+
+ exit(rc);
}
unsafe fn handle_result(