Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvdfp-pipe
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvdfp-pipe
Commits
546c8a54
Unverified
Commit
546c8a54
authored
Jan 01, 2024
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust to VDP API Changes from VC#4035
Ref
https://github.com/varnishcache/varnish-cache/pull/4035
parent
3ddeaa5f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
30 deletions
+36
-30
README.rst
README.rst
+10
-10
vdfp_pipe.c
src/vdfp_pipe.c
+16
-10
vdfp_pipe.vcc
src/vdfp_pipe.vcc
+10
-10
No files found.
README.rst
View file @
546c8a54
...
...
@@ -204,14 +204,14 @@ VOID xvdp.arg(STRING)
The ``.arg()`` method sets a command-line argument to be used with a
program.
Restricted to: ``vcl_init``, ``vcl_deliver``.
Restricted to: ``vcl_init``, ``vcl_deliver``
, ``vcl_backend_fetch``
.
Invocations of ``.arg()`` in ``vcl_init`` set arguments to be used
globally in the VCL instance. Invocations in ``vcl_deliver``
set
arguments to be used for a single client response, overriding any
arguments that may have been set in ``vcl_init`` For example, you can
call ``.arg()`` in ``vcl_deliver`` if the arguments to be used are not
known until runtime.
globally in the VCL instance. Invocations in ``vcl_deliver``
/
``vcl_backend_fetch`` are valid for a single resp.body / bereq.body,
overriding any arguments that may have been set in ``vcl_init`` For
example, you can call ``.arg()`` in ``vcl_deliver`` if the arguments
to be used are not
known until runtime.
The parameter in ``.arg()`` MAY be empty (if you need the empty string
as a CLI argument), but MAY NOT be NULL (for example, it may not be
...
...
@@ -277,12 +277,12 @@ VOID xvdp.setenv(STRING var, STRING value, BOOL overwrite)
Set the environment variable ``var`` to ``value`` in the invoked
process.
Restricted to: ``vcl_init``, ``vcl_deliver``.
Restricted to: ``vcl_init``, ``vcl_deliver``
, ``vcl_backend_fetch``
.
Settings in ``vcl_init`` are global for the VCL instance, while
settings in ``vcl_deliver``
are valid for a single client response
(for use cases where the environment settings are not known until
runtime).
settings in ``vcl_deliver``
/ ``vcl_backend_fetch`` are valid for a
single resp.body / bereq.body (for use cases where the environment
settings are not known until
runtime).
Currently, any invocation of ``.setenv()`` in ``vcl_deliver`` cancels
all environment settings specified in ``vcl_init`` for the current
...
...
src/vdfp_pipe.c
View file @
546c8a54
...
...
@@ -174,9 +174,10 @@ mk_dup(int oldfd, int newfd)
}
static
int
v_matchproto_
(
vdp_init_f
)
vdp_init
(
VRT_CTX
,
struct
vdp_ctx
*
vc
,
void
**
priv
,
struct
objcore
*
objcore
)
vdp_init
(
VRT_CTX
,
struct
vdp_ctx
*
vc
,
void
**
priv
,
struct
objcore
*
objcore
,
struct
req
*
req
,
struct
http
*
hd
,
intmax_t
*
cl
)
{
struct
req
*
req
;
struct
vdp_state
*
state
;
struct
vdp_entry
*
vdpe
;
struct
vdp_map
map_entry
,
*
map
;
...
...
@@ -188,18 +189,19 @@ vdp_init(VRT_CTX, struct vdp_ctx *vc, void **priv, struct objcore *objcore)
char
**
argv
;
CHECK_OBJ_NOTNULL
(
vc
,
VDP_CTX_MAGIC
);
req
=
vc
->
req
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
AN
(
req
->
vcl
);
AN
(
priv
);
AZ
(
*
priv
);
CHECK_OBJ_ORNULL
(
objcore
,
OBJCORE_MAGIC
);
CHECK_OBJ_ORNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
hd
,
HTTP_MAGIC
);
AN
(
cl
);
AZ
(
*
priv
);
vdpe
=
VTAILQ_LAST
(
&
vc
->
vdp
,
vdp_entry_s
);
CHECK_OBJ_NOTNULL
(
vdpe
,
VDP_ENTRY_MAGIC
);
AN
(
vdpe
->
vdp
);
map_entry
.
vdp
=
vdpe
->
vdp
;
map_entry
.
vcl
=
req
->
vcl
;
map_entry
.
vcl
=
ctx
->
vcl
;
map
=
VRBT_FIND
(
vdp_tree
,
&
tree_h
,
&
map_entry
);
CHECK_OBJ_NOTNULL
(
map
,
PIPE_VDP_MAP_MAGIC
);
CHECK_OBJ_NOTNULL
(
map
->
obj
,
PIPE_VDP_MAGIC
);
...
...
@@ -309,7 +311,8 @@ vdp_init(VRT_CTX, struct vdp_ctx *vc, void **priv, struct objcore *objcore)
state
->
fds
[
STDIN_FILENO
].
fd
=
in
[
1
];
state
->
fds
[
STDOUT_FILENO
].
fd
=
out
[
0
];
state
->
fds
[
STDERR_FILENO
].
fd
=
err
[
0
];
http_Unset
(
req
->
resp
,
H_Content_Length
);
http_Unset
(
hd
,
H_Content_Length
);
*
cl
=
-
1
;
return
(
0
);
}
...
...
@@ -800,6 +803,9 @@ get_task(VRT_CTX, struct VPFX(pipe_vdp) *obj, const char *method)
return
(
task
);
}
#define VDP_VALID_METHOD \
(VCL_MET_INIT | VCL_MET_DELIVER | VCL_MET_BACKEND_FETCH)
VCL_VOID
vmod_vdp_arg
(
VRT_CTX
,
struct
VPFX
(
pipe_vdp
)
*
obj
,
VCL_STRING
arg
)
{
...
...
@@ -810,7 +816,7 @@ vmod_vdp_arg(VRT_CTX, struct VPFX(pipe_vdp) *obj, VCL_STRING arg)
CHECK_OBJ_NOTNULL
(
ctx
->
ws
,
WS_MAGIC
);
CHECK_OBJ_NOTNULL
(
obj
,
PIPE_VDP_MAGIC
);
AN
(
ctx
->
method
&
(
VCL_MET_INIT
|
VCL_MET_DELIVER
)
);
AN
(
ctx
->
method
&
VDP_VALID_METHOD
);
if
(
arg
==
NULL
)
{
VDPFAIL
(
ctx
,
"%s.arg(): arg is NULL"
,
obj
->
name
);
...
...
@@ -893,7 +899,7 @@ vmod_vdp_setenv(VRT_CTX, struct VPFX(pipe_vdp) *obj, VCL_STRING var,
CHECK_OBJ_NOTNULL
(
ctx
->
ws
,
WS_MAGIC
);
CHECK_OBJ_NOTNULL
(
obj
,
PIPE_VDP_MAGIC
);
AN
(
ctx
->
method
&
(
VCL_MET_INIT
|
VCL_MET_DELIVER
)
);
AN
(
ctx
->
method
&
VDP_VALID_METHOD
);
if
(
var
==
NULL
||
*
var
==
'\0'
)
{
VDPFAIL
(
ctx
,
"%s.setenv(): var is empty"
,
obj
->
name
);
...
...
src/vdfp_pipe.vcc
View file @
546c8a54
...
...
@@ -185,14 +185,14 @@ $Method VOID .arg(STRING)
The ``.arg()`` method sets a command-line argument to be used with a
program.
$Restrict vcl_init vcl_deliver
$Restrict vcl_init vcl_deliver
vcl_backend_fetch
Invocations of ``.arg()`` in ``vcl_init`` set arguments to be used
globally in the VCL instance. Invocations in ``vcl_deliver``
set
arguments to be used for a single client response, overriding any
arguments that may have been set in ``vcl_init`` For example, you can
call ``.arg()`` in ``vcl_deliver`` if the arguments to be used are not
known until runtime.
globally in the VCL instance. Invocations in ``vcl_deliver``
/
``vcl_backend_fetch`` are valid for a single resp.body / bereq.body,
overriding any arguments that may have been set in ``vcl_init`` For
example, you can call ``.arg()`` in ``vcl_deliver`` if the arguments
to be used are not
known until runtime.
The parameter in ``.arg()`` MAY be empty (if you need the empty string
as a CLI argument), but MAY NOT be NULL (for example, it may not be
...
...
@@ -251,12 +251,12 @@ $Method VOID .setenv(STRING var, STRING value, BOOL overwrite=1)
Set the environment variable ``var`` to ``value`` in the invoked
process.
$Restrict vcl_init vcl_deliver
$Restrict vcl_init vcl_deliver
vcl_backend_fetch
Settings in ``vcl_init`` are global for the VCL instance, while
settings in ``vcl_deliver``
are valid for a single client response
(for use cases where the environment settings are not known until
runtime).
settings in ``vcl_deliver``
/ ``vcl_backend_fetch`` are valid for a
single resp.body / bereq.body (for use cases where the environment
settings are not known until
runtime).
Currently, any invocation of ``.setenv()`` in ``vcl_deliver`` cancels
all environment settings specified in ``vcl_init`` for the current
...
...
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