mirror of
https://github.com/rustdesk/rustdesk-server.git
synced 2026-12-01 02:04:35 +00:00
fix: write complete administrative console responses (#717)
* fix: write complete administrative console responses * Document changed function contracts
This commit is contained in:
1 parent
1bd3938cfe
commit
36a0996ee8
2 files changed
+4
-2
No files matched your search
+2
-1
@@ -385,6 +385,7 @@ async fn io_loop(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Accepts a relay connection and routes loopback console requests separately.
|
||||||
async fn handle_connection(
|
async fn handle_connection(
|
||||||
stream: TcpStream,
|
stream: TcpStream,
|
||||||
addr: SocketAddr,
|
addr: SocketAddr,
|
||||||
@@ -401,7 +402,7 @@ async fn handle_connection(
|
|||||||
if let Ok(Ok(n)) = timeout(1000, stream.read(&mut buffer[..])).await {
|
if let Ok(Ok(n)) = timeout(1000, stream.read(&mut buffer[..])).await {
|
||||||
if let Ok(data) = std::str::from_utf8(&buffer[..n]) {
|
if let Ok(data) = std::str::from_utf8(&buffer[..n]) {
|
||||||
let res = check_cmd(data, limiter).await;
|
let res = check_cmd(data, limiter).await;
|
||||||
stream.write(res.as_bytes()).await.ok();
|
stream.write_all(res.as_bytes()).await.ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1167,6 +1167,7 @@ impl RendezvousServer {
|
|||||||
res
|
res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Handles loopback console requests and external NAT or online-status queries.
|
||||||
async fn handle_listener2(&self, stream: TcpStream, addr: SocketAddr) {
|
async fn handle_listener2(&self, stream: TcpStream, addr: SocketAddr) {
|
||||||
let mut rs = self.clone();
|
let mut rs = self.clone();
|
||||||
let ip = try_into_v4(addr).ip();
|
let ip = try_into_v4(addr).ip();
|
||||||
@@ -1177,7 +1178,7 @@ impl RendezvousServer {
|
|||||||
if let Ok(Ok(n)) = timeout(1000, stream.read(&mut buffer[..])).await {
|
if let Ok(Ok(n)) = timeout(1000, stream.read(&mut buffer[..])).await {
|
||||||
if let Ok(data) = std::str::from_utf8(&buffer[..n]) {
|
if let Ok(data) = std::str::from_utf8(&buffer[..n]) {
|
||||||
let res = rs.check_cmd(data).await;
|
let res = rs.check_cmd(data).await;
|
||||||
stream.write(res.as_bytes()).await.ok();
|
stream.write_all(res.as_bytes()).await.ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user