bugfixes!

This commit is contained in:
dr-frmr 2023-11-30 15:14:11 -05:00
parent 402a1d2170
commit eb5924661d
No known key found for this signature in database
4 changed files with 37 additions and 43 deletions

2
Cargo.lock generated
View File

@ -5093,7 +5093,7 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
[[package]]
name = "uqbar"
version = "0.3.0"
version = "0.4.0"
dependencies = [
"aes-gcm 0.10.2",
"anyhow",

View File

@ -585,9 +585,6 @@ async fn handle_app_message(
// the receiver will automatically trigger a 503 when sender is dropped.
return;
};
let Some((_id, (path, channel))) = http_response_senders.remove(&km.id) else {
return;
};
// XX REFACTOR THIS:
// for the login case, todo refactor out?
let segments: Vec<&str> = path
@ -638,7 +635,7 @@ async fn handle_app_message(
}
}
}
let _ = channel.send((
let _ = sender.send((
HttpResponse {
status: response.status,
headers: response.headers,

View File

@ -201,30 +201,30 @@ async fn handle_kernel_request(
valid_capabilities.insert(cap);
}
// if process is not public, give the initializer and itself the messaging cap.
if !public {
valid_capabilities.insert(t::Capability {
issuer: t::Address {
node: our_name.clone(),
process: id.clone(),
},
params: "\"messaging\"".into(),
});
caps_oracle
.send(t::CapMessage::Add {
on: km.source.process.clone(),
cap: t::Capability {
issuer: t::Address {
node: our_name.clone(),
process: id.clone(),
},
params: "\"messaging\"".into(),
// give the initializer and itself the messaging cap.
// NOTE: we do this even if the process is public, because
// a process might redundantly call grant_messaging.
valid_capabilities.insert(t::Capability {
issuer: t::Address {
node: our_name.clone(),
process: id.clone(),
},
params: "\"messaging\"".into(),
});
caps_oracle
.send(t::CapMessage::Add {
on: km.source.process.clone(),
cap: t::Capability {
issuer: t::Address {
node: our_name.clone(),
process: id.clone(),
},
responder: tokio::sync::oneshot::channel().0,
})
.await
.expect("event loop: fatal: sender died");
}
params: "\"messaging\"".into(),
},
responder: tokio::sync::oneshot::channel().0,
})
.await
.expect("event loop: fatal: sender died");
// fires "success" response back if successful
match start_process(

View File

@ -354,19 +354,13 @@ impl ProcessState {
println!("need non-None prompting_message to handle Response");
return None;
};
match &prompting_message.rsvp {
None => {
let _ = self
.send_to_terminal
.send(t::Printout {
verbosity: 1,
content: "kernel: prompting_message has no rsvp".into(),
})
.await;
None
}
Some(address) => Some((prompting_message.id, address.clone())),
}
Some((
prompting_message.id,
match &prompting_message.rsvp {
None => prompting_message.source.clone(),
Some(address) => address.clone(),
},
))
}
}
@ -419,7 +413,7 @@ pub async fn make_process_loop(
}
let component =
Component::new(&engine, wasm_bytes).expect("make_process_loop: couldn't read file");
Component::new(&engine, wasm_bytes.clone()).expect("make_process_loop: couldn't read file");
let mut linker = Linker::new(&engine);
Process::add_to_linker(&mut linker, |state: &mut ProcessWasi| state).unwrap();
@ -564,7 +558,10 @@ pub async fn make_process_loop(
.unwrap(),
metadata: None,
}),
payload: None,
payload: Some(t::Payload {
mime: None,
bytes: wasm_bytes,
}),
signed_capabilities: None,
})
.await