Skip to content

Commit 8dc34ec

Browse files
committed
fix session establishment detection
1 parent 34b239d commit 8dc34ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/session.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ where S::Artifact: IntoInit<M::Init>
444444
type Connection = S::Connection;
445445
type Artifact = ProtocolArtifact<M, S>;
446446

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

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

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

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

0 commit comments

Comments
 (0)