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
6df4d965
Commit
6df4d965
authored
Feb 04, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split mcf_server_startstop() into two separate functions
parent
af2fb997
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
20 deletions
+34
-20
mgt_child.c
bin/varnishd/mgt/mgt_child.c
+18
-5
mgt_cli.c
bin/varnishd/mgt/mgt_cli.c
+14
-14
mgt_cli.h
bin/varnishd/mgt/mgt_cli.h
+2
-1
No files found.
bin/varnishd/mgt/mgt_child.c
View file @
6df4d965
...
...
@@ -611,17 +611,16 @@ mgt_stop_child(void)
}
/*=====================================================================
* CLI command to start/stop child
* CLI command
s
to start/stop child
*/
void
__match_proto__
(
cli_func_t
)
mcf_server_start
stop
(
struct
cli
*
cli
,
const
char
*
const
*
av
,
void
*
priv
)
mcf_server_start
(
struct
cli
*
cli
,
const
char
*
const
*
av
,
void
*
priv
)
{
(
void
)
av
;
if
(
priv
!=
NULL
&&
child_state
==
CH_RUNNING
)
mgt_stop_child
();
else
if
(
priv
==
NULL
&&
child_state
==
CH_STOPPED
)
{
(
void
)
priv
;
if
(
child_state
==
CH_STOPPED
)
{
if
(
mgt_has_vcl
())
{
mgt_launch_child
(
cli
);
}
else
{
...
...
@@ -634,6 +633,20 @@ mcf_server_startstop(struct cli *cli, const char * const *av, void *priv)
}
}
void
__match_proto__
(
cli_func_t
)
mcf_server_stop
(
struct
cli
*
cli
,
const
char
*
const
*
av
,
void
*
priv
)
{
(
void
)
av
;
(
void
)
priv
;
if
(
child_state
==
CH_RUNNING
)
{
mgt_stop_child
();
}
else
{
VCLI_SetResult
(
cli
,
CLIS_CANT
);
VCLI_Out
(
cli
,
"Child in state %s"
,
ch_state
[
child_state
]);
}
}
/*--------------------------------------------------------------------*/
void
...
...
bin/varnishd/mgt/mgt_cli.c
View file @
6df4d965
...
...
@@ -89,20 +89,20 @@ mcf_banner(struct cli *cli, const char *const *av, void *priv)
/* XXX: what order should this list be in ? */
static
struct
cli_proto
cli_proto
[]
=
{
{
CLI_BANNER
,
""
,
mcf_banner
,
NULL
},
{
CLI_SERVER_STATUS
,
""
,
mcf_server_status
,
NULL
},
{
CLI_SERVER_START
,
""
,
mcf_server_start
stop
,
NULL
},
{
CLI_SERVER_STOP
,
""
,
mcf_server_st
artstop
,
cli_proto
},
{
CLI_VCL_LOAD
,
""
,
mcf_vcl_load
,
NULL
},
{
CLI_VCL_INLINE
,
""
,
mcf_vcl_inline
,
NULL
},
{
CLI_VCL_USE
,
""
,
mcf_vcl_use
,
NULL
},
{
CLI_VCL_STATE
,
""
,
mcf_vcl_state
,
NULL
},
{
CLI_VCL_DISCARD
,
""
,
mcf_vcl_discard
,
NULL
},
{
CLI_VCL_LIST
,
""
,
mcf_vcl_list
,
NULL
},
{
CLI_PARAM_SHOW
,
""
,
mcf_param_show
,
NULL
},
{
CLI_PARAM_SET
,
""
,
mcf_param_set
,
NULL
},
{
CLI_PANIC_SHOW
,
""
,
mcf_panic_show
,
NULL
},
{
CLI_PANIC_CLEAR
,
""
,
mcf_panic_clear
,
NULL
},
{
CLI_BANNER
,
""
,
mcf_banner
},
{
CLI_SERVER_STATUS
,
""
,
mcf_server_status
},
{
CLI_SERVER_START
,
""
,
mcf_server_start
},
{
CLI_SERVER_STOP
,
""
,
mcf_server_st
op
},
{
CLI_VCL_LOAD
,
""
,
mcf_vcl_load
},
{
CLI_VCL_INLINE
,
""
,
mcf_vcl_inline
},
{
CLI_VCL_USE
,
""
,
mcf_vcl_use
},
{
CLI_VCL_STATE
,
""
,
mcf_vcl_state
},
{
CLI_VCL_DISCARD
,
""
,
mcf_vcl_discard
},
{
CLI_VCL_LIST
,
""
,
mcf_vcl_list
},
{
CLI_PARAM_SHOW
,
""
,
mcf_param_show
},
{
CLI_PARAM_SET
,
""
,
mcf_param_set
},
{
CLI_PANIC_SHOW
,
""
,
mcf_panic_show
},
{
CLI_PANIC_CLEAR
,
""
,
mcf_panic_clear
},
{
NULL
}
};
...
...
bin/varnishd/mgt/mgt_cli.h
View file @
6df4d965
...
...
@@ -29,7 +29,8 @@
*/
/* mgt_child.c */
cli_func_t
mcf_server_startstop
;
cli_func_t
mcf_server_start
;
cli_func_t
mcf_server_stop
;
cli_func_t
mcf_server_status
;
cli_func_t
mcf_panic_show
;
cli_func_t
mcf_panic_clear
;
...
...
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