mirror of
https://github.com/Xevion/dynamic-preauth.git
synced 2025-12-06 01:14:55 -06:00
Copy send_message result for send_state
This commit is contained in:
@@ -105,7 +105,9 @@ async fn handle_socket(session_id: u32, websocket: WebSocket) {
|
|||||||
.expect("Unable to get session");
|
.expect("Unable to get session");
|
||||||
session.tx = Some(tx_channel);
|
session.tx = Some(tx_channel);
|
||||||
|
|
||||||
session.send_state();
|
session
|
||||||
|
.send_state()
|
||||||
|
.expect("Failed to buffer state message");
|
||||||
session
|
session
|
||||||
.send_message(executable_message)
|
.send_message(executable_message)
|
||||||
.expect("Failed to buffer executables message");
|
.expect("Failed to buffer executables message");
|
||||||
@@ -196,7 +198,9 @@ pub async fn download(req: &mut Request, res: &mut Response, depot: &mut Depot)
|
|||||||
|
|
||||||
// Don't try to send state if somehow the session has not connected
|
// Don't try to send state if somehow the session has not connected
|
||||||
if session.tx.is_some() {
|
if session.tx.is_some() {
|
||||||
session.send_state();
|
session
|
||||||
|
.send_state()
|
||||||
|
.expect("Failed to buffer state message");
|
||||||
} else {
|
} else {
|
||||||
tracing::warn!("Download being made without any connection websocket");
|
tracing::warn!("Download being made without any connection websocket");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,12 +67,12 @@ impl Session {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn send_state(&mut self) {
|
pub fn send_state(&mut self) -> Result<(), anyhow::Error> {
|
||||||
let message = OutgoingMessage::State {
|
let message = OutgoingMessage::State {
|
||||||
session: self.clone(),
|
session: self.clone(),
|
||||||
};
|
};
|
||||||
|
|
||||||
self.send_message(message);
|
self.send_message(message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user