Compare commits
No commits in common. "78bc46c56b7977be728706e06fc5a15ffc59d790" and "878df8da40aae7ab62c83ad28893832b6dd4b04b" have entirely different histories.
78bc46c56b
...
878df8da40
|
@ -19,15 +19,15 @@ pub struct Stats {
|
||||||
|
|
||||||
impl Stats {
|
impl Stats {
|
||||||
pub fn add_connection(&self) {
|
pub fn add_connection(&self) {
|
||||||
self.connections.fetch_add(1, Ordering::Relaxed);
|
self.connections.store(1, Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_rx_bytes(&self, n: usize) {
|
pub fn add_rx_bytes(&self, n: usize) {
|
||||||
self.rx.fetch_add(n, Ordering::Relaxed);
|
self.rx.store(n, Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_tx_bytes(&self, n: usize) {
|
pub fn add_tx_bytes(&self, n: usize) {
|
||||||
self.tx.fetch_add(n, Ordering::Relaxed);
|
self.tx.store(n, Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn connections(&self) -> usize {
|
pub fn connections(&self) -> usize {
|
||||||
|
@ -39,7 +39,7 @@ impl Stats {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_failed(&self, failed: bool) {
|
pub fn set_failed(&self, failed: bool) {
|
||||||
self.failed.fetch_and(failed, Ordering::Relaxed);
|
self.failed.store(failed, Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn rx(&self) -> Unit {
|
pub fn rx(&self) -> Unit {
|
||||||
|
|
|
@ -330,26 +330,6 @@ impl russh::server::Handler for Handler {
|
||||||
Ok(session.channel_success(channel)?)
|
Ok(session.channel_success(channel)?)
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn channel_close(
|
|
||||||
&mut self,
|
|
||||||
channel: ChannelId,
|
|
||||||
session: &mut Session,
|
|
||||||
) -> Result<(), Self::Error> {
|
|
||||||
if let Some(pty_channel) = self.pty_channel
|
|
||||||
&& pty_channel == channel
|
|
||||||
{
|
|
||||||
debug!("Pty channel closed");
|
|
||||||
|
|
||||||
session.disconnect(
|
|
||||||
russh::Disconnect::ByApplication,
|
|
||||||
"Remaining active connections have been closed",
|
|
||||||
"EN",
|
|
||||||
)?;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn tcpip_forward(
|
async fn tcpip_forward(
|
||||||
&mut self,
|
&mut self,
|
||||||
address: &str,
|
address: &str,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user