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
c6b0aaa1
Commit
c6b0aaa1
authored
Jun 20, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate the "DONE" state, it is now a session state.
parent
a1e3ed99
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
21 deletions
+5
-21
cache_center.c
bin/varnishd/cache/cache_center.c
+4
-16
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+1
-4
steps.h
include/tbl/steps.h
+0
-1
No files found.
bin/varnishd/cache/cache_center.c
View file @
c6b0aaa1
...
...
@@ -227,7 +227,7 @@ DOT DONE -> ESI_RESP
*/
static
int
cnt_done
(
struct
sess
*
sp
,
struct
worker
*
wrk
,
struct
req
*
req
)
cnt_
sess_
done
(
struct
sess
*
sp
,
struct
worker
*
wrk
,
struct
req
*
req
)
{
double
dh
,
dp
,
da
;
int
i
;
...
...
@@ -242,9 +242,7 @@ cnt_done(struct sess *sp, struct worker *wrk, struct req *req)
req
->
director
=
NULL
;
req
->
restarts
=
0
;
/* If we did an ESI include, don't mess up our state */
if
(
req
->
esi_level
>
0
)
return
(
1
);
AZ
(
req
->
esi_level
);
if
(
req
->
vcl
!=
NULL
)
{
if
(
wrk
->
vcl
!=
NULL
)
...
...
@@ -343,7 +341,7 @@ CNT_Session(struct sess *sp)
SES_Close
(
sp
,
"remote closed"
);
else
SES_Close
(
sp
,
"error"
);
assert
(
cnt_done
(
sp
,
wrk
,
sp
->
req
)
==
1
);
assert
(
cnt_
sess_
done
(
sp
,
wrk
,
sp
->
req
)
==
1
);
return
;
}
...
...
@@ -362,10 +360,7 @@ CNT_Session(struct sess *sp)
if
(
done
==
2
)
return
;
assert
(
done
==
1
);
}
if
(
sp
->
step
==
STP_DONE
)
{
done
=
cnt_done
(
sp
,
wrk
,
sp
->
req
);
done
=
cnt_sess_done
(
sp
,
wrk
,
sp
->
req
);
if
(
done
)
return
;
}
...
...
@@ -547,7 +542,6 @@ cnt_deliver(struct sess *sp, struct worker *wrk, struct req *req)
assert
(
WRW_IsReleased
(
wrk
));
(
void
)
HSH_Deref
(
&
wrk
->
stats
,
NULL
,
&
req
->
obj
);
http_Teardown
(
req
->
resp
);
sp
->
step
=
STP_DONE
;
return
(
1
);
}
/*--------------------------------------------------------------------
...
...
@@ -594,7 +588,6 @@ cnt_error(struct sess *sp, struct worker *wrk, struct req *req)
req
->
director
=
NULL
;
http_Teardown
(
bo
->
beresp
);
http_Teardown
(
bo
->
bereq
);
sp
->
step
=
STP_DONE
;
return
(
1
);
}
CHECK_OBJ_NOTNULL
(
req
->
obj
,
OBJECT_MAGIC
);
...
...
@@ -1361,7 +1354,6 @@ cnt_pipe(struct sess *sp, struct worker *wrk, struct req *req)
assert
(
WRW_IsReleased
(
wrk
));
http_Teardown
(
bo
->
bereq
);
VBO_DerefBusyObj
(
wrk
,
&
req
->
busyobj
);
sp
->
step
=
STP_DONE
;
return
(
1
);
}
...
...
@@ -1487,7 +1479,6 @@ cnt_recv(struct sess *sp, const struct worker *wrk, struct req *req)
if
(
req
->
esi_level
>
0
)
{
/* XXX: VSL something */
INCOMPL
();
/* sp->step = STP_DONE; */
return
(
1
);
}
sp
->
step
=
STP_PIPE
;
...
...
@@ -1552,7 +1543,6 @@ cnt_start(struct sess *sp, struct worker *wrk, struct req *req)
/* If we could not even parse the request, just close */
if
(
req
->
err_code
==
400
)
{
sp
->
step
=
STP_DONE
;
SES_Close
(
sp
,
"junk"
);
return
(
1
);
}
...
...
@@ -1569,7 +1559,6 @@ cnt_start(struct sess *sp, struct worker *wrk, struct req *req)
if
(
strcasecmp
(
p
,
"100-continue"
))
{
req
->
err_code
=
417
;
}
else
if
(
strlen
(
r
)
!=
write
(
sp
->
fd
,
r
,
strlen
(
r
)))
{
sp
->
step
=
STP_DONE
;
SES_Close
(
sp
,
"remote closed"
);
return
(
1
);
}
...
...
@@ -1657,7 +1646,6 @@ CNT_Request(struct req *req)
assert
(
req
->
sp
==
sp
);
assert
(
sp
->
step
!=
STP_WAIT
);
assert
(
sp
->
step
!=
STP_DONE
);
switch
(
sp
->
step
)
{
#define SESS_STEP(l,u,arg) \
...
...
bin/varnishd/cache/cache_esi_deliver.c
View file @
c6b0aaa1
...
...
@@ -96,10 +96,8 @@ ved_include(struct req *req, const char *src, const char *host)
while
(
1
)
{
req
->
sp
->
wrk
=
wrk
;
i
=
CNT_Request
(
req
);
if
(
req
->
sp
->
step
==
STP_DONE
)
{
assert
(
i
==
1
);
if
(
i
==
1
)
break
;
}
assert
(
i
==
2
);
AZ
(
req
->
sp
->
wrk
);
DSL
(
0x20
,
SLT_Debug
,
req
->
sp
->
vsl_id
,
"loop waiting for ESI"
);
...
...
@@ -107,7 +105,6 @@ ved_include(struct req *req, const char *src, const char *host)
}
req
->
xid
=
sxid
;
AN
(
req
->
sp
->
wrk
);
assert
(
req
->
sp
->
step
==
STP_DONE
);
req
->
esi_level
--
;
req
->
obj
=
obj
;
req
->
res_mode
=
res_mode
;
...
...
include/tbl/steps.h
View file @
c6b0aaa1
...
...
@@ -43,5 +43,4 @@ SESS_STEP(fetchbody, FETCHBODY, (sp, sp->wrk, sp->req))
SESS_STEP
(
prepresp
,
PREPRESP
,
(
sp
,
sp
->
wrk
,
sp
->
req
))
SESS_STEP
(
deliver
,
DELIVER
,
(
sp
,
sp
->
wrk
,
sp
->
req
))
SESS_STEP
(
error
,
ERROR
,
(
sp
,
sp
->
wrk
,
sp
->
req
))
SESS_STEP
(
done
,
DONE
,
(
sp
,
sp
->
wrk
,
sp
->
req
))
/*lint -restore */
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