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
624b3731
Commit
624b3731
authored
Dec 26, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move sha256 hash context from worker to req
parent
6c148642
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
11 deletions
+12
-11
cache.h
bin/varnishd/cache/cache.h
+3
-3
cache_center.c
bin/varnishd/cache/cache_center.c
+2
-2
cache_hash.c
bin/varnishd/cache/cache_hash.c
+2
-2
cache_session.c
bin/varnishd/cache/cache_session.c
+5
-1
cache_wrk.c
bin/varnishd/cache/cache_wrk.c
+0
-3
No files found.
bin/varnishd/cache/cache.h
View file @
624b3731
...
...
@@ -324,9 +324,6 @@ struct worker {
uint32_t
*
wlb
,
*
wlp
,
*
wle
;
unsigned
wlr
;
/* Lookup stuff */
struct
SHA256Context
*
sha256ctx
;
struct
ws
ws
[
1
];
struct
busyobj
*
busyobj
;
...
...
@@ -622,6 +619,9 @@ struct req {
struct
ws
ws
[
1
];
struct
object
*
obj
;
struct
objcore
*
objcore
;
/* Lookup stuff */
struct
SHA256Context
*
sha256ctx
;
};
/*--------------------------------------------------------------------*/
...
...
bin/varnishd/cache/cache_center.c
View file @
624b3731
...
...
@@ -1502,10 +1502,10 @@ cnt_recv(struct sess *sp, struct worker *wrk, struct req *req)
}
}
SHA256_Init
(
wrk
->
sha256ctx
);
SHA256_Init
(
req
->
sha256ctx
);
VCL_hash_method
(
sp
);
assert
(
req
->
handling
==
VCL_RET_HASH
);
SHA256_Final
(
req
->
digest
,
wrk
->
sha256ctx
);
SHA256_Final
(
req
->
digest
,
req
->
sha256ctx
);
if
(
!
strcmp
(
req
->
http
->
hd
[
HTTP_HDR_REQ
].
b
,
"HEAD"
))
req
->
wantbody
=
0
;
...
...
bin/varnishd/cache/cache_hash.c
View file @
624b3731
...
...
@@ -158,8 +158,8 @@ HSH_AddString(const struct sess *sp, const char *str)
str
=
""
;
l
=
strlen
(
str
);
SHA256_Update
(
sp
->
wrk
->
sha256ctx
,
str
,
l
);
SHA256_Update
(
sp
->
wrk
->
sha256ctx
,
"#"
,
1
);
SHA256_Update
(
sp
->
req
->
sha256ctx
,
str
,
l
);
SHA256_Update
(
sp
->
req
->
sha256ctx
,
"#"
,
1
);
if
(
cache_param
->
log_hash
)
WSP
(
sp
,
SLT_Hash
,
"%s"
,
str
);
...
...
bin/varnishd/cache/cache_session.c
View file @
624b3731
...
...
@@ -42,6 +42,7 @@
#include "cache.h"
#include "waiter/waiter.h"
#include "vsha256.h"
#include "vtim.h"
static
unsigned
ses_size
=
sizeof
(
struct
sess
);
...
...
@@ -270,7 +271,10 @@ SES_GetReq(struct sess *sp)
nhttp
=
(
uint16_t
)
cache_param
->
http_max_hdr
;
hl
=
HTTP_estimate
(
nhttp
);
xxxassert
(
sz
>
3
*
hl
+
128
);
xxxassert
(
sz
>
3
*
hl
+
sizeof
(
struct
SHA256Context
)
+
128
);
sp
->
req
->
sha256ctx
=
(
void
*
)
p
;
p
+=
sizeof
(
struct
SHA256Context
);
sp
->
req
->
http
=
HTTP_create
(
p
,
nhttp
);
p
+=
hl
;
// XXX: align ?
...
...
bin/varnishd/cache/cache_wrk.c
View file @
624b3731
...
...
@@ -37,7 +37,6 @@
#include "cache.h"
#include "hash/hash_slinger.h"
#include "vsha256.h"
static
struct
lock
wstat_mtx
;
...
...
@@ -140,7 +139,6 @@ wrk_thread_real(void *priv, unsigned shm_workspace, unsigned sess_workspace,
/* XXX: can we trust these to be properly aligned ? */
unsigned
char
ws
[
sess_workspace
];
struct
iovec
iov
[
siov
];
struct
SHA256Context
sha256
;
THR_SetName
(
"cache-worker"
);
w
=
&
ww
;
...
...
@@ -149,7 +147,6 @@ wrk_thread_real(void *priv, unsigned shm_workspace, unsigned sess_workspace,
w
->
lastused
=
NAN
;
w
->
wlb
=
w
->
wlp
=
wlog
;
w
->
wle
=
wlog
+
(
sizeof
wlog
)
/
4
;
w
->
sha256ctx
=
&
sha256
;
w
->
wrw
.
iov
=
iov
;
w
->
wrw
.
siov
=
siov
;
w
->
wrw
.
ciov
=
siov
;
...
...
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