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
9584dc03
Commit
9584dc03
authored
Nov 20, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move cache_param entirely into the cache * namespace and communicate
it via heritage.
parent
eb18d9be
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
12 deletions
+12
-12
cache.h
bin/varnishd/cache/cache.h
+1
-0
cache_main.c
bin/varnishd/cache/cache_main.c
+2
-0
heritage.h
bin/varnishd/common/heritage.h
+2
-0
params.h
bin/varnishd/common/params.h
+0
-6
mgt_child.c
bin/varnishd/mgt/mgt_child.c
+1
-1
mgt_param.c
bin/varnishd/mgt/mgt_param.c
+2
-2
mgt_shmem.c
bin/varnishd/mgt/mgt_shmem.c
+4
-3
No files found.
bin/varnishd/cache/cache.h
View file @
9584dc03
...
...
@@ -784,6 +784,7 @@ int HTC_Complete(struct http_conn *htc);
#undef HTTPH
/* cache_main.c */
extern
volatile
struct
params
*
cache_param
;
void
THR_SetName
(
const
char
*
name
);
const
char
*
THR_GetName
(
void
);
void
THR_SetSession
(
const
struct
sess
*
sp
);
...
...
bin/varnishd/cache/cache_main.c
View file @
9584dc03
...
...
@@ -96,6 +96,8 @@ child_main(void)
setbuf
(
stderr
,
NULL
);
printf
(
"Child starts
\n
"
);
cache_param
=
heritage
.
param
;
AZ
(
pthread_key_create
(
&
sp_key
,
NULL
));
AZ
(
pthread_key_create
(
&
name_key
,
NULL
));
...
...
bin/varnishd/common/heritage.h
View file @
9584dc03
...
...
@@ -60,6 +60,8 @@ struct heritage {
struct
vsm_sc
*
vsm
;
struct
params
*
param
;
char
*
name
;
char
identity
[
1024
];
};
...
...
bin/varnishd/common/params.h
View file @
9584dc03
...
...
@@ -193,9 +193,3 @@ struct params {
ssize_t
vsm_space
;
ssize_t
vsl_space
;
};
/*
* We declare this a volatile pointer, so that reads of parameters
* become atomic, leaving the CLI thread lattitude to change the values
*/
extern
volatile
struct
params
*
cache_param
;
bin/varnishd/mgt/mgt_child.c
View file @
9584dc03
...
...
@@ -315,7 +315,7 @@ start_child(struct cli *cli)
heritage
.
std_fd
=
cp
[
1
];
child_output
=
cp
[
0
];
AN
(
cache_
param
);
AN
(
heritage
.
param
);
if
((
pid
=
fork
())
<
0
)
{
perror
(
"Could not fork child"
);
exit
(
1
);
...
...
bin/varnishd/mgt/mgt_param.c
View file @
9584dc03
...
...
@@ -1205,8 +1205,8 @@ MCF_ParamSet(struct cli *cli, const char *param, const char *val)
}
pp
->
func
(
cli
,
pp
,
val
);
if
(
cli
->
result
==
CLIS_OK
&&
cache_
param
!=
NULL
)
*
cache_
param
=
mgt_param
;
if
(
cli
->
result
==
CLIS_OK
&&
heritage
.
param
!=
NULL
)
*
heritage
.
param
=
mgt_param
;
if
(
cli
->
result
!=
CLIS_OK
)
{
VCLI_Out
(
cli
,
"(attempting to set param %s to %s)
\n
"
,
...
...
bin/varnishd/mgt/mgt_shmem.c
View file @
9584dc03
...
...
@@ -210,9 +210,10 @@ mgt_SHM_Init(void)
AZ
(
atexit
(
mgt_shm_atexit
));
cache_param
=
VSM_Alloc
(
sizeof
*
cache_param
,
VSM_CLASS_PARAM
,
""
,
""
);
AN
(
cache_param
);
*
cache_param
=
mgt_param
;
heritage
.
param
=
VSM_Alloc
(
sizeof
*
heritage
.
param
,
VSM_CLASS_PARAM
,
""
,
""
);
AN
(
heritage
.
param
);
*
heritage
.
param
=
mgt_param
;
PAN_panicstr_len
=
64
*
1024
;
PAN_panicstr
=
VSM_Alloc
(
PAN_panicstr_len
,
PAN_CLASS
,
""
,
""
);
...
...
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