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
c5bd5e83
Commit
c5bd5e83
authored
Apr 29, 2021
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mvp_fixes' of code.uplex.de:uplex-varnish/libvdfp-pipe into mvp_fixes
parents
e16dc7b0
684aa039
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
10 deletions
+22
-10
append.sh
src/tests/append.sh
+3
-0
append.vtc
src/tests/append.vtc
+13
-0
error.vtc
src/tests/error.vtc
+1
-0
vdfp_pipe.c
src/vdfp_pipe.c
+5
-10
No files found.
src/tests/append.sh
View file @
c5bd5e83
...
...
@@ -2,10 +2,13 @@
while
read
line
do
echo
>
&2 append
$1
while
read
echo
$line
sleep
1
echo
append
$1
done
echo
>
&2 append
$1
before final
echo
final
$1
echo
>
&2 append
$1
after final
exit
0
src/tests/append.vtc
View file @
c5bd5e83
...
...
@@ -27,6 +27,17 @@ varnish v1 -arg "-p debug=+syncvsl" -vcl+backend {
}
} -start
logexpect l1001 -v v1 -q "vxid == 1001" -i Error {
expect 0 1001 Error "stderr: append 1 while read$"
expect 0 = Error "stderr: append 2 while read$"
expect 0 = Error "stderr: append 2 while read$"
expect 0 = Error "stderr: append 2 while read$"
expect ? = Error "stderr: append 2 before final$"
expect ? = Error "stderr: append 2 after final$"
expect ? = Error "stderr: append 1 before final$"
expect ? = Error "stderr: append 1 after final$"
} -start
client c1 {
txreq
rxresp
...
...
@@ -41,3 +52,5 @@ final 2
}
} -run
logexpect l1001 -wait
\ No newline at end of file
src/tests/error.vtc
View file @
c5bd5e83
...
...
@@ -27,6 +27,7 @@ client c1 {
logexpect l1 -v v1 -g vxid -d 1 -q Error {
expect 0 * Begin {^req \d+ rxreq$}
expect * = Error {^vdfp_pipe: vdp cat: ${cat} stderr: }
expect * = Error {^vdfp_pipe: vdp cat: ${cat} exited with status 1}
expect * = End
} -run
...
...
src/vdfp_pipe.c
View file @
c5bd5e83
...
...
@@ -457,10 +457,10 @@ vdp_bytes(struct vdp_ctx *ctx, enum vdp_action act, void **priv,
closefd
(
&
fds
[
STDERR_FILENO
].
fd
);
continue
;
}
close
_all
(
fds
);
if
(
act_bytes
=
=
VDP_END
)
return
(
0
);
return
(
VDP_bytes
(
ctx
,
VDP_END
,
NULL
,
0
))
;
close
fd
(
&
fds
[
STDOUT_FILENO
].
fd
);
if
(
act_bytes
!
=
VDP_END
)
VDP_bytes
(
ctx
,
VDP_END
,
NULL
,
0
);
continue
;
}
errno
=
0
;
nbytes
=
read
(
fds
[
i
].
fd
,
state
->
buf
,
obj
->
bufsz
);
...
...
@@ -473,17 +473,12 @@ vdp_bytes(struct vdp_ctx *ctx, enum vdp_action act, void **priv,
close_all
(
fds
);
return
(
-
1
);
}
assert
(
nbytes
>
0
);
if
(
i
==
STDOUT_FILENO
&&
fds
[
i
].
revents
&
POLLHUP
&&
nbytes
<
obj
->
bufsz
)
{
act_bytes
=
VDP_END
;
}
if
(
nbytes
==
0
)
{
if
(
i
==
STDOUT_FILENO
)
closefd
(
&
fds
[
STDOUT_FILENO
].
fd
);
else
closefd
(
&
fds
[
STDERR_FILENO
].
fd
);
}
if
(
i
==
STDOUT_FILENO
)
{
retval
=
VDP_bytes
(
ctx
,
act_bytes
,
state
->
buf
,
nbytes
);
...
...
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