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
903f1a06
Commit
903f1a06
authored
Dec 26, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce the scope of the SHA256 contexts memory demand, we only
need it during vcl_hash{}
parent
f5577b72
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
cache_center.c
bin/varnishd/cache/cache_center.c
+3
-0
cache_hash.c
bin/varnishd/cache/cache_hash.c
+1
-0
cache_session.c
bin/varnishd/cache/cache_session.c
+1
-5
No files found.
bin/varnishd/cache/cache_center.c
View file @
903f1a06
...
...
@@ -1459,6 +1459,7 @@ static int
cnt_recv
(
struct
sess
*
sp
,
struct
worker
*
wrk
,
struct
req
*
req
)
{
unsigned
recv_handling
;
struct
SHA256Context
sha256ctx
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
...
...
@@ -1502,10 +1503,12 @@ cnt_recv(struct sess *sp, struct worker *wrk, struct req *req)
}
}
req
->
sha256ctx
=
&
sha256ctx
;
SHA256_Init
(
req
->
sha256ctx
);
VCL_hash_method
(
sp
);
assert
(
req
->
handling
==
VCL_RET_HASH
);
SHA256_Final
(
req
->
digest
,
req
->
sha256ctx
);
req
->
sha256ctx
=
NULL
;
if
(
!
strcmp
(
req
->
http
->
hd
[
HTTP_HDR_REQ
].
b
,
"HEAD"
))
req
->
wantbody
=
0
;
...
...
bin/varnishd/cache/cache_hash.c
View file @
903f1a06
...
...
@@ -158,6 +158,7 @@ HSH_AddString(const struct sess *sp, const char *str)
str
=
""
;
l
=
strlen
(
str
);
AN
(
sp
->
req
->
sha256ctx
);
SHA256_Update
(
sp
->
req
->
sha256ctx
,
str
,
l
);
SHA256_Update
(
sp
->
req
->
sha256ctx
,
"#"
,
1
);
...
...
bin/varnishd/cache/cache_session.c
View file @
903f1a06
...
...
@@ -42,7 +42,6 @@
#include "cache.h"
#include "waiter/waiter.h"
#include "vsha256.h"
#include "vtim.h"
static
unsigned
ses_size
=
sizeof
(
struct
sess
);
...
...
@@ -271,10 +270,7 @@ SES_GetReq(struct sess *sp)
nhttp
=
(
uint16_t
)
cache_param
->
http_max_hdr
;
hl
=
HTTP_estimate
(
nhttp
);
xxxassert
(
sz
>
3
*
hl
+
sizeof
(
struct
SHA256Context
)
+
128
);
sp
->
req
->
sha256ctx
=
(
void
*
)
p
;
p
+=
sizeof
(
struct
SHA256Context
);
xxxassert
(
sz
>
3
*
hl
+
128
);
sp
->
req
->
http
=
HTTP_create
(
p
,
nhttp
);
p
+=
hl
;
// XXX: align ?
...
...
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