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
8bcaeac6
Commit
8bcaeac6
authored
Oct 21, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start a separate source file for VDP infrastructure
parent
c613a535
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
47 deletions
+85
-47
Makefile.am
bin/varnishd/Makefile.am
+1
-0
cache.h
bin/varnishd/cache/cache.h
+0
-47
cache_deliver_proc.c
bin/varnishd/cache/cache_deliver_proc.c
+80
-0
cache_filter.h
bin/varnishd/cache/cache_filter.h
+4
-0
No files found.
bin/varnishd/Makefile.am
View file @
8bcaeac6
...
...
@@ -16,6 +16,7 @@ varnishd_SOURCES = \
cache/cache_ban.c
\
cache/cache_busyobj.c
\
cache/cache_cli.c
\
cache/cache_deliver_proc.c
\
cache/cache_director.c
\
cache/cache_esi_deliver.c
\
cache/cache_esi_fetch.c
\
...
...
bin/varnishd/cache/cache.h
View file @
8bcaeac6
...
...
@@ -747,53 +747,6 @@ int VRB_Cache(struct req *req, ssize_t maxsize);
int
VRB_Iterate
(
struct
req
*
req
,
req_body_iter_f
*
func
,
void
*
priv
);
void
VRB_Free
(
struct
req
*
req
);
static
inline
int
VDP_bytes
(
struct
req
*
req
,
enum
vdp_action
act
,
const
void
*
ptr
,
ssize_t
len
)
{
int
i
,
retval
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
assert
(
act
>
VDP_NULL
||
len
>
0
);
/* Call the present layer, while pointing to the next layer down */
i
=
req
->
vdp_nxt
--
;
assert
(
i
>=
0
&&
i
<
N_VDPS
);
retval
=
req
->
vdps
[
i
](
req
,
act
,
&
req
->
vdpp
[
i
],
ptr
,
len
);
req
->
vdp_nxt
++
;
return
(
retval
);
}
static
inline
void
VDP_push
(
struct
req
*
req
,
vdp_bytes
*
func
,
void
*
priv
)
{
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
AN
(
func
);
/* Push another layer */
assert
(
req
->
vdp_nxt
>=
0
);
assert
(
req
->
vdp_nxt
+
1
<
N_VDPS
);
req
->
vdps
[
++
req
->
vdp_nxt
]
=
func
;
req
->
vdpp
[
req
->
vdp_nxt
]
=
priv
;
AZ
(
req
->
vdps
[
req
->
vdp_nxt
](
req
,
VDP_INIT
,
&
req
->
vdpp
[
req
->
vdp_nxt
],
NULL
,
0
));
}
static
inline
void
VDP_pop
(
struct
req
*
req
,
vdp_bytes
*
func
)
{
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
/* Pop top layer */
assert
(
req
->
vdp_nxt
>=
1
);
assert
(
req
->
vdp_nxt
<
N_VDPS
);
assert
(
req
->
vdps
[
req
->
vdp_nxt
]
==
func
);
AZ
(
req
->
vdps
[
req
->
vdp_nxt
](
req
,
VDP_FINI
,
&
req
->
vdpp
[
req
->
vdp_nxt
],
NULL
,
0
));
AZ
(
req
->
vdpp
[
req
->
vdp_nxt
]);
req
->
vdps
[
req
->
vdp_nxt
]
=
NULL
;
req
->
vdp_nxt
--
;
}
/* cache_req_fsm.c [CNT] */
enum
req_fsm_nxt
CNT_Request
(
struct
worker
*
,
struct
req
*
);
void
CNT_AcctLogCharge
(
struct
dstat
*
,
struct
req
*
);
...
...
bin/varnishd/cache/cache_deliver_proc.c
0 → 100644
View file @
8bcaeac6
/*-
* Copyright (c) 2006 Verdens Gang AS
* Copyright (c) 2006-2014 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.
*/
#include "config.h"
#include "cache.h"
//#include "cache_filter.h"
int
VDP_bytes
(
struct
req
*
req
,
enum
vdp_action
act
,
const
void
*
ptr
,
ssize_t
len
)
{
int
i
,
retval
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
assert
(
act
>
VDP_NULL
||
len
>
0
);
/* Call the present layer, while pointing to the next layer down */
i
=
req
->
vdp_nxt
--
;
assert
(
i
>=
0
&&
i
<
N_VDPS
);
retval
=
req
->
vdps
[
i
](
req
,
act
,
&
req
->
vdpp
[
i
],
ptr
,
len
);
req
->
vdp_nxt
++
;
return
(
retval
);
}
void
VDP_push
(
struct
req
*
req
,
vdp_bytes
*
func
,
void
*
priv
)
{
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
AN
(
func
);
/* Push another layer */
assert
(
req
->
vdp_nxt
>=
0
);
assert
(
req
->
vdp_nxt
+
1
<
N_VDPS
);
req
->
vdps
[
++
req
->
vdp_nxt
]
=
func
;
req
->
vdpp
[
req
->
vdp_nxt
]
=
priv
;
AZ
(
req
->
vdps
[
req
->
vdp_nxt
](
req
,
VDP_INIT
,
&
req
->
vdpp
[
req
->
vdp_nxt
],
NULL
,
0
));
}
void
VDP_pop
(
struct
req
*
req
,
vdp_bytes
*
func
)
{
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
/* Pop top layer */
assert
(
req
->
vdp_nxt
>=
1
);
assert
(
req
->
vdp_nxt
<
N_VDPS
);
assert
(
req
->
vdps
[
req
->
vdp_nxt
]
==
func
);
AZ
(
req
->
vdps
[
req
->
vdp_nxt
](
req
,
VDP_FINI
,
&
req
->
vdpp
[
req
->
vdp_nxt
],
NULL
,
0
));
AZ
(
req
->
vdpp
[
req
->
vdp_nxt
]);
req
->
vdps
[
req
->
vdp_nxt
]
=
NULL
;
req
->
vdp_nxt
--
;
}
bin/varnishd/cache/cache_filter.h
View file @
8bcaeac6
...
...
@@ -80,3 +80,7 @@ enum vdp_action {
};
typedef
int
vdp_bytes
(
struct
req
*
,
enum
vdp_action
,
void
**
priv
,
const
void
*
ptr
,
ssize_t
len
);
int
VDP_bytes
(
struct
req
*
,
enum
vdp_action
act
,
const
void
*
ptr
,
ssize_t
len
);
void
VDP_push
(
struct
req
*
,
vdp_bytes
*
func
,
void
*
priv
);
void
VDP_pop
(
struct
req
*
,
vdp_bytes
*
func
);
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