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
bc19f22d
Commit
bc19f22d
authored
Oct 06, 2011
by
Per Buer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://git.varnish-cache.org/git/varnish-cache
parents
880b0f85
1c9bf690
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
15 deletions
+78
-15
v00010.vtc
bin/varnishtest/tests/v00010.vtc
+9
-9
vtc_varnish.c
bin/varnishtest/vtc_varnish.c
+58
-0
vsl.c
lib/libvarnishapi/vsl.c
+0
-2
Makefile.am
man/Makefile.am
+4
-1
varnish.spec
redhat/varnish.spec
+7
-3
No files found.
bin/varnishtest/tests/v00010.vtc
View file @
bc19f22d
...
...
@@ -5,6 +5,8 @@ server s1 {
txresp -hdr "Foo: bar" -body "abcdef\n"
rxreq
txresp -hdr "Panic: please" -body "012345\n"
close
sema r1 sync 2
accept
rxreq
...
...
@@ -25,25 +27,23 @@ varnish v1 -cliok "param.set diag_bitmap 0x00001000"
# Force the (random) port selected to be used again after restart.
varnish v1 -cliok "param.set listen_address ${v1_addr}:${v1_port}"
# varnishtest defaults to auto_restart off, to avoid masking bugs.
varnish v1 -cliok "param.set auto_restart on"
client c1 {
txreq -url "/"
rxresp
txreq -url "/foo"
# Don't expect answer, the server crashed.
sema r1 sync 2
} -run
delay 2.5
varnish v1 -wait-stopped
varnish v1 -cliok "panic.show"
varnish v1 -cliok "panic.clear"
varnish v1 -clierr 300 "panic.clear"
varnish v1 -cliok "start"
varnish v1 -wait-running
sema r1 sync 2
client c1 {
txreq -url "/"
rxresp
expect resp.http.foo == "foo"
} -run
varnish v1 -cliok "panic.show"
varnish v1 -cliok "panic.clear"
varnish v1 -clierr 300 "panic.clear"
bin/varnishtest/vtc_varnish.c
View file @
bc19f22d
...
...
@@ -119,6 +119,55 @@ varnish_ask_cli(const struct varnish *v, const char *cmd, char **repl)
return
((
enum
VCLI_status_e
)
retval
);
}
/**********************************************************************
*
*/
static
void
wait_stopped
(
const
struct
varnish
*
v
)
{
char
*
r
;
enum
VCLI_status_e
st
;
while
(
1
)
{
vtc_log
(
v
->
vl
,
3
,
"wait-stopped"
);
st
=
varnish_ask_cli
(
v
,
"status"
,
&
r
);
if
(
st
!=
CLIS_OK
)
vtc_log
(
v
->
vl
,
0
,
"CLI status command failed: %u %s"
,
st
,
r
);
if
(
!
strcmp
(
r
,
"Child in state stopped"
))
{
free
(
r
);
break
;
}
free
(
r
);
(
void
)
usleep
(
200000
);
}
}
/**********************************************************************
*
*/
static
void
wait_running
(
const
struct
varnish
*
v
)
{
char
*
r
;
enum
VCLI_status_e
st
;
while
(
1
)
{
vtc_log
(
v
->
vl
,
3
,
"wait-running"
);
st
=
varnish_ask_cli
(
v
,
"status"
,
&
r
);
if
(
st
!=
CLIS_OK
)
vtc_log
(
v
->
vl
,
0
,
"CLI status command failed: %u %s"
,
st
,
r
);
if
(
!
strcmp
(
r
,
"Child in state running"
))
{
free
(
r
);
break
;
}
free
(
r
);
(
void
)
usleep
(
200000
);
}
}
/**********************************************************************
* Varnishlog gatherer + thread
*/
...
...
@@ -439,6 +488,7 @@ varnish_start(struct varnish *v)
return
;
if
(
u
!=
CLIS_OK
)
vtc_log
(
v
->
vl
,
0
,
"CLI start command failed: %u %s"
,
u
,
resp
);
wait_running
(
v
);
free
(
resp
);
u
=
varnish_ask_cli
(
v
,
"debug.xid 1000"
,
&
resp
);
if
(
vtc_error
)
...
...
@@ -823,6 +873,14 @@ cmd_varnish(CMD_ARGS)
varnish_stop
(
v
);
continue
;
}
if
(
!
strcmp
(
*
av
,
"-wait-stopped"
))
{
wait_stopped
(
v
);
continue
;
}
if
(
!
strcmp
(
*
av
,
"-wait-running"
))
{
wait_running
(
v
);
continue
;
}
if
(
!
strcmp
(
*
av
,
"-wait"
))
{
varnish_wait
(
v
);
continue
;
...
...
lib/libvarnishapi/vsl.c
View file @
bc19f22d
...
...
@@ -215,7 +215,6 @@ VSL_NextLog(const struct VSM_data *vd, uint32_t **pp, uint64_t *bits)
struct
vsl
*
vsl
;
uint32_t
*
p
;
unsigned
char
t
;
unsigned
u
;
int
i
;
CHECK_OBJ_NOTNULL
(
vd
,
VSM_MAGIC
);
...
...
@@ -226,7 +225,6 @@ VSL_NextLog(const struct VSM_data *vd, uint32_t **pp, uint64_t *bits)
i
=
vsl_nextlog
(
vsl
,
&
p
);
if
(
i
!=
1
)
return
(
i
);
u
=
VSL_ID
(
p
);
t
=
VSL_TAG
(
p
);
if
(
vsl
->
skip
)
{
--
vsl
->
skip
;
...
...
man/Makefile.am
View file @
bc19f22d
#
if
HAVE_RST2MAN
noinst_PROGRAMS
=
vsc2rst
endif
vsc2rst_SOURCES
=
vsc2rst.c
\
$(top_srcdir)
/include/vsc_fields.h
...
...
@@ -30,10 +32,11 @@ else
@false
endif
varnish-counters.7
:
vsc2rst
if
HAVE_RST2MAN
varnish-counters.7
:
vsc2rst
./vsc2rst |
${
RST2MAN
}
-
$@
else
varnish-counters.7
:
$(top_srcdir)/include/vsc_fields.h
@
echo
"========================================"
@
echo
"You need rst2man installed to make dist"
@
echo
"========================================"
...
...
redhat/varnish.spec
View file @
bc19f22d
%define v_rc
%define vd_rc %{?v_rc:-%{?v_rc}}
Summary: High-performance HTTP accelerator
Name: varnish
Version: 3.
0
.0
Release: 0.2011
0715
%{?dist}
Version: 3.
1
.0
Release: 0.2011
1006%{?v_rc}
%{?dist}
License: BSD
Group: System Environment/Daemons
URL: http://www.varnish-cache.org/
#Source0: http://repo.varnish-cache.org/source/%{name}-%{version}.tar.gz
#Source0: %{name}-%{version}%{?vd_rc}.tar.gz
Source0: %{name}-trunk.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# To build from git, start with a make dist, see redhat/README.redhat
...
...
@@ -71,7 +75,7 @@ Documentation files for %name
#Varnish Cache is a high-performance HTTP accelerator
%prep
#%setup -q
#%setup -q
-n varnish-%{version}%{?vd_rc}
%setup -q -n varnish-trunk
mkdir examples
...
...
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