Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
1172fc93
Commit
1172fc93
authored
Jul 19, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various minor cleanups for code clarity.
parent
c34f10e1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
31 deletions
+11
-31
cache_center.c
bin/varnishd/cache/cache_center.c
+2
-8
cache_session.c
bin/varnishd/cache/cache_session.c
+9
-23
No files found.
bin/varnishd/cache/cache_center.c
View file @
1172fc93
...
@@ -175,8 +175,8 @@ cnt_wait(struct sess *sp, struct worker *wrk, struct req *req)
...
@@ -175,8 +175,8 @@ cnt_wait(struct sess *sp, struct worker *wrk, struct req *req)
}
}
}
}
}
}
AZ
(
req
->
vcl
);
SES_ReleaseReq
(
req
);
SES_ReleaseReq
(
req
);
assert
(
why
!=
SC_NULL
);
SES_Delete
(
sp
,
why
,
now
);
SES_Delete
(
sp
,
why
,
now
);
return
(
1
);
return
(
1
);
}
}
...
@@ -254,14 +254,8 @@ cnt_sess_done(struct sess *sp, struct worker *wrk, struct req *req)
...
@@ -254,14 +254,8 @@ cnt_sess_done(struct sess *sp, struct worker *wrk, struct req *req)
req
->
hash_always_miss
=
0
;
req
->
hash_always_miss
=
0
;
req
->
hash_ignore_busy
=
0
;
req
->
hash_ignore_busy
=
0
;
if
(
sp
->
fd
>=
0
&&
req
->
doclose
!=
SC_NULL
)
{
if
(
sp
->
fd
>=
0
&&
req
->
doclose
!=
SC_NULL
)
/*
* This is an orderly close of the connection; ditch nolinger
* before we close, to get queued data transmitted.
*/
// XXX: not yet (void)VTCP_linger(sp->fd, 0);
SES_Close
(
sp
,
req
->
doclose
);
SES_Close
(
sp
,
req
->
doclose
);
}
if
(
sp
->
fd
<
0
)
{
if
(
sp
->
fd
<
0
)
{
wrk
->
stats
.
sess_closed
++
;
wrk
->
stats
.
sess_closed
++
;
...
...
bin/varnishd/cache/cache_session.c
View file @
1172fc93
...
@@ -133,12 +133,9 @@ static void
...
@@ -133,12 +133,9 @@ static void
ses_req_pool_task
(
struct
worker
*
wrk
,
void
*
arg
)
ses_req_pool_task
(
struct
worker
*
wrk
,
void
*
arg
)
{
{
struct
req
*
req
;
struct
req
*
req
;
struct
sess
*
sp
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CAST_OBJ_NOTNULL
(
req
,
arg
,
REQ_MAGIC
);
CAST_OBJ_NOTNULL
(
req
,
arg
,
REQ_MAGIC
);
sp
=
req
->
sp
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
THR_SetRequest
(
req
);
THR_SetRequest
(
req
);
AZ
(
wrk
->
aws
->
r
);
AZ
(
wrk
->
aws
->
r
);
...
@@ -180,6 +177,9 @@ ses_sess_pool_task(struct worker *wrk, void *arg)
...
@@ -180,6 +177,9 @@ ses_sess_pool_task(struct worker *wrk, void *arg)
*
*
* We use VSL() to get the sessions vxid and to make sure tha this
* We use VSL() to get the sessions vxid and to make sure tha this
* VSL comes before anything else for this session.
* VSL comes before anything else for this session.
*
* This is a separate procedure only to isolate the two stack buffers.
*
*/
*/
static
void
static
void
...
@@ -317,12 +317,7 @@ SES_Close(struct sess *sp, enum sess_close reason)
...
@@ -317,12 +317,7 @@ SES_Close(struct sess *sp, enum sess_close reason)
}
}
/*--------------------------------------------------------------------
/*--------------------------------------------------------------------
* (Close &) Free or Recycle a session.
* Report and dismantle a session.
*
* If the workspace has changed, deleted it, otherwise wash it, and put
* it up for adoption.
*
* XXX: We should also check nhttp
*/
*/
void
void
...
@@ -338,27 +333,18 @@ SES_Delete(struct sess *sp, enum sess_close reason, double now)
...
@@ -338,27 +333,18 @@ SES_Delete(struct sess *sp, enum sess_close reason, double now)
if
(
reason
!=
SC_NULL
)
if
(
reason
!=
SC_NULL
)
SES_Close
(
sp
,
reason
);
SES_Close
(
sp
,
reason
);
assert
(
sp
->
fd
<
0
);
if
(
isnan
(
now
))
if
(
isnan
(
now
))
now
=
VTIM_real
();
now
=
VTIM_real
();
assert
(
!
isnan
(
sp
->
t_open
));
assert
(
!
isnan
(
sp
->
t_open
));
assert
(
sp
->
fd
<
0
);
if
(
*
sp
->
addr
==
'\0'
)
strcpy
(
sp
->
addr
,
"-"
);
if
(
*
sp
->
port
==
'\0'
)
strcpy
(
sp
->
addr
,
"-"
);
b
=
&
sp
->
acct_ses
;
b
=
&
sp
->
acct_ses
;
VSL
(
SLT_SessClose
,
sp
->
vxid
,
"%s %.3f %ju %ju %ju %ju %ju %ju"
,
VSL
(
SLT_SessClose
,
sp
->
vxid
,
sess_close_str
(
sp
->
reason
,
0
),
now
-
sp
->
t_open
,
b
->
req
,
"%s %.3f %ju %ju %ju %ju %ju %ju"
,
b
->
pipe
,
b
->
pass
,
b
->
fetch
,
b
->
hdrbytes
,
b
->
bodybytes
);
sess_close_str
(
sp
->
reason
,
0
),
now
-
sp
->
t_open
,
b
->
req
,
b
->
pipe
,
b
->
pass
,
b
->
fetch
,
b
->
hdrbytes
,
b
->
bodybytes
);
MPL_Free
(
pp
->
mpl_sess
,
sp
);
MPL_Free
(
pp
->
mpl_sess
,
sp
);
}
}
/*--------------------------------------------------------------------
/*--------------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment