-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
memcached_clone of SASL connection closes random file descriptor #75
Comments
hmm. too fast. |
unitialized = false ;) we have a preconfigured source, with one server. gdb bt:
|
possible solution: case MEMCACHED_BEHAVIOR_BINARY_PROTOCOL:
our connection is already binary, and flags were already cloned, and there is no reason on Earth to disconnect it. |
no, that alone brought trouble. final approach we took and it tested OK:
memcached.cc (memcached_clone):
|
Imported from Launchpad using lp2gh.
memcached_clone(0, connection_that_already_configured_to_use_SASL_but_not_connected)
internally calls
memcached_create
that does not initialise fd field.
later SASL data fields are cloned.
that sets BINARY behaviour.
setting that behaviour tries to close existing connection (that was NOT yet made in this use-case):
memcached_behavior_set:
case MEMCACHED_BEHAVIOR_BINARY_PROTOCOL:
send_quit(ptr); // We need t shutdown all of the connections to make sure we do the correct protocol
since fd is not initialised, send_quit goes along some random fd number that happen to be in memory that was malloced during memcached_create.
trivial solution:
add
self->fd= INVALID_SOCKET;
_memcached_init in libmemcached/memcached.cc
The text was updated successfully, but these errors were encountered: