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
2608703b
Commit
2608703b
authored
Feb 20, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Give WRW a hint about which vsl to log to.
Consequent Constification
parent
e65be4b1
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
25 additions
and
23 deletions
+25
-23
cache.h
bin/varnishd/cache/cache.h
+8
-8
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+1
-1
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+1
-1
cache_gzip.c
bin/varnishd/cache/cache_gzip.c
+1
-1
cache_http.c
bin/varnishd/cache/cache_http.c
+1
-1
cache_pipe.c
bin/varnishd/cache/cache_pipe.c
+1
-1
cache_response.c
bin/varnishd/cache/cache_response.c
+1
-1
cache_wrw.c
bin/varnishd/cache/cache_wrw.c
+11
-9
No files found.
bin/varnishd/cache/cache.h
View file @
2608703b
...
...
@@ -773,7 +773,7 @@ void VGZ_UpdateObj(const struct vgz*, struct object *);
int
VGZ_WrwInit
(
struct
vgz
*
vg
);
int
VGZ_WrwGunzip
(
struct
worker
*
w
,
struct
vgz
*
,
const
void
*
ibuf
,
ssize_t
ibufl
);
void
VGZ_WrwFlush
(
struct
worker
*
wrk
,
struct
vgz
*
vg
);
void
VGZ_WrwFlush
(
const
struct
worker
*
wrk
,
struct
vgz
*
vg
);
/* Return values */
#define VGZ_ERROR -1
...
...
@@ -789,7 +789,7 @@ const char *http_StatusMessage(unsigned);
unsigned
http_EstimateWS
(
const
struct
http
*
fm
,
unsigned
how
,
uint16_t
*
nhd
);
void
HTTP_Init
(
void
);
void
http_ClrHeader
(
struct
http
*
to
);
unsigned
http_Write
(
struct
worker
*
w
,
const
struct
http
*
hp
,
int
resp
);
unsigned
http_Write
(
const
struct
worker
*
w
,
const
struct
http
*
hp
,
int
resp
);
void
http_SetResp
(
struct
http
*
to
,
const
char
*
proto
,
uint16_t
status
,
const
char
*
response
);
void
http_FilterReq
(
const
struct
sess
*
sp
,
unsigned
how
);
...
...
@@ -885,13 +885,13 @@ int Pool_Task(struct pool *pp, struct pool_task *task, enum pool_how how);
#define WRW_IsReleased(w) ((w)->wrw == NULL)
int
WRW_Error
(
const
struct
worker
*
w
);
void
WRW_Chunked
(
struct
worker
*
w
);
void
WRW_EndChunk
(
struct
worker
*
w
);
void
WRW_Reserve
(
struct
worker
*
w
,
int
*
fd
,
double
t0
);
unsigned
WRW_Flush
(
struct
worker
*
w
);
void
WRW_Chunked
(
const
struct
worker
*
w
);
void
WRW_EndChunk
(
const
struct
worker
*
w
);
void
WRW_Reserve
(
struct
worker
*
w
,
int
*
fd
,
struct
vsl_log
*
,
double
t0
);
unsigned
WRW_Flush
(
const
struct
worker
*
w
);
unsigned
WRW_FlushRelease
(
struct
worker
*
w
);
unsigned
WRW_Write
(
struct
worker
*
w
,
const
void
*
ptr
,
int
len
);
unsigned
WRW_WriteH
(
struct
worker
*
w
,
const
txt
*
hh
,
const
char
*
suf
);
unsigned
WRW_Write
(
const
struct
worker
*
w
,
const
void
*
ptr
,
int
len
);
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
);
...
...
bin/varnishd/cache/cache_esi_deliver.c
View file @
2608703b
...
...
@@ -113,7 +113,7 @@ ved_include(struct sess *sp, const char *src, const char *host)
WS_Reset
(
sp
->
req
->
ws
,
sp_ws_wm
);
WS_Reset
(
w
->
aws
,
wrk_ws_wm
);
/* XXX ? */
WRW_Reserve
(
sp
->
wrk
,
&
sp
->
fd
,
sp
->
req
->
t_resp
);
WRW_Reserve
(
sp
->
wrk
,
&
sp
->
fd
,
sp
->
req
->
vsl
,
sp
->
req
->
t_resp
);
if
(
sp
->
req
->
res_mode
&
RES_CHUNKED
)
WRW_Chunked
(
sp
->
wrk
);
}
...
...
bin/varnishd/cache/cache_fetch.c
View file @
2608703b
...
...
@@ -428,7 +428,7 @@ FetchHdr(struct sess *sp, int need_host_hdr, int sendbody)
VDI_AddHostHeader
(
bo
->
bereq
,
vc
);
(
void
)
VTCP_blocking
(
vc
->
fd
);
/* XXX: we should timeout instead */
WRW_Reserve
(
wrk
,
&
vc
->
fd
,
sp
->
t_req
);
/* XXX t_resp ? */
WRW_Reserve
(
wrk
,
&
vc
->
fd
,
bo
->
vsl
,
sp
->
t_req
);
/* XXX t_resp ? */
(
void
)
http_Write
(
wrk
,
hp
,
0
);
/* XXX: stats ? */
/* Deal with any message-body the request might have */
...
...
bin/varnishd/cache/cache_gzip.c
View file @
2608703b
...
...
@@ -356,7 +356,7 @@ VGZ_WrwGunzip(struct worker *wrk, struct vgz *vg, const void *ibuf,
/*--------------------------------------------------------------------*/
void
VGZ_WrwFlush
(
struct
worker
*
wrk
,
struct
vgz
*
vg
)
VGZ_WrwFlush
(
const
struct
worker
*
wrk
,
struct
vgz
*
vg
)
{
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
vg
,
VGZ_MAGIC
);
...
...
bin/varnishd/cache/cache_http.c
View file @
2608703b
...
...
@@ -1061,7 +1061,7 @@ HTTP_Copy(struct http *to, const struct http * const fm)
/*--------------------------------------------------------------------*/
unsigned
http_Write
(
struct
worker
*
w
,
const
struct
http
*
hp
,
int
resp
)
http_Write
(
const
struct
worker
*
w
,
const
struct
http
*
hp
,
int
resp
)
{
unsigned
u
,
l
;
...
...
bin/varnishd/cache/cache_pipe.c
View file @
2608703b
...
...
@@ -80,7 +80,7 @@ PipeSession(struct sess *sp)
bo
->
vbc
=
vc
;
/* For panic dumping */
(
void
)
VTCP_blocking
(
vc
->
fd
);
WRW_Reserve
(
wrk
,
&
vc
->
fd
,
sp
->
t_req
);
WRW_Reserve
(
wrk
,
&
vc
->
fd
,
bo
->
vsl
,
sp
->
t_req
);
sp
->
wrk
->
acct_tmp
.
hdrbytes
+=
http_Write
(
wrk
,
bo
->
bereq
,
0
);
...
...
bin/varnishd/cache/cache_response.c
View file @
2608703b
...
...
@@ -237,7 +237,7 @@ RES_WriteObj(struct sess *sp)
req
=
sp
->
req
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
WRW_Reserve
(
sp
->
wrk
,
&
sp
->
fd
,
sp
->
req
->
t_resp
);
WRW_Reserve
(
sp
->
wrk
,
&
sp
->
fd
,
sp
->
req
->
vsl
,
sp
->
req
->
t_resp
);
if
(
req
->
obj
->
response
==
200
&&
req
->
http
->
conds
&&
...
...
bin/varnishd/cache/cache_wrw.c
View file @
2608703b
...
...
@@ -57,6 +57,7 @@ struct wrw {
ssize_t
cliov
;
unsigned
ciov
;
/* Chunked header marker */
double
t0
;
struct
vsl_log
*
vsl
;
};
/*--------------------------------------------------------------------
...
...
@@ -70,7 +71,7 @@ WRW_Error(const struct worker *wrk)
}
void
WRW_Reserve
(
struct
worker
*
wrk
,
int
*
fd
,
double
t0
)
WRW_Reserve
(
struct
worker
*
wrk
,
int
*
fd
,
struct
vsl_log
*
vsl
,
double
t0
)
{
struct
wrw
*
wrw
;
unsigned
u
;
...
...
@@ -95,6 +96,7 @@ WRW_Reserve(struct worker *wrk, int *fd, double t0)
wrw
->
niov
=
0
;
wrw
->
wfd
=
fd
;
wrw
->
t0
=
t0
;
wrw
->
vsl
=
vsl
;
wrk
->
wrw
=
wrw
;
}
...
...
@@ -136,7 +138,7 @@ wrw_prune(struct wrw *wrw, ssize_t bytes)
}
unsigned
WRW_Flush
(
struct
worker
*
wrk
)
WRW_Flush
(
const
struct
worker
*
wrk
)
{
ssize_t
i
;
struct
wrw
*
wrw
;
...
...
@@ -179,7 +181,7 @@ WRW_Flush(struct worker *wrk)
*/
if
(
VTIM_real
()
-
wrw
->
t0
>
cache_param
->
send_timeout
)
{
WSL
(
wrk
->
vsl
,
SLT_Debug
,
*
wrw
->
wfd
,
VSLb
(
wrw
->
vsl
,
SLT_Debug
,
"Hit total send timeout, "
"wrote = %zd/%zd; not retrying"
,
i
,
wrw
->
liov
);
...
...
@@ -187,7 +189,7 @@ WRW_Flush(struct worker *wrk)
break
;
}
WSL
(
wrk
->
vsl
,
SLT_Debug
,
*
wrw
->
wfd
,
VSLb
(
wrw
->
vsl
,
SLT_Debug
,
"Hit send timeout, wrote = %zd/%zd; retrying"
,
i
,
wrw
->
liov
);
...
...
@@ -196,7 +198,7 @@ WRW_Flush(struct worker *wrk)
}
if
(
i
<=
0
)
{
wrw
->
werr
++
;
WSL
(
wrk
->
vsl
,
SLT_Debug
,
*
wrw
->
wfd
,
VSLb
(
wrw
->
vsl
,
SLT_Debug
,
"Write error, retval = %zd, len = %zd, errno = %s"
,
i
,
wrw
->
liov
,
strerror
(
errno
));
}
...
...
@@ -222,7 +224,7 @@ WRW_FlushRelease(struct worker *wrk)
}
unsigned
WRW_WriteH
(
struct
worker
*
wrk
,
const
txt
*
hh
,
const
char
*
suf
)
WRW_WriteH
(
const
struct
worker
*
wrk
,
const
txt
*
hh
,
const
char
*
suf
)
{
unsigned
u
;
...
...
@@ -239,7 +241,7 @@ WRW_WriteH(struct worker *wrk, const txt *hh, const char *suf)
}
unsigned
WRW_Write
(
struct
worker
*
wrk
,
const
void
*
ptr
,
int
len
)
WRW_Write
(
const
struct
worker
*
wrk
,
const
void
*
ptr
,
int
len
)
{
struct
wrw
*
wrw
;
...
...
@@ -265,7 +267,7 @@ WRW_Write(struct worker *wrk, const void *ptr, int len)
}
void
WRW_Chunked
(
struct
worker
*
wrk
)
WRW_Chunked
(
const
struct
worker
*
wrk
)
{
struct
wrw
*
wrw
;
...
...
@@ -294,7 +296,7 @@ WRW_Chunked(struct worker *wrk)
*/
void
WRW_EndChunk
(
struct
worker
*
wrk
)
WRW_EndChunk
(
const
struct
worker
*
wrk
)
{
struct
wrw
*
wrw
;
...
...
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