[master] 4f15e16 Move cnt_first{} up above cnt_wait{}, this is a more logical order and will make subsequent diffs clearer.
Poul-Henning Kamp
phk at varnish-cache.org
Tue Jun 19 13:34:06 CEST 2012
commit 4f15e168abc9cf3a38fb8d096354e508a84d2e82
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Tue Jun 19 11:33:33 2012 +0000
Move cnt_first{} up above cnt_wait{}, this is a more logical order
and will make subsequent diffs clearer.
diff --git a/bin/varnishd/cache/cache_center.c b/bin/varnishd/cache/cache_center.c
index 372d0c4..0d4e93b 100644
--- a/bin/varnishd/cache/cache_center.c
+++ b/bin/varnishd/cache/cache_center.c
@@ -80,6 +80,58 @@ DOT acceptor -> first [style=bold,color=green]
static unsigned xids;
/*--------------------------------------------------------------------
+ * A freshly accepted socket
+ *
+DOT subgraph xcluster_first {
+DOT first [
+DOT shape=box
+DOT label="cnt_first:\nrender\naddresses"
+DOT ]
+DOT }
+DOT first -> wait [style=bold,color=green]
+ */
+
+static int
+cnt_first(struct sess *sp, struct worker *wrk)
+{
+ struct req *req;
+ char laddr[ADDR_BUFSIZE];
+ char lport[PORT_BUFSIZE];
+
+ CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
+ CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
+
+ /* Allocate a request already now, so we can VSL to it */
+ AZ(sp->req);
+ req = SES_GetReq(sp);
+ CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
+ assert(req->sp == sp);
+
+ VTCP_name(&sp->sockaddr, sp->sockaddrlen,
+ sp->addr, sizeof sp->addr, sp->port, sizeof sp->port);
+ if (cache_param->log_local_addr) {
+ AZ(getsockname(sp->fd, (void*)&sp->mysockaddr,
+ &sp->mysockaddrlen));
+ VTCP_name(&sp->mysockaddr, sp->mysockaddrlen,
+ laddr, sizeof laddr, lport, sizeof lport);
+ /* XXX: have no req yet */
+ VSLb(req->vsl, SLT_SessionOpen, "%s %s %s %s",
+ sp->addr, sp->port, laddr, lport);
+ } else {
+ /* XXX: have no req yet */
+ VSLb(req->vsl, SLT_SessionOpen, "%s %s %s",
+ sp->addr, sp->port, sp->mylsock->name);
+ }
+
+ wrk->acct_tmp.sess++;
+
+ sp->t_rx = sp->t_open;
+ sp->t_idle = sp->t_open;
+ sp->step = STP_WAIT;
+ return (0);
+}
+
+/*--------------------------------------------------------------------
* WAIT
* Collect the request from the client.
*
@@ -916,58 +968,6 @@ cnt_fetchbody(struct sess *sp, struct worker *wrk, struct req *req)
}
/*--------------------------------------------------------------------
- * A freshly accepted socket
- *
-DOT subgraph xcluster_first {
-DOT first [
-DOT shape=box
-DOT label="cnt_first:\nrender\naddresses"
-DOT ]
-DOT }
-DOT first -> wait [style=bold,color=green]
- */
-
-static int
-cnt_first(struct sess *sp, struct worker *wrk)
-{
- struct req *req;
- char laddr[ADDR_BUFSIZE];
- char lport[PORT_BUFSIZE];
-
- CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
- CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
-
- /* Allocate a request already now, so we can VSL to it */
- AZ(sp->req);
- req = SES_GetReq(sp);
- CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
- assert(req->sp == sp);
-
- VTCP_name(&sp->sockaddr, sp->sockaddrlen,
- sp->addr, sizeof sp->addr, sp->port, sizeof sp->port);
- if (cache_param->log_local_addr) {
- AZ(getsockname(sp->fd, (void*)&sp->mysockaddr,
- &sp->mysockaddrlen));
- VTCP_name(&sp->mysockaddr, sp->mysockaddrlen,
- laddr, sizeof laddr, lport, sizeof lport);
- /* XXX: have no req yet */
- VSLb(req->vsl, SLT_SessionOpen, "%s %s %s %s",
- sp->addr, sp->port, laddr, lport);
- } else {
- /* XXX: have no req yet */
- VSLb(req->vsl, SLT_SessionOpen, "%s %s %s",
- sp->addr, sp->port, sp->mylsock->name);
- }
-
- wrk->acct_tmp.sess++;
-
- sp->t_rx = sp->t_open;
- sp->t_idle = sp->t_open;
- sp->step = STP_WAIT;
- return (0);
-}
-
-/*--------------------------------------------------------------------
* HIT
* We had a cache hit. Ask VCL, then march off as instructed.
*
More information about the varnish-commit
mailing list