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
d3780078
Commit
d3780078
authored
Oct 23, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly give esi_level>0 requests their own VDP stack which
passes down to parents VDP stack. Always close all the VDPs.
parent
18c88fbd
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
5 deletions
+40
-5
cache_deliver_proc.c
bin/varnishd/cache/cache_deliver_proc.c
+9
-0
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+27
-4
cache_filter.h
bin/varnishd/cache/cache_filter.h
+2
-1
cache_http1_deliver.c
bin/varnishd/http1/cache_http1_deliver.c
+2
-0
No files found.
bin/varnishd/cache/cache_deliver_proc.c
View file @
d3780078
...
@@ -83,3 +83,12 @@ VDP_pop(struct req *req, vdp_bytes *func)
...
@@ -83,3 +83,12 @@ VDP_pop(struct req *req, vdp_bytes *func)
AZ
(
vdp
->
priv
);
AZ
(
vdp
->
priv
);
req
->
vdp_nxt
=
VTAILQ_FIRST
(
&
req
->
vdp
);
req
->
vdp_nxt
=
VTAILQ_FIRST
(
&
req
->
vdp
);
}
}
void
VDP_close
(
struct
req
*
req
)
{
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
while
(
!
VTAILQ_EMPTY
(
&
req
->
vdp
))
VDP_pop
(
req
,
VTAILQ_FIRST
(
&
req
->
vdp
)
->
func
);
}
bin/varnishd/cache/cache_esi_deliver.c
View file @
d3780078
...
@@ -41,6 +41,27 @@
...
@@ -41,6 +41,27 @@
#include "vend.h"
#include "vend.h"
#include "vgz.h"
#include "vgz.h"
/*--------------------------------------------------------------------*/
static
int
__match_proto__
(
vdp_bytes
)
ved_vdp_bytes
(
struct
req
*
req
,
enum
vdp_action
act
,
void
**
priv
,
const
void
*
ptr
,
ssize_t
len
)
{
struct
req
*
preq
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
if
(
act
==
VDP_INIT
)
return
(
0
);
if
(
act
==
VDP_FINI
)
{
*
priv
=
NULL
;
return
(
0
);
}
CAST_OBJ_NOTNULL
(
preq
,
*
priv
,
REQ_MAGIC
);
req
->
acct
.
resp_bodybytes
+=
len
;
return
(
VDP_bytes
(
preq
,
act
,
ptr
,
len
));
}
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
static
void
static
void
...
@@ -112,13 +133,16 @@ ved_include(struct req *preq, const char *src, const char *host)
...
@@ -112,13 +133,16 @@ ved_include(struct req *preq, const char *src, const char *host)
req
->
l_crc
=
preq
->
l_crc
;
req
->
l_crc
=
preq
->
l_crc
;
req
->
vdp
=
preq
->
vdp
;
req
->
vdp_nxt
=
0
;
req
->
vdp_nxt
=
preq
->
vdp_nxt
;
VTAILQ_INIT
(
&
req
->
vdp
);
VDP_push
(
req
,
ved_vdp_bytes
,
preq
);
THR_SetRequest
(
req
);
THR_SetRequest
(
req
);
VSLb_ts_req
(
req
,
"Start"
,
W_TIM_real
(
wrk
));
VSLb_ts_req
(
req
,
"Start"
,
W_TIM_real
(
wrk
));
req
->
ws_req
=
WS_Snapshot
(
req
->
ws
);
while
(
1
)
{
while
(
1
)
{
req
->
wrk
=
wrk
;
req
->
wrk
=
wrk
;
s
=
CNT_Request
(
wrk
,
req
);
s
=
CNT_Request
(
wrk
,
req
);
...
@@ -132,8 +156,7 @@ ved_include(struct req *preq, const char *src, const char *host)
...
@@ -132,8 +156,7 @@ ved_include(struct req *preq, const char *src, const char *host)
}
}
AN
(
V1L_IsReleased
(
wrk
));
AN
(
V1L_IsReleased
(
wrk
));
/* Charge the transmitted body byte counts also to the parent request */
VDP_close
(
req
);
preq
->
acct
.
resp_bodybytes
+=
req
->
acct
.
resp_bodybytes
;
CNT_AcctLogCharge
(
wrk
->
stats
,
req
);
CNT_AcctLogCharge
(
wrk
->
stats
,
req
);
VSL_End
(
req
->
vsl
);
VSL_End
(
req
->
vsl
);
...
...
bin/varnishd/cache/cache_filter.h
View file @
d3780078
...
@@ -89,10 +89,10 @@ enum vfp_status VFP_GetStorage(struct vfp_ctx *, ssize_t *sz, uint8_t **ptr);
...
@@ -89,10 +89,10 @@ enum vfp_status VFP_GetStorage(struct vfp_ctx *, ssize_t *sz, uint8_t **ptr);
enum
vdp_action
{
enum
vdp_action
{
VDP_INIT
,
VDP_INIT
,
VDP_FINI
,
VDP_NULL
,
VDP_NULL
,
VDP_FLUSH
,
VDP_FLUSH
,
VDP_FINISH
,
VDP_FINISH
,
VDP_FINI
,
};
};
typedef
int
vdp_bytes
(
struct
req
*
,
enum
vdp_action
,
void
**
priv
,
typedef
int
vdp_bytes
(
struct
req
*
,
enum
vdp_action
,
void
**
priv
,
...
@@ -109,6 +109,7 @@ struct vdp_entry {
...
@@ -109,6 +109,7 @@ struct vdp_entry {
int
VDP_bytes
(
struct
req
*
,
enum
vdp_action
act
,
const
void
*
ptr
,
ssize_t
len
);
int
VDP_bytes
(
struct
req
*
,
enum
vdp_action
act
,
const
void
*
ptr
,
ssize_t
len
);
void
VDP_push
(
struct
req
*
,
vdp_bytes
*
func
,
void
*
priv
);
void
VDP_push
(
struct
req
*
,
vdp_bytes
*
func
,
void
*
priv
);
void
VDP_pop
(
struct
req
*
,
vdp_bytes
*
func
);
void
VDP_pop
(
struct
req
*
,
vdp_bytes
*
func
);
void
VDP_close
(
struct
req
*
req
);
vdp_bytes
VDP_gunzip
;
vdp_bytes
VDP_gunzip
;
vdp_bytes
VED_pretend_gzip
;
vdp_bytes
VED_pretend_gzip
;
...
...
bin/varnishd/http1/cache_http1_deliver.c
View file @
d3780078
...
@@ -384,4 +384,6 @@ V1D_Deliver(struct req *req, struct busyobj *bo)
...
@@ -384,4 +384,6 @@ V1D_Deliver(struct req *req, struct busyobj *bo)
if
((
V1L_FlushRelease
(
req
->
wrk
)
||
ois
!=
OIS_DONE
)
&&
if
((
V1L_FlushRelease
(
req
->
wrk
)
||
ois
!=
OIS_DONE
)
&&
req
->
sp
->
fd
>=
0
)
req
->
sp
->
fd
>=
0
)
SES_Close
(
req
->
sp
,
SC_REM_CLOSE
);
SES_Close
(
req
->
sp
,
SC_REM_CLOSE
);
if
(
req
->
esi_level
==
0
)
VDP_close
(
req
);
}
}
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