refactoring, more config, packaging

This commit is contained in:
John Smith
2022-05-16 11:52:48 -04:00
parent 444f65d76d
commit ef1f5d7b52
42 changed files with 1329 additions and 368 deletions

View File

@@ -88,14 +88,29 @@ impl ClientApiConnection {
}
async fn process_veilid_state<'a>(
&'a mut self,
state: veilid_state::Reader<'a>,
veilid_state: veilid_state::Reader<'a>,
) -> Result<(), String> {
let mut inner = self.inner.borrow_mut();
// Process attachment state
let attachment = state.reborrow().get_attachment().map_err(map_to_string)?;
let state = attachment.get_state().map_err(map_to_string)?;
inner.comproc.update_attachment(state);
let attachment = veilid_state
.reborrow()
.get_attachment()
.map_err(map_to_string)?;
let attachment_state = attachment.get_state().map_err(map_to_string)?;
let network = veilid_state
.reborrow()
.get_network()
.map_err(map_to_string)?;
let started = network.get_started();
let bps_down = network.get_bps_down();
let bps_up = network.get_bps_up();
inner.comproc.update_attachment(attachment_state);
inner
.comproc
.update_network_status(started, bps_down, bps_up);
Ok(())
}