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
16b84c2a
Commit
16b84c2a
authored
Mar 04, 2015
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use s?size_t for req_bodybytes and VRB_Cache
The VRT side of things still needs attention
parent
6fd7f77d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
4 deletions
+11
-4
cache.h
bin/varnishd/cache/cache.h
+2
-2
cache_req_body.c
bin/varnishd/cache/cache_req_body.c
+4
-2
cache_vrt.c
bin/varnishd/cache/cache_vrt.c
+2
-0
vrt.h
include/vrt.h
+3
-0
No files found.
bin/varnishd/cache/cache.h
View file @
16b84c2a
...
...
@@ -587,7 +587,7 @@ struct req {
enum
sess_close
doclose
;
double
d_ttl
;
uint64
_t
req_bodybytes
;
/* Parsed req bodybytes */
ssize
_t
req_bodybytes
;
/* Parsed req bodybytes */
uint16_t
err_code
;
const
char
*
err_reason
;
...
...
@@ -760,7 +760,7 @@ void V1P_Process(struct req *req, struct busyobj *bo, int fd);
/* cache_req_body.c */
int
VRB_Ignore
(
struct
req
*
req
);
in
t
VRB_Cache
(
struct
req
*
req
,
ssize_t
maxsize
);
ssize_
t
VRB_Cache
(
struct
req
*
req
,
ssize_t
maxsize
);
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 @
16b84c2a
...
...
@@ -191,7 +191,7 @@ VRB_Free(struct req *req)
* off to prevent parallelism.
*/
in
t
ssize_
t
VRB_Cache
(
struct
req
*
req
,
ssize_t
maxsize
)
{
ssize_t
l
,
yet
;
...
...
@@ -220,6 +220,7 @@ VRB_Cache(struct req *req, ssize_t maxsize)
vfc
=
req
->
htc
->
vfc
;
if
(
req
->
htc
->
content_length
>
maxsize
)
{
// XXX #1664
req
->
req_body_status
=
REQ_BODY_FAIL
;
(
void
)
VFP_Error
(
vfc
,
"Request body too big to cache"
);
return
(
-
1
);
...
...
@@ -240,6 +241,7 @@ VRB_Cache(struct req *req, ssize_t maxsize)
return
(
-
1
);
}
AZ
(
req
->
req_bodybytes
);
AN
(
req
->
htc
);
yet
=
req
->
htc
->
content_length
;
if
(
yet
<
0
)
...
...
@@ -265,7 +267,7 @@ VRB_Cache(struct req *req, ssize_t maxsize)
VFP_Close
(
vfc
);
if
(
vfps
==
VFP_END
)
{
assert
(
req
->
req_bodybytes
>=
0
);
if
(
req
->
req_bodybytes
!=
req
->
htc
->
content_length
)
{
/* We must update also the "pristine" req.* copy */
http_Unset
(
req
->
http0
,
H_Content_Length
);
...
...
bin/varnishd/cache/cache_vrt.c
View file @
16b84c2a
...
...
@@ -475,6 +475,8 @@ VRT_ban_string(VRT_CTX, const char *str)
/*--------------------------------------------------------------------
*
* XXX this really should be ssize_t VRT_CacheReqBody(VRT_CTX, size_t)
* - change with next VRT major bump
*/
int
...
...
include/vrt.h
View file @
16b84c2a
...
...
@@ -37,6 +37,9 @@
* Whenever something is added, increment MINOR version
* Whenever something is deleted or changed in a way which is not
* binary/load-time compatible, increment MAJOR version
*
* changes to consider with next VRT_MAJOR_VERSION bump:
* - cache_vrt.c: -> ssize_t VRT_CacheReqBody(VRT_CTX, size_t)
*/
#define VRT_MAJOR_VERSION 2U
...
...
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