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
ccfa03fc
Commit
ccfa03fc
authored
Jan 10, 2018
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reintroduce VLU_Feed()
parent
86e8f721
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
vlu.h
include/vlu.h
+1
-0
vlu.c
lib/libvarnish/vlu.c
+23
-0
No files found.
include/vlu.h
View file @
ccfa03fc
...
...
@@ -37,3 +37,4 @@ struct vlu *VLU_New(vlu_f *, void *, unsigned);
int
VLU_Fd
(
struct
vlu
*
,
int
);
void
VLU_Destroy
(
struct
vlu
**
);
int
VLU_File
(
int
,
vlu_f
*
,
void
*
,
unsigned
);
int
VLU_Feed
(
struct
vlu
*
,
const
char
*
,
int
);
lib/libvarnish/vlu.c
View file @
ccfa03fc
...
...
@@ -143,3 +143,26 @@ VLU_File(int fd, vlu_f *func, void *priv, unsigned bufsize)
VLU_Destroy
(
&
vlu
);
return
(
i
);
}
int
VLU_Feed
(
struct
vlu
*
l
,
const
char
*
ptr
,
int
len
)
{
int
i
=
0
,
ll
;
CHECK_OBJ_NOTNULL
(
l
,
LINEUP_MAGIC
);
AN
(
ptr
);
assert
(
len
>
0
);
while
(
len
>
0
)
{
ll
=
len
;
if
(
ll
>
l
->
bufl
-
l
->
bufp
)
ll
=
l
->
bufl
-
l
->
bufp
;
memcpy
(
l
->
buf
+
l
->
bufp
,
ptr
,
ll
);
len
-=
ll
;
ptr
+=
ll
;
l
->
bufp
+=
ll
;
i
=
LineUpProcess
(
l
);
if
(
i
)
return
(
i
);
}
return
(
i
);
}
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