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
42cf6a92
Commit
42cf6a92
authored
May 29, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Downgrade the VCL_*_method() argument from sess to req
parent
cf811a3e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
20 deletions
+20
-20
cache.h
bin/varnishd/cache/cache.h
+1
-1
cache_center.c
bin/varnishd/cache/cache_center.c
+9
-9
cache_vcl.c
bin/varnishd/cache/cache_vcl.c
+10
-10
No files found.
bin/varnishd/cache/cache.h
View file @
42cf6a92
...
@@ -967,7 +967,7 @@ void VCL_Rel(struct VCL_conf **vcc);
...
@@ -967,7 +967,7 @@ void VCL_Rel(struct VCL_conf **vcc);
void
VCL_Poll
(
void
);
void
VCL_Poll
(
void
);
const
char
*
VCL_Return_Name
(
unsigned
method
);
const
char
*
VCL_Return_Name
(
unsigned
method
);
#define VCL_MET_MAC(l,u,b) void VCL_##l##_method(struct
sess
*);
#define VCL_MET_MAC(l,u,b) void VCL_##l##_method(struct
req
*);
#include "tbl/vcl_returns.h"
#include "tbl/vcl_returns.h"
#undef VCL_MET_MAC
#undef VCL_MET_MAC
...
...
bin/varnishd/cache/cache_center.c
View file @
42cf6a92
...
@@ -267,7 +267,7 @@ cnt_prepresp(struct sess *sp, struct worker *wrk, struct req *req)
...
@@ -267,7 +267,7 @@ cnt_prepresp(struct sess *sp, struct worker *wrk, struct req *req)
HTTP_Setup
(
req
->
resp
,
req
->
ws
,
req
->
vsl
,
HTTP_Resp
);
HTTP_Setup
(
req
->
resp
,
req
->
ws
,
req
->
vsl
,
HTTP_Resp
);
RES_BuildHttp
(
sp
);
RES_BuildHttp
(
sp
);
VCL_deliver_method
(
sp
);
VCL_deliver_method
(
req
);
switch
(
req
->
handling
)
{
switch
(
req
->
handling
)
{
case
VCL_RET_DELIVER
:
case
VCL_RET_DELIVER
:
break
;
break
;
...
@@ -522,7 +522,7 @@ cnt_error(struct sess *sp, struct worker *wrk, struct req *req)
...
@@ -522,7 +522,7 @@ cnt_error(struct sess *sp, struct worker *wrk, struct req *req)
http_PutResponse
(
h
,
req
->
err_reason
);
http_PutResponse
(
h
,
req
->
err_reason
);
else
else
http_PutResponse
(
h
,
http_StatusMessage
(
req
->
err_code
));
http_PutResponse
(
h
,
http_StatusMessage
(
req
->
err_code
));
VCL_error_method
(
sp
);
VCL_error_method
(
req
);
if
(
req
->
handling
==
VCL_RET_RESTART
&&
if
(
req
->
handling
==
VCL_RET_RESTART
&&
req
->
restarts
<
cache_param
->
max_restarts
)
{
req
->
restarts
<
cache_param
->
max_restarts
)
{
...
@@ -631,7 +631,7 @@ cnt_fetch(struct sess *sp, struct worker *wrk, struct req *req)
...
@@ -631,7 +631,7 @@ cnt_fetch(struct sess *sp, struct worker *wrk, struct req *req)
AZ
(
bo
->
do_esi
);
AZ
(
bo
->
do_esi
);
AZ
(
bo
->
do_pass
);
AZ
(
bo
->
do_pass
);
VCL_fetch_method
(
sp
);
VCL_fetch_method
(
req
);
if
(
bo
->
do_pass
)
if
(
bo
->
do_pass
)
req
->
objcore
->
flags
|=
OC_F_PASS
;
req
->
objcore
->
flags
|=
OC_F_PASS
;
...
@@ -997,7 +997,7 @@ cnt_hit(struct sess *sp, struct worker *wrk, struct req *req)
...
@@ -997,7 +997,7 @@ cnt_hit(struct sess *sp, struct worker *wrk, struct req *req)
assert
(
!
(
req
->
obj
->
objcore
->
flags
&
OC_F_PASS
));
assert
(
!
(
req
->
obj
->
objcore
->
flags
&
OC_F_PASS
));
VCL_hit_method
(
sp
);
VCL_hit_method
(
req
);
if
(
req
->
handling
==
VCL_RET_DELIVER
)
{
if
(
req
->
handling
==
VCL_RET_DELIVER
)
{
//AZ(req->busyobj->bereq->ws);
//AZ(req->busyobj->bereq->ws);
...
@@ -1171,7 +1171,7 @@ cnt_miss(struct sess *sp, struct worker *wrk, struct req *req)
...
@@ -1171,7 +1171,7 @@ cnt_miss(struct sess *sp, struct worker *wrk, struct req *req)
http_SetHeader
(
bo
->
bereq
,
"Accept-Encoding: gzip"
);
http_SetHeader
(
bo
->
bereq
,
"Accept-Encoding: gzip"
);
}
}
VCL_miss_method
(
sp
);
VCL_miss_method
(
req
);
if
(
req
->
handling
==
VCL_RET_FETCH
)
{
if
(
req
->
handling
==
VCL_RET_FETCH
)
{
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
...
@@ -1237,7 +1237,7 @@ cnt_pass(struct sess *sp, struct worker *wrk, struct req *req)
...
@@ -1237,7 +1237,7 @@ cnt_pass(struct sess *sp, struct worker *wrk, struct req *req)
HTTP_Setup
(
bo
->
bereq
,
bo
->
ws
,
bo
->
vsl
,
HTTP_Bereq
);
HTTP_Setup
(
bo
->
bereq
,
bo
->
ws
,
bo
->
vsl
,
HTTP_Bereq
);
http_FilterReq
(
sp
,
HTTPH_R_PASS
);
http_FilterReq
(
sp
,
HTTPH_R_PASS
);
VCL_pass_method
(
sp
);
VCL_pass_method
(
req
);
if
(
req
->
handling
==
VCL_RET_ERROR
)
{
if
(
req
->
handling
==
VCL_RET_ERROR
)
{
http_Teardown
(
bo
->
bereq
);
http_Teardown
(
bo
->
bereq
);
...
@@ -1297,7 +1297,7 @@ cnt_pipe(struct sess *sp, struct worker *wrk, struct req *req)
...
@@ -1297,7 +1297,7 @@ cnt_pipe(struct sess *sp, struct worker *wrk, struct req *req)
HTTP_Setup
(
bo
->
bereq
,
bo
->
ws
,
bo
->
vsl
,
HTTP_Bereq
);
HTTP_Setup
(
bo
->
bereq
,
bo
->
ws
,
bo
->
vsl
,
HTTP_Bereq
);
http_FilterReq
(
sp
,
0
);
http_FilterReq
(
sp
,
0
);
VCL_pipe_method
(
sp
);
VCL_pipe_method
(
req
);
if
(
req
->
handling
==
VCL_RET_ERROR
)
if
(
req
->
handling
==
VCL_RET_ERROR
)
INCOMPL
();
INCOMPL
();
...
@@ -1395,7 +1395,7 @@ cnt_recv(struct sess *sp, const struct worker *wrk, struct req *req)
...
@@ -1395,7 +1395,7 @@ cnt_recv(struct sess *sp, const struct worker *wrk, struct req *req)
http_CollectHdr
(
req
->
http
,
H_Cache_Control
);
http_CollectHdr
(
req
->
http
,
H_Cache_Control
);
VCL_recv_method
(
sp
);
VCL_recv_method
(
req
);
recv_handling
=
req
->
handling
;
recv_handling
=
req
->
handling
;
if
(
cache_param
->
http_gzip_support
&&
if
(
cache_param
->
http_gzip_support
&&
...
@@ -1411,7 +1411,7 @@ cnt_recv(struct sess *sp, const struct worker *wrk, struct req *req)
...
@@ -1411,7 +1411,7 @@ cnt_recv(struct sess *sp, const struct worker *wrk, struct req *req)
req
->
sha256ctx
=
&
sha256ctx
;
/* so HSH_AddString() can find it */
req
->
sha256ctx
=
&
sha256ctx
;
/* so HSH_AddString() can find it */
SHA256_Init
(
req
->
sha256ctx
);
SHA256_Init
(
req
->
sha256ctx
);
VCL_hash_method
(
sp
);
VCL_hash_method
(
req
);
assert
(
req
->
handling
==
VCL_RET_HASH
);
assert
(
req
->
handling
==
VCL_RET_HASH
);
SHA256_Final
(
req
->
digest
,
req
->
sha256ctx
);
SHA256_Final
(
req
->
digest
,
req
->
sha256ctx
);
req
->
sha256ctx
=
NULL
;
req
->
sha256ctx
=
NULL
;
...
...
bin/varnishd/cache/cache_vcl.c
View file @
42cf6a92
...
@@ -330,18 +330,18 @@ ccf_config_use(struct cli *cli, const char * const *av, void *priv)
...
@@ -330,18 +330,18 @@ ccf_config_use(struct cli *cli, const char * const *av, void *priv)
#define VCL_MET_MAC(func, upper, bitmap) \
#define VCL_MET_MAC(func, upper, bitmap) \
void \
void \
VCL_##func##_method(struct
sess *sp
) \
VCL_##func##_method(struct
req *req
) \
{ \
{ \
\
\
sp->
req->handling = 0; \
req->handling = 0; \
sp->req->cur_method = VCL_MET_ ## upper;
\
req->cur_method = VCL_MET_ ## upper;
\
VSLb(
sp->
req->vsl, SLT_VCL_call, "%s", #func); \
VSLb(req->vsl, SLT_VCL_call, "%s", #func); \
(void)
sp->req->vcl->func##_func(
sp); \
(void)
req->vcl->func##_func(req->
sp); \
VSLb(
sp->req->vsl, SLT_VCL_return, "%s",
\
VSLb(
req->vsl, SLT_VCL_return, "%s",
\
VCL_Return_Name(
sp->req->handling));
\
VCL_Return_Name(
req->handling));
\
sp->req->cur_method = 0;
\
req->cur_method = 0;
\
assert((1U <<
sp->req->handling) & bitmap);
\
assert((1U <<
req->handling) & bitmap);
\
assert(!((1U <<
sp->
req->handling) & ~bitmap)); \
assert(!((1U << req->handling) & ~bitmap)); \
}
}
#include "tbl/vcl_returns.h"
#include "tbl/vcl_returns.h"
...
...
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