[master] 9a267ba Have HTTP1 use the new R_STP_TRANSPORT as well.
Poul-Henning Kamp
phk at FreeBSD.org
Sun Mar 12 21:24:06 CET 2017
commit 9a267ba2886e2b2240ad136551a36ad0e6f5a91b
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Sun Mar 12 20:22:51 2017 +0000
Have HTTP1 use the new R_STP_TRANSPORT as well.
diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index fba8763..7db4280 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -942,7 +942,6 @@ void VRB_Free(struct req *);
/* cache_req_fsm.c [CNT] */
enum req_fsm_nxt CNT_Request(struct worker *, struct req *);
void CNT_AcctLogCharge(struct dstat *, struct req *);
-int CNT_GotReq(struct worker *, struct req *);
/* cache_session.c [SES] */
struct sess *SES_New(struct pool *);
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index 733e45b..fa77dd8 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -53,8 +53,8 @@
* Handle "Expect:" and "Connection:" on incoming request
*/
-int
-CNT_GotReq(struct worker *wrk, struct req *req)
+static enum req_fsm_nxt
+cnt_transport(struct worker *wrk, struct req *req)
{
const char *p;
@@ -70,7 +70,7 @@ CNT_GotReq(struct worker *wrk, struct req *req)
req->doclose = SC_RX_JUNK;
(void)req->transport->minimal_response(req, 417);
wrk->stats->client_req_417++;
- return (-1);
+ return (REQ_FSM_DONE);
}
if (req->http->protover >= 11 &&
req->htc->pipeline_b == NULL) // XXX: HTTP1 vs 2 ?
@@ -87,20 +87,10 @@ CNT_GotReq(struct worker *wrk, struct req *req)
req->doclose = http_DoConnection(req->http);
if (req->doclose == SC_RX_BAD) {
(void)req->transport->minimal_response(req, 400);
- return (-1);
+ return (REQ_FSM_DONE);
}
HTTP_Copy(req->http0, req->http); // For ESI & restart
- return (0);
-}
-
-static enum req_fsm_nxt
-cnt_transport(struct worker *wrk, struct req *req)
-{
-
- if (CNT_GotReq(wrk, req))
- return (REQ_FSM_DONE);
-
req->req_step = R_STP_RECV;
return (REQ_FSM_MORE);
}
diff --git a/bin/varnishd/http1/cache_http1_fsm.c b/bin/varnishd/http1/cache_http1_fsm.c
index 5e8d42e..4b238c3 100644
--- a/bin/varnishd/http1/cache_http1_fsm.c
+++ b/bin/varnishd/http1/cache_http1_fsm.c
@@ -319,8 +319,7 @@ http1_dissect(struct worker *wrk, struct req *req)
default:
WRONG("Unknown req_body_status situation");
}
-
- return (CNT_GotReq(wrk, req));
+ return (0);
}
/*----------------------------------------------------------------------
@@ -436,7 +435,7 @@ HTTP1_Session(struct worker *wrk, struct req *req)
return;
}
}
- req->req_step = R_STP_RECV;
+ req->req_step = R_STP_TRANSPORT;
http1_setstate(sp, H1PROC);
} else if (st == H1BUSY) {
CHECK_OBJ_NOTNULL(req->transport, TRANSPORT_MAGIC);
More information about the varnish-commit
mailing list