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
0776128d
Commit
0776128d
authored
Sep 11, 2015
by
Lasse Karstensen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 4.1
parents
d0bdfb19
6ad2dd4d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
51 additions
and
30 deletions
+51
-30
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+27
-12
varnishstat.c
bin/varnishstat/varnishstat.c
+9
-5
varnishstat_curses.c
bin/varnishstat/varnishstat_curses.c
+4
-4
r00325.vtc
bin/varnishtest/tests/r00325.vtc
+2
-2
r01729.vtc
bin/varnishtest/tests/r01729.vtc
+3
-1
vtc_process.c
bin/varnishtest/vtc_process.c
+4
-4
varnishstat.rst
doc/sphinx/reference/varnishstat.rst
+1
-1
Makefile.am
lib/libvarnishapi/Makefile.am
+1
-1
No files found.
bin/varnishd/cache/cache_esi_deliver.c
View file @
0776128d
...
...
@@ -405,6 +405,18 @@ VDP_ESI(struct req *req, enum vdp_action act, void **priv,
}
}
/*
* Account body bytes on req
* Push bytes to preq
*/
static
inline
int
ved_bytes
(
struct
req
*
req
,
struct
req
*
preq
,
enum
vdp_action
act
,
const
void
*
ptr
,
ssize_t
len
)
{
req
->
acct
.
resp_bodybytes
+=
len
;
return
(
VDP_bytes
(
preq
,
act
,
ptr
,
len
));
}
/*---------------------------------------------------------------------
* If a gzip'ed ESI object includes a ungzip'ed object, we need to make
* it looked like a gzip'ed data stream. The official way to do so would
...
...
@@ -431,9 +443,11 @@ ved_pretend_gzip(struct req *req, enum vdp_action act, void **priv,
const
uint8_t
*
p
;
uint16_t
lx
;
struct
ecx
*
ecx
;
struct
req
*
preq
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CAST_OBJ_NOTNULL
(
ecx
,
*
priv
,
ECX_MAGIC
);
preq
=
ecx
->
preq
;
(
void
)
priv
;
if
(
act
==
VDP_INIT
)
...
...
@@ -443,7 +457,7 @@ ved_pretend_gzip(struct req *req, enum vdp_action act, void **priv,
return
(
0
);
}
if
(
l
==
0
)
return
(
VDP_bytes
(
ecx
->
preq
,
act
,
pv
,
l
));
return
(
ved_bytes
(
req
,
ecx
->
preq
,
act
,
pv
,
l
));
p
=
pv
;
...
...
@@ -460,23 +474,23 @@ ved_pretend_gzip(struct req *req, enum vdp_action act, void **priv,
while
(
l
>
0
)
{
if
(
l
>=
65535
)
{
lx
=
65535
;
if
(
VDP_bytes
(
ecx
->
preq
,
VDP_NULL
,
buf1
,
sizeof
buf1
))
if
(
ved_bytes
(
req
,
preq
,
VDP_NULL
,
buf1
,
sizeof
buf1
))
return
(
-
1
);
}
else
{
lx
=
(
uint16_t
)
l
;
buf2
[
0
]
=
0
;
vle16enc
(
buf2
+
1
,
lx
);
vle16enc
(
buf2
+
3
,
~
lx
);
if
(
VDP_bytes
(
ecx
->
preq
,
VDP_NULL
,
buf2
,
sizeof
buf2
))
if
(
ved_bytes
(
req
,
preq
,
VDP_NULL
,
buf2
,
sizeof
buf2
))
return
(
-
1
);
}
if
(
VDP_bytes
(
ecx
->
preq
,
VDP_NULL
,
p
,
lx
))
if
(
ved_bytes
(
req
,
preq
,
VDP_NULL
,
p
,
lx
))
return
(
-
1
);
l
-=
lx
;
p
+=
lx
;
}
/* buf2 is local, have to flush */
return
(
VDP_bytes
(
ecx
->
preq
,
VDP_FLUSH
,
NULL
,
0
));
return
(
ved_bytes
(
req
,
preq
,
VDP_FLUSH
,
NULL
,
0
));
}
/*---------------------------------------------------------------------
...
...
@@ -515,10 +529,12 @@ ved_stripgzip(struct req *req, struct busyobj *bo)
void
*
sp
;
ssize_t
sl
,
ll
,
dl
;
struct
ecx
*
ecx
;
struct
req
*
preq
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
->
objcore
,
OBJCORE_MAGIC
);
CAST_OBJ_NOTNULL
(
ecx
,
req
->
transport_priv
,
ECX_MAGIC
);
preq
=
ecx
->
preq
;
if
(
bo
!=
NULL
)
VBO_waitstate
(
bo
,
BOS_FINISHED
);
...
...
@@ -578,7 +594,7 @@ ved_stripgzip(struct req *req, struct busyobj *bo)
if
(
dl
>
0
)
{
if
(
dl
>
sl
)
dl
=
sl
;
if
(
VDP_bytes
(
ecx
->
preq
,
VDP_NULL
,
pp
,
dl
))
if
(
ved_bytes
(
req
,
preq
,
VDP_NULL
,
pp
,
dl
))
break
;
ll
+=
dl
;
sl
-=
dl
;
...
...
@@ -589,7 +605,7 @@ ved_stripgzip(struct req *req, struct busyobj *bo)
/* Remove the "LAST" bit */
dbits
[
0
]
=
*
pp
;
dbits
[
0
]
&=
~
(
1U
<<
(
last
&
7
));
if
(
VDP_bytes
(
ecx
->
preq
,
VDP_NULL
,
dbits
,
1
))
if
(
ved_bytes
(
req
,
preq
,
VDP_NULL
,
dbits
,
1
))
break
;
ll
++
;
sl
--
;
...
...
@@ -601,7 +617,7 @@ ved_stripgzip(struct req *req, struct busyobj *bo)
if
(
dl
>
0
)
{
if
(
dl
>
sl
)
dl
=
sl
;
if
(
VDP_bytes
(
ecx
->
preq
,
VDP_NULL
,
pp
,
dl
))
if
(
ved_bytes
(
req
,
preq
,
VDP_NULL
,
pp
,
dl
))
break
;
ll
+=
dl
;
sl
-=
dl
;
...
...
@@ -663,7 +679,7 @@ ved_stripgzip(struct req *req, struct busyobj *bo)
default:
WRONG
(
"compiler must be broken"
);
}
if
(
VDP_bytes
(
ecx
->
preq
,
VDP_NULL
,
dbits
+
1
,
lpad
))
if
(
ved_bytes
(
req
,
preq
,
VDP_NULL
,
dbits
+
1
,
lpad
))
break
;
}
if
(
sl
>
0
)
{
...
...
@@ -686,7 +702,7 @@ ved_stripgzip(struct req *req, struct busyobj *bo)
}
}
while
(
ois
==
OIS_DATA
||
ois
==
OIS_STREAM
);
ObjIterEnd
(
req
->
objcore
,
&
oi
);
(
void
)
VDP_bytes
(
ecx
->
preq
,
VDP_FLUSH
,
NULL
,
0
);
(
void
)
ved_bytes
(
req
,
preq
,
VDP_FLUSH
,
NULL
,
0
);
icrc
=
vle32dec
(
tailbuf
);
ilen
=
vle32dec
(
tailbuf
+
4
);
...
...
@@ -711,8 +727,7 @@ ved_vdp_bytes(struct req *req, enum vdp_action act, void **priv,
return
(
0
);
}
CAST_OBJ_NOTNULL
(
preq
,
*
priv
,
REQ_MAGIC
);
req
->
acct
.
resp_bodybytes
+=
len
;
return
(
VDP_bytes
(
preq
,
act
,
ptr
,
len
));
return
(
ved_bytes
(
req
,
preq
,
act
,
ptr
,
len
));
}
/*--------------------------------------------------------------------*/
...
...
bin/varnishstat/varnishstat.c
View file @
0776128d
...
...
@@ -251,17 +251,21 @@ usage(void)
{
#define FMT " %-28s # %s\n"
fprintf
(
stderr
,
"usage: varnishstat "
"[-1lV] [-f field] "
"[-1lV] [-f field]
[-t seconds|<off>]
"
VSC_n_USAGE
"
\n
"
);
fprintf
(
stderr
,
FMT
,
"-1"
,
"Print the statistics to stdout."
);
fprintf
(
stderr
,
FMT
,
"-f field"
,
"Field inclusion glob"
);
fprintf
(
stderr
,
FMT
,
""
,
"If it starts with '^' it is used as an exclusion list"
);
"If it starts with '^' it is used as an exclusion list
.
"
);
fprintf
(
stderr
,
FMT
,
"-l"
,
"Lists the available fields to use with the -f option"
);
"Lists the available fields to use with the -f option
.
"
);
fprintf
(
stderr
,
FMT
,
"-n varnish_name"
,
"The varnishd instance to get logs from"
);
fprintf
(
stderr
,
FMT
,
"-V"
,
"Display the version number and exit"
);
"The varnishd instance to get logs from."
);
fprintf
(
stderr
,
FMT
,
"-N filename"
,
"Filename of a stale VSM instance."
);
fprintf
(
stderr
,
FMT
,
"-t seconds|<off>"
,
"Timeout before returning error on initial VSM connection."
);
fprintf
(
stderr
,
FMT
,
"-V"
,
"Display the version number and exit."
);
fprintf
(
stderr
,
FMT
,
"-x"
,
"Print statistics to stdout as XML."
);
fprintf
(
stderr
,
FMT
,
"-j"
,
...
...
bin/varnishstat/varnishstat_curses.c
View file @
0776128d
...
...
@@ -384,14 +384,14 @@ sample_points(void)
pt
->
t_cur
=
VTIM_mono
();
if
(
pt
->
t_last
)
pt
->
chg
=
((
int
max_t
)
pt
->
cur
-
(
intmax
_t
)
pt
->
last
)
/
pt
->
chg
=
((
int
64_t
)
pt
->
cur
-
(
int64
_t
)
pt
->
last
)
/
(
pt
->
t_cur
-
pt
->
t_last
);
if
(
pt
->
semantics
==
'g'
)
{
pt
->
avg
=
0
.;
update_ma
(
&
pt
->
ma_10
,
pt
->
cur
);
update_ma
(
&
pt
->
ma_100
,
pt
->
cur
);
update_ma
(
&
pt
->
ma_1000
,
pt
->
cur
);
update_ma
(
&
pt
->
ma_10
,
(
int64_t
)
pt
->
cur
);
update_ma
(
&
pt
->
ma_100
,
(
int64_t
)
pt
->
cur
);
update_ma
(
&
pt
->
ma_1000
,
(
int64_t
)
pt
->
cur
);
}
else
if
(
pt
->
semantics
==
'c'
)
{
if
(
VSC_C_main
!=
NULL
&&
VSC_C_main
->
uptime
)
pt
->
avg
=
pt
->
cur
/
VSC_C_main
->
uptime
;
...
...
bin/varnishtest/tests/r00325.vtc
View file @
0776128d
...
...
@@ -2,7 +2,7 @@ varnishtest "Check lack of response-string"
server s1 {
rxreq
send "HTTP/1.
1
200 \r\n"
send "HTTP/1.
0
200 \r\n"
send "Connection: close\r\n"
send "\r\n"
send "\r\n"
...
...
@@ -20,7 +20,7 @@ client c1 {
server s1 {
rxreq
send "HTTP/1.
1
200\r\n"
send "HTTP/1.
0
200\r\n"
send "Connection: close\r\n"
send "\r\n"
send "\r\n"
...
...
bin/varnishtest/tests/r01729.vtc
View file @
0776128d
varnishtest "C-L/T-E:chunked conflict"
server s1 {
non-fatal
rxreq
expect req.bodylen == 20
...
...
@@ -20,6 +21,7 @@ varnish v1 -vcl+backend { } -start
client c1 {
non-fatal
send "PUT /1 HTTP/1.1\r\n"
send "Content-Length: 31\r\n"
send "Transfer-Encoding: chunked\r\n"
...
...
@@ -35,7 +37,7 @@ client c1 {
} -run
client c1 {
fatal
send "PUT /2 HTTP/1.1\r\n"
send "Transfer-Encoding: chunked\r\n"
send "\r\n"
...
...
bin/varnishtest/vtc_process.c
View file @
0776128d
...
...
@@ -165,11 +165,11 @@ process_thread(void *priv)
if
(
WIFEXITED
(
p
->
status
)
&&
WEXITSTATUS
(
p
->
status
)
==
0
)
return
(
NULL
);
#ifdef WCOREDUMP
vtc_log
(
p
->
vl
,
2
,
"Bad exit code: %04x sig %
x exit %x core %x
"
,
vtc_log
(
p
->
vl
,
2
,
"Bad exit code: %04x sig %
d exit %d core %d
"
,
p
->
status
,
WTERMSIG
(
p
->
status
),
WEXITSTATUS
(
p
->
status
),
WCOREDUMP
(
p
->
status
));
#else
vtc_log
(
p
->
vl
,
2
,
"Bad exit code: %04x sig %
x exit %x
"
,
vtc_log
(
p
->
vl
,
2
,
"Bad exit code: %04x sig %
d exit %d
"
,
p
->
status
,
WTERMSIG
(
p
->
status
),
WEXITSTATUS
(
p
->
status
));
#endif
...
...
@@ -202,7 +202,7 @@ process_start(struct process *p)
if
(
p
->
pid
==
0
)
{
assert
(
dup2
(
p
->
fds
[
0
],
0
)
==
0
);
assert
(
dup2
(
out_fd
,
1
)
==
1
);
assert
(
dup2
(
out
_fd
,
2
)
==
2
);
assert
(
dup2
(
err
_fd
,
2
)
==
2
);
for
(
i
=
3
;
i
<
getdtablesize
();
i
++
)
(
void
)
close
(
i
);
AZ
(
execl
(
"/bin/sh"
,
"/bin/sh"
,
"-c"
,
VSB_data
(
cl
),
(
char
*
)
0
));
...
...
@@ -299,7 +299,7 @@ process_close(struct process *p)
if
(
!
p
->
running
||
!
p
->
pid
)
vtc_log
(
p
->
vl
,
0
,
"Cannot close on a non-running process"
);
AZ
(
close
(
p
->
fds
[
1
])
);
(
void
)
close
(
p
->
fds
[
1
]
);
p
->
fds
[
1
]
=
-
1
;
}
...
...
doc/sphinx/reference/varnishstat.rst
View file @
0776128d
...
...
@@ -15,7 +15,7 @@ Varnish Cache statistics
SYNOPSIS
========
varnishstat [-1] [-x] [-j] [-f field] [-l] [-n varnish_name] [-N filename] [-V]
varnishstat [-1] [-x] [-j] [-f field] [-l] [-n varnish_name] [-N filename] [-
t seconds|<off>] [-
V]
.. TODO: autogenerate this synopsis like the others.
...
...
lib/libvarnishapi/Makefile.am
View file @
0776128d
...
...
@@ -9,7 +9,7 @@ AM_CPPFLAGS = \
lib_LTLIBRARIES
=
libvarnishapi.la
libvarnishapi_la_LDFLAGS
=
$(AM_LDFLAGS)
-version-info
1:
0
:0
libvarnishapi_la_LDFLAGS
=
$(AM_LDFLAGS)
-version-info
1:
4
:0
libvarnishapi_la_SOURCES
=
\
vsm_api.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