Closed Geobert closed 4 years ago
There can be no workaround, since Unbind is meant to terminate the session: see the specification, which also comments that "Unbind [..] is not the antithesis of the Bind operation as the name implies".
And the "session" is bound to the LdapConn
? Because what I've done is when unbind
is called, I create a brand new LdapConn
otherwise nothing goes through. But I need to test with 0.7 now :)
Right, LdapConn
is unusable after Unbind. Perhaps I should make the unbind()
method take self
to enforce this through the type system.
I don't know if it's still the case in 0.7 though
Try this with 0.7, pointing it at a known-to-work server:
use ldap3::LdapConn;
use ldap3::result::Result;
fn main() -> Result<()> {
let mut ldap = LdapConn::new("ldap://localhost:2389")?;
ldap.unbind()?;
// trying to use the connection after Unbind
Ok(ldap.unbind()?)
}
You'll get
Error: ResultRecv { source: RecvError(()) }
So the connection is properly unusable and doesn't hang.
Cheers for your test :) I was planning to upgrade our internal tool asap, but I'm on another task right now :)
Hi there!
I've notice an issue when calling a bind after an unbind: bind hang forever :-/
Is that has to do with the caveats disclaimed in the readme?
If so, what would be the workaround/fix? Migrating to Tokio 0.2? (which is a big work, I know).