Skip to content

Commit

Permalink
fix session establishment detection
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed May 5, 2024
1 parent 34b239d commit 8dc34ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ where S::Artifact: IntoInit<M::Init>
type Connection = S::Connection;
type Artifact = ProtocolArtifact<M, S>;

fn is_established(&self) -> bool { self.state.is_complete() }
fn is_established(&self) -> bool { self.state.is_complete() && self.artifact().is_some() }

fn run_handshake(&mut self) -> io::Result<()> {
#[cfg(feature = "log")]
Expand Down Expand Up @@ -662,6 +662,6 @@ mod impl_socks5 {

fn is_init(&self) -> bool { true }

fn is_complete(&self) -> bool { matches!(self, Socks5::Active(_)) }
fn is_complete(&self) -> bool { matches!(self, Socks5::Active(_)) && self.artifact().is_some() }
}
}

0 comments on commit 8dc34ec

Please sign in to comment.