[experimental-ims] a87ec7a Shift some code to more appropriate location
Geoff Simmons
geoff at varnish-cache.org
Tue Jan 10 00:03:30 CET 2012
commit a87ec7adb127158fc70635ab3fb61ddc9180e426
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Thu Dec 22 21:51:36 2011 +0000
Shift some code to more appropriate location
diff --git a/bin/varnishd/cache/cache_pool.c b/bin/varnishd/cache/cache_pool.c
index ee71572..1a67548 100644
--- a/bin/varnishd/cache/cache_pool.c
+++ b/bin/varnishd/cache/cache_pool.c
@@ -331,28 +331,10 @@ pool_queue(struct pool *pp, struct sess *sp)
int
Pool_Schedule(struct pool *pp, struct sess *sp)
{
+
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
AZ(sp->wrk);
- if (pool_queue(pp, sp) == 0)
- return(0);
-
- VSC_C_main->client_drop_late++;
-
- /*
- * Couldn't queue it -- kill it.
- *
- * XXX: a notice might be polite, but would potentially
- * XXX: sleep whichever thread got us here
- */
- sp->t_end = VTIM_real();
- if (sp->vcl != NULL) {
- /*
- * A session parked on a busy object can come here
- * after it wakes up. Loose the VCL reference.
- */
- VCL_Rel(&sp->vcl);
- }
- return (1);
+ return(pool_queue(pp, sp));
}
/*--------------------------------------------------------------------
diff --git a/bin/varnishd/cache/cache_session.c b/bin/varnishd/cache/cache_session.c
index 9c5e82b..1b1f87c 100644
--- a/bin/varnishd/cache/cache_session.c
+++ b/bin/varnishd/cache/cache_session.c
@@ -42,6 +42,7 @@
#include "cache.h"
#include "waiter/waiter.h"
+#include "vtim.h"
/*--------------------------------------------------------------------*/
@@ -266,6 +267,15 @@ SES_Schedule(struct sess *sp)
AN(pp->pool);
if (Pool_Schedule(pp->pool, sp)) {
+ VSC_C_main->client_drop_late++;
+ sp->t_end = VTIM_real();
+ if (sp->vcl != NULL) {
+ /*
+ * A session parked on a busy object can come here
+ * after it wakes up. Loose the VCL reference.
+ */
+ VCL_Rel(&sp->vcl);
+ }
SES_Delete(sp, "dropped");
return (1);
}
More information about the varnish-commit
mailing list