Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
94d7a686
Commit
94d7a686
authored
Jun 25, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make SES_Charge() and SES_ReleaseReq() take struct req* argument
instead of struct sess*
parent
6dfad3d4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
20 deletions
+24
-20
cache.h
bin/varnishd/cache/cache.h
+2
-2
cache_center.c
bin/varnishd/cache/cache_center.c
+4
-4
cache_hash.c
bin/varnishd/cache/cache_hash.c
+1
-1
cache_session.c
bin/varnishd/cache/cache_session.c
+17
-13
No files found.
bin/varnishd/cache/cache.h
View file @
94d7a686
...
...
@@ -925,13 +925,13 @@ unsigned WRW_WriteH(const struct worker *w, const txt *hh, const char *suf);
/* cache_session.c [SES] */
void
SES_Close
(
struct
sess
*
sp
,
const
char
*
reason
);
void
SES_Delete
(
struct
sess
*
sp
,
const
char
*
reason
,
double
now
);
void
SES_Charge
(
struct
worker
*
,
struct
sess
*
);
void
SES_Charge
(
struct
worker
*
,
struct
req
*
);
struct
sesspool
*
SES_NewPool
(
struct
pool
*
pp
,
unsigned
pool_no
);
void
SES_DeletePool
(
struct
sesspool
*
sp
);
int
SES_Schedule
(
struct
sess
*
sp
);
void
SES_Handle
(
struct
sess
*
sp
,
double
now
);
struct
req
*
SES_GetReq
(
struct
sess
*
sp
);
void
SES_ReleaseReq
(
struct
sess
*
sp
);
void
SES_ReleaseReq
(
struct
req
*
);
pool_func_t
SES_pool_accept_task
;
/* cache_shmlog.c */
...
...
bin/varnishd/cache/cache_center.c
View file @
94d7a686
...
...
@@ -191,8 +191,8 @@ cnt_wait(struct sess *sp, struct worker *wrk, struct req *req)
if
(
when
<
now
||
tmo
==
0
)
{
sp
->
t_rx
=
NAN
;
wrk
->
stats
.
sess_herd
++
;
SES_Charge
(
wrk
,
sp
);
SES_ReleaseReq
(
sp
);
SES_Charge
(
wrk
,
req
);
SES_ReleaseReq
(
req
);
WAIT_Enter
(
sp
);
return
(
1
);
}
...
...
@@ -206,7 +206,7 @@ cnt_wait(struct sess *sp, struct worker *wrk, struct req *req)
}
}
}
SES_Charge
(
wrk
,
sp
);
SES_Charge
(
wrk
,
req
);
SES_Delete
(
sp
,
why
,
now
);
return
(
1
);
}
...
...
@@ -1624,7 +1624,7 @@ CNT_Request(struct worker *wrk, struct req *req)
CHECK_OBJ_ORNULL
(
wrk
->
nobjhead
,
OBJHEAD_MAGIC
);
}
if
(
done
==
1
)
SES_Charge
(
wrk
,
req
->
sp
);
SES_Charge
(
wrk
,
req
);
req
->
wrk
=
NULL
;
...
...
bin/varnishd/cache/cache_hash.c
View file @
94d7a686
...
...
@@ -424,7 +424,7 @@ HSH_Lookup(struct req *req)
if
(
cache_param
->
diag_bitmap
&
0x20
)
VSLb
(
req
->
vsl
,
SLT_Debug
,
"on waiting list <%p>"
,
oh
);
SES_Charge
(
req
->
wrk
,
req
->
sp
);
SES_Charge
(
req
->
wrk
,
req
);
/*
* The objhead reference transfers to the sess, we get it
* back when the sess comes off the waiting list and
...
...
bin/varnishd/cache/cache_session.c
View file @
94d7a686
...
...
@@ -61,16 +61,18 @@ struct sesspool {
*/
void
SES_Charge
(
struct
worker
*
wrk
,
struct
sess
*
sp
)
SES_Charge
(
struct
worker
*
wrk
,
struct
req
*
req
)
{
struct
sess
*
sp
;
struct
acct
*
a
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
sp
->
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
sp
=
req
->
sp
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
a
=
&
wrk
->
acct_tmp
;
sp
->
req
->
req_bodybytes
+=
a
->
bodybytes
;
req
->
req_bodybytes
+=
a
->
bodybytes
;
#define ACCT(foo) \
wrk->stats.s_##foo += a->foo; \
...
...
@@ -259,7 +261,7 @@ SES_Delete(struct sess *sp, const char *reason, double now)
if
(
sp
->
req
!=
NULL
)
{
AZ
(
sp
->
req
->
vcl
);
SES_ReleaseReq
(
sp
);
SES_ReleaseReq
(
sp
->
req
);
}
if
(
*
sp
->
addr
==
'\0'
)
...
...
@@ -346,21 +348,23 @@ SES_GetReq(struct sess *sp)
}
void
SES_ReleaseReq
(
struct
sess
*
sp
)
SES_ReleaseReq
(
struct
req
*
req
)
{
struct
sess
*
sp
;
struct
sesspool
*
pp
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
sp
=
req
->
sp
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
assert
(
sp
->
req
==
req
);
pp
=
sp
->
sesspool
;
CHECK_OBJ_NOTNULL
(
pp
,
SESSPOOL_MAGIC
);
AN
(
pp
->
pool
);
CHECK_OBJ_NOTNULL
(
sp
->
req
,
REQ_MAGIC
);
AN
(
sp
->
req
->
sp
);
assert
(
sp
->
req
->
sp
==
sp
);
MPL_AssertSane
(
sp
->
req
);
VSL_Flush
(
sp
->
req
->
vsl
,
0
);
sp
->
req
->
sp
=
NULL
;
MPL_Free
(
pp
->
mpl_req
,
sp
->
req
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
MPL_AssertSane
(
req
);
VSL_Flush
(
req
->
vsl
,
0
);
req
->
sp
=
NULL
;
MPL_Free
(
pp
->
mpl_req
,
req
);
sp
->
req
=
NULL
;
THR_SetRequest
(
NULL
);
}
...
...
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