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
a3d1d60e
Commit
a3d1d60e
authored
Nov 16, 2020
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update for changed vdp_init and _fini signatures.
parent
36e06705
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
vdfp_pipe.c
src/vdfp_pipe.c
+16
-13
No files found.
src/vdfp_pipe.c
View file @
a3d1d60e
...
...
@@ -166,8 +166,9 @@ mk_dup(int oldfd, int newfd)
}
static
int
v_matchproto_
(
vdp_init_f
)
vdp_init
(
struct
req
*
req
,
void
**
priv
)
vdp_init
(
struct
vdp_ctx
*
ctx
,
void
**
priv
,
struct
objcore
*
objcore
)
{
struct
req
*
req
;
struct
vdp_state
*
state
;
struct
vdp_entry
*
vdpe
;
struct
vdp_map
map_entry
,
*
map
;
...
...
@@ -179,13 +180,15 @@ vdp_init(struct req *req, void **priv)
struct
setenv_head
*
setenv_head
;
char
**
argv
;
CHECK_OBJ_NOTNULL
(
ctx
,
VDP_CTX_MAGIC
);
req
=
ctx
->
req
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
->
vdc
,
VDP_CTX_MAGIC
);
AN
(
req
->
vcl
);
AN
(
priv
);
AZ
(
*
priv
);
CHECK_OBJ_NOTNULL
(
objcore
,
OBJCORE_MAGIC
);
vdpe
=
VTAILQ_LAST
(
&
req
->
vdc
->
vdp
,
vdp_entry_s
);
vdpe
=
VTAILQ_LAST
(
&
ctx
->
vdp
,
vdp_entry_s
);
CHECK_OBJ_NOTNULL
(
vdpe
,
VDP_ENTRY_MAGIC
);
AN
(
vdpe
->
vdp
);
map_entry
.
vdp
=
vdpe
->
vdp
;
...
...
@@ -199,13 +202,13 @@ vdp_init(struct req *req, void **priv)
errno
=
0
;
ALLOC_OBJ
(
state
,
PIPE_VDP_STATE_MAGIC
);
if
(
state
==
NULL
)
{
VSLb
(
req
->
vsl
,
SLT_Error
,
"vdfp_pipe: vdp %s: cannot allocate "
VSLb
(
ctx
->
vsl
,
SLT_Error
,
"vdfp_pipe: vdp %s: cannot allocate "
"state: %s"
,
obj
->
name
,
vstrerror
(
errno
));
return
(
-
1
);
}
state
->
buf
=
malloc
(
obj
->
bufsz
);
if
(
state
->
buf
==
NULL
)
{
VSLb
(
req
->
vsl
,
SLT_Error
,
"vdfp_pipe: vdp %s: cannot allocate "
VSLb
(
ctx
->
vsl
,
SLT_Error
,
"vdfp_pipe: vdp %s: cannot allocate "
"buffer size %zd: %s"
,
obj
->
name
,
obj
->
bufsz
,
vstrerror
(
errno
));
return
(
-
1
);
...
...
@@ -236,17 +239,17 @@ vdp_init(struct req *req, void **priv)
setenv_head
=
task
->
setenv_head
;
}
if
(
mk_pipe
(
in
,
obj
->
name
,
req
->
vsl
)
!=
0
)
if
(
mk_pipe
(
in
,
obj
->
name
,
ctx
->
vsl
)
!=
0
)
return
(
-
1
);
if
(
mk_pipe
(
out
,
obj
->
name
,
req
->
vsl
)
!=
0
)
if
(
mk_pipe
(
out
,
obj
->
name
,
ctx
->
vsl
)
!=
0
)
return
(
-
1
);
if
(
mk_pipe
(
err
,
obj
->
name
,
req
->
vsl
)
!=
0
)
if
(
mk_pipe
(
err
,
obj
->
name
,
ctx
->
vsl
)
!=
0
)
return
(
-
1
);
errno
=
0
;
state
->
chldpid
=
fork
();
if
(
state
->
chldpid
<
0
)
{
VSLb
(
req
->
vsl
,
SLT_Error
,
"vdfp_pipe: vdp %s: fork failed for "
VSLb
(
ctx
->
vsl
,
SLT_Error
,
"vdfp_pipe: vdp %s: fork failed for "
"%s: %s"
,
obj
->
name
,
obj
->
path
,
vstrerror
(
errno
));
return
(
-
1
);
}
...
...
@@ -292,7 +295,7 @@ vdp_init(struct req *req, void **priv)
}
}
VSLb
(
req
->
vsl
,
SLT_Notice
,
"vdfp_pipe: vdp %s: exec'd %s as pid %jd"
,
VSLb
(
ctx
->
vsl
,
SLT_Notice
,
"vdfp_pipe: vdp %s: exec'd %s as pid %jd"
,
obj
->
name
,
obj
->
path
,
(
intmax_t
)
state
->
chldpid
);
closefd
(
&
in
[
0
]);
closefd
(
&
out
[
1
]);
...
...
@@ -513,11 +516,11 @@ vdp_bytes(struct vdp_ctx *ctx, enum vdp_action act, void **priv,
}
static
int
v_matchproto_
(
vdp_fini_f
)
vdp_fini
(
struct
req
*
req
,
void
**
priv
)
vdp_fini
(
struct
vdp_ctx
*
ctx
,
void
**
priv
)
{
struct
vdp_state
*
state
;
CHECK_OBJ_NOTNULL
(
req
,
REQ
_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
,
VDP_CTX
_MAGIC
);
AN
(
priv
);
if
(
*
priv
==
NULL
)
return
(
0
);
...
...
@@ -529,7 +532,7 @@ vdp_fini(struct req *req, void **priv)
close_all
(
state
->
fds
);
if
(
state
->
chldpid
!=
-
1
)
(
void
)
check_pid
(
state
,
req
->
vsl
,
0
);
(
void
)
check_pid
(
state
,
ctx
->
vsl
,
0
);
if
(
state
->
buf
!=
NULL
)
free
(
state
->
buf
);
FREE_OBJ
(
state
);
...
...
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