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
3a5b4d83
Unverified
Commit
3a5b4d83
authored
Jun 17, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use $Restrict
parent
d14cb1ea
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
27 deletions
+21
-27
vdfp_pipe.c
src/vdfp_pipe.c
+3
-11
vdfp_pipe.vcc
src/vdfp_pipe.vcc
+18
-16
No files found.
src/vdfp_pipe.c
View file @
3a5b4d83
/*-
/*-
* Copyright
(c) 2019
UPLEX Nils Goroll Systemoptimierung
* Copyright
2019, 2023
UPLEX Nils Goroll Systemoptimierung
* All rights reserved
* All rights reserved
*
*
* Author: Geoffrey Simmons <geoffrey.simmons@uplex.de>
* Author: Geoffrey Simmons <geoffrey.simmons@uplex.de>
...
@@ -793,11 +793,7 @@ vmod_vdp_arg(VRT_CTX, struct VPFX(pipe_vdp) *obj, VCL_STRING arg)
...
@@ -793,11 +793,7 @@ vmod_vdp_arg(VRT_CTX, struct VPFX(pipe_vdp) *obj, VCL_STRING arg)
CHECK_OBJ_NOTNULL
(
ctx
->
ws
,
WS_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
ws
,
WS_MAGIC
);
CHECK_OBJ_NOTNULL
(
obj
,
PIPE_VDP_MAGIC
);
CHECK_OBJ_NOTNULL
(
obj
,
PIPE_VDP_MAGIC
);
if
(
!
(
ctx
->
method
&
(
VCL_MET_INIT
|
VCL_MET_DELIVER
)))
{
AN
(
ctx
->
method
&
(
VCL_MET_INIT
|
VCL_MET_DELIVER
));
VDPFAIL
(
ctx
,
"%s.arg(): may only be called in vcl_init or "
"vcl_deliver"
,
obj
->
name
);
return
;
}
if
(
arg
==
NULL
)
{
if
(
arg
==
NULL
)
{
VDPFAIL
(
ctx
,
"%s.arg(): arg is NULL"
,
obj
->
name
);
VDPFAIL
(
ctx
,
"%s.arg(): arg is NULL"
,
obj
->
name
);
...
@@ -871,11 +867,7 @@ vmod_vdp_setenv(VRT_CTX, struct VPFX(pipe_vdp) *obj, VCL_STRING var,
...
@@ -871,11 +867,7 @@ vmod_vdp_setenv(VRT_CTX, struct VPFX(pipe_vdp) *obj, VCL_STRING var,
CHECK_OBJ_NOTNULL
(
ctx
->
ws
,
WS_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
ws
,
WS_MAGIC
);
CHECK_OBJ_NOTNULL
(
obj
,
PIPE_VDP_MAGIC
);
CHECK_OBJ_NOTNULL
(
obj
,
PIPE_VDP_MAGIC
);
if
(
!
(
ctx
->
method
&
(
VCL_MET_INIT
|
VCL_MET_DELIVER
)))
{
AN
(
ctx
->
method
&
(
VCL_MET_INIT
|
VCL_MET_DELIVER
));
VDPFAIL
(
ctx
,
"%s.setenv(): may only be called in vcl_init or "
"vcl_deliver"
,
obj
->
name
);
return
;
}
if
(
var
==
NULL
||
*
var
==
'\0'
)
{
if
(
var
==
NULL
||
*
var
==
'\0'
)
{
VDPFAIL
(
ctx
,
"%s.setenv(): var is empty"
,
obj
->
name
);
VDPFAIL
(
ctx
,
"%s.setenv(): var is empty"
,
obj
->
name
);
...
...
src/vdfp_pipe.vcc
View file @
3a5b4d83
...
@@ -91,8 +91,7 @@ For example, to execute the VDPs shown above after ESI processing::
...
@@ -91,8 +91,7 @@ For example, to execute the VDPs shown above after ESI processing::
$Object vdp(STRING path, STRING name=0, BYTES bufsz=0, DURATION timeout=60)
$Object vdp(STRING path, STRING name=0, BYTES bufsz=0, DURATION timeout=60)
Define a VDP that transforms client responses by piping them through
Define a VDP that transforms client responses by piping them through
the program located at ``path``. The constructor may only be called in
the program located at ``path``.
``vcl_init``.
The ``path`` parameter is required, MAY NOT be empty, and MUST specify
The ``path`` parameter is required, MAY NOT be empty, and MUST specify
the absolute location of the file; the ``PATH`` environment variable
the absolute location of the file; the ``PATH`` environment variable
...
@@ -184,14 +183,16 @@ A complete example::
...
@@ -184,14 +183,16 @@ A complete example::
$Method VOID .arg(STRING)
$Method VOID .arg(STRING)
The ``.arg()`` method sets a command-line argument to be used with a
The ``.arg()`` method sets a command-line argument to be used with a
program. The method MAY NOT be called in any VCL subroutine besides
program.
``vcl_init`` or ``vcl_deliver``. Invocations of ``.arg()`` in
``vcl_init`` set arguments to be used globally in the VCL
$Restrict vcl_init vcl_deliver
instance. Invocations in ``vcl_deliver`` set arguments to be used for
a single client response, overriding any arguments that may have been
Invocations of ``.arg()`` in ``vcl_init`` set arguments to be used
set in ``vcl_init`` For example, you can call ``.arg()`` in
globally in the VCL instance. Invocations in ``vcl_deliver`` set
``vcl_deliver`` if the arguments to be used are not known until
arguments to be used for a single client response, overriding any
runtime.
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
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
as a CLI argument), but MAY NOT be NULL (for example, it may not be
...
@@ -250,11 +251,12 @@ $Method VOID .setenv(STRING var, STRING value, BOOL overwrite=1)
...
@@ -250,11 +251,12 @@ $Method VOID .setenv(STRING var, STRING value, BOOL overwrite=1)
Set the environment variable ``var`` to ``value`` in the invoked
Set the environment variable ``var`` to ``value`` in the invoked
process.
process.
Like ``.arg()``, ``.setenv()`` MAY NOT be called in any VCL subroutine
$Restrict vcl_init vcl_deliver
besides ``vcl_init`` or ``vcl_deliver``. Settings in ``vcl_init`` are
global for the VCL instance, while settings in ``vcl_deliver`` are
Settings in ``vcl_init`` are global for the VCL instance, while
valid for a single client response (for use cases where the
settings in ``vcl_deliver`` are valid for a single client response
environment settings are not known until runtime).
(for use cases where the environment settings are not known until
runtime).
Currently, any invocation of ``.setenv()`` in ``vcl_deliver`` cancels
Currently, any invocation of ``.setenv()`` in ``vcl_deliver`` cancels
all environment settings specified in ``vcl_init`` for the current
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