hotfix on ws connections
This commit is contained in:
parent
bae5443ca4
commit
2e6e7efdbf
@ -50,11 +50,16 @@ pub async fn websocketpubsub(
|
||||
continue;
|
||||
}
|
||||
};
|
||||
if tosend.ipdata.clone().unwrap().hostname != gethostname(true)
|
||||
|| tosend.msgtype == "init".to_string()
|
||||
{
|
||||
let txps = txpubsub.read().await;
|
||||
txps.send(tosend).await.unwrap();
|
||||
match tosend.ipdata.clone() {
|
||||
Some(o) => {
|
||||
if o.hostname != gethostname(true)
|
||||
|| tosend.msgtype == "init".to_string()
|
||||
{
|
||||
let txps = txpubsub.read().await;
|
||||
txps.send(tosend).await.unwrap();
|
||||
}
|
||||
}
|
||||
None => {}
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
@ -111,7 +116,9 @@ pub async fn send_to_ipbl_websocket(
|
||||
}
|
||||
};
|
||||
} else {
|
||||
println!("can't write to socket");
|
||||
ws.close(None).unwrap_or(());
|
||||
sleep_s(1);
|
||||
return false;
|
||||
};
|
||||
|
||||
@ -125,6 +132,8 @@ pub async fn send_to_ipbl_websocket(
|
||||
}
|
||||
};
|
||||
} else {
|
||||
println!("can't read from socket");
|
||||
sleep_s(1);
|
||||
ws.close(None).unwrap_or(());
|
||||
return false;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user