This is mostly cosmetic: in fact we are getting an extra
ref in _map_session and holding the session lock, so
it's safe, but it's awkward to be giving up the ref on
a session and then continuing to refer to it.
Signed-off-by: John Spray <john.spray@redhat.com>
int r = _map_session(&op->target, &s, lc);
assert(r == 0);
mapped_session = true;
+ } else {
+ get_session(s);
}
s->lock.get_write();
if (mapped_session) {
_session_op_assign(s, op);
- put_session(s);
}
if (op->should_resend) {
if (!op->session->is_homeless() && !op->target.paused) {
_cancel_linger_op(op);
}
s->lock.unlock();
+ put_session(s);
}
for (list<LingerOp*>::iterator p = need_resend_linger.begin();
p != need_resend_linger.end(); ++p) {