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
57240f5a
Commit
57240f5a
authored
Oct 24, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Decontaminate STV_alloc() to not need session
parent
3999568c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
9 deletions
+11
-9
cache.h
bin/varnishd/cache.h
+2
-1
cache_esi_fetch.c
bin/varnishd/cache_esi_fetch.c
+1
-1
cache_fetch.c
bin/varnishd/cache_fetch.c
+1
-1
stevedore.c
bin/varnishd/storage/stevedore.c
+7
-6
No files found.
bin/varnishd/cache.h
View file @
57240f5a
...
...
@@ -950,7 +950,8 @@ int RFC2616_Do_Cond(const struct sess *sp);
/* stevedore.c */
struct
object
*
STV_NewObject
(
struct
sess
*
sp
,
const
char
*
hint
,
unsigned
len
,
struct
exp
*
,
uint16_t
nhttp
);
struct
storage
*
STV_alloc
(
const
struct
sess
*
sp
,
size_t
size
);
struct
storage
*
STV_alloc
(
struct
worker
*
w
,
const
struct
object
*
obj
,
size_t
size
);
void
STV_trim
(
struct
storage
*
st
,
size_t
size
);
void
STV_free
(
struct
storage
*
st
);
void
STV_open
(
void
);
...
...
bin/varnishd/cache_esi_fetch.c
View file @
57240f5a
...
...
@@ -368,7 +368,7 @@ vfp_esi_end(struct sess *sp)
l
=
VSB_len
(
vsb
);
assert
(
l
>
0
);
/* XXX: This is a huge waste of storage... */
sp
->
obj
->
esidata
=
STV_alloc
(
sp
,
l
);
sp
->
obj
->
esidata
=
STV_alloc
(
sp
->
wrk
,
sp
->
obj
,
l
);
XXXAN
(
sp
->
obj
->
esidata
);
memcpy
(
sp
->
obj
->
esidata
->
ptr
,
VSB_data
(
vsb
),
l
);
sp
->
obj
->
esidata
->
len
=
l
;
...
...
bin/varnishd/cache_fetch.c
View file @
57240f5a
...
...
@@ -159,7 +159,7 @@ FetchStorage(const struct sess *sp, ssize_t sz)
l
=
sz
;
if
(
l
==
0
)
l
=
params
->
fetch_chunksize
*
1024LL
;
st
=
STV_alloc
(
sp
,
l
);
st
=
STV_alloc
(
sp
->
wrk
,
sp
->
obj
,
l
);
if
(
st
==
NULL
)
{
errno
=
ENOMEM
;
return
(
NULL
);
...
...
bin/varnishd/storage/stevedore.c
View file @
57240f5a
...
...
@@ -154,7 +154,7 @@ stv_pick_stevedore(const struct sess *sp, const char **hint)
/*-------------------------------------------------------------------*/
static
struct
storage
*
stv_alloc
(
const
struct
sess
*
sp
,
size_t
size
)
stv_alloc
(
struct
worker
*
w
,
const
struct
object
*
obj
,
size_t
size
)
{
struct
storage
*
st
;
struct
stevedore
*
stv
;
...
...
@@ -164,8 +164,9 @@ stv_alloc(const struct sess *sp, size_t size)
* Always use the stevedore which allocated the object in order to
* keep an object inside the same stevedore.
*/
CHECK_OBJ_NOTNULL
(
sp
->
obj
,
OBJECT_MAGIC
);
stv
=
sp
->
obj
->
objstore
->
stevedore
;
CHECK_OBJ_NOTNULL
(
obj
,
OBJECT_MAGIC
);
CHECK_OBJ_NOTNULL
(
w
,
WORKER_MAGIC
);
stv
=
obj
->
objstore
->
stevedore
;
CHECK_OBJ_NOTNULL
(
stv
,
STEVEDORE_MAGIC
);
if
(
size
>
(
size_t
)(
params
->
fetch_maxchunksize
)
<<
10
)
...
...
@@ -184,7 +185,7 @@ stv_alloc(const struct sess *sp, size_t size)
}
/* no luck; try to free some space and keep trying */
if
(
EXP_NukeOne
(
sp
->
wrk
,
stv
->
lru
)
==
-
1
)
if
(
EXP_NukeOne
(
w
,
stv
->
lru
)
==
-
1
)
break
;
/* Enough is enough: try another if we have one */
...
...
@@ -370,10 +371,10 @@ STV_Freestore(struct object *o)
/*-------------------------------------------------------------------*/
struct
storage
*
STV_alloc
(
const
struct
sess
*
sp
,
size_t
size
)
STV_alloc
(
struct
worker
*
w
,
const
struct
object
*
obj
,
size_t
size
)
{
return
(
stv_alloc
(
sp
,
size
));
return
(
stv_alloc
(
w
,
obj
,
size
));
}
void
...
...
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