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
72a8e80c
Commit
72a8e80c
authored
Dec 10, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the req.body iterator use same prototype as obj iterator
parent
b44b1e94
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
11 deletions
+8
-11
cache.h
bin/varnishd/cache/cache.h
+1
-2
cache_req_body.c
bin/varnishd/cache/cache_req_body.c
+5
-6
cache_http1_fetch.c
bin/varnishd/http1/cache_http1_fetch.c
+2
-3
No files found.
bin/varnishd/cache/cache.h
View file @
72a8e80c
...
...
@@ -682,8 +682,7 @@ void VBO_waitstate(struct busyobj *bo, enum busyobj_state_e want);
/* cache_req_body.c */
int
VRB_Ignore
(
struct
req
*
req
);
ssize_t
VRB_Cache
(
struct
req
*
req
,
ssize_t
maxsize
);
typedef
int
(
req_body_iter_f
)(
struct
req
*
,
void
*
priv
,
const
void
*
ptr
,
size_t
);
typedef
int
req_body_iter_f
(
void
*
priv
,
int
flush
,
const
void
*
ptr
,
ssize_t
len
);
ssize_t
VRB_Iterate
(
struct
req
*
req
,
req_body_iter_f
*
func
,
void
*
priv
);
void
VRB_Free
(
struct
req
*
req
);
...
...
bin/varnishd/cache/cache_req_body.c
View file @
72a8e80c
...
...
@@ -56,16 +56,15 @@ struct vrb_foo {
ssize_t
ll
;
};
static
int
static
int
__match_proto__
(
objiterate_f
)
vrb_objiterator
(
void
*
priv
,
int
flush
,
const
void
*
ptr
,
ssize_t
len
)
{
struct
vrb_foo
*
foo
;
CAST_OBJ_NOTNULL
(
foo
,
priv
,
VRB_FOO_MAGIC
);
(
void
)
flush
;
foo
->
ll
+=
len
;
return
(
foo
->
func
(
foo
->
req
,
foo
->
priv
,
ptr
,
len
));
return
(
foo
->
func
(
foo
->
priv
,
flush
,
ptr
,
len
));
}
ssize_t
...
...
@@ -144,7 +143,7 @@ VRB_Iterate(struct req *req, req_body_iter_f *func, void *priv)
req
->
req_bodybytes
+=
l
;
req
->
acct
.
req_bodybytes
+=
l
;
ll
+=
l
;
l
=
func
(
req
,
priv
,
buf
,
l
);
l
=
func
(
priv
,
1
,
buf
,
l
);
if
(
l
)
{
req
->
req_body_status
=
REQ_BODY_FAIL
;
ll
=
-
1
;
...
...
@@ -165,11 +164,11 @@ VRB_Iterate(struct req *req, req_body_iter_f *func, void *priv)
*/
static
int
__match_proto__
(
req_body_iter_f
)
httpq_req_body_discard
(
struct
req
*
req
,
void
*
priv
,
const
void
*
ptr
,
size_t
len
)
httpq_req_body_discard
(
void
*
priv
,
int
flush
,
const
void
*
ptr
,
s
size_t
len
)
{
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
(
void
)
priv
;
(
void
)
flush
;
(
void
)
ptr
;
(
void
)
len
;
return
(
0
);
...
...
bin/varnishd/http1/cache_http1_fetch.c
View file @
72a8e80c
...
...
@@ -49,16 +49,15 @@
*/
static
int
__match_proto__
(
req_body_iter_f
)
vbf_iter_req_body
(
struct
req
*
req
,
void
*
priv
,
const
void
*
ptr
,
size_t
l
)
vbf_iter_req_body
(
void
*
priv
,
int
flush
,
const
void
*
ptr
,
s
size_t
l
)
{
struct
busyobj
*
bo
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CAST_OBJ_NOTNULL
(
bo
,
priv
,
BUSYOBJ_MAGIC
);
if
(
l
>
0
)
{
bo
->
acct
.
bereq_bodybytes
+=
V1L_Write
(
bo
->
wrk
,
ptr
,
l
);
if
(
V1L_Flush
(
bo
->
wrk
))
if
(
flush
&&
V1L_Flush
(
bo
->
wrk
))
return
(
-
1
);
}
return
(
0
);
...
...
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