mirror of https://github.com/ospab/ostp.git
Fix Speedtest disconnects and Discord WebRTC
This commit is contained in:
parent
2ba9a3694d
commit
0334322aae
|
|
@ -180,8 +180,8 @@ where
|
||||||
R: tokio::io::AsyncRead + Unpin + Send + 'static,
|
R: tokio::io::AsyncRead + Unpin + Send + 'static,
|
||||||
W: tokio::io::AsyncWrite + Unpin + Send + 'static,
|
W: tokio::io::AsyncWrite + Unpin + Send + 'static,
|
||||||
{
|
{
|
||||||
let (app_tx, mut tx_rx) = mpsc::channel::<Bytes>(1024);
|
let (app_tx, mut tx_rx) = mpsc::channel::<Bytes>(16384);
|
||||||
let (rx_tx, app_rx) = mpsc::channel::<Bytes>(1024);
|
let (rx_tx, app_rx) = mpsc::channel::<Bytes>(16384);
|
||||||
|
|
||||||
// TX Loop (App -> UoT -> Network): prefix each frame with u16 BE length
|
// TX Loop (App -> UoT -> Network): prefix each frame with u16 BE length
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ pub async fn handle_relay_message(
|
||||||
if debug {
|
if debug {
|
||||||
let _ = ui_event_tx.send(UiEvent::Log(format!("Relay UDP ASSOCIATE stream_id={stream_id}")));
|
let _ = ui_event_tx.send(UiEvent::Log(format!("Relay UDP ASSOCIATE stream_id={stream_id}")));
|
||||||
}
|
}
|
||||||
let server_udp = match UdpSocket::bind("0.0.0.0:0").await {
|
let server_udp = match UdpSocket::bind("[::]:0").await.or_else(|_| UdpSocket::bind("0.0.0.0:0").await) {
|
||||||
Ok(s) => std::sync::Arc::new(s),
|
Ok(s) => std::sync::Arc::new(s),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
let _ = ui_event_tx.send(UiEvent::Log(format!("UDP bind failed: {e}")));
|
let _ = ui_event_tx.send(UiEvent::Log(format!("UDP bind failed: {e}")));
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ where
|
||||||
info!("UoT client authenticated from {}", peer_addr);
|
info!("UoT client authenticated from {}", peer_addr);
|
||||||
|
|
||||||
// Register this connection in the map
|
// Register this connection in the map
|
||||||
let (tx, mut rx) = mpsc::channel::<Bytes>(1024);
|
let (tx, mut rx) = mpsc::channel::<Bytes>(16384);
|
||||||
{
|
{
|
||||||
tcp_map.write().await.insert(peer_addr, tx);
|
tcp_map.write().await.insert(peer_addr, tx);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue