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
80dbd458
Commit
80dbd458
authored
Mar 24, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More untangling of sess/req interface
parent
6ae8ccac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
33 deletions
+37
-33
cache_http1_fsm.c
bin/varnishd/http1/cache_http1_fsm.c
+37
-33
No files found.
bin/varnishd/http1/cache_http1_fsm.c
View file @
80dbd458
...
...
@@ -73,44 +73,18 @@ http1_wait(struct sess *sp, struct worker *wrk, struct req *req)
while
(
1
)
{
hs
=
SES_Rx
(
req
->
htc
,
tmo
);
now
=
VTIM_real
();
if
(
hs
==
HTC_S_OK
||
hs
==
HTC_S_TIMEOUT
)
hs
=
HTTP1_Complete
(
req
->
htc
);
if
(
hs
==
HTC_S_COMPLETE
)
{
/* Got it, run with it */
if
(
isnan
(
req
->
t_first
))
req
->
t_first
=
now
;
if
(
isnan
(
req
->
t_req
))
req
->
t_req
=
now
;
req
->
acct
.
req_hdrbytes
+=
req
->
htc
->
rxbuf_e
-
req
->
htc
->
rxbuf_b
;
return
(
REQ_FSM_MORE
);
}
else
if
(
hs
==
HTC_S_EOF
)
{
if
(
hs
==
HTC_S_EOF
)
{
WS_ReleaseP
(
req
->
htc
->
ws
,
req
->
htc
->
rxbuf_b
);
why
=
SC_REM_CLOSE
;
break
;
}
else
if
(
hs
==
HTC_S_OVERFLOW
)
{
}
if
(
hs
==
HTC_S_OVERFLOW
)
{
WS_ReleaseP
(
req
->
htc
->
ws
,
req
->
htc
->
rxbuf_b
);
why
=
SC_RX_OVERFLOW
;
break
;
}
else
if
(
hs
==
HTC_S_EMPTY
)
{
/* Nothing but whitespace */
when
=
sp
->
t_idle
+
cache_param
->
timeout_idle
;
if
(
when
<
now
)
{
why
=
SC_RX_TIMEOUT
;
break
;
}
when
=
sp
->
t_idle
+
cache_param
->
timeout_linger
;
tmo
=
when
-
now
;
if
(
tmo
<=
0
)
{
wrk
->
stats
->
sess_herd
++
;
SES_ReleaseReq
(
req
);
if
(
VTCP_nonblocking
(
sp
->
fd
))
SES_Close
(
sp
,
SC_REM_CLOSE
);
else
SES_Wait
(
sp
);
return
(
REQ_FSM_DONE
);
}
}
else
{
}
hs
=
HTTP1_Complete
(
req
->
htc
);
if
(
hs
==
HTC_S_OK
)
{
/* Working on it */
if
(
isnan
(
req
->
t_first
))
/* Record first byte received time stamp */
...
...
@@ -121,7 +95,38 @@ http1_wait(struct sess *sp, struct worker *wrk, struct req *req)
why
=
SC_RX_TIMEOUT
;
break
;
}
continue
;
}
if
(
hs
==
HTC_S_COMPLETE
)
{
/* Got it, run with it */
if
(
isnan
(
req
->
t_first
))
req
->
t_first
=
now
;
if
(
isnan
(
req
->
t_req
))
req
->
t_req
=
now
;
req
->
acct
.
req_hdrbytes
+=
req
->
htc
->
rxbuf_e
-
req
->
htc
->
rxbuf_b
;
return
(
REQ_FSM_MORE
);
}
assert
(
hs
==
HTC_S_EMPTY
);
/* Nothing but whitespace */
when
=
sp
->
t_idle
+
cache_param
->
timeout_idle
;
if
(
when
<
now
)
{
why
=
SC_RX_TIMEOUT
;
break
;
}
when
=
sp
->
t_idle
+
cache_param
->
timeout_linger
;
tmo
=
when
-
now
;
if
(
tmo
>
0
)
continue
;
wrk
->
stats
->
sess_herd
++
;
SES_ReleaseReq
(
req
);
if
(
VTCP_nonblocking
(
sp
->
fd
))
{
why
=
SC_REM_CLOSE
;
break
;
}
SES_Wait
(
sp
);
return
(
REQ_FSM_DONE
);
}
req
->
acct
.
req_hdrbytes
+=
req
->
htc
->
rxbuf_e
-
req
->
htc
->
rxbuf_b
;
CNT_AcctLogCharge
(
wrk
->
stats
,
req
);
...
...
@@ -330,7 +335,6 @@ HTTP1_Session(struct worker *wrk, struct req *req)
return
;
}
while
(
1
)
{
switch
(
sp
->
sess_step
)
{
case
S_STP_H1NEWSESS
:
...
...
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