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
75b1392b
Commit
75b1392b
authored
Sep 16, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure any halfbaked object is always deallocated when
we hit stp_error and make a new object.
parent
c709e110
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
12 deletions
+15
-12
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+12
-12
cache_obj.c
bin/varnishd/cache/cache_obj.c
+2
-0
storage_persistent_silo.c
bin/varnishd/storage/storage_persistent_silo.c
+1
-0
No files found.
bin/varnishd/cache/cache_fetch.c
View file @
75b1392b
...
...
@@ -658,17 +658,15 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
vbf_fetch_body_helper
(
bo
);
}
if
(
bo
->
vfc
->
failed
&&
!
bo
->
do_stream
)
{
assert
(
bo
->
state
<
BOS_STREAM
);
ObjFreeObj
(
bo
->
wrk
,
bo
->
fetch_objcore
);
// XXX: doclose = ?
VDI_Finish
(
bo
->
wrk
,
bo
);
return
(
F_STP_ERROR
);
}
if
(
bo
->
vfc
->
failed
)
{
VDI_Finish
(
bo
->
wrk
,
bo
);
return
(
F_STP_FAIL
);
if
(
!
bo
->
do_stream
)
{
assert
(
bo
->
state
<
BOS_STREAM
);
// XXX: doclose = ?
return
(
F_STP_ERROR
);
}
else
{
return
(
F_STP_FAIL
);
}
}
if
(
bo
->
do_stream
)
...
...
@@ -775,8 +773,12 @@ vbf_stp_error(struct worker *wrk, struct busyobj *bo)
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
->
fetch_objcore
,
OBJCORE_MAGIC
);
assert
(
bo
->
director_state
==
DIR_S_NULL
);
if
(
bo
->
fetch_objcore
->
stobj
->
stevedore
!=
NULL
)
ObjFreeObj
(
bo
->
wrk
,
bo
->
fetch_objcore
);
now
=
W_TIM_real
(
wrk
);
VSLb_ts_busyobj
(
bo
,
"Error"
,
now
);
...
...
@@ -792,10 +794,8 @@ vbf_stp_error(struct worker *wrk, struct busyobj *bo)
http_TimeHeader
(
bo
->
beresp
,
"Date: "
,
now
);
http_SetHeader
(
bo
->
beresp
,
"Server: Varnish"
);
EXP_Clr
(
&
bo
->
fetch_objcore
->
exp
);
bo
->
fetch_objcore
->
exp
.
t_origin
=
bo
->
t_prev
;
bo
->
fetch_objcore
->
exp
.
ttl
=
0
;
bo
->
fetch_objcore
->
exp
.
grace
=
0
;
bo
->
fetch_objcore
->
exp
.
keep
=
0
;
VCL_backend_error_method
(
bo
->
vcl
,
wrk
,
NULL
,
bo
,
synth_body
);
...
...
bin/varnishd/cache/cache_obj.c
View file @
75b1392b
...
...
@@ -52,6 +52,7 @@ obj_getmethods(const struct objcore *oc)
{
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
AN
(
oc
->
stobj
->
stevedore
);
CHECK_OBJ_NOTNULL
(
oc
->
stobj
->
stevedore
,
STEVEDORE_MAGIC
);
AN
(
oc
->
stobj
->
stevedore
->
methods
);
return
(
oc
->
stobj
->
stevedore
->
methods
);
...
...
@@ -443,6 +444,7 @@ ObjFreeObj(struct worker *wrk, struct objcore *oc)
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
AN
(
m
->
freeobj
);
m
->
freeobj
(
wrk
,
oc
);
AZ
(
oc
->
stobj
->
stevedore
);
}
/*====================================================================
...
...
bin/varnishd/storage/storage_persistent_silo.c
View file @
75b1392b
...
...
@@ -508,6 +508,7 @@ smp_oc_freeobj(struct worker *wrk, struct objcore *oc)
}
Lck_Unlock
(
&
sg
->
sc
->
mtx
);
memset
(
oc
->
stobj
,
0
,
sizeof
oc
->
stobj
);
}
/*--------------------------------------------------------------------
...
...
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