-
Notifications
You must be signed in to change notification settings - Fork 252
Queue reads everywhere #144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is because Net::LDAP::Connection#add calls read without queueing, meaning it can read the wrong message off the socket.
Yup. Let me know when it's ready for review or if you'd like to take a few of the tasks. |
Conflicts: lib/net/ldap/connection.rb
I was able to come up with a straightforward, if not simpler reproduction of the issue while introducing |
FWIW, I'm starting to hate the |
Looks good to me. I didn't try running all of these, but just did a sanity check of the changes.
Did you want to just change it back to |
@jch |
@mtodd your call. I'm fine with leaving it queued_read as is. It's an internal method that's only used within Connection, so it's low impact to change whenever we'd like. 🚢 when you're ready. |
@jch not going to block this PR on the method name, better to have a separate conversation about it. |
Queue reads everywhere
After #138 was merged, I realized that any reads from the socket are susceptible from the same problem as described in #136.
I've added a reproduction (as an integration test) to illustrate the point, and also includes a trivial fix based on replacing
read
usage withqueued_read
.This needs to be done for any usage of
read
inNet::LDAP::Connection
:setup_encryption
bind_simple
bind_sasl
modify
add
rename
delete
cc @jch @schaary