[master] 2c90d78 Remove redundant field

Poul-Henning Kamp phk at varnish-cache.org
Fri Dec 23 08:21:37 CET 2011


commit 2c90d78747a527fc8d55893d4d8eed68fe1120be
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Dec 23 07:21:21 2011 +0000

    Remove redundant field

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 7e7088e..b674bd7 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -198,7 +198,6 @@ struct http_conn {
 /*--------------------------------------------------------------------*/
 
 struct acct {
-	double			first;
 #define ACCT(foo)	uint64_t	foo;
 #include "tbl/acct_fields.h"
 #undef ACCT
diff --git a/bin/varnishd/cache/cache_center.c b/bin/varnishd/cache/cache_center.c
index b14ec24..052a68b 100644
--- a/bin/varnishd/cache/cache_center.c
+++ b/bin/varnishd/cache/cache_center.c
@@ -1019,7 +1019,8 @@ cnt_streambody(struct sess *sp)
 }
 
 /*--------------------------------------------------------------------
- * The very first request
+ * A freshly accepted socket
+ *
 DOT subgraph xcluster_first {
 DOT	first [
 DOT		shape=box
@@ -1040,16 +1041,10 @@ cnt_first(struct sess *sp)
 	wrk = sp->wrk;
 	CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
 
-	/*
-	 * XXX: If we don't have acceptfilters we are somewhat subject
-	 * XXX: to DoS'ing here.  One remedy would be to set a shorter
-	 * XXX: SO_RCVTIMEO and once we have received something here
-	 * XXX: increase it to the normal value.
-	 */
-
 	assert(sp->xid == 0);
 	assert(sp->restarts == 0);
 	AZ(sp->esi_level);
+
 	VTCP_name(&sp->sockaddr, sp->sockaddrlen,
 	    sp->addr, sizeof sp->addr, sp->port, sizeof sp->port);
 	if (cache_param->log_local_addr) {
@@ -1063,7 +1058,6 @@ cnt_first(struct sess *sp)
 		WSP(sp, SLT_SessionOpen, "%s %s %s",
 		    sp->addr, sp->port, sp->mylsock->name);
 	}
-	sp->acct_ses.first = sp->t_open;
 
 	/* Receive a HTTP protocol request */
 	HTC_Init(sp->htc, sp->ws, sp->fd, sp->vsl_id,
diff --git a/bin/varnishd/cache/cache_session.c b/bin/varnishd/cache/cache_session.c
index 46bfb8d..1292e5e 100644
--- a/bin/varnishd/cache/cache_session.c
+++ b/bin/varnishd/cache/cache_session.c
@@ -345,6 +345,7 @@ SES_Delete(struct sess *sp, const char *reason, double now)
 		SES_Close(sp, reason);
 	if (isnan(now))
 		now = VTIM_real();
+	assert(!isnan(sp->t_open));
 	assert(sp->fd < 0);
 
 	AZ(sp->vcl);
@@ -354,11 +355,10 @@ SES_Delete(struct sess *sp, const char *reason, double now)
 		strcpy(sp->addr, "-");
 
 	b = &sp->acct_ses;
-	assert(!isnan(b->first));
 
 	VSL(SLT_StatSess, sp->vsl_id, "%s %s %.0f %ju %ju %ju %ju %ju %ju %ju",
 	    sp->addr, sp->port,
-	    now - b->first, 	// XXX ??? 
+	    now - sp->t_open,
 	    b->sess, b->req, b->pipe, b->pass,
 	    b->fetch, b->hdrbytes, b->bodybytes);
 



More information about the varnish-commit mailing list