1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-21 18:12:23 +03:00

speculative windows build fix

This commit is contained in:
Wez Furlong 2024-05-13 13:57:14 -07:00
parent eb6fc75a17
commit ccc32faaba
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387
4 changed files with 24 additions and 4 deletions

View File

@ -40,6 +40,13 @@ impl std::os::windows::io::AsRawSocket for AsyncSslStream {
}
}
#[cfg(windows)]
impl std::os::windows::io::AsSocket for AsyncSslStream {
fn as_socket(&self) -> std::os::windows::io::BorrowedSocket {
self.s.get_ref().as_socket()
}
}
impl AsRawDesc for AsyncSslStream {}
impl std::io::Read for AsyncSslStream {

View File

@ -1,7 +1,7 @@
use crate::{
AsRawFileDescriptor, AsRawSocketDescriptor, Error, FileDescriptor, FromRawFileDescriptor,
FromRawSocketDescriptor, IntoRawFileDescriptor, IntoRawSocketDescriptor, OwnedHandle, Pipe,
Result, StdioDescriptor,
AsRawFileDescriptor, AsRawSocketDescriptor, AsSocket, Error, FileDescriptor,
FromRawFileDescriptor, FromRawSocketDescriptor, IntoRawFileDescriptor, IntoRawSocketDescriptor,
OwnedHandle, Pipe, Result, StdioDescriptor,
};
use std::io::{self, Error as IoError};
use std::os::windows::prelude::*;
@ -320,6 +320,12 @@ impl AsRawSocket for FileDescriptor {
}
}
impl AsSocket for FileDescriptor {
fn as_socket(&self) -> BorrowedSocket {
unsafe { BorrowedSocket::borrow_raw(self.as_raw_socket()) }
}
}
impl FromRawSocket for FileDescriptor {
unsafe fn from_raw_socket(handle: RawSocket) -> FileDescriptor {
Self {

View File

@ -572,6 +572,13 @@ impl std::os::windows::io::AsRawSocket for SshStream {
}
}
#[cfg(windows)]
impl std::os::windows::io::AsSocket for SshStream {
fn as_socket(&self) -> std::os::windows::io::BorrowedSocket {
self.stdout.as_socket()
}
}
impl Read for SshStream {
fn read(&mut self, buf: &mut [u8]) -> Result<usize, std::io::Error> {
self.stdout.read(buf)

View File

@ -11,7 +11,7 @@ use smol::Async;
#[cfg(unix)]
pub trait AsRawDesc: std::os::unix::io::AsRawFd + std::os::fd::AsFd {}
#[cfg(windows)]
pub trait AsRawDesc: std::os::windows::io::AsRawSocket {}
pub trait AsRawDesc: std::os::windows::io::AsRawSocket + std::os::windows::io::AsSocket {}
impl AsRawDesc for UnixStream {}
impl AsRawDesc for AsyncSslStream {}