1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-27 02:25:28 +03:00

ssh: flatten out session module

This commit is contained in:
Wez Furlong 2021-10-18 07:56:22 -07:00
parent 75f946c22c
commit 1f073db776
6 changed files with 9 additions and 11 deletions

View File

@ -29,7 +29,7 @@ impl AuthenticationEvent {
} }
} }
impl crate::session::SessionInner { impl crate::sessioninner::SessionInner {
fn agent_auth(&mut self, sess: &ssh2::Session, user: &str) -> anyhow::Result<bool> { fn agent_auth(&mut self, sess: &ssh2::Session, user: &str) -> anyhow::Result<bool> {
if let Some(only) = self.config.get("identitiesonly") { if let Some(only) = self.config.get("identitiesonly") {
if only == "yes" { if only == "yes" {

View File

@ -21,7 +21,7 @@ impl HostVerificationEvent {
} }
} }
impl crate::session::SessionInner { impl crate::sessioninner::SessionInner {
pub fn host_verification_libssh( pub fn host_verification_libssh(
&mut self, &mut self,
sess: &libssh::Session, sess: &libssh::Session,

View File

@ -5,6 +5,7 @@ mod filewrap;
mod host; mod host;
mod pty; mod pty;
mod session; mod session;
mod sessioninner;
mod sessionwrap; mod sessionwrap;
mod sftp; mod sftp;

View File

@ -1,6 +1,5 @@
use crate::session::{ use crate::session::{SessionRequest, SessionSender, SignalChannel};
ChannelId, ChannelInfo, DescriptorState, SessionRequest, SessionSender, SignalChannel, use crate::sessioninner::{ChannelId, ChannelInfo, DescriptorState};
};
use crate::sessionwrap::SessionWrap; use crate::sessionwrap::SessionWrap;
use filedescriptor::{socketpair, FileDescriptor}; use filedescriptor::{socketpair, FileDescriptor};
use portable_pty::{ExitStatus, PtySize}; use portable_pty::{ExitStatus, PtySize};
@ -165,7 +164,7 @@ impl portable_pty::Child for SshChildProcess {
} }
} }
impl crate::session::SessionInner { impl crate::sessioninner::SessionInner {
pub fn new_pty(&mut self, sess: &mut SessionWrap, newpty: &NewPty) -> anyhow::Result<()> { pub fn new_pty(&mut self, sess: &mut SessionWrap, newpty: &NewPty) -> anyhow::Result<()> {
sess.set_blocking(true); sess.set_blocking(true);

View File

@ -1,9 +1,8 @@
use crate::auth::*; use crate::auth::*;
use crate::channelwrap::ChannelWrap;
use crate::config::ConfigMap; use crate::config::ConfigMap;
use crate::host::*; use crate::host::*;
use crate::pty::*; use crate::pty::*;
pub(crate) use crate::session::inner::*; use crate::sessioninner::*;
use crate::sftp::{Sftp, SftpRequest}; use crate::sftp::{Sftp, SftpRequest};
use filedescriptor::{socketpair, FileDescriptor}; use filedescriptor::{socketpair, FileDescriptor};
use portable_pty::PtySize; use portable_pty::PtySize;
@ -12,8 +11,6 @@ use std::collections::HashMap;
use std::io::Write; use std::io::Write;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
mod inner;
#[derive(Debug)] #[derive(Debug)]
pub enum SessionEvent { pub enum SessionEvent {
Banner(Option<String>), Banner(Option<String>),

View File

@ -1,7 +1,8 @@
use crate::channelwrap::ChannelWrap;
use crate::config::ConfigMap; use crate::config::ConfigMap;
use crate::filewrap::FileWrap; use crate::filewrap::FileWrap;
use crate::pty::*; use crate::pty::*;
use crate::session::{ChannelWrap, Exec, ExecResult, SessionEvent, SessionRequest, SignalChannel}; use crate::session::{Exec, ExecResult, SessionEvent, SessionRequest, SignalChannel};
use crate::sessionwrap::SessionWrap; use crate::sessionwrap::SessionWrap;
use crate::sftp::{ use crate::sftp::{
self, File, FileId, FileRequest, Metadata, SftpChannelError, SftpChannelResult, SftpRequest, self, File, FileId, FileRequest, Metadata, SftpChannelError, SftpChannelResult, SftpRequest,