Guarantee router session is present for call to clientReply; properly free callbacks; attempt to set all necessary values for dbusers; do more to ensure buffers freed.

This commit is contained in:
counterpoint
2015-09-21 14:25:12 +01:00
parent 88716c35fb
commit 7aa36b77ea
5 changed files with 19 additions and 6 deletions

View File

@ -1926,6 +1926,7 @@ dcb_maybe_add_persistent(DCB *dcb)
&& !(dcb->flags & DCBF_HUNG)
&& (poolcount = dcb_persistent_clean_count(dcb, false)) < dcb->server->persistpoolmax)
{
DCB_CALLBACK *loopcallback;
LOGIF(LD, (skygw_log_write(
LOGFILE_DEBUG,
"%lu [dcb_maybe_add_persistent] Adding DCB to persistent pool, user %s.\n",
@ -1946,7 +1947,13 @@ dcb_maybe_add_persistent(DCB *dcb)
session_free(local_session);
}
}
dcb->callbacks = NULL;
spinlock_acquire(&dcb->cb_lock);
while ((loopcallback = dcb->callbacks) != NULL)
{
dcb->callbacks = loopcallback->next;
free(loopcallback);
}
spinlock_release(&dcb->cb_lock);
spinlock_acquire(&dcb->server->persistlock);
dcb->nextpersistent = dcb->server->persistent;
dcb->server->persistent = dcb;