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
d6b64285
Commit
d6b64285
authored
Dec 08, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the beresp and bereq from worker ot busyobj for good.
parent
0dd1ee21
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
13 deletions
+24
-13
cache.h
bin/varnishd/cache/cache.h
+0
-4
cache_busyobj.c
bin/varnishd/cache/cache_busyobj.c
+24
-3
cache_pool.c
bin/varnishd/cache/cache_pool.c
+0
-2
cache_wrk.c
bin/varnishd/cache/cache_wrk.c
+0
-4
No files found.
bin/varnishd/cache/cache.h
View file @
d6b64285
...
...
@@ -328,10 +328,6 @@ struct worker {
/* This is only here so VRT can find it */
const
char
*
storage_hint
;
/* Fetch stuff. Here because pipe has no busyobj */
struct
http
*
x_bereq
;
struct
http
*
x_beresp
;
/* Stream state */
struct
stream_ctx
*
sctx
;
...
...
bin/varnishd/cache/cache_busyobj.c
View file @
d6b64285
...
...
@@ -43,6 +43,7 @@ struct vbo {
#define VBO_MAGIC 0xde3d8223
struct
lock
mtx
;
unsigned
refcount
;
uint16_t
nhttp
;
struct
busyobj
bo
;
};
...
...
@@ -64,9 +65,20 @@ static struct vbo *
vbo_New
(
void
)
{
struct
vbo
*
vbo
;
uint16_t
nhttp
;
ssize_t
http_space
;
ALLOC_OBJ
(
vbo
,
VBO_MAGIC
);
assert
(
cache_param
->
http_max_hdr
<
65536
);
nhttp
=
(
uint16_t
)
cache_param
->
http_max_hdr
;
http_space
=
HTTP_estimate
(
nhttp
);
vbo
=
malloc
(
sizeof
*
vbo
+
2
*
http_space
);
AN
(
vbo
);
memset
(
vbo
,
0
,
sizeof
*
vbo
);
vbo
->
magic
=
VBO_MAGIC
;
vbo
->
nhttp
=
nhttp
;
Lck_New
(
&
vbo
->
mtx
,
lck_busyobj
);
return
(
vbo
);
}
...
...
@@ -89,6 +101,7 @@ struct busyobj *
VBO_GetBusyObj
(
struct
worker
*
wrk
)
{
struct
vbo
*
vbo
=
NULL
;
char
*
p
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
...
...
@@ -109,17 +122,25 @@ VBO_GetBusyObj(struct worker *wrk)
Lck_Unlock
(
&
vbo_mtx
);
}
if
(
vbo
!=
NULL
&&
vbo
->
nhttp
!=
cache_param
->
http_max_hdr
)
VBO_Free
(
&
vbo
);
if
(
vbo
==
NULL
)
vbo
=
vbo_New
();
CHECK_OBJ_NOTNULL
(
vbo
,
VBO_MAGIC
);
AZ
(
vbo
->
refcount
);
AZ
(
vbo
->
bo
.
magic
);
vbo
->
refcount
=
1
;
vbo
->
bo
.
magic
=
BUSYOBJ_MAGIC
;
vbo
->
bo
.
vbo
=
vbo
;
vbo
->
bo
.
beresp
=
wrk
->
x_beresp
;
vbo
->
bo
.
bereq
=
wrk
->
x_bereq
;
p
=
(
void
*
)(
vbo
+
1
);
vbo
->
bo
.
bereq
=
HTTP_create
(
p
,
vbo
->
nhttp
);
p
+=
HTTP_estimate
(
vbo
->
nhttp
);
vbo
->
bo
.
beresp
=
HTTP_create
(
p
,
vbo
->
nhttp
);
return
(
&
vbo
->
bo
);
}
...
...
bin/varnishd/cache/cache_pool.c
View file @
d6b64285
...
...
@@ -196,8 +196,6 @@ Pool_Work_Thread(void *priv, struct worker *w)
Lck_AssertHeld
(
&
pp
->
mtx
);
CHECK_OBJ_NOTNULL
(
w
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
w
->
x_bereq
,
HTTP_MAGIC
);
CHECK_OBJ_NOTNULL
(
w
->
x_beresp
,
HTTP_MAGIC
);
CHECK_OBJ_NOTNULL
(
w
->
resp
,
HTTP_MAGIC
);
WS_Reset
(
w
->
ws
,
NULL
);
...
...
bin/varnishd/cache/cache_wrk.c
View file @
d6b64285
...
...
@@ -139,8 +139,6 @@ wrk_thread_real(void *priv, unsigned shm_workspace, unsigned sess_workspace,
uint32_t
wlog
[
shm_workspace
/
4
];
/* XXX: can we trust these to be properly aligned ? */
unsigned
char
ws
[
sess_workspace
];
unsigned
char
http0
[
http_space
];
unsigned
char
http1
[
http_space
];
unsigned
char
http2
[
http_space
];
struct
iovec
iov
[
siov
];
struct
SHA256Context
sha256
;
...
...
@@ -153,8 +151,6 @@ wrk_thread_real(void *priv, unsigned shm_workspace, unsigned sess_workspace,
w
->
wlb
=
w
->
wlp
=
wlog
;
w
->
wle
=
wlog
+
(
sizeof
wlog
)
/
4
;
w
->
sha256ctx
=
&
sha256
;
w
->
x_bereq
=
HTTP_create
(
http0
,
nhttp
);
w
->
x_beresp
=
HTTP_create
(
http1
,
nhttp
);
w
->
resp
=
HTTP_create
(
http2
,
nhttp
);
w
->
wrw
.
iov
=
iov
;
w
->
wrw
.
siov
=
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