read_message and write_message both dereference connection-state, so avoid
clearing it when replacing a pipe.
read_message still uses it to find rx_buffers in ways that may interfere
when two Pipes reference the connection, but currently that is only used
for lossy pipes. We could still take pipe_lock in that case, but it is
only an optimization (we copy the data if the buffers don't get used
directly) and probably not worth bothering with.
Signed-off-by: Sage Weil <sage@newdream.net>
should let the daemon handle it itself.
Otherwise, take over other Connection so we don't lose older messages */
existing->connection_state->reset_pipe(this);
- existing->connection_state->put();
- existing->connection_state = NULL;
+
+ // do not clear existing->connection_state, since read_message and write_message both
+ // dereference it without pipe_lock.
// steal queue and out_seq
existing->requeue_sent();