Skip to content

Commit ef63299

Browse files
committed
refactor(dgw): rename module rdp_extension to rd_clean_path
1 parent 5a6ecd9 commit ef63299

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

devolutions-gateway/src/api/fwd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ where
249249

250250
// Establish TLS connection with server
251251

252-
let server_stream = crate::tls::connect(selected_target.host(), server_stream)
252+
let server_stream = crate::tls::connect(selected_target.host().to_owned(), server_stream)
253253
.await
254254
.context("TLS connect")
255255
.map_err(ForwardError::BadGateway)?;

devolutions-gateway/src/api/rdp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async fn handle_socket(
6969
Duration::from_secs(conf.debug.ws_keep_alive_interval),
7070
);
7171

72-
let result = crate::rdp_extension::handle(
72+
let result = crate::rd_clean_path::handle(
7373
stream,
7474
source_addr,
7575
conf,

devolutions-gateway/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub mod middleware;
2828
pub mod ngrok;
2929
pub mod plugin_manager;
3030
pub mod proxy;
31-
pub mod rdp_extension;
31+
pub mod rd_clean_path;
3232
pub mod rdp_pcb;
3333
pub mod recording;
3434
pub mod session;

devolutions-gateway/src/rdp_extension.rs renamed to devolutions-gateway/src/rd_clean_path.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ async fn process_cleanpath(
237237

238238
// Establish TLS connection with server
239239

240-
let server_stream = crate::tls::connect(selected_target.host(), server_stream)
240+
let server_stream = crate::tls::connect(selected_target.host().to_owned(), server_stream)
241241
.await
242242
.map_err(|source| CleanPathError::TlsHandshake {
243243
source,
@@ -321,7 +321,7 @@ pub async fn handle(
321321
.recording_policy(claims.jet_rec)
322322
.build();
323323

324-
info!("RDP-TLS forwarding");
324+
info!("RDP-TLS forwarding (RDCleanPath)");
325325

326326
Proxy::builder()
327327
.conf(conf)

devolutions-gateway/src/tls.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use std::io;
22
use std::sync::{Arc, LazyLock};
33

44
use anyhow::Context as _;
5-
use tokio::net::TcpStream;
65
use tokio_rustls::client::TlsStream;
76
use tokio_rustls::rustls::{self, pki_types};
87

@@ -32,10 +31,13 @@ static TLS_CONNECTOR: LazyLock<tokio_rustls::TlsConnector> = LazyLock::new(|| {
3231
tokio_rustls::TlsConnector::from(Arc::new(config))
3332
});
3433

35-
pub async fn connect(dns_name: &str, stream: TcpStream) -> io::Result<TlsStream<TcpStream>> {
34+
pub async fn connect<IO>(dns_name: String, stream: IO) -> io::Result<TlsStream<IO>>
35+
where
36+
IO: tokio::io::AsyncRead + tokio::io::AsyncWrite + Unpin,
37+
{
3638
use tokio::io::AsyncWriteExt as _;
3739

38-
let dns_name = pki_types::ServerName::try_from(dns_name.to_owned()).map_err(io::Error::other)?;
40+
let dns_name = pki_types::ServerName::try_from(dns_name).map_err(io::Error::other)?;
3941

4042
let mut tls_stream = TLS_CONNECTOR.connect(dns_name, stream).await?;
4143

0 commit comments

Comments
 (0)