From fd2c3a9ee4baf7d1d06069569be533f6f8cc3aa7 Mon Sep 17 00:00:00 2001
From: Nils Goroll <nils.goroll@uplex.de>
Date: Fri, 13 Jan 2012 14:45:24 +0100
Subject: [PATCH] need to base port_getn timeout on sp->t_idle
 could trigger an assertion failure on assert(tmo > 0.0);

---
 bin/varnishd/waiter/cache_waiter_ports.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/varnishd/waiter/cache_waiter_ports.c b/bin/varnishd/waiter/cache_waiter_ports.c
index 4f39ca4..87eaeac 100644
--- a/bin/varnishd/waiter/cache_waiter_ports.c
+++ b/bin/varnishd/waiter/cache_waiter_ports.c
@@ -3,7 +3,7 @@
  * Copyright (c) 2006 Varnish Software AS
  * Copyright (c) 2007 OmniTI Computer Consulting, Inc.
  * Copyright (c) 2007 Theo Schlossnagle
- * Copyright (c) 2010 UPLEX, Nils Goroll
+ * Copyright (c) 2010-2012 UPLEX, Nils Goroll
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -220,7 +220,7 @@ vws_thread(void *priv)
 
 		if (sp) {
 			double tmo =
-			    (sp->t_open + cache_param->timeout_idle) - now;
+			    (sp->t_idle + cache_param->timeout_idle) - now;
 
 			/*
 			 * we should have removed all sps whose timeout
-- 
1.5.6.5

