Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
c5e69db8
Commit
c5e69db8
authored
Jan 26, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate the cached the wrk->storage pointer, it is unnecesary.
parent
b965780e
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
34 deletions
+22
-34
cache.h
bin/varnishd/cache.h
+1
-2
cache_center.c
bin/varnishd/cache_center.c
+0
-1
cache_esi_fetch.c
bin/varnishd/cache_esi_fetch.c
+2
-2
cache_fetch.c
bin/varnishd/cache_fetch.c
+15
-23
cache_gzip.c
bin/varnishd/cache_gzip.c
+4
-4
cache_pool.c
bin/varnishd/cache_pool.c
+0
-2
No files found.
bin/varnishd/cache.h
View file @
c5e69db8
...
...
@@ -279,7 +279,6 @@ struct worker {
/* Fetch stuff */
enum
body_status
body_status
;
struct
storage
*
storage
;
struct
vfp
*
vfp
;
struct
vgz
*
vgz_rx
;
struct
vef_priv
*
vef_priv
;
...
...
@@ -630,7 +629,7 @@ void EXP_Touch(struct object *o, double tnow);
int
EXP_NukeOne
(
const
struct
sess
*
sp
,
const
struct
lru
*
lru
);
/* cache_fetch.c */
int
FetchStorage
(
const
struct
sess
*
sp
,
ssize_t
sz
);
struct
storage
*
FetchStorage
(
const
struct
sess
*
sp
,
ssize_t
sz
);
int
FetchHdr
(
struct
sess
*
sp
);
int
FetchBody
(
struct
sess
*
sp
);
int
FetchReqBody
(
struct
sess
*
sp
);
...
...
bin/varnishd/cache_center.c
View file @
c5e69db8
...
...
@@ -1367,7 +1367,6 @@ CNT_Session(struct sess *sp)
CHECK_OBJ_ORNULL
(
w
->
nobjhead
,
OBJHEAD_MAGIC
);
WS_Assert
(
w
->
ws
);
AZ
(
sp
->
wrk
->
storage_hint
);
AZ
(
sp
->
wrk
->
storage
);
switch
(
sp
->
step
)
{
#define STEP(l,u) \
...
...
bin/varnishd/cache_esi_fetch.c
View file @
c5e69db8
...
...
@@ -77,9 +77,9 @@ vfp_esi_bytes_uu(struct sess *sp, struct http_conn *htc, ssize_t bytes)
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
while
(
bytes
>
0
)
{
if
(
FetchStorage
(
sp
,
0
))
st
=
FetchStorage
(
sp
,
0
);
if
(
st
==
NULL
)
return
(
-
1
);
st
=
sp
->
wrk
->
storage
;
w
=
vef_read
(
htc
,
st
->
ptr
+
st
->
len
,
st
->
space
-
st
->
len
,
bytes
);
if
(
w
<=
0
)
...
...
bin/varnishd/cache_fetch.c
View file @
c5e69db8
...
...
@@ -64,7 +64,6 @@ static void __match_proto__()
vfp_nop_begin
(
struct
sess
*
sp
,
size_t
estimate
)
{
AZ
(
sp
->
wrk
->
storage
);
if
(
fetchfrag
>
0
)
{
estimate
=
fetchfrag
;
WSL
(
sp
->
wrk
,
SLT_Debug
,
sp
->
fd
,
...
...
@@ -91,9 +90,9 @@ vfp_nop_bytes(struct sess *sp, struct http_conn *htc, ssize_t bytes)
struct
storage
*
st
;
while
(
bytes
>
0
)
{
if
(
FetchStorage
(
sp
,
0
))
st
=
FetchStorage
(
sp
,
0
);
if
(
st
==
NULL
)
return
(
-
1
);
st
=
sp
->
wrk
->
storage
;
l
=
st
->
space
-
st
->
len
;
if
(
l
>
bytes
)
l
=
bytes
;
...
...
@@ -121,13 +120,10 @@ vfp_nop_end(struct sess *sp)
{
struct
storage
*
st
;
st
=
sp
->
wrk
->
storage
;
sp
->
wrk
->
storage
=
NULL
;
st
=
VTAILQ_LAST
(
&
sp
->
obj
->
store
,
storagehead
);
if
(
st
==
NULL
)
return
(
0
);
assert
(
st
==
VTAILQ_LAST
(
&
sp
->
obj
->
store
,
storagehead
));
if
(
st
->
len
==
0
)
{
VTAILQ_REMOVE
(
&
sp
->
obj
->
store
,
st
,
list
);
STV_free
(
st
);
...
...
@@ -148,32 +144,29 @@ static struct vfp vfp_nop = {
* Fetch Storage
*/
int
struct
storage
*
FetchStorage
(
const
struct
sess
*
sp
,
ssize_t
sz
)
{
ssize_t
l
;
struct
storage
*
st
;
if
(
sp
->
wrk
->
storage
!=
NULL
&&
sp
->
wrk
->
storage
->
len
==
sp
->
wrk
->
storage
->
space
)
sp
->
wrk
->
storage
=
NULL
;
if
(
sp
->
wrk
->
storage
!=
NULL
)
{
assert
(
sp
->
wrk
->
storage
==
VTAILQ_LAST
(
&
sp
->
obj
->
store
,
storagehead
));
return
(
0
);
}
st
=
VTAILQ_LAST
(
&
sp
->
obj
->
store
,
storagehead
);
if
(
st
!=
NULL
&&
st
->
len
<
st
->
space
)
return
(
st
);
l
=
fetchfrag
;
if
(
l
==
0
)
l
=
sz
;
if
(
l
==
0
)
l
=
params
->
fetch_chunksize
*
1024LL
;
s
p
->
wrk
->
storage
=
STV_alloc
(
sp
,
l
);
if
(
s
p
->
wrk
->
storage
==
NULL
)
{
s
t
=
STV_alloc
(
sp
,
l
);
if
(
s
t
==
NULL
)
{
errno
=
ENOMEM
;
return
(
-
1
);
return
(
NULL
);
}
AZ
(
s
p
->
wrk
->
storage
->
len
);
VTAILQ_INSERT_TAIL
(
&
sp
->
obj
->
store
,
s
p
->
wrk
->
storage
,
list
);
return
(
0
);
AZ
(
s
t
->
len
);
VTAILQ_INSERT_TAIL
(
&
sp
->
obj
->
store
,
s
t
,
list
);
return
(
st
);
}
/*--------------------------------------------------------------------
...
...
@@ -514,7 +507,7 @@ FetchBody(struct sess *sp)
* XXX: Missing: RFC2616 sec. 4.4 in re 1xx, 204 & 304 responses
*/
AZ
(
sp
->
wrk
->
storage
);
AZ
(
VTAILQ_FIRST
(
&
sp
->
obj
->
store
)
);
switch
(
sp
->
wrk
->
body_status
)
{
case
BS_NONE
:
cls
=
0
;
...
...
@@ -553,7 +546,6 @@ FetchBody(struct sess *sp)
* to get it trimmed and added to the object.
*/
XXXAZ
(
vfp_nop_end
(
sp
));
AZ
(
sp
->
wrk
->
storage
);
WSL
(
sp
->
wrk
,
SLT_Fetch_Body
,
sp
->
vbc
->
fd
,
"%u %d %u"
,
sp
->
wrk
->
body_status
,
cls
,
mklen
);
...
...
bin/varnishd/cache_gzip.c
View file @
c5e69db8
...
...
@@ -245,10 +245,10 @@ VGZ_ObufStorage(const struct sess *sp, struct vgz *vg)
{
struct
storage
*
st
;
if
(
FetchStorage
(
sp
,
0
))
st
=
FetchStorage
(
sp
,
0
);
if
(
st
==
NULL
)
return
(
-
1
);
st
=
sp
->
wrk
->
storage
;
vg
->
obuf
=
st
;
VGZ_Obuf
(
vg
,
st
->
ptr
+
st
->
len
,
st
->
space
-
st
->
len
);
...
...
@@ -527,9 +527,9 @@ vfp_testgzip_bytes(struct sess *sp, struct http_conn *htc, ssize_t bytes)
CHECK_OBJ_NOTNULL
(
vg
,
VGZ_MAGIC
);
AZ
(
vg
->
vz
.
avail_in
);
while
(
bytes
>
0
)
{
if
(
FetchStorage
(
sp
,
0
))
st
=
FetchStorage
(
sp
,
0
);
if
(
st
==
NULL
)
return
(
-
1
);
st
=
sp
->
wrk
->
storage
;
l
=
st
->
space
-
st
->
len
;
if
(
l
>
bytes
)
l
=
bytes
;
...
...
bin/varnishd/cache_pool.c
View file @
c5e69db8
...
...
@@ -182,13 +182,11 @@ wrk_thread_real(struct wq *qp, unsigned shm_workspace, unsigned sess_workspace,
w
->
beresp
=
NULL
;
w
->
resp
=
NULL
;
w
->
storage_hint
=
NULL
;
w
->
storage
=
NULL
;
w
->
wrq
->
func
(
w
,
w
->
wrq
->
priv
);
AZ
(
w
->
bereq
);
AZ
(
w
->
beresp1
);
AZ
(
w
->
beresp
);
AZ
(
w
->
resp
);
AZ
(
w
->
storage
);
WS_Assert
(
w
->
ws
);
AZ
(
w
->
wfd
);
AZ
(
w
->
storage_hint
);
...
...
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