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
779406a6
Commit
779406a6
authored
Nov 26, 2013
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shuffle more stuff between proto-specific and generic fetch code.
parent
eef05a8a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
17 deletions
+27
-17
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+25
-1
cache_http1_fetch.c
bin/varnishd/cache/cache_http1_fetch.c
+2
-16
No files found.
bin/varnishd/cache/cache_fetch.c
View file @
779406a6
...
...
@@ -443,7 +443,31 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
assert
(
bo
->
state
==
BOS_REQ_DONE
);
VBO_setstate
(
bo
,
BOS_FETCHING
);
switch
(
bo
->
htc
.
body_status
)
{
case
BS_NONE
:
break
;
case
BS_ERROR
:
/* XXX: Why not earlier ? */
bo
->
should_close
|=
VFP_Error
(
bo
,
"error incompatible Transfer-Encoding"
);
break
;
default:
if
(
bo
->
vbc
==
NULL
)
(
void
)
VFP_Error
(
bo
,
"Backend connection gone"
);
else
V1F_fetch_body
(
bo
);
break
;
}
bo
->
t_body
=
VTIM_mono
();
if
(
bo
->
vbc
!=
NULL
)
{
if
(
bo
->
should_close
)
VDI_CloseFd
(
&
bo
->
vbc
);
else
VDI_RecycleFd
(
&
bo
->
vbc
);
AZ
(
bo
->
vbc
);
}
bo
->
vfp
=
NULL
;
...
...
bin/varnishd/cache/cache_http1_fetch.c
View file @
779406a6
...
...
@@ -330,6 +330,7 @@ V1F_fetch_body(struct busyobj *bo)
obj
=
bo
->
fetch_obj
;
CHECK_OBJ_NOTNULL
(
obj
,
OBJECT_MAGIC
);
CHECK_OBJ_NOTNULL
(
obj
->
http
,
HTTP_MAGIC
);
AN
(
bo
->
vbc
);
assert
(
bo
->
state
==
BOS_FETCHING
);
...
...
@@ -340,8 +341,6 @@ V1F_fetch_body(struct busyobj *bo)
/* XXX: pick up estimate from objdr ? */
cl
=
0
;
switch
(
htc
->
body_status
)
{
case
BS_NONE
:
break
;
case
BS_LENGTH
:
cl
=
vbf_fetch_number
(
bo
->
h_content_length
,
10
);
...
...
@@ -366,14 +365,9 @@ V1F_fetch_body(struct busyobj *bo)
if
(
bo
->
vfp
->
end
(
bo
))
assert
(
bo
->
state
==
BOS_FAILED
);
break
;
case
BS_ERROR
:
bo
->
should_close
|=
VFP_Error
(
bo
,
"error incompatible Transfer-Encoding"
);
break
;
default:
INCOMPL
(
);
WRONG
(
"Wrong body_status"
);
}
bo
->
t_body
=
VTIM_mono
();
AZ
(
bo
->
vgz_rx
);
/*
...
...
@@ -391,12 +385,4 @@ V1F_fetch_body(struct busyobj *bo)
STV_trim
(
st
,
st
->
len
,
1
);
}
}
if
(
bo
->
vbc
!=
NULL
)
{
if
(
bo
->
should_close
)
VDI_CloseFd
(
&
bo
->
vbc
);
else
VDI_RecycleFd
(
&
bo
->
vbc
);
}
AZ
(
bo
->
vbc
);
}
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