Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
09c459cb
Commit
09c459cb
authored
Aug 13, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate the cnt_start state by folding it into cnt_recv
parent
5d82c73b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
45 deletions
+17
-45
cache_http1_fsm.c
bin/varnishd/cache/cache_http1_fsm.c
+6
-6
cache_req_fsm.c
bin/varnishd/cache/cache_req_fsm.c
+11
-38
steps.h
include/tbl/steps.h
+0
-1
No files found.
bin/varnishd/cache/cache_http1_fsm.c
View file @
09c459cb
...
...
@@ -50,7 +50,7 @@
*DOT hash -> CNT_Request [label="Busy object\nS_STP_WORKING\nR_STP_LOOKUP"
*DOT color=blue]
*DOT disembark -> hash [style=dotted, color=blue]
*DOT http1_wait -> CNT_Request [label="S_STP_WORKING\nR_STP_
START
"]
*DOT http1_wait -> CNT_Request [label="S_STP_WORKING\nR_STP_
RECV
"]
*DOT http1_wait -> disembark [label="Session close"]
*DOT http1_wait -> disembark [label="Timeout" color=green]
*DOT disembark -> waiter [style=dotted, color=green]
...
...
@@ -59,7 +59,7 @@
*DOT [label="Busy object\nS_STP_WORKING\nR_STP_LOOKUP" color=blue]
*DOT CNT_Request -> http1_cleanup
*DOT http1_cleanup -> disembark [label="Session close"]
*DOT http1_cleanup -> CNT_Request [label="S_STP_WORKING\nR_STP_
START
"]
*DOT http1_cleanup -> CNT_Request [label="S_STP_WORKING\nR_STP_
RECV
"]
*DOT http1_cleanup -> http1_wait [label="S_STP_NEWREQ"]
*DOT
*DOT }
...
...
@@ -331,10 +331,10 @@ HTTP1_Session(struct worker *wrk, struct req *req)
assert
(
sp
->
sess_step
==
S_STP_NEWREQ
||
req
->
req_step
==
R_STP_LOOKUP
||
req
->
req_step
==
R_STP_
START
);
req
->
req_step
==
R_STP_
RECV
);
if
(
sp
->
sess_step
==
S_STP_WORKING
)
{
if
(
req
->
req_step
==
R_STP_
START
)
if
(
req
->
req_step
==
R_STP_
RECV
)
done
=
http1_dissect
(
wrk
,
req
);
if
(
done
==
0
)
done
=
CNT_Request
(
wrk
,
req
);
...
...
@@ -350,7 +350,7 @@ HTTP1_Session(struct worker *wrk, struct req *req)
break
;
case
SESS_DONE_RET_START
:
sp
->
sess_step
=
S_STP_WORKING
;
req
->
req_step
=
R_STP_
START
;
req
->
req_step
=
R_STP_
RECV
;
break
;
default:
WRONG
(
"Illegal enum http1_cleanup_ret"
);
...
...
@@ -362,7 +362,7 @@ HTTP1_Session(struct worker *wrk, struct req *req)
if
(
done
)
return
;
sp
->
sess_step
=
S_STP_WORKING
;
req
->
req_step
=
R_STP_
START
;
req
->
req_step
=
R_STP_
RECV
;
}
}
}
bin/varnishd/cache/cache_req_fsm.c
View file @
09c459cb
...
...
@@ -1105,6 +1105,16 @@ cnt_recv(const struct worker *wrk, struct req *req)
AZ
(
req
->
obj
);
AZ
(
req
->
busyobj
);
/* Assign XID and log */
req
->
xid
=
++
xids
;
/* XXX not locked */
VSLb
(
req
->
vsl
,
SLT_ReqStart
,
"%s %s %u"
,
req
->
sp
->
addr
,
req
->
sp
->
port
,
req
->
xid
);
if
(
req
->
err_code
)
{
req
->
req_step
=
R_STP_ERROR
;
return
(
0
);
}
/* By default we use the first backend */
AZ
(
req
->
director
);
req
->
director
=
req
->
vcl
->
director
[
0
];
...
...
@@ -1168,42 +1178,6 @@ cnt_recv(const struct worker *wrk, struct req *req)
}
}
/*--------------------------------------------------------------------
* START
* First time we see a request
*
DOT start [
DOT shape=box
DOT label="cnt_start:\nDissect request\nHandle expect"
DOT ]
DOT start -> recv [style=bold,color=green]
DOT start -> DONE [label=errors]
*/
static
int
cnt_start
(
struct
worker
*
wrk
,
struct
req
*
req
)
{
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
AZ
(
req
->
restarts
);
AZ
(
req
->
obj
);
AN
(
req
->
vcl
);
AZ
(
req
->
esi_level
);
assert
(
!
isnan
(
req
->
t_req
));
/* Assign XID and log */
req
->
xid
=
++
xids
;
/* XXX not locked */
VSLb
(
req
->
vsl
,
SLT_ReqStart
,
"%s %s %u"
,
req
->
sp
->
addr
,
req
->
sp
->
port
,
req
->
xid
);
if
(
req
->
err_code
)
req
->
req_step
=
R_STP_ERROR
;
else
req
->
req_step
=
R_STP_RECV
;
return
(
0
);
}
/*--------------------------------------------------------------------
* Central state engine dispatcher.
*
...
...
@@ -1235,8 +1209,7 @@ CNT_Request(struct worker *wrk, struct req *req)
*/
assert
(
req
->
req_step
==
R_STP_LOOKUP
||
req
->
req_step
==
R_STP_START
||
req
->
req_step
==
R_STP_RECV
);
// from ESI
req
->
req_step
==
R_STP_RECV
);
req
->
wrk
=
wrk
;
...
...
include/tbl/steps.h
View file @
09c459cb
...
...
@@ -38,7 +38,6 @@ SESS_STEP(working, WORKING)
#ifdef REQ_STEP
REQ_STEP
(
restart
,
RESTART
,
(
wrk
,
req
))
REQ_STEP
(
recv
,
RECV
,
(
wrk
,
req
))
REQ_STEP
(
start
,
START
,
(
wrk
,
req
))
REQ_STEP
(
pipe
,
PIPE
,
(
wrk
,
req
))
REQ_STEP
(
pass
,
PASS
,
(
wrk
,
req
))
REQ_STEP
(
lookup
,
LOOKUP
,
(
wrk
,
req
))
...
...
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