Commit 7954649c authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Break down and lock the n_vbe_conn counter to avoid over & underflows.

Fixes #604



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4437 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent aebd9400
......@@ -84,7 +84,9 @@ VBE_ReleaseConn(struct vbe_conn *vc)
VSL_stats->backend_unused++;
Lck_Unlock(&VBE_mtx);
} else {
Lck_Lock(&VBE_mtx);
VSL_stats->n_vbe_conn--;
Lck_Unlock(&VBE_mtx);
free(vc);
}
}
......@@ -211,7 +213,9 @@ vbe_NewConn(void)
XXXAN(vc);
vc->magic = VBE_CONN_MAGIC;
vc->fd = -1;
Lck_Lock(&VBE_mtx);
VSL_stats->n_vbe_conn++;
Lck_Unlock(&VBE_mtx);
return (vc);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment