mirror of https://github.com/ospab/ostp.git
fix(client): resolve borrow after move error in bridge.rs and clean up warnings
This commit is contained in:
parent
9f143f730a
commit
0fdea7ee21
|
|
@ -335,7 +335,7 @@ impl Bridge {
|
|||
tx.send(UiEvent::Log(start_msg.to_string())).await.ok();
|
||||
|
||||
// Send an immediate Ping so the UI updates without a 60s delay
|
||||
for session in sessions.iter_mut() {
|
||||
for session in sessions_opt.as_mut().unwrap().iter_mut() {
|
||||
let ts = SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_millis() as u64;
|
||||
let ping_payload = Bytes::from(RelayMessage::Ping(ts).encode());
|
||||
if let Ok(ProtocolAction::SendDatagram(frame)) = session.machine.on_event(OstpEvent::Outbound(0, ping_payload)) {
|
||||
|
|
@ -516,7 +516,7 @@ impl Bridge {
|
|||
let _ = tx.send(UiEvent::Log("Background reconnect successful! Connection restored.".into())).await;
|
||||
|
||||
// Send an immediate Ping so the UI updates without a 60s delay
|
||||
for session in new_sessions.iter_mut() {
|
||||
for session in sessions_opt.as_mut().unwrap().iter_mut() {
|
||||
let ts = SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_millis() as u64;
|
||||
let ping_payload = Bytes::from(RelayMessage::Ping(ts).encode());
|
||||
if let Ok(ProtocolAction::SendDatagram(frame)) = session.machine.on_event(OstpEvent::Outbound(0, ping_payload)) {
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ impl tokio::io::AsyncRead for RealityStream {
|
|||
}
|
||||
|
||||
impl tokio::io::AsyncWrite for RealityStream {
|
||||
fn poll_write(mut self: Pin<&mut Self>, cx: &mut TaskContext<'_>, buf: &[u8]) -> Poll<std::io::Result<usize>> {
|
||||
fn poll_write(self: Pin<&mut Self>, cx: &mut TaskContext<'_>, buf: &[u8]) -> Poll<std::io::Result<usize>> {
|
||||
let this = self.get_mut();
|
||||
while !this.tx_buf.is_empty() {
|
||||
match Pin::new(&mut this.inner).poll_write(cx, &this.tx_buf) {
|
||||
|
|
@ -217,7 +217,7 @@ impl tokio::io::AsyncWrite for RealityStream {
|
|||
}
|
||||
}
|
||||
|
||||
fn poll_flush(mut self: Pin<&mut Self>, cx: &mut TaskContext<'_>) -> Poll<std::io::Result<()>> {
|
||||
fn poll_flush(self: Pin<&mut Self>, cx: &mut TaskContext<'_>) -> Poll<std::io::Result<()>> {
|
||||
let this = self.get_mut();
|
||||
while !this.tx_buf.is_empty() {
|
||||
match Pin::new(&mut this.inner).poll_write(cx, &this.tx_buf) {
|
||||
|
|
@ -229,7 +229,7 @@ impl tokio::io::AsyncWrite for RealityStream {
|
|||
Pin::new(&mut this.inner).poll_flush(cx)
|
||||
}
|
||||
|
||||
fn poll_shutdown(mut self: Pin<&mut Self>, cx: &mut TaskContext<'_>) -> Poll<std::io::Result<()>> {
|
||||
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut TaskContext<'_>) -> Poll<std::io::Result<()>> {
|
||||
let this = self.get_mut();
|
||||
while !this.tx_buf.is_empty() {
|
||||
match Pin::new(&mut this.inner).poll_write(cx, &this.tx_buf) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue