#889: drop the hub write-cap and core-limit changes (neither is read)

This commit is contained in:
bflatastic
2026-10-20 04:22:26 +07:00
parent ca0e689834
commit 89529b3d00
2 changed files with 10 additions and 12 deletions
+9 -11
View File
@@ -860,7 +860,7 @@ fn serve(mut stream: TcpStream, conn: u64, hub: &Sender<HubIn>, limits: NetLimit
let Ok(peer) = stream.peer_addr().map(|a| a.ip().to_canonical()) else { return };
let proxied = limits.trusted_proxy.is_some_and(|p| p.to_canonical() == peer);
let Ok((rd, wr, sock)) = Duplex::split(stream, None) else { return };
let write_cfg = config(limits.max_server_message);
let cfg = config(limits.max_client_message);
let mut forwarded = None;
// The handshake callback's type is tungstenite's (its error is an HTTP response).
#[allow(clippy::result_large_err)]
@@ -904,16 +904,14 @@ fn serve(mut stream: TcpStream, conn: u64, hub: &Sender<HubIn>, limits: NetLimit
max_block: limits.max_queued_block,
max_all: limits.max_queued_total,
};
let writer = match sock
.try_clone()
.map(|s| spawn("live-write", move || write_loop(WebSocket::from_raw_socket(wr, Role::Server, Some(write_cfg)), &rx, &s)))
{
Ok(Ok(t)) => t,
_ => {
shutdown(&sock);
return;
}
};
let writer =
match sock.try_clone().map(|s| spawn("live-write", move || write_loop(WebSocket::from_raw_socket(wr, Role::Server, Some(cfg)), &rx, &s))) {
Ok(Ok(t)) => t,
_ => {
shutdown(&sock);
return;
}
};
let end = |why: Option<&str>| {
if let Some(why) = why {
refuse(&out, why);
+1 -1
View File
@@ -139,7 +139,7 @@ impl LiveLink for NetLink {
doc,
name: o.name,
limits: self.limits,
core: figcraft_collab::Limits { max_message_bytes: self.limits.max_server_message, ..figcraft_collab::Limits::default() },
core: figcraft_collab::Limits::default(),
};
let host = Host::start(cfg, inbox.clone()).map_err(|e| format!("can't listen on {ip}: {e}"))?;
let invite = Invite::new(host.addr().to_string(), file, token);