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
12ddc91b
Commit
12ddc91b
authored
Sep 06, 2017
by
Poul-Henning Kamp
Committed by
Pål Hermunn Johansen
Sep 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop the incestous relationship between VSM and VSC, and stack
VSC neatly on top of VSM.
parent
23333e3c
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
77 additions
and
122 deletions
+77
-122
varnishstat.c
bin/varnishstat/varnishstat.c
+18
-15
varnishstat.h
bin/varnishstat/varnishstat.h
+1
-1
varnishstat_curses.c
bin/varnishstat/varnishstat_curses.c
+4
-4
vtc_varnish.c
bin/varnishtest/vtc_varnish.c
+7
-3
vsc.h
include/vapi/vsc.h
+6
-3
Makefile.am
lib/libvarnishapi/Makefile.am
+0
-1
libvarnishapi.map
lib/libvarnishapi/libvarnishapi.map
+2
-0
vsc.c
lib/libvarnishapi/vsc.c
+39
-37
vsc_priv.h
lib/libvarnishapi/vsc_priv.h
+0
-36
vsm.c
lib/libvarnishapi/vsm.c
+0
-22
No files found.
bin/varnishstat/varnishstat.c
View file @
12ddc91b
...
...
@@ -74,7 +74,7 @@ do_xml_cb(void *priv, const struct VSC_point * const pt)
}
static
void
do_xml
(
struct
vs
m
*
vd
)
do_xml
(
struct
vs
c
*
vsc
)
{
char
time_stamp
[
20
];
time_t
now
;
...
...
@@ -83,7 +83,7 @@ do_xml(struct vsm *vd)
now
=
time
(
NULL
);
(
void
)
strftime
(
time_stamp
,
20
,
"%Y-%m-%dT%H:%M:%S"
,
localtime
(
&
now
));
printf
(
"<varnishstat timestamp=
\"
%s
\"
>
\n
"
,
time_stamp
);
(
void
)
VSC_Iter
(
v
d
,
NULL
,
do_xml_cb
,
NULL
);
(
void
)
VSC_Iter
(
v
sc
,
NULL
,
do_xml_cb
,
NULL
);
printf
(
"</varnishstat>
\n
"
);
}
...
...
@@ -124,7 +124,7 @@ do_json_cb(void *priv, const struct VSC_point * const pt)
}
static
void
do_json
(
struct
vs
m
*
vd
)
do_json
(
struct
vs
c
*
vsc
)
{
char
time_stamp
[
20
];
time_t
now
;
...
...
@@ -137,7 +137,7 @@ do_json(struct vsm *vd)
(
void
)
strftime
(
time_stamp
,
20
,
"%Y-%m-%dT%H:%M:%S"
,
localtime
(
&
now
));
printf
(
"
\"
timestamp
\"
:
\"
%s
\"
,
\n
"
,
time_stamp
);
(
void
)
VSC_Iter
(
v
d
,
NULL
,
do_json_cb
,
&
jp
);
(
void
)
VSC_Iter
(
v
sc
,
NULL
,
do_json_cb
,
&
jp
);
printf
(
"
\n
}
\n
"
);
}
...
...
@@ -194,15 +194,15 @@ do_once_cb(void *priv, const struct VSC_point * const pt)
}
static
void
do_once
(
struct
vs
m
*
vd
)
do_once
(
struct
vs
c
*
vsc
)
{
struct
once_priv
op
;
memset
(
&
op
,
0
,
sizeof
op
);
op
.
pad
=
18
;
(
void
)
VSC_Iter
(
v
d
,
NULL
,
do_once_cb_first
,
&
op
);
(
void
)
VSC_Iter
(
v
d
,
NULL
,
do_once_cb
,
&
op
);
(
void
)
VSC_Iter
(
v
sc
,
NULL
,
do_once_cb_first
,
&
op
);
(
void
)
VSC_Iter
(
v
sc
,
NULL
,
do_once_cb
,
&
op
);
}
/*--------------------------------------------------------------------*/
...
...
@@ -226,13 +226,13 @@ do_list_cb(void *priv, const struct VSC_point * const pt)
}
static
void
list_fields
(
struct
vs
m
*
vd
)
list_fields
(
struct
vs
c
*
vsc
)
{
printf
(
"Varnishstat -f option fields:
\n
"
);
printf
(
"Field name Description
\n
"
);
printf
(
"---------- -----------
\n
"
);
(
void
)
VSC_Iter
(
v
d
,
NULL
,
do_list_cb
,
NULL
);
(
void
)
VSC_Iter
(
v
sc
,
NULL
,
do_list_cb
,
NULL
);
}
/*--------------------------------------------------------------------*/
...
...
@@ -256,10 +256,13 @@ main(int argc, char * const *argv)
int
once
=
0
,
xml
=
0
,
json
=
0
,
f_list
=
0
,
curses
=
0
;
signed
char
opt
;
int
i
;
struct
vsc
*
vsc
;
VUT_Init
(
progname
,
argc
,
argv
,
&
vopt_spec
);
vd
=
VSM_New
();
AN
(
vd
);
vsc
=
VSC_New
(
vd
);
AN
(
vsc
);
while
((
opt
=
getopt
(
argc
,
argv
,
vopt_spec
.
vopt_optstring
))
!=
-
1
)
{
switch
(
opt
)
{
...
...
@@ -282,7 +285,7 @@ main(int argc, char * const *argv)
json
=
1
;
break
;
default:
i
=
VSC_Arg
(
v
d
,
opt
,
optarg
);
i
=
VSC_Arg
(
v
sc
,
opt
,
optarg
);
if
(
i
<
0
)
VUT_Error
(
1
,
"%s"
,
VSM_Error
(
vd
));
if
(
!
i
)
...
...
@@ -300,15 +303,15 @@ main(int argc, char * const *argv)
VUT_Error
(
1
,
"%s"
,
VSM_Error
(
vd
));
if
(
curses
)
do_curses
(
vd
,
1
.
0
);
do_curses
(
vd
,
vsc
,
1
.
0
);
else
if
(
xml
)
do_xml
(
v
d
);
do_xml
(
v
sc
);
else
if
(
json
)
do_json
(
v
d
);
do_json
(
v
sc
);
else
if
(
once
)
do_once
(
v
d
);
do_once
(
v
sc
);
else
if
(
f_list
)
list_fields
(
v
d
);
list_fields
(
v
sc
);
else
assert
(
0
);
...
...
bin/varnishstat/varnishstat.h
View file @
12ddc91b
...
...
@@ -35,4 +35,4 @@
#include "vas.h"
#include "vcs.h"
void
do_curses
(
struct
vsm
*
vd
,
double
delay
);
void
do_curses
(
struct
vsm
*
,
struct
vsc
*
,
double
);
bin/varnishstat/varnishstat_curses.c
View file @
12ddc91b
...
...
@@ -313,7 +313,7 @@ build_pt_list_cb(void *priv, const struct VSC_point *vpt)
}
static
void
build_pt_list
(
struct
vs
m
*
vd
,
struct
vsm_fantom
*
fantom
)
build_pt_list
(
struct
vs
c
*
vsc
,
struct
vsm_fantom
*
fantom
)
{
struct
pt_priv
pt_priv
;
int
i
;
...
...
@@ -334,7 +334,7 @@ build_pt_list(struct vsm *vd, struct vsm_fantom *fantom)
main_cache_hit
=
NULL
;
main_cache_miss
=
NULL
;
(
void
)
VSC_Iter
(
v
d
,
fantom
,
build_pt_list_cb
,
&
pt_priv
);
(
void
)
VSC_Iter
(
v
sc
,
fantom
,
build_pt_list_cb
,
&
pt_priv
);
delete_pt_list
();
AN
(
VTAILQ_EMPTY
(
&
ptlist
));
AZ
(
n_ptlist
);
...
...
@@ -1044,7 +1044,7 @@ handle_keypress(int ch)
}
void
do_curses
(
struct
vsm
*
vd
,
double
delay
)
do_curses
(
struct
vsm
*
vd
,
struct
vsc
*
vsc
,
double
delay
)
{
struct
pollfd
pollfd
;
long
t
;
...
...
@@ -1073,7 +1073,7 @@ do_curses(struct vsm *vd, double delay)
(
VSM_Status
(
vd
)
&
(
VSM_MGT_CHANGED
|
VSM_WRK_CHANGED
)))
{
init_hitrate
();
delete_pt_list
();
build_pt_list
(
v
d
,
&
f_iter
);
build_pt_list
(
v
sc
,
&
f_iter
);
initial
=
0
;
}
...
...
bin/varnishtest/vtc_varnish.c
View file @
12ddc91b
...
...
@@ -78,6 +78,7 @@ struct varnish {
struct
vsm
*
vsm_vsl
;
struct
vsm
*
vsm_vsc
;
struct
vsc
*
vsc
;
int
has_a_arg
;
unsigned
vsl_tag_count
[
256
];
...
...
@@ -521,7 +522,10 @@ varnish_launch(struct varnish *v)
free
(
r
);
v
->
vsm_vsc
=
VSM_New
();
(
void
)
VSM_Arg
(
v
->
vsm_vsc
,
'n'
,
v
->
workdir
);
AN
(
v
->
vsm_vsc
);
v
->
vsc
=
VSC_New
(
v
->
vsm_vsc
);
AN
(
v
->
vsc
);
(
void
)
VSC_Arg
(
v
->
vsc
,
'n'
,
v
->
workdir
);
AZ
(
VSM_Attach
(
v
->
vsm_vsc
,
-
1
));
v
->
vsm_vsl
=
VSM_New
();
...
...
@@ -846,7 +850,7 @@ varnish_vsc(const struct varnish *v, const char *arg)
dp
.
arg
=
arg
;
(
void
)
VSM_Status
(
v
->
vsm_vsc
);
(
void
)
VSC_Iter
(
v
->
vs
m_vs
c
,
NULL
,
do_stat_dump_cb
,
&
dp
);
(
void
)
VSC_Iter
(
v
->
vsc
,
NULL
,
do_stat_dump_cb
,
&
dp
);
}
/**********************************************************************
...
...
@@ -912,7 +916,7 @@ varnish_expect(const struct varnish *v, char * const *av)
for
(
i
=
0
;
i
<
50
;
i
++
,
(
void
)
usleep
(
100000
))
{
(
void
)
VSM_Status
(
v
->
vsm_vsc
);
good
=
VSC_Iter
(
v
->
vs
m_vs
c
,
NULL
,
do_expect_cb
,
&
sp
);
good
=
VSC_Iter
(
v
->
vsc
,
NULL
,
do_expect_cb
,
&
sp
);
if
(
!
good
)
{
good
=
-
2
;
continue
;
...
...
include/vapi/vsc.h
View file @
12ddc91b
...
...
@@ -38,13 +38,17 @@
#include "vapi/vsc_int.h"
struct
vsm
;
struct
vsc
;
struct
vsm_fantom
;
/*---------------------------------------------------------------------
* VSC level access functions
*/
int
VSC_Arg
(
struct
vsm
*
vd
,
char
arg
,
const
char
*
opt
);
struct
vsc
*
VSC_New
(
struct
vsm
*
);
void
VSC_Destroy
(
struct
vsc
**
);
int
VSC_Arg
(
struct
vsc
*
,
char
arg
,
const
char
*
opt
);
/*
* Handle standard stat-presenter arguments
* Return:
...
...
@@ -80,8 +84,7 @@ void VSC_Destroy_Point(struct VSC_point **);
typedef
int
VSC_iter_f
(
void
*
priv
,
const
struct
VSC_point
*
const
pt
);
int
VSC_Iter
(
struct
vsm
*
vd
,
struct
vsm_fantom
*
fantom
,
VSC_iter_f
*
func
,
void
*
priv
);
int
VSC_Iter
(
struct
vsc
*
,
struct
vsm_fantom
*
,
VSC_iter_f
*
func
,
void
*
priv
);
/*
* Iterate over all statistics counters, calling "func" for
* each counter not suppressed by any "-f" arguments.
...
...
lib/libvarnishapi/Makefile.am
View file @
12ddc91b
...
...
@@ -14,7 +14,6 @@ libvarnishapi_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:6:0
libvarnishapi_la_SOURCES
=
\
vjsn.c
\
vjsn.h
\
vsc_priv.h
\
vsl_api.h
\
vxp.h
\
vxp_tokens.h
\
...
...
lib/libvarnishapi/libvarnishapi.map
View file @
12ddc91b
...
...
@@ -193,4 +193,6 @@ LIBVARNISHAPI_1.7 {
VSM_Status;
VSM_Arg;
VSM_Dup;
VSC_New;
VSC_Destroy;
} LIBVARNISHAPI_1.0;
lib/libvarnishapi/vsc.c
View file @
12ddc91b
...
...
@@ -51,8 +51,6 @@
#include "vapi/vsc.h"
#include "vapi/vsm.h"
#include "vsc_priv.h"
struct
vsc_sf
{
unsigned
magic
;
#define VSC_SF_MAGIC 0x558478dd
...
...
@@ -65,6 +63,7 @@ struct vsc {
unsigned
magic
;
#define VSC_MAGIC 0x3373554a
struct
vsm
*
vsm
;
struct
vsc_sf_head
sf_list_include
;
struct
vsc_sf_head
sf_list_exclude
;
};
...
...
@@ -116,20 +115,18 @@ VSC_Destroy_Point(struct VSC_point **p)
/*--------------------------------------------------------------------*/
st
atic
st
ruct
vsc
*
vsc_setup
(
struct
vsm
*
vd
)
struct
vsc
*
VSC_New
(
struct
vsm
*
vsm
)
{
struct
vsc
*
vsc
;
vsc
=
VSM_GetVSC
(
vd
);
if
(
vsc
==
NULL
)
{
ALLOC_OBJ
(
vsc
,
VSC_MAGIC
);
AN
(
vsc
);
VTAILQ_INIT
(
&
vsc
->
sf_list_include
);
VTAILQ_INIT
(
&
vsc
->
sf_list_exclude
);
VSM_SetVSC
(
vd
,
vsc
);
}
CHECK_OBJ_NOTNULL
(
vsc
,
VSC_MAGIC
);
AN
(
vsm
);
ALLOC_OBJ
(
vsc
,
VSC_MAGIC
);
if
(
vsc
==
NULL
)
return
(
vsc
);
vsc
->
vsm
=
vsm
;
VTAILQ_INIT
(
&
vsc
->
sf_list_include
);
VTAILQ_INIT
(
&
vsc
->
sf_list_exclude
);
return
(
vsc
);
}
...
...
@@ -150,10 +147,11 @@ vsc_delete_sf_list(struct vsc_sf_head *head)
}
void
VSC_De
lete
(
struct
vsc
*
vsc
)
VSC_De
stroy
(
struct
vsc
**
vscp
)
{
struct
vsc
*
vsc
;
CHECK_OBJ_NOTNULL
(
vsc
,
VSC_MAGIC
);
TAKE_OBJ_NOTNULL
(
vsc
,
vscp
,
VSC_MAGIC
);
vsc_delete_sf_list
(
&
vsc
->
sf_list_include
);
vsc_delete_sf_list
(
&
vsc
->
sf_list_exclude
);
FREE_OBJ
(
vsc
);
...
...
@@ -162,13 +160,11 @@ VSC_Delete(struct vsc *vsc)
/*--------------------------------------------------------------------*/
static
int
vsc_f_arg
(
struct
vs
m
*
vd
,
const
char
*
opt
)
vsc_f_arg
(
struct
vs
c
*
vsc
,
const
char
*
opt
)
{
struct
vsc
*
vsc
=
vsc_setup
(
vd
);
struct
vsc_sf
*
sf
;
unsigned
exclude
=
0
;
AN
(
vd
);
AN
(
opt
);
ALLOC_OBJ
(
sf
,
VSC_SF_MAGIC
);
...
...
@@ -193,14 +189,16 @@ vsc_f_arg(struct vsm *vd, const char *opt)
/*--------------------------------------------------------------------*/
int
VSC_Arg
(
struct
vs
m
*
vd
,
char
arg
,
const
char
*
opt
)
VSC_Arg
(
struct
vs
c
*
vsc
,
char
arg
,
const
char
*
opt
)
{
CHECK_OBJ_NOTNULL
(
vsc
,
VSC_MAGIC
);
switch
(
arg
)
{
case
'f'
:
return
(
vsc_f_arg
(
v
d
,
opt
));
case
'f'
:
return
(
vsc_f_arg
(
v
sc
,
opt
));
case
'n'
:
case
't'
:
return
(
VSM_Arg
(
v
d
,
arg
,
opt
));
return
(
VSM_Arg
(
v
sc
->
vsm
,
arg
,
opt
));
default:
return
(
0
);
}
...
...
@@ -210,11 +208,11 @@ VSC_Arg(struct vsm *vd, char arg, const char *opt)
*/
static
int
vsc_filter
(
struct
vsm
*
vd
,
const
char
*
nm
)
vsc_filter
(
const
struct
vsc
*
vsc
,
const
char
*
nm
)
{
struct
vsc
*
vsc
=
vsc_setup
(
vd
);
struct
vsc_sf
*
sf
;
CHECK_OBJ_NOTNULL
(
vsc
,
VSC_MAGIC
);
VTAILQ_FOREACH
(
sf
,
&
vsc
->
sf_list_exclude
,
list
)
if
(
!
fnmatch
(
sf
->
pattern
,
nm
,
0
))
return
(
1
);
...
...
@@ -230,12 +228,13 @@ vsc_filter(struct vsm *vd, const char *nm)
*/
static
int
vsc_iter_elem
(
struct
vsm
*
vd
,
const
struct
vsm_fantom
*
fantom
,
vsc_iter_elem
(
const
struct
vsc
*
vsc
,
const
struct
vsm_fantom
*
fantom
,
const
struct
vjsn_val
*
vv
,
struct
vsb
*
vsb
,
VSC_iter_f
*
func
,
void
*
priv
)
{
struct
VSC_point
point
;
struct
vjsn_val
*
vt
;
CHECK_OBJ_NOTNULL
(
vsc
,
VSC_MAGIC
);
memset
(
&
point
,
0
,
sizeof
point
);
vt
=
vjsn_child
(
vv
,
"name"
);
...
...
@@ -246,7 +245,7 @@ vsc_iter_elem(struct vsm *vd, const struct vsm_fantom *fantom,
VSB_printf
(
vsb
,
"%s.%s"
,
fantom
->
ident
,
vt
->
value
);
AZ
(
VSB_finish
(
vsb
));
if
(
vsc_filter
(
v
d
,
VSB_data
(
vsb
)))
if
(
vsc_filter
(
v
sc
,
VSB_data
(
vsb
)))
return
(
0
);
point
.
name
=
VSB_data
(
vsb
);
...
...
@@ -315,7 +314,7 @@ vsc_iter_elem(struct vsm *vd, const struct vsm_fantom *fantom,
}
static
int
vsc_iter_fantom
(
struct
vsm
*
vd
,
const
struct
vsm_fantom
*
fantom
,
vsc_iter_fantom
(
const
struct
vsc
*
vsc
,
const
struct
vsm_fantom
*
fantom
,
struct
vsb
*
vsb
,
VSC_iter_f
*
func
,
void
*
priv
)
{
int
i
=
0
;
...
...
@@ -324,6 +323,8 @@ vsc_iter_fantom(struct vsm *vd, const struct vsm_fantom *fantom,
struct
vjsn
*
vj
;
struct
vjsn_val
*
vv
,
*
vve
;
CHECK_OBJ_NOTNULL
(
vsc
,
VSC_MAGIC
);
p
=
(
char
*
)
fantom
->
b
+
8
+
vbe64dec
(
fantom
->
b
);
assert
(
p
<
(
char
*
)
fantom
->
e
);
vj
=
vjsn_parse
(
p
,
&
e
);
...
...
@@ -332,7 +333,7 @@ vsc_iter_fantom(struct vsm *vd, const struct vsm_fantom *fantom,
vve
=
vjsn_child
(
vj
->
value
,
"elem"
);
AN
(
vve
);
VTAILQ_FOREACH
(
vv
,
&
vve
->
children
,
list
)
{
i
=
vsc_iter_elem
(
v
d
,
fantom
,
vv
,
vsb
,
func
,
priv
);
i
=
vsc_iter_elem
(
v
sc
,
fantom
,
vv
,
vsb
,
func
,
priv
);
if
(
i
)
break
;
}
...
...
@@ -343,21 +344,21 @@ vsc_iter_fantom(struct vsm *vd, const struct vsm_fantom *fantom,
/*--------------------------------------------------------------------
*/
int
VSC_Iter
(
struct
vsm
*
vd
,
struct
vsm_fantom
*
fantom
,
VSC_iter_f
*
func
,
void
*
priv
)
int
__match_proto__
()
// We don't want vsc to be const
VSC_Iter
(
struct
vsc
*
vsc
,
struct
vsm_fantom
*
f
,
VSC_iter_f
*
func
,
void
*
priv
)
{
struct
vsm_fantom
ifantom
;
uint64_t
u
;
int
i
=
0
;
struct
vsb
*
vsb
;
CHECK_OBJ_NOTNULL
(
vsc
,
VSC_MAGIC
);
vsb
=
VSB_new_auto
();
AN
(
vsb
);
VSM_FOREACH
(
&
ifantom
,
v
d
)
{
VSM_FOREACH
(
&
ifantom
,
v
sc
->
vsm
)
{
if
(
strcmp
(
ifantom
.
class
,
VSC_CLASS
))
continue
;
AZ
(
VSM_Map
(
v
d
,
&
ifantom
));
AZ
(
VSM_Map
(
v
sc
->
vsm
,
&
ifantom
));
u
=
vbe64dec
(
ifantom
.
b
);
if
(
u
==
0
)
{
VRMB
();
...
...
@@ -365,11 +366,12 @@ VSC_Iter(struct vsm *vd, struct vsm_fantom *fantom, VSC_iter_f *func,
u
=
vbe64dec
(
ifantom
.
b
);
}
assert
(
u
>
0
);
if
(
fantom
!=
NULL
)
*
fantom
=
ifantom
;
i
=
vsc_iter_fantom
(
vd
,
&
ifantom
,
vsb
,
func
,
priv
);
if
(
fantom
==
NULL
)
AZ
(
VSM_Unmap
(
vd
,
&
ifantom
));
i
=
vsc_iter_fantom
(
vsc
,
&
ifantom
,
vsb
,
func
,
priv
);
if
(
f
!=
NULL
)
{
*
f
=
ifantom
;
}
else
{
AZ
(
VSM_Unmap
(
vsc
->
vsm
,
&
ifantom
));
}
if
(
i
)
break
;
}
...
...
lib/libvarnishapi/vsc_priv.h
deleted
100644 → 0
View file @
23333e3c
/*-
* Copyright (c) 2006 Verdens Gang AS
* Copyright (c) 2006-2015 Varnish Software AS
* All rights reserved.
*
* Author: Poul-Henning Kamp <phk@phk.freebsd.dk>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
struct
vsc
;
struct
vsm
;
void
VSM_SetVSC
(
struct
vsm
*
,
struct
vsc
*
);
struct
vsc
*
VSM_GetVSC
(
const
struct
vsm
*
);
void
VSC_Delete
(
struct
vsc
*
);
lib/libvarnishapi/vsm.c
View file @
12ddc91b
...
...
@@ -52,7 +52,6 @@
#include "vin.h"
#include "vsb.h"
#include "vsm_priv.h"
#include "vsc_priv.h"
#include "vqueue.h"
#include "vtim.h"
...
...
@@ -115,7 +114,6 @@ struct vsm {
struct
stat
dst
;
char
*
dname
;
struct
vsc
*
vsc
;
struct
vsm_set
*
mgt
;
struct
vsm_set
*
child
;
...
...
@@ -239,8 +237,6 @@ VSM_Destroy(struct vsm **vdp)
TAKE_OBJ_NOTNULL
(
vd
,
vdp
,
VSM_MAGIC
);
if
(
vd
->
vsc
!=
NULL
)
VSC_Delete
(
vd
->
vsc
);
VSM_ResetError
(
vd
);
free
(
vd
->
dname
);
vsm_delset
(
&
vd
->
mgt
);
...
...
@@ -252,24 +248,6 @@ VSM_Destroy(struct vsm **vdp)
/*--------------------------------------------------------------------*/
void
VSM_SetVSC
(
struct
vsm
*
vd
,
struct
vsc
*
vsc
)
{
CHECK_OBJ_NOTNULL
(
vd
,
VSM_MAGIC
);
vd
->
vsc
=
vsc
;
}
struct
vsc
*
VSM_GetVSC
(
const
struct
vsm
*
vd
)
{
CHECK_OBJ_NOTNULL
(
vd
,
VSM_MAGIC
);
return
(
vd
->
vsc
);
}
/*--------------------------------------------------------------------*/
const
char
*
VSM_Error
(
const
struct
vsm
*
vd
)
{
...
...
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