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
ac922674
Commit
ac922674
authored
Jun 09, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the 'type' argument from VSM_Get()
parent
53ca9ec5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
11 deletions
+9
-11
varnishadm.c
bin/varnishadm/varnishadm.c
+2
-2
mgt_cli.c
bin/varnishd/mgt/mgt_cli.c
+2
-2
vsm.h
include/vapi/vsm.h
+2
-2
vsl_cursor.c
lib/libvarnishapi/vsl_cursor.c
+1
-1
vsm.c
lib/libvarnishapi/vsm.c
+2
-4
No files found.
bin/varnishadm/varnishadm.c
View file @
ac922674
...
...
@@ -411,7 +411,7 @@ n_arg_sock(const char *n_arg)
return
(
-
1
);
}
if
(
!
VSM_Get
(
vsm
,
&
vt
,
"Arg"
,
"-T"
,
""
))
{
if
(
!
VSM_Get
(
vsm
,
&
vt
,
"Arg"
,
"-T"
))
{
fprintf
(
stderr
,
"No -T arg in shared memory
\n
"
);
VSM_Delete
(
vsm
);
return
(
-
1
);
...
...
@@ -420,7 +420,7 @@ n_arg_sock(const char *n_arg)
AN
(
vt
.
b
);
T_start
=
T_arg
=
strdup
(
vt
.
b
);
if
(
VSM_Get
(
vsm
,
&
vt
,
"Arg"
,
"-S"
,
""
))
{
if
(
VSM_Get
(
vsm
,
&
vt
,
"Arg"
,
"-S"
))
{
AZ
(
VSM_Map
(
vsm
,
&
vt
));
AN
(
vt
.
b
);
S_arg
=
strdup
(
vt
.
b
);
...
...
bin/varnishd/mgt/mgt_cli.c
View file @
ac922674
...
...
@@ -503,7 +503,7 @@ mgt_cli_secret(const char *S_arg)
char
buf
[
BUFSIZ
];
/* Save in shmem */
mgt_SHM_static_alloc
(
S_arg
,
strlen
(
S_arg
)
+
1L
,
"Arg"
,
"
-S"
,
"
"
);
mgt_SHM_static_alloc
(
S_arg
,
strlen
(
S_arg
)
+
1L
,
"Arg"
,
"
"
,
"-S
"
);
VJ_master
(
JAIL_MASTER_FILE
);
fd
=
open
(
S_arg
,
O_RDONLY
);
...
...
@@ -573,7 +573,7 @@ mgt_cli_telnet(const char *T_arg)
if
(
VSB_len
(
vsb
)
==
0
)
ARGV_ERR
(
"-T %s could not be listened on.
\n
"
,
T_arg
);
/* Save in shmem */
mgt_SHM_static_alloc
(
VSB_data
(
vsb
),
VSB_len
(
vsb
)
+
1
,
"Arg"
,
"
-T"
,
"
"
);
mgt_SHM_static_alloc
(
VSB_data
(
vsb
),
VSB_len
(
vsb
)
+
1
,
"Arg"
,
"
"
,
"-T
"
);
VSB_destroy
(
&
vsb
);
}
...
...
include/vapi/vsm.h
View file @
ac922674
...
...
@@ -196,11 +196,11 @@ const struct vsm_valid *VSM_StillValid(const struct vsm *vd,
*/
int
VSM_Get
(
const
struct
vsm
*
vd
,
struct
VSM_fantom
*
vf
,
const
char
*
class
,
const
char
*
type
,
const
char
*
ident
);
const
char
*
class
,
const
char
*
ident
);
/*
* Find a chunk, produce fantom for it.
* Returns zero on failure.
* class is mandatory,
type and
ident optional.
* class is mandatory, ident optional.
*/
#endif
/* VAPI_VSM_H_INCLUDED */
lib/libvarnishapi/vsl_cursor.c
View file @
ac922674
...
...
@@ -247,7 +247,7 @@ VSL_CursorVSM(struct VSL_data *vsl, struct vsm *vsm, unsigned options)
CHECK_OBJ_NOTNULL
(
vsl
,
VSL_MAGIC
);
if
(
!
VSM_Get
(
vsm
,
&
vf
,
VSL_CLASS
,
""
,
""
))
{
if
(
!
VSM_Get
(
vsm
,
&
vf
,
VSL_CLASS
,
NULL
))
{
(
void
)
vsl_diag
(
vsl
,
"No VSL chunk found (child not started ?)"
);
return
(
NULL
);
...
...
lib/libvarnishapi/vsm.c
View file @
ac922674
...
...
@@ -208,7 +208,7 @@ VSM_Name(const struct vsm *vd)
struct
VSM_fantom
vt
;
CHECK_OBJ_NOTNULL
(
vd
,
VSM_MAGIC
);
if
(
VSM_Get
(
vd
,
&
vt
,
"Arg"
,
"-i"
,
""
))
if
(
VSM_Get
(
vd
,
&
vt
,
"Arg"
,
"-i"
))
return
(
vt
.
b
);
return
(
""
);
}
...
...
@@ -481,15 +481,13 @@ VSM_StillValid(const struct vsm *vd, struct VSM_fantom *vf)
int
VSM_Get
(
const
struct
vsm
*
vd
,
struct
VSM_fantom
*
vf
,
const
char
*
class
,
const
char
*
type
,
const
char
*
ident
)
const
char
*
class
,
const
char
*
ident
)
{
CHECK_OBJ_NOTNULL
(
vd
,
VSM_MAGIC
);
VSM_FOREACH
(
vf
,
vd
)
{
if
(
strcmp
(
vf
->
class
,
class
))
continue
;
if
(
type
!=
NULL
&&
strcmp
(
vf
->
type
,
type
))
continue
;
if
(
ident
!=
NULL
&&
strcmp
(
vf
->
ident
,
ident
))
continue
;
return
(
1
);
...
...
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