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
6c9021d9
Commit
6c9021d9
authored
Apr 03, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an assert to ensure that our estimate of struct http size
matches the actual size later on. Inspired by: #2298
parent
667256f1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
8 deletions
+9
-8
cache.h
bin/varnishd/cache/cache.h
+1
-1
cache_busyobj.c
bin/varnishd/cache/cache_busyobj.c
+3
-3
cache_http.c
bin/varnishd/cache/cache_http.c
+2
-1
cache_req.c
bin/varnishd/cache/cache_req.c
+3
-3
No files found.
bin/varnishd/cache/cache.h
View file @
6c9021d9
...
...
@@ -749,7 +749,7 @@ void VGZ_UpdateObj(const struct vfp_ctx *, struct vgz*, enum vgz_ua_e);
/* cache_http.c */
unsigned
HTTP_estimate
(
unsigned
nhttp
);
void
HTTP_Copy
(
struct
http
*
to
,
const
struct
http
*
const
fm
);
struct
http
*
HTTP_create
(
void
*
p
,
uint16_t
nhttp
);
struct
http
*
HTTP_create
(
void
*
p
,
uint16_t
nhttp
,
unsigned
);
const
char
*
http_Status2Reason
(
unsigned
,
const
char
**
);
unsigned
http_EstimateWS
(
const
struct
http
*
fm
,
unsigned
how
);
void
http_PutResponse
(
struct
http
*
to
,
const
char
*
proto
,
uint16_t
status
,
...
...
bin/varnishd/cache/cache_busyobj.c
View file @
6c9021d9
...
...
@@ -101,17 +101,17 @@ VBO_GetBusyObj(struct worker *wrk, const struct req *req)
nhttp
=
(
uint16_t
)
cache_param
->
http_max_hdr
;
sz
=
HTTP_estimate
(
nhttp
);
bo
->
bereq0
=
HTTP_create
(
p
,
nhttp
);
bo
->
bereq0
=
HTTP_create
(
p
,
nhttp
,
sz
);
p
+=
sz
;
p
=
(
void
*
)
PRNDUP
(
p
);
assert
(
p
<
bo
->
end
);
bo
->
bereq
=
HTTP_create
(
p
,
nhttp
);
bo
->
bereq
=
HTTP_create
(
p
,
nhttp
,
sz
);
p
+=
sz
;
p
=
(
void
*
)
PRNDUP
(
p
);
assert
(
p
<
bo
->
end
);
bo
->
beresp
=
HTTP_create
(
p
,
nhttp
);
bo
->
beresp
=
HTTP_create
(
p
,
nhttp
,
sz
);
p
+=
sz
;
p
=
(
void
*
)
PRNDUP
(
p
);
assert
(
p
<
bo
->
end
);
...
...
bin/varnishd/cache/cache_http.c
View file @
6c9021d9
...
...
@@ -147,7 +147,7 @@ HTTP_estimate(unsigned nhttp)
}
struct
http
*
HTTP_create
(
void
*
p
,
uint16_t
nhttp
)
HTTP_create
(
void
*
p
,
uint16_t
nhttp
,
unsigned
len
)
{
struct
http
*
hp
;
...
...
@@ -156,6 +156,7 @@ HTTP_create(void *p, uint16_t nhttp)
hp
->
hd
=
(
void
*
)(
hp
+
1
);
hp
->
shd
=
nhttp
;
hp
->
hdf
=
(
void
*
)(
hp
->
hd
+
nhttp
);
assert
((
unsigned
char
*
)
p
+
len
==
hp
->
hdf
+
nhttp
);
return
(
hp
);
}
...
...
bin/varnishd/cache/cache_req.c
View file @
6c9021d9
...
...
@@ -77,17 +77,17 @@ Req_New(const struct worker *wrk, struct sess *sp)
nhttp
=
(
uint16_t
)
cache_param
->
http_max_hdr
;
hl
=
HTTP_estimate
(
nhttp
);
req
->
http
=
HTTP_create
(
p
,
nhttp
);
req
->
http
=
HTTP_create
(
p
,
nhttp
,
hl
);
p
+=
hl
;
p
=
(
void
*
)
PRNDUP
(
p
);
assert
(
p
<
e
);
req
->
http0
=
HTTP_create
(
p
,
nhttp
);
req
->
http0
=
HTTP_create
(
p
,
nhttp
,
hl
);
p
+=
hl
;
p
=
(
void
*
)
PRNDUP
(
p
);
assert
(
p
<
e
);
req
->
resp
=
HTTP_create
(
p
,
nhttp
);
req
->
resp
=
HTTP_create
(
p
,
nhttp
,
hl
);
p
+=
hl
;
p
=
(
void
*
)
PRNDUP
(
p
);
assert
(
p
<
e
);
...
...
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