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
d8dfd9c1
Commit
d8dfd9c1
authored
Sep 27, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Retire common.h
parent
8bd3b43f
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
60 additions
and
71 deletions
+60
-71
Makefile.am
bin/varnishd/Makefile.am
+0
-1
cache.h
bin/varnishd/cache/cache.h
+9
-1
common.h
bin/varnishd/common/common.h
+0
-60
common_vsc.c
bin/varnishd/common/common_vsc.c
+5
-1
heritage.h
bin/varnishd/common/heritage.h
+15
-0
hash_classic.c
bin/varnishd/hash/hash_classic.c
+1
-0
mgt.h
bin/varnishd/mgt/mgt.h
+12
-1
mgt_cli.c
bin/varnishd/mgt/mgt_cli.c
+1
-0
mgt_jail.c
bin/varnishd/mgt/mgt_jail.c
+1
-0
mgt_jail_unix.c
bin/varnishd/mgt/mgt_jail_unix.c
+1
-0
mgt_main.c
bin/varnishd/mgt/mgt_main.c
+4
-5
mgt_param_tcp.c
bin/varnishd/mgt/mgt_param_tcp.c
+1
-0
mgt_shmem.c
bin/varnishd/mgt/mgt_shmem.c
+1
-1
mgt_vcl.c
bin/varnishd/mgt/mgt_vcl.c
+2
-1
mgt_stevedore.c
bin/varnishd/storage/mgt_stevedore.c
+1
-0
mgt_storage_persistent.c
bin/varnishd/storage/mgt_storage_persistent.c
+1
-0
stevedore_utils.c
bin/varnishd/storage/stevedore_utils.c
+1
-0
storage_file.c
bin/varnishd/storage/storage_file.c
+1
-0
storage_malloc.c
bin/varnishd/storage/storage_malloc.c
+1
-0
storage_persistent_subr.c
bin/varnishd/storage/storage_persistent_subr.c
+1
-0
mgt_waiter.c
bin/varnishd/waiter/mgt_waiter.c
+1
-0
No files found.
bin/varnishd/Makefile.am
View file @
d8dfd9c1
...
...
@@ -139,7 +139,6 @@ nobase_pkginclude_HEADERS = \
cache/cache_filter.h
\
cache/cache_backend.h
\
cache/cache_director.h
\
common/common.h
\
common/common_vsm.h
\
common/com_params.h
\
waiter/waiter.h
...
...
bin/varnishd/cache/cache.h
View file @
d8dfd9c1
...
...
@@ -35,8 +35,16 @@
#define VARNISH_CACHE_CHILD 1
#include <stdarg.h>
#include <stdint.h>
#include "common/common.h"
#include <sys/types.h>
#include "miniobj.h"
#include "vas.h"
#include "vcs.h"
#include "vdef.h"
#include "vqueue.h"
#include "vsb.h"
#include "vapi/vsl_int.h"
...
...
bin/varnishd/common/common.h
deleted
100644 → 0
View file @
8bd3b43f
/*-
* Copyright (c) 2006 Verdens Gang AS
* Copyright (c) 2006-2011 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.
*
*/
#ifdef COMMON_COMMON_H
#error "Multiple includes of common/common.h"
#endif
#define COMMON_COMMON_H
#include <stdint.h>
#include <sys/types.h>
#include "miniobj.h"
#include "vas.h"
#include "vcs.h"
#include "vdef.h"
#include "vqueue.h"
#include "vsb.h"
/**********************************************************************/
extern
pid_t
mgt_pid
;
#define ASSERT_MGT() do { assert(getpid() == mgt_pid);} while (0)
/* Really belongs in mgt.h, but storage_file chokes on both */
void
MCH_Fd_Inherit
(
int
fd
,
const
char
*
what
);
#define ARGV_ERR(...) \
do { \
fprintf(stderr, "Error: " __VA_ARGS__); \
fprintf(stderr, "(-? gives usage)\n"); \
exit(2); \
} while (0)
bin/varnishd/common/common_vsc.c
View file @
d8dfd9c1
...
...
@@ -31,17 +31,21 @@
#include <errno.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "common.h"
#include "common/common_vsm.h"
#include "vdef.h"
#include "miniobj.h"
#include "vas.h"
#include "vend.h"
#include "vsmw.h"
#include "vgz.h"
#include "vmb.h"
#include "vqueue.h"
#include "vapi/vsc_int.h"
struct
vsmw
*
proc_vsmw
;
...
...
bin/varnishd/common/heritage.h
View file @
d8dfd9c1
...
...
@@ -87,10 +87,25 @@ struct heritage {
struct
VCLS
*
cls
;
const
char
*
ident
;
long
mgt_pid
;
};
extern
struct
heritage
heritage
;
#define ASSERT_MGT() do { assert(getpid() == heritage.mgt_pid);} while (0)
/* Really belongs in mgt.h, but storage_file chokes on both */
void
MCH_Fd_Inherit
(
int
fd
,
const
char
*
what
);
#define ARGV_ERR(...) \
do { \
ASSERT_MGT(); \
fprintf(stderr, "Error: " __VA_ARGS__); \
fprintf(stderr, "(-? gives usage)\n"); \
exit(2); \
} while (0)
/* cache/cache_main.c */
void
child_main
(
void
);
...
...
bin/varnishd/hash/hash_classic.c
View file @
d8dfd9c1
...
...
@@ -32,6 +32,7 @@
#include "config.h"
#include "cache/cache.h"
#include "common/heritage.h"
#include <stdio.h>
#include <stdlib.h>
...
...
bin/varnishd/mgt/mgt.h
View file @
d8dfd9c1
...
...
@@ -33,7 +33,18 @@
#endif
#define MGT_MGT_H
#include "common/common.h"
#include <stdint.h>
#include <sys/types.h>
#include "miniobj.h"
#include "vas.h"
#include "vcs.h"
#include "vdef.h"
#include "vqueue.h"
#include "vsb.h"
#include "common/com_params.h"
#include "VSC_mgt.h"
...
...
bin/varnishd/mgt/mgt_cli.c
View file @
d8dfd9c1
...
...
@@ -44,6 +44,7 @@
#include <unistd.h>
#include "mgt/mgt.h"
#include "common/heritage.h"
#include "vcli_serve.h"
#include "vev.h"
...
...
bin/varnishd/mgt/mgt_jail.c
View file @
d8dfd9c1
...
...
@@ -40,6 +40,7 @@
#include <sys/stat.h>
#include "mgt/mgt.h"
#include "common/heritage.h"
#include "vav.h"
/**********************************************************************
...
...
bin/varnishd/mgt/mgt_jail_unix.c
View file @
d8dfd9c1
...
...
@@ -41,6 +41,7 @@
#include <sys/stat.h>
#include "mgt/mgt.h"
#include "common/heritage.h"
#ifdef __linux__
#include <sys/prctl.h>
...
...
bin/varnishd/mgt/mgt_main.c
View file @
d8dfd9c1
...
...
@@ -61,7 +61,6 @@
struct
heritage
heritage
;
unsigned
d_flag
=
0
;
pid_t
mgt_pid
;
struct
vev_base
*
mgt_evb
;
int
exit_status
=
0
;
struct
vsb
*
vident
;
...
...
@@ -202,7 +201,7 @@ mgt_secret_atexit(void)
{
/* Only master process */
if
(
getpid
()
!=
mgt_pid
)
if
(
getpid
()
!=
heritage
.
mgt_pid
)
return
;
VJ_master
(
JAIL_MASTER_FILE
);
(
void
)
unlink
(
"_.secret"
);
...
...
@@ -240,7 +239,7 @@ mgt_Cflag_atexit(void)
{
/* Only master process */
if
(
getpid
()
!=
mgt_pid
)
if
(
getpid
()
!=
heritage
.
mgt_pid
)
return
;
(
void
)
rmdir
(
"vmod_cache"
);
(
void
)
unlink
(
"_.pid"
);
...
...
@@ -313,7 +312,7 @@ mgt_initialize(struct cli *cli)
static
unsigned
clilim
=
32768
;
/* for ASSERT_MGT() */
mgt_pid
=
getpid
();
heritage
.
mgt_pid
=
getpid
();
/* Create a cli for convenience in otherwise CLI functions */
INIT_OBJ
(
cli
,
CLI_MAGIC
);
...
...
@@ -593,7 +592,7 @@ main(int argc, char * const *argv)
if
(
!
C_flag
&&
!
d_flag
&&
!
F_flag
)
{
eric_fd
=
mgt_eric
();
MCH_TrackHighFd
(
eric_fd
);
mgt_pid
=
getpid
();
heritage
.
mgt_pid
=
getpid
();
}
VRND_SeedAll
();
...
...
bin/varnishd/mgt/mgt_param_tcp.c
View file @
d8dfd9c1
...
...
@@ -43,6 +43,7 @@
#include <unistd.h>
#include "mgt/mgt.h"
#include "common/heritage.h"
#include "vtcp.h"
...
...
bin/varnishd/mgt/mgt_shmem.c
View file @
d8dfd9c1
...
...
@@ -72,7 +72,7 @@ mgt_shm_atexit(void)
{
/* Do not let VCC kill our VSM */
if
(
getpid
()
!=
mgt_pid
)
if
(
getpid
()
!=
heritage
.
mgt_pid
)
return
;
VJ_master
(
JAIL_MASTER_FILE
);
VSMW_Destroy
(
&
mgt_vsmw
);
...
...
bin/varnishd/mgt/mgt_vcl.c
View file @
d8dfd9c1
...
...
@@ -40,6 +40,7 @@
#include <sys/stat.h>
#include "mgt/mgt.h"
#include "common/heritage.h"
#include "libvcc.h"
#include "vcli_serve.h"
...
...
@@ -902,7 +903,7 @@ mgt_vcl_atexit(void)
{
struct
vclprog
*
vp
;
if
(
getpid
()
!=
mgt_pid
)
if
(
getpid
()
!=
heritage
.
mgt_pid
)
return
;
active_vcl
=
NULL
;
do
{
...
...
bin/varnishd/storage/mgt_stevedore.c
View file @
d8dfd9c1
...
...
@@ -39,6 +39,7 @@
#include <unistd.h>
#include "mgt/mgt.h"
#include "common/heritage.h"
#include "vcli_serve.h"
#include "storage/storage.h"
...
...
bin/varnishd/storage/mgt_storage_persistent.c
View file @
d8dfd9c1
...
...
@@ -36,6 +36,7 @@
#include "config.h"
#include "cache/cache.h"
#include "common/heritage.h"
#include <sys/mman.h>
...
...
bin/varnishd/storage/stevedore_utils.c
View file @
d8dfd9c1
...
...
@@ -41,6 +41,7 @@
#include <unistd.h>
#include "mgt/mgt.h"
#include "common/heritage.h"
#include "storage/storage.h"
#include "vnum.h"
...
...
bin/varnishd/storage/storage_file.c
View file @
d8dfd9c1
...
...
@@ -32,6 +32,7 @@
#include "config.h"
#include "cache/cache.h"
#include "common/heritage.h"
#include <sys/mman.h>
...
...
bin/varnishd/storage/storage_malloc.c
View file @
d8dfd9c1
...
...
@@ -32,6 +32,7 @@
#include "config.h"
#include "cache/cache.h"
#include "common/heritage.h"
#include <stdio.h>
#include <stdlib.h>
...
...
bin/varnishd/storage/storage_persistent_subr.c
View file @
d8dfd9c1
...
...
@@ -37,6 +37,7 @@
#include <stddef.h>
#include "cache/cache.h"
#include "common/heritage.h"
#include <sys/mman.h>
...
...
bin/varnishd/waiter/mgt_waiter.c
View file @
d8dfd9c1
...
...
@@ -33,6 +33,7 @@
#include "mgt/mgt.h"
#include "waiter/mgt_waiter.h"
#include "common/heritage.h"
static
const
struct
choice
waiter_choice
[]
=
{
#define WAITER(nm) { #nm, &waiter_##nm },
...
...
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