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
eacdb4ff
Commit
eacdb4ff
authored
May 07, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Decouple VSC api from VSM internal format
parent
d24c9962
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
23 additions
and
66 deletions
+23
-66
cache.h
bin/varnishd/cache/cache.h
+0
-1
common_vsm.c
bin/varnishd/common/common_vsm.c
+1
-1
Makefile.am
include/Makefile.am
+0
-1
vsc.h
include/vapi/vsc.h
+2
-2
vsm.h
include/vapi/vsm.h
+4
-6
vsm_int.h
include/vapi/vsm_int.h
+0
-44
vsl_priv.h
include/vsl_priv.h
+1
-1
vsm_priv.h
include/vsm_priv.h
+3
-1
vsc.c
lib/libvarnishapi/vsc.c
+3
-3
vsm.c
lib/libvarnishapi/vsm.c
+9
-6
No files found.
bin/varnishd/cache/cache.h
View file @
eacdb4ff
...
...
@@ -39,7 +39,6 @@
#include "common/common.h"
#include "vapi/vsl_int.h"
#include "vapi/vsm_int.h"
#include "waiter/waiter.h"
...
...
bin/varnishd/common/common_vsm.c
View file @
eacdb4ff
...
...
@@ -27,7 +27,7 @@
*
* VSM stuff common to manager and child.
*
* Please see comments in <v
api/vsm_int
.h> for details of protocols and
* Please see comments in <v
sm_priv
.h> for details of protocols and
* data consistency.
*
*/
...
...
include/Makefile.am
View file @
eacdb4ff
...
...
@@ -46,7 +46,6 @@ nobase_pkginclude_HEADERS = \
tbl/vsl_tags_http.h
\
tbl/waiters.h
\
vapi/vsm.h
\
vapi/vsm_int.h
\
vapi/vsc.h
\
vapi/vsc_int.h
\
vapi/vsl.h
\
...
...
include/vapi/vsc.h
View file @
eacdb4ff
...
...
@@ -114,8 +114,8 @@ struct VSC_type_desc {
};
struct
VSC_section
{
c
onst
c
har
*
type
;
c
onst
c
har
*
ident
;
char
*
type
;
char
*
ident
;
const
struct
VSC_type_desc
*
desc
;
};
...
...
include/vapi/vsm.h
View file @
eacdb4ff
...
...
@@ -36,8 +36,6 @@
#ifndef VAPI_VSM_H_INCLUDED
#define VAPI_VSM_H_INCLUDED
#include "vsm_int.h"
struct
VSM_chunk
;
struct
VSM_data
;
...
...
@@ -50,12 +48,12 @@ struct VSM_fantom {
void
*
b
;
/* first byte of payload */
void
*
e
;
/* first byte past payload */
uintptr_t
priv
;
/* VSM private */
char
class
[
VSM_MARKER_LEN
]
;
char
type
[
VSM_MARKER_LEN
]
;
char
ident
[
VSM_IDENT_LEN
]
;
char
*
class
;
char
*
type
;
char
*
ident
;
};
#define VSM_FANTOM_NULL { 0, 0, 0, 0,
{0}, {0}, {0}
}
#define VSM_FANTOM_NULL { 0, 0, 0, 0,
0, 0, 0
}
/*---------------------------------------------------------------------
* VSM level access functions
...
...
include/vapi/vsm_int.h
deleted
100644 → 0
View file @
d24c9962
/*-
* 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.
*
* Define the internal details which must be kept in sync between
* vsm_priv.h and vapi/vsm.h, and this file SHALL not be included
* from anywhere but those two files.
*
* NB: THIS IS NOT A PUBLIC API TO VARNISH!
*
*/
#ifndef VSM_INT_H_INCLUDED
#define VSM_INT_H_INCLUDED
#define VSM_FILENAME "_.vsm"
#define VSM_MARKER_LEN 8
#define VSM_IDENT_LEN 128
#endif
/* VSM_INT_H_INCLUDED */
include/vsl_priv.h
View file @
eacdb4ff
...
...
@@ -36,7 +36,7 @@
#define VSL_PRIV_H_INCLUDED
#include "vapi/vsl_int.h"
#include "v
api/vsm_int
.h"
#include "v
sm_priv
.h"
#define VSL_CLASS "Log"
#define VSL_SEGMENTS 8U // power of two
...
...
include/vsm_priv.h
View file @
eacdb4ff
...
...
@@ -96,7 +96,9 @@
#ifndef VSM_PRIV_H_INCLUDED
#define VSM_PRIV_H_INCLUDED
#include <vapi/vsm_int.h>
#define VSM_FILENAME "_.vsm"
#define VSM_MARKER_LEN 8
#define VSM_IDENT_LEN 128
struct
VSM_chunk
{
#define VSM_CHUNK_MARKER "VSMCHUNK"
...
...
lib/libvarnishapi/vsc.c
View file @
eacdb4ff
...
...
@@ -253,8 +253,8 @@ vsc_add_vf(struct vsc *vsc, const struct VSM_fantom *fantom,
ALLOC_OBJ
(
vf
,
VSC_VF_MAGIC
);
AN
(
vf
);
vf
->
fantom
=
*
fantom
;
vf
->
section
.
type
=
vf
->
fantom
.
type
;
vf
->
section
.
ident
=
vf
->
fantom
.
ident
;
REPLACE
(
vf
->
section
.
type
,
vf
->
fantom
.
type
)
;
REPLACE
(
vf
->
section
.
ident
,
vf
->
fantom
.
ident
)
;
vf
->
section
.
desc
=
desc
;
vf
->
order
=
order
;
...
...
@@ -336,7 +336,7 @@ vsc_build_pt_list(struct VSM_data *vd)
VTAILQ_FOREACH
(
vf
,
&
vsc
->
vf_list
,
list
)
{
#define VSC_DO(U,l,t,h) \
CHECK_OBJ_NOTNULL(vf, VSC_VF_MAGIC); \
if (!strcmp(vf->
fantom
.type, t)) \
if (!strcmp(vf->
section
.type, t)) \
iter_##l(vsc, VSC_desc_##l, vf);
#define VSC_F(n,t,l,s,f,v,d,e)
#define VSC_DONE(a,b,c)
...
...
lib/libvarnishapi/vsm.c
View file @
eacdb4ff
...
...
@@ -397,12 +397,15 @@ VSM__itern(const struct VSM_data *vd, struct VSM_fantom *vf)
vf
->
priv
=
vd
->
head
->
alloc_seq
;
vf
->
b
=
(
void
*
)(
vf
->
chunk
+
1
);
vf
->
e
=
(
char
*
)
vf
->
b
+
vf
->
chunk
->
len
;
strncpy
(
vf
->
class
,
vf
->
chunk
->
class
,
sizeof
vf
->
class
);
vf
->
class
[
sizeof
vf
->
class
-
1
]
=
'\0'
;
strncpy
(
vf
->
type
,
vf
->
chunk
->
type
,
sizeof
vf
->
type
);
vf
->
type
[
sizeof
vf
->
type
-
1
]
=
'\0'
;
strncpy
(
vf
->
ident
,
vf
->
chunk
->
ident
,
sizeof
vf
->
ident
);
vf
->
ident
[
sizeof
vf
->
ident
-
1
]
=
'\0'
;
AZ
(
vf
->
chunk
->
class
[
sizeof
vf
->
chunk
->
class
-
1
]);
REPLACE
(
vf
->
class
,
vf
->
chunk
->
class
);
AZ
(
vf
->
chunk
->
type
[
sizeof
vf
->
chunk
->
type
-
1
]);
REPLACE
(
vf
->
type
,
vf
->
chunk
->
type
);
AZ
(
vf
->
chunk
->
ident
[
sizeof
vf
->
chunk
->
ident
-
1
]);
REPLACE
(
vf
->
ident
,
vf
->
chunk
->
ident
);
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