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
a5e70172
Commit
a5e70172
authored
Apr 22, 2013
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move cur_method from req to wrk
parent
20a5abe7
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
36 additions
and
15 deletions
+36
-15
cache.h
bin/varnishd/cache/cache.h
+3
-2
cache_panic.c
bin/varnishd/cache/cache_panic.c
+8
-2
cache_vcl.c
bin/varnishd/cache/cache_vcl.c
+17
-4
cache_vrt.c
bin/varnishd/cache/cache_vrt.c
+4
-3
c00033.vtc
bin/varnishtest/tests/c00033.vtc
+2
-2
vrt.h
include/vrt.h
+1
-1
vcc_action.c
lib/libvcl/vcc_action.c
+1
-1
No files found.
bin/varnishd/cache/cache.h
View file @
a5e70172
...
...
@@ -349,6 +349,7 @@ struct worker {
struct
vxid_pool
vxid_pool
;
unsigned
cur_method
;
unsigned
handling
;
};
...
...
@@ -613,7 +614,6 @@ struct req {
enum
sess_close
doclose
;
struct
exp
exp
;
unsigned
cur_method
;
unsigned
char
wantbody
;
enum
req_body_state_e
req_body_status
;
...
...
@@ -1014,7 +1014,8 @@ void VCL_Init(void);
void
VCL_Refresh
(
struct
VCL_conf
**
vcc
);
void
VCL_Rel
(
struct
VCL_conf
**
vcc
);
void
VCL_Poll
(
void
);
const
char
*
VCL_Return_Name
(
unsigned
method
);
const
char
*
VCL_Return_Name
(
unsigned
);
const
char
*
VCL_Method_Name
(
unsigned
);
#define VCL_MET_MAC(l,u,b) \
void VCL_##l##_method(struct worker *, struct req *, struct ws *);
...
...
bin/varnishd/cache/cache_panic.c
View file @
a5e70172
...
...
@@ -229,11 +229,17 @@ pan_wrk(const struct worker *wrk)
VSB_printf
(
pan_vsp
,
" worker = %p {
\n
"
,
wrk
);
pan_ws
(
wrk
->
aws
,
4
);
hand
=
VCL_Method_Name
(
wrk
->
cur_method
);
if
(
hand
!=
NULL
)
VSB_printf
(
pan_vsp
,
" VCL::method = %s,
\n
"
,
hand
);
else
VSB_printf
(
pan_vsp
,
" VCL::method = 0x%x,
\n
"
,
wrk
->
cur_method
);
hand
=
VCL_Return_Name
(
wrk
->
handling
);
if
(
hand
!=
NULL
)
VSB_printf
(
pan_vsp
,
"
handling
= %s,
\n
"
,
hand
);
VSB_printf
(
pan_vsp
,
"
VCL::return
= %s,
\n
"
,
hand
);
else
VSB_printf
(
pan_vsp
,
"
handling
= 0x%x,
\n
"
,
wrk
->
handling
);
VSB_printf
(
pan_vsp
,
"
VCL::return
= 0x%x,
\n
"
,
wrk
->
handling
);
VSB_printf
(
pan_vsp
,
" },
\n
"
);
}
...
...
bin/varnishd/cache/cache_vcl.c
View file @
a5e70172
...
...
@@ -65,10 +65,10 @@ static struct vcls *vcl_active; /* protected by vcl_mtx */
/*--------------------------------------------------------------------*/
const
char
*
VCL_Return_Name
(
unsigned
method
)
VCL_Return_Name
(
unsigned
r
)
{
switch
(
method
)
{
switch
(
r
)
{
#define VCL_RET_MAC(l, U, B) case VCL_RET_##U: return(#l);
#include "tbl/vcl_returns.h"
#undef VCL_RET_MAC
...
...
@@ -77,6 +77,19 @@ VCL_Return_Name(unsigned method)
}
}
const
char
*
VCL_Method_Name
(
unsigned
m
)
{
switch
(
m
)
{
#define VCL_MET_MAC(func, upper, bitmap) case VCL_MET_##upper: return (#upper);
#include "tbl/vcl_returns.h"
#undef VCL_MET_MAC
default:
return
(
NULL
);
}
}
/*--------------------------------------------------------------------*/
static
void
...
...
@@ -346,12 +359,12 @@ VCL_##func##_method(struct worker *wrk, struct req *req, struct ws *ws) \
AN(req->sp); \
aws = WS_Snapshot(wrk->aws); \
wrk->handling = 0; \
req
->cur_method = VCL_MET_ ## upper; \
wrk
->cur_method = VCL_MET_ ## upper; \
VSLb(req->vsl, SLT_VCL_call, "%s", #func); \
(void)req->vcl->func##_func(wrk, req, NULL, ws); \
VSLb(req->vsl, SLT_VCL_return, "%s", \
VCL_Return_Name(wrk->handling)); \
req
->cur_method = 0; \
wrk
->cur_method = 0; \
assert((1U << wrk->handling) & bitmap); \
assert(!((1U << wrk->handling) & ~bitmap)); \
WS_Reset(wrk->aws, aws); \
...
...
bin/varnishd/cache/cache_vrt.c
View file @
a5e70172
...
...
@@ -487,13 +487,14 @@ VRT_CacheReqBody(struct req *req, long long maxsize)
*/
void
VRT_purge
(
struct
req
*
req
,
double
ttl
,
double
grace
)
VRT_purge
(
const
struct
worker
*
wrk
,
struct
req
*
req
,
double
ttl
,
double
grace
)
{
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
if
(
req
->
cur_method
==
VCL_MET_LOOKUP
)
if
(
wrk
->
cur_method
==
VCL_MET_LOOKUP
)
HSH_Purge
(
req
,
req
->
obj
->
objcore
->
objhead
,
ttl
,
grace
);
else
if
(
req
->
cur_method
==
VCL_MET_MISS
)
else
if
(
wrk
->
cur_method
==
VCL_MET_MISS
)
HSH_Purge
(
req
,
req
->
objcore
->
objhead
,
ttl
,
grace
);
}
...
...
bin/varnishtest/tests/c00033.vtc
View file @
a5e70172
...
...
@@ -25,13 +25,13 @@ varnish v1 -vcl+backend {
sub vcl_lookup {
if (req.method == "PURGE") {
C{ VRT_purge(req, 0, 0); }C
C{ VRT_purge(
wrk,
req, 0, 0); }C
error 456 "got it";
}
}
sub vcl_miss {
if (req.method == "PURGE") {
C{ VRT_purge(req, 0, 0); }C
C{ VRT_purge(
wrk,
req, 0, 0); }C
error 456 "got it";
}
}
...
...
include/vrt.h
View file @
a5e70172
...
...
@@ -170,7 +170,7 @@ const char *VRT_regsub(struct req *, int all, const char *,
void
*
,
const
char
*
);
void
VRT_ban_string
(
const
char
*
);
void
VRT_purge
(
struct
req
*
,
double
ttl
,
double
grace
);
void
VRT_purge
(
const
struct
worker
*
,
struct
req
*
,
double
ttl
,
double
grace
);
void
VRT_count
(
struct
req
*
,
unsigned
);
int
VRT_rewrite
(
const
char
*
,
const
char
*
);
...
...
lib/libvcl/vcc_action.c
View file @
a5e70172
...
...
@@ -347,7 +347,7 @@ parse_purge(struct vcc *tl)
{
vcc_NextToken
(
tl
);
Fb
(
tl
,
1
,
"VRT_purge(req, 0, 0);
\n
"
);
Fb
(
tl
,
1
,
"VRT_purge(
wrk,
req, 0, 0);
\n
"
);
}
/*--------------------------------------------------------------------*/
...
...
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