mirror of
https://github.com/bitwarden/browser
synced 2026-02-15 07:54:55 +00:00
Fix windows
This commit is contained in:
@@ -24,10 +24,11 @@ impl NamedPipeServerStream {
|
|||||||
pub async fn listen(
|
pub async fn listen(
|
||||||
pipe_name: String,
|
pipe_name: String,
|
||||||
agent: BitwardenDesktopAgent,
|
agent: BitwardenDesktopAgent,
|
||||||
) -> Result<NamedPipeServerStream, anyhow::Error> {
|
) -> Result<(), anyhow::Error> {
|
||||||
info!("Starting SSH Named Pipe listener");
|
info!("Starting SSH Named Pipe listener");
|
||||||
let (tx, rx) = tokio::sync::mpsc::channel(16);
|
let (tx, rx) = tokio::sync::mpsc::channel(16);
|
||||||
|
|
||||||
|
let cloned_agent = agent.clone();
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
info!("Creating named pipe server on {}", pipe_name.clone());
|
info!("Creating named pipe server on {}", pipe_name.clone());
|
||||||
let mut listener = match ServerOptions::new().create(pipe_name.clone()) {
|
let mut listener = match ServerOptions::new().create(pipe_name.clone()) {
|
||||||
@@ -37,7 +38,7 @@ impl NamedPipeServerStream {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let cancellation_token = agent.cancellation_token();
|
let cancellation_token = cloned_agent.cancellation_token();
|
||||||
loop {
|
loop {
|
||||||
info!("Waiting for connection");
|
info!("Waiting for connection");
|
||||||
select! {
|
select! {
|
||||||
@@ -72,7 +73,8 @@ impl NamedPipeServerStream {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Ok(NamedPipeServerStream { rx })
|
agent.serve(NamedPipeServerStream { rx }).await;
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user