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
0d58f56e
Commit
0d58f56e
authored
Sep 30, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Second pass to tag VSL's with backend or client bits.
parent
009eb1c5
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
56 additions
and
55 deletions
+56
-55
cache.h
bin/varnishd/cache.h
+7
-6
cache_acceptor.c
bin/varnishd/cache_acceptor.c
+2
-2
cache_backend.c
bin/varnishd/cache_backend.c
+2
-2
cache_center.c
bin/varnishd/cache_center.c
+9
-9
cache_dir.c
bin/varnishd/cache_dir.c
+2
-2
cache_esi_deliver.c
bin/varnishd/cache_esi_deliver.c
+1
-1
cache_fetch.c
bin/varnishd/cache_fetch.c
+5
-6
cache_http.c
bin/varnishd/cache_http.c
+13
-12
cache_response.c
bin/varnishd/cache_response.c
+12
-12
cache_vrt.c
bin/varnishd/cache_vrt.c
+3
-3
No files found.
bin/varnishd/cache.h
View file @
0d58f56e
...
...
@@ -763,17 +763,18 @@ unsigned http_Write(struct worker *w, unsigned vsl_id, const struct http *hp,
void
http_CopyResp
(
struct
http
*
to
,
const
struct
http
*
fm
);
void
http_SetResp
(
struct
http
*
to
,
const
char
*
proto
,
uint16_t
status
,
const
char
*
response
);
void
http_FilterFields
(
struct
worker
*
w
,
int
f
d
,
struct
http
*
to
,
void
http_FilterFields
(
struct
worker
*
w
,
unsigned
vsl_i
d
,
struct
http
*
to
,
const
struct
http
*
fm
,
unsigned
how
);
void
http_FilterHeader
(
const
struct
sess
*
sp
,
unsigned
how
);
void
http_PutProtocol
(
struct
worker
*
w
,
int
f
d
,
const
struct
http
*
to
,
void
http_PutProtocol
(
struct
worker
*
w
,
unsigned
vsl_i
d
,
const
struct
http
*
to
,
const
char
*
protocol
);
void
http_PutStatus
(
struct
http
*
to
,
uint16_t
status
);
void
http_PutResponse
(
struct
worker
*
w
,
int
f
d
,
const
struct
http
*
to
,
void
http_PutResponse
(
struct
worker
*
w
,
unsigned
vsl_i
d
,
const
struct
http
*
to
,
const
char
*
response
);
void
http_PrintfHeader
(
struct
worker
*
w
,
int
f
d
,
struct
http
*
to
,
void
http_PrintfHeader
(
struct
worker
*
w
,
unsigned
vsl_i
d
,
struct
http
*
to
,
const
char
*
fmt
,
...);
void
http_SetHeader
(
struct
worker
*
w
,
int
fd
,
struct
http
*
to
,
const
char
*
hdr
);
void
http_SetHeader
(
struct
worker
*
w
,
unsigned
vsl_id
,
struct
http
*
to
,
const
char
*
hdr
);
void
http_SetH
(
const
struct
http
*
to
,
unsigned
n
,
const
char
*
fm
);
void
http_ForceGet
(
const
struct
http
*
to
);
void
http_Setup
(
struct
http
*
ht
,
struct
ws
*
ws
);
...
...
@@ -790,7 +791,7 @@ uint16_t http_DissectRequest(struct sess *sp);
uint16_t
http_DissectResponse
(
struct
worker
*
w
,
const
struct
http_conn
*
htc
,
struct
http
*
sp
);
const
char
*
http_DoConnection
(
const
struct
http
*
hp
);
void
http_CopyHome
(
struct
worker
*
w
,
int
f
d
,
const
struct
http
*
hp
);
void
http_CopyHome
(
struct
worker
*
w
,
unsigned
vsl_i
d
,
const
struct
http
*
hp
);
void
http_Unset
(
struct
http
*
hp
,
const
char
*
hdr
);
void
http_CollectHdr
(
struct
http
*
hp
,
const
char
*
hdr
);
...
...
bin/varnishd/cache_acceptor.c
View file @
0d58f56e
...
...
@@ -130,10 +130,10 @@ VCA_Prep(struct sess *sp)
AZ
(
getsockname
(
sp
->
fd
,
(
void
*
)
&
sp
->
mysockaddr
,
&
sp
->
mysockaddrlen
));
VTCP_name
(
&
sp
->
mysockaddr
,
sp
->
mysockaddrlen
,
addr
,
sizeof
addr
,
port
,
sizeof
port
);
VSL
(
SLT_SessionOpen
,
sp
->
fd
,
"%s %s %s %s"
,
WSP
(
sp
,
SLT_SessionOpen
,
"%s %s %s %s"
,
sp
->
addr
,
sp
->
port
,
addr
,
port
);
}
else
{
VSL
(
SLT_SessionOpen
,
sp
->
fd
,
"%s %s %s"
,
WSP
(
sp
,
SLT_SessionOpen
,
"%s %s %s"
,
sp
->
addr
,
sp
->
port
,
sp
->
mylsock
->
name
);
}
sp
->
acct_ses
.
first
=
sp
->
t_open
;
...
...
bin/varnishd/cache_backend.c
View file @
0d58f56e
...
...
@@ -70,7 +70,7 @@ VDI_AddHostHeader(const struct sess *sp)
CHECK_OBJ_NOTNULL
(
sp
->
wrk
->
bereq
,
HTTP_MAGIC
);
CHECK_OBJ_NOTNULL
(
sp
->
vbc
,
VBC_MAGIC
);
CHECK_OBJ_NOTNULL
(
sp
->
vbc
->
vdis
,
VDI_SIMPLE_MAGIC
);
http_PrintfHeader
(
sp
->
wrk
,
sp
->
f
d
,
sp
->
wrk
->
bereq
,
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_i
d
,
sp
->
wrk
->
bereq
,
"Host: %s"
,
sp
->
vbc
->
vdis
->
vrt
->
hosthdr
);
}
...
...
@@ -357,7 +357,7 @@ vbe_GetVbe(const struct sess *sp, struct vdi_simple *vs)
return
(
vc
);
}
VSC_C_main
->
backend_toolate
++
;
WSL
(
sp
->
wrk
,
SLT_BackendClose
,
vc
->
f
d
,
"%s"
,
bp
->
vcl_name
);
WSL
(
sp
->
wrk
,
SLT_BackendClose
,
vc
->
vsl_i
d
,
"%s"
,
bp
->
vcl_name
);
/* Checkpoint log to flush all info related to this connection
before the OS reuses the FD */
...
...
bin/varnishd/cache_center.c
View file @
0d58f56e
...
...
@@ -104,7 +104,7 @@ cnt_wait(struct sess *sp)
i
=
HTC_Rx
(
sp
->
htc
);
}
if
(
i
==
0
)
{
WS
L
(
sp
->
wrk
,
SLT_Debug
,
sp
->
fd
,
"herding"
);
WS
P
(
sp
,
SLT_Debug
,
"herding"
);
sp
->
wrk
->
stats
.
sess_herd
++
;
SES_Charge
(
sp
);
sp
->
wrk
=
NULL
;
...
...
@@ -464,16 +464,16 @@ cnt_error(struct sess *sp)
if
(
sp
->
err_code
<
100
||
sp
->
err_code
>
999
)
sp
->
err_code
=
501
;
http_PutProtocol
(
w
,
sp
->
f
d
,
h
,
"HTTP/1.1"
);
http_PutProtocol
(
w
,
sp
->
vsl_i
d
,
h
,
"HTTP/1.1"
);
http_PutStatus
(
h
,
sp
->
err_code
);
TIM_format
(
TIM_real
(),
date
);
http_PrintfHeader
(
w
,
sp
->
f
d
,
h
,
"Date: %s"
,
date
);
http_PrintfHeader
(
w
,
sp
->
f
d
,
h
,
"Server: Varnish"
);
http_PrintfHeader
(
w
,
sp
->
vsl_i
d
,
h
,
"Date: %s"
,
date
);
http_PrintfHeader
(
w
,
sp
->
vsl_i
d
,
h
,
"Server: Varnish"
);
if
(
sp
->
err_reason
!=
NULL
)
http_PutResponse
(
w
,
sp
->
f
d
,
h
,
sp
->
err_reason
);
http_PutResponse
(
w
,
sp
->
vsl_i
d
,
h
,
sp
->
err_reason
);
else
http_PutResponse
(
w
,
sp
->
f
d
,
h
,
http_PutResponse
(
w
,
sp
->
vsl_i
d
,
h
,
http_StatusMessage
(
sp
->
err_code
));
VCL_error_method
(
sp
);
...
...
@@ -728,7 +728,7 @@ cnt_fetchbody(struct sess *sp)
/* If we do gzip, add the C-E header */
if
(
sp
->
wrk
->
do_gzip
)
http_PrintfHeader
(
sp
->
wrk
,
sp
->
f
d
,
sp
->
wrk
->
beresp
,
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_i
d
,
sp
->
wrk
->
beresp
,
"Content-Encoding: %s"
,
"gzip"
);
/* But we can't do both at the same time */
...
...
@@ -1194,7 +1194,7 @@ cnt_miss(struct sess *sp)
* the minority of clients which don't.
*/
http_Unset
(
sp
->
wrk
->
bereq
,
H_Accept_Encoding
);
http_PrintfHeader
(
sp
->
wrk
,
sp
->
f
d
,
sp
->
wrk
->
bereq
,
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_i
d
,
sp
->
wrk
->
bereq
,
"Accept-Encoding: gzip"
);
}
sp
->
wrk
->
connect_timeout
=
0
;
...
...
@@ -1398,7 +1398,7 @@ cnt_recv(struct sess *sp)
(
recv_handling
!=
VCL_RET_PASS
))
{
if
(
RFC2616_Req_Gzip
(
sp
))
{
http_Unset
(
sp
->
http
,
H_Accept_Encoding
);
http_PrintfHeader
(
sp
->
wrk
,
sp
->
f
d
,
sp
->
http
,
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_i
d
,
sp
->
http
,
"Accept-Encoding: gzip"
);
}
else
{
http_Unset
(
sp
->
http
,
H_Accept_Encoding
);
...
...
bin/varnishd/cache_dir.c
View file @
0d58f56e
...
...
@@ -48,7 +48,7 @@ VDI_CloseFd(struct sess *sp)
bp
=
sp
->
vbc
->
backend
;
WSL
(
sp
->
wrk
,
SLT_BackendClose
,
sp
->
vbc
->
f
d
,
"%s"
,
bp
->
vcl_name
);
WSL
(
sp
->
wrk
,
SLT_BackendClose
,
sp
->
vbc
->
vsl_i
d
,
"%s"
,
bp
->
vcl_name
);
/* Checkpoint log to flush all info related to this connection
before the OS reuses the FD */
...
...
@@ -76,7 +76,7 @@ VDI_RecycleFd(struct sess *sp)
bp
=
sp
->
vbc
->
backend
;
WSL
(
sp
->
wrk
,
SLT_BackendReuse
,
sp
->
vbc
->
f
d
,
"%s"
,
bp
->
vcl_name
);
WSL
(
sp
->
wrk
,
SLT_BackendReuse
,
sp
->
vbc
->
vsl_i
d
,
"%s"
,
bp
->
vcl_name
);
/*
* Flush the shmlog, so that another session reusing this backend
* will log chronologically later than our use of it.
...
...
bin/varnishd/cache_esi_deliver.c
View file @
0d58f56e
...
...
@@ -72,7 +72,7 @@ ved_include(struct sess *sp, const char *src, const char *host)
if
(
host
!=
NULL
&&
*
host
!=
'\0'
)
{
http_Unset
(
sp
->
http
,
H_Host
);
http_Unset
(
sp
->
http
,
H_If_Modified_Since
);
http_SetHeader
(
w
,
sp
->
f
d
,
sp
->
http
,
host
);
http_SetHeader
(
w
,
sp
->
vsl_i
d
,
sp
->
http
,
host
);
}
/*
* XXX: We should decide if we should cache the director
...
...
bin/varnishd/cache_fetch.c
View file @
0d58f56e
...
...
@@ -63,8 +63,7 @@ vfp_nop_begin(struct sess *sp, size_t estimate)
if
(
fetchfrag
>
0
)
{
estimate
=
fetchfrag
;
WSL
(
sp
->
wrk
,
SLT_Debug
,
sp
->
fd
,
"Fetch %d byte segments:"
,
fetchfrag
);
WSP
(
sp
,
SLT_Debug
,
"Fetch %d byte segments:"
,
fetchfrag
);
}
if
(
estimate
>
0
)
(
void
)
FetchStorage
(
sp
,
estimate
);
...
...
@@ -355,7 +354,7 @@ FetchReqBody(struct sess *sp)
}
if
(
http_GetHdr
(
sp
->
http
,
H_Transfer_Encoding
,
NULL
))
{
/* XXX: Handle chunked encoding. */
WS
L
(
sp
->
wrk
,
SLT_Debug
,
sp
->
fd
,
"Transfer-Encoding in request"
);
WS
P
(
sp
,
SLT_Debug
,
"Transfer-Encoding in request"
);
return
(
1
);
}
return
(
0
);
...
...
@@ -542,7 +541,7 @@ FetchBody(struct sess *sp)
*/
AZ
(
vfp_nop_end
(
sp
));
WSL
(
w
,
SLT_Fetch_Body
,
sp
->
vbc
->
f
d
,
"%u(%s) cls %d mklen %u"
,
WSL
(
w
,
SLT_Fetch_Body
,
sp
->
vbc
->
vsl_i
d
,
"%u(%s) cls %d mklen %u"
,
w
->
body_status
,
body_status
(
w
->
body_status
),
cls
,
mklen
);
...
...
@@ -567,7 +566,7 @@ FetchBody(struct sess *sp)
if
(
cls
==
0
&&
w
->
do_close
)
cls
=
1
;
WSL
(
w
,
SLT_Length
,
sp
->
vbc
->
f
d
,
"%u"
,
sp
->
obj
->
len
);
WSL
(
w
,
SLT_Length
,
sp
->
vbc
->
vsl_i
d
,
"%u"
,
sp
->
obj
->
len
);
{
/* Sanity check fetch methods accounting */
...
...
@@ -585,7 +584,7 @@ FetchBody(struct sess *sp)
if
(
mklen
>
0
)
{
http_Unset
(
sp
->
obj
->
http
,
H_Content_Length
);
http_PrintfHeader
(
w
,
sp
->
f
d
,
sp
->
obj
->
http
,
http_PrintfHeader
(
w
,
sp
->
vsl_i
d
,
sp
->
obj
->
http
,
"Content-Length: %jd"
,
(
intmax_t
)
sp
->
obj
->
len
);
}
...
...
bin/varnishd/cache_http.c
View file @
0d58f56e
...
...
@@ -77,7 +77,7 @@ http2shmlog(const struct http *hp, int t)
}
static
void
WSLH
(
struct
worker
*
w
,
int
vsl_id
,
const
struct
http
*
hp
,
unsigned
hdr
)
WSLH
(
struct
worker
*
w
,
unsigned
vsl_id
,
const
struct
http
*
hp
,
unsigned
hdr
)
{
AN
(
vsl_id
&
(
VSL_CLIENTMARKER
|
VSL_BACKENDMARKER
));
...
...
@@ -486,7 +486,7 @@ http_GetReq(const struct http *hp)
*/
static
uint16_t
http_dissect_hdrs
(
struct
worker
*
w
,
struct
http
*
hp
,
int
vsl_id
,
char
*
p
,
http_dissect_hdrs
(
struct
worker
*
w
,
struct
http
*
hp
,
unsigned
vsl_id
,
char
*
p
,
const
struct
http_conn
*
htc
)
{
char
*
q
,
*
r
;
...
...
@@ -562,7 +562,7 @@ http_dissect_hdrs(struct worker *w, struct http *hp, int vsl_id, char *p,
*/
static
uint16_t
http_splitline
(
struct
worker
*
w
,
int
vsl_id
,
struct
http
*
hp
,
http_splitline
(
struct
worker
*
w
,
unsigned
vsl_id
,
struct
http
*
hp
,
const
struct
http_conn
*
htc
,
int
h1
,
int
h2
,
int
h3
)
{
char
*
p
,
*
q
;
...
...
@@ -792,7 +792,7 @@ http_SetResp(struct http *to, const char *proto, uint16_t status,
}
static
void
http_copyheader
(
struct
worker
*
w
,
int
vsl_id
,
struct
http
*
to
,
http_copyheader
(
struct
worker
*
w
,
unsigned
vsl_id
,
struct
http
*
to
,
const
struct
http
*
fm
,
unsigned
n
)
{
...
...
@@ -843,7 +843,7 @@ http_EstimateWS(const struct http *fm, unsigned how, uint16_t *nhd)
/*--------------------------------------------------------------------*/
void
http_FilterFields
(
struct
worker
*
w
,
int
vsl_id
,
struct
http
*
to
,
http_FilterFields
(
struct
worker
*
w
,
unsigned
vsl_id
,
struct
http
*
to
,
const
struct
http
*
fm
,
unsigned
how
)
{
unsigned
u
;
...
...
@@ -893,7 +893,7 @@ http_FilterHeader(const struct sess *sp, unsigned how)
*/
void
http_CopyHome
(
struct
worker
*
w
,
int
vsl_id
,
const
struct
http
*
hp
)
http_CopyHome
(
struct
worker
*
w
,
unsigned
vsl_id
,
const
struct
http
*
hp
)
{
unsigned
u
,
l
;
char
*
p
;
...
...
@@ -939,7 +939,8 @@ http_ClrHeader(struct http *to)
/*--------------------------------------------------------------------*/
void
http_SetHeader
(
struct
worker
*
w
,
int
vsl_id
,
struct
http
*
to
,
const
char
*
hdr
)
http_SetHeader
(
struct
worker
*
w
,
unsigned
vsl_id
,
struct
http
*
to
,
const
char
*
hdr
)
{
CHECK_OBJ_NOTNULL
(
to
,
HTTP_MAGIC
);
...
...
@@ -954,8 +955,8 @@ http_SetHeader(struct worker *w, int vsl_id, struct http *to, const char *hdr)
/*--------------------------------------------------------------------*/
static
void
http_PutField
(
struct
worker
*
w
,
int
vsl_id
,
const
struct
http
*
to
,
int
field
,
const
char
*
string
)
http_PutField
(
struct
worker
*
w
,
unsigned
vsl_id
,
const
struct
http
*
to
,
int
field
,
const
char
*
string
)
{
char
*
p
;
unsigned
l
;
...
...
@@ -977,7 +978,7 @@ http_PutField(struct worker *w, int vsl_id, const struct http *to, int field,
}
void
http_PutProtocol
(
struct
worker
*
w
,
int
vsl_id
,
const
struct
http
*
to
,
http_PutProtocol
(
struct
worker
*
w
,
unsigned
vsl_id
,
const
struct
http
*
to
,
const
char
*
protocol
)
{
...
...
@@ -993,7 +994,7 @@ http_PutStatus(struct http *to, uint16_t status)
}
void
http_PutResponse
(
struct
worker
*
w
,
int
vsl_id
,
const
struct
http
*
to
,
http_PutResponse
(
struct
worker
*
w
,
unsigned
vsl_id
,
const
struct
http
*
to
,
const
char
*
response
)
{
...
...
@@ -1001,7 +1002,7 @@ http_PutResponse(struct worker *w, int vsl_id, const struct http *to,
}
void
http_PrintfHeader
(
struct
worker
*
w
,
int
vsl_id
,
struct
http
*
to
,
http_PrintfHeader
(
struct
worker
*
w
,
unsigned
vsl_id
,
struct
http
*
to
,
const
char
*
fmt
,
...)
{
va_list
ap
;
...
...
bin/varnishd/cache_response.c
View file @
0d58f56e
...
...
@@ -92,12 +92,12 @@ res_dorange(const struct sess *sp, const char *r, ssize_t *plow, ssize_t *phigh)
if
(
low
>
high
)
return
;
http_PrintfHeader
(
sp
->
wrk
,
sp
->
f
d
,
sp
->
wrk
->
resp
,
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_i
d
,
sp
->
wrk
->
resp
,
"Content-Range: bytes %jd-%jd/%jd"
,
(
intmax_t
)
low
,
(
intmax_t
)
high
,
(
intmax_t
)
sp
->
obj
->
len
);
http_Unset
(
sp
->
wrk
->
resp
,
H_Content_Length
);
assert
(
sp
->
wrk
->
res_mode
&
RES_LEN
);
http_PrintfHeader
(
sp
->
wrk
,
sp
->
f
d
,
sp
->
wrk
->
resp
,
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_i
d
,
sp
->
wrk
->
resp
,
"Content-Length: %jd"
,
(
intmax_t
)(
1
+
high
-
low
));
http_SetResp
(
sp
->
wrk
->
resp
,
"HTTP/1.1"
,
206
,
"Partial Content"
);
...
...
@@ -118,34 +118,34 @@ RES_BuildHttp(const struct sess *sp)
http_ClrHeader
(
sp
->
wrk
->
resp
);
sp
->
wrk
->
resp
->
logtag
=
HTTP_Tx
;
http_CopyResp
(
sp
->
wrk
->
resp
,
sp
->
obj
->
http
);
http_FilterFields
(
sp
->
wrk
,
sp
->
f
d
,
sp
->
wrk
->
resp
,
sp
->
obj
->
http
,
http_FilterFields
(
sp
->
wrk
,
sp
->
vsl_i
d
,
sp
->
wrk
->
resp
,
sp
->
obj
->
http
,
HTTPH_A_DELIVER
);
if
(
!
(
sp
->
wrk
->
res_mode
&
RES_LEN
))
{
http_Unset
(
sp
->
wrk
->
resp
,
H_Content_Length
);
}
else
if
(
params
->
http_range_support
)
{
/* We only accept ranges if we know the length */
http_SetHeader
(
sp
->
wrk
,
sp
->
f
d
,
sp
->
wrk
->
resp
,
http_SetHeader
(
sp
->
wrk
,
sp
->
vsl_i
d
,
sp
->
wrk
->
resp
,
"Accept-Ranges: bytes"
);
}
if
(
sp
->
wrk
->
res_mode
&
RES_CHUNKED
)
http_PrintfHeader
(
sp
->
wrk
,
sp
->
f
d
,
sp
->
wrk
->
resp
,
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_i
d
,
sp
->
wrk
->
resp
,
"Transfer-Encoding: chunked"
);
TIM_format
(
TIM_real
(),
time_str
);
http_PrintfHeader
(
sp
->
wrk
,
sp
->
f
d
,
sp
->
wrk
->
resp
,
"Date: %s"
,
time_str
);
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_i
d
,
sp
->
wrk
->
resp
,
"Date: %s"
,
time_str
);
if
(
sp
->
xid
!=
sp
->
obj
->
xid
)
http_PrintfHeader
(
sp
->
wrk
,
sp
->
f
d
,
sp
->
wrk
->
resp
,
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_i
d
,
sp
->
wrk
->
resp
,
"X-Varnish: %u %u"
,
sp
->
xid
,
sp
->
obj
->
xid
);
else
http_PrintfHeader
(
sp
->
wrk
,
sp
->
f
d
,
sp
->
wrk
->
resp
,
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_i
d
,
sp
->
wrk
->
resp
,
"X-Varnish: %u"
,
sp
->
xid
);
http_PrintfHeader
(
sp
->
wrk
,
sp
->
f
d
,
sp
->
wrk
->
resp
,
"Age: %.0f"
,
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_i
d
,
sp
->
wrk
->
resp
,
"Age: %.0f"
,
sp
->
obj
->
exp
.
age
+
sp
->
t_resp
-
sp
->
obj
->
exp
.
entered
);
http_SetHeader
(
sp
->
wrk
,
sp
->
f
d
,
sp
->
wrk
->
resp
,
"Via: 1.1 varnish"
);
http_PrintfHeader
(
sp
->
wrk
,
sp
->
f
d
,
sp
->
wrk
->
resp
,
"Connection: %s"
,
http_SetHeader
(
sp
->
wrk
,
sp
->
vsl_i
d
,
sp
->
wrk
->
resp
,
"Via: 1.1 varnish"
);
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_i
d
,
sp
->
wrk
->
resp
,
"Connection: %s"
,
sp
->
doclose
?
"close"
:
"keep-alive"
);
}
...
...
@@ -348,7 +348,7 @@ RES_StreamStart(struct sess *sp)
if
(
!
(
sp
->
wrk
->
res_mode
&
RES_CHUNKED
)
&&
sp
->
wrk
->
h_content_length
!=
NULL
)
http_PrintfHeader
(
sp
->
wrk
,
sp
->
f
d
,
sp
->
wrk
->
resp
,
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_i
d
,
sp
->
wrk
->
resp
,
"Content-Length: %s"
,
sp
->
wrk
->
h_content_length
);
sp
->
wrk
->
acct_tmp
.
hdrbytes
+=
...
...
bin/varnishd/cache_vrt.c
View file @
0d58f56e
...
...
@@ -86,7 +86,7 @@ VRT_count(const struct sess *sp, unsigned u)
void
VRT_acl_log
(
const
struct
sess
*
sp
,
const
char
*
msg
)
{
WS
L
(
sp
->
wrk
,
SLT_VCL_acl
,
sp
->
fd
,
msg
);
WS
P
(
sp
,
SLT_VCL_acl
,
msg
);
}
/*--------------------------------------------------------------------*/
...
...
@@ -232,7 +232,7 @@ VRT_SetHdr(const struct sess *sp , enum gethdr_e where, const char *hdr,
WSP
(
sp
,
SLT_LostHeader
,
"%s"
,
hdr
+
1
);
}
else
{
http_Unset
(
hp
,
hdr
);
http_SetHeader
(
sp
->
wrk
,
sp
->
f
d
,
hp
,
b
);
http_SetHeader
(
sp
->
wrk
,
sp
->
vsl_i
d
,
hp
,
b
);
}
}
va_end
(
ap
);
...
...
@@ -418,7 +418,7 @@ VRT_synth_page(const struct sess *sp, unsigned flags, const char *str, ...)
va_end
(
ap
);
SMS_Finish
(
sp
->
obj
);
http_Unset
(
sp
->
obj
->
http
,
H_Content_Length
);
http_PrintfHeader
(
sp
->
wrk
,
sp
->
f
d
,
sp
->
obj
->
http
,
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_i
d
,
sp
->
obj
->
http
,
"Content-Length: %d"
,
sp
->
obj
->
len
);
}
...
...
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