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
f9f6b2a4
Commit
f9f6b2a4
authored
Apr 05, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use SES_RxStuff() also for receiving beresp headers
parent
57adab3d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
34 deletions
+32
-34
cache_http1_fetch.c
bin/varnishd/http1/cache_http1_fetch.c
+32
-34
No files found.
bin/varnishd/http1/cache_http1_fetch.c
View file @
f9f6b2a4
...
...
@@ -136,8 +136,10 @@ V1F_FetchRespHdr(struct busyobj *bo)
{
struct
http
*
hp
;
int
first
,
i
;
int
i
;
double
t
;
struct
http_conn
*
htc
;
enum
htc_status_e
hs
;
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
->
htc
,
HTTP_CONN_MAGIC
);
...
...
@@ -153,41 +155,37 @@ V1F_FetchRespHdr(struct busyobj *bo)
CHECK_OBJ_NOTNULL
(
htc
,
HTTP_CONN_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
->
htc
,
HTTP_CONN_MAGIC
);
VTCP_set_read_timeout
(
htc
->
fd
,
htc
->
first_byte_timeout
);
first
=
1
;
do
{
i
=
(
htc
->
ws
->
r
-
htc
->
rxbuf_e
)
-
1
;
/* space for NUL */
if
(
i
<=
0
)
{
bo
->
acct
.
beresp_hdrbytes
+=
htc
->
rxbuf_e
-
htc
->
rxbuf_b
;
WS_ReleaseP
(
htc
->
ws
,
htc
->
rxbuf_b
);
VSLb
(
bo
->
vsl
,
SLT_FetchError
,
"http %sread error: overflow"
,
first
?
"first "
:
""
);
htc
->
doclose
=
SC_RX_OVERFLOW
;
return
(
-
1
);
}
i
=
read
(
htc
->
fd
,
htc
->
rxbuf_e
,
i
);
if
(
i
<=
0
)
{
t
=
VTIM_real
()
+
htc
->
first_byte_timeout
;
hs
=
SES_RxStuff
(
htc
,
HTTP1_Complete
,
NULL
,
NULL
,
t
,
t
+
htc
->
between_bytes_timeout
);
if
(
hs
!=
HTC_S_COMPLETE
)
{
bo
->
acct
.
beresp_hdrbytes
+=
htc
->
rxbuf_e
-
htc
->
rxbuf_b
;
WS_ReleaseP
(
htc
->
ws
,
htc
->
rxbuf_b
);
VSLb
(
bo
->
vsl
,
SLT_FetchError
,
"http %sread error: EOF"
,
first
?
"first "
:
""
);
switch
(
hs
)
{
case
HTC_S_JUNK
:
VSLb
(
bo
->
vsl
,
SLT_FetchError
,
"Received junk"
);
htc
->
doclose
=
SC_RX_JUNK
;
break
;
case
HTC_S_CLOSE
:
VSLb
(
bo
->
vsl
,
SLT_FetchError
,
"backend closed"
);
htc
->
doclose
=
SC_RESP_CLOSE
;
break
;
case
HTC_S_TIMEOUT
:
VSLb
(
bo
->
vsl
,
SLT_FetchError
,
"timeout"
);
htc
->
doclose
=
SC_RX_TIMEOUT
;
return
(
first
?
1
:
-
1
);
break
;
case
HTC_S_OVERFLOW
:
VSLb
(
bo
->
vsl
,
SLT_FetchError
,
"overflow"
);
htc
->
doclose
=
SC_RX_OVERFLOW
;
break
;
default:
VSLb
(
bo
->
vsl
,
SLT_FetchError
,
"HTC status %d"
,
hs
);
htc
->
doclose
=
SC_RX_BAD
;
break
;
}
if
(
first
)
{
first
=
0
;
VTCP_set_read_timeout
(
htc
->
fd
,
htc
->
between_bytes_timeout
);
return
(
htc
->
rxbuf_e
==
htc
->
rxbuf_b
?
1
:
-
1
);
}
htc
->
rxbuf_e
+=
i
;
*
htc
->
rxbuf_e
=
'\0'
;
}
while
(
HTTP1_Complete
(
htc
)
!=
HTC_S_COMPLETE
);
WS_ReleaseP
(
htc
->
ws
,
htc
->
rxbuf_e
);
VTCP_set_read_timeout
(
htc
->
fd
,
htc
->
between_bytes_timeout
);
hp
=
bo
->
beresp
;
...
...
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