Merge pull request #82 from uqbar-dao/dr/kernel-bugfixes

bugfixes!
This commit is contained in:
dr-frmr 2023-11-30 15:16:43 -05:00 committed by GitHub
commit 89c00c6cc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 37 additions and 44 deletions

2
Cargo.lock generated
View File

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

View File

@ -1,4 +1,3 @@
Last updated: 11/01/23
## Setup ## Setup
### Building components ### Building components

View File

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

View File

@ -201,8 +201,9 @@ async fn handle_kernel_request(
valid_capabilities.insert(cap); valid_capabilities.insert(cap);
} }
// if process is not public, give the initializer and itself the messaging cap. // give the initializer and itself the messaging cap.
if !public { // NOTE: we do this even if the process is public, because
// a process might redundantly call grant_messaging.
valid_capabilities.insert(t::Capability { valid_capabilities.insert(t::Capability {
issuer: t::Address { issuer: t::Address {
node: our_name.clone(), node: our_name.clone(),
@ -224,7 +225,6 @@ async fn handle_kernel_request(
}) })
.await .await
.expect("event loop: fatal: sender died"); .expect("event loop: fatal: sender died");
}
// fires "success" response back if successful // fires "success" response back if successful
match start_process( match start_process(

View File

@ -354,19 +354,13 @@ impl ProcessState {
println!("need non-None prompting_message to handle Response"); println!("need non-None prompting_message to handle Response");
return None; return None;
}; };
Some((
prompting_message.id,
match &prompting_message.rsvp { match &prompting_message.rsvp {
None => { None => prompting_message.source.clone(),
let _ = self Some(address) => address.clone(),
.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())),
}
} }
} }
@ -419,7 +413,7 @@ pub async fn make_process_loop(
} }
let component = 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); let mut linker = Linker::new(&engine);
Process::add_to_linker(&mut linker, |state: &mut ProcessWasi| state).unwrap(); Process::add_to_linker(&mut linker, |state: &mut ProcessWasi| state).unwrap();
@ -564,7 +558,10 @@ pub async fn make_process_loop(
.unwrap(), .unwrap(),
metadata: None, metadata: None,
}), }),
payload: None, payload: Some(t::Payload {
mime: None,
bytes: wasm_bytes,
}),
signed_capabilities: None, signed_capabilities: None,
}) })
.await .await