Commit d0d20077 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Remove the http->conds microoptimization, it does not save anything

any more.
parent 7ccd8e60
......@@ -165,7 +165,6 @@ struct http {
struct ws *ws;
uint16_t status;
uint8_t protover;
uint8_t conds; /* If-* headers present */
};
/*--------------------------------------------------------------------*/
......
......@@ -142,7 +142,6 @@ ved_include(struct req *preq, const char *src, const char *host,
HTTP_Setup(req->http, req->ws, req->vsl, SLT_ReqMethod);
HTTP_Copy(req->http, preq->http);
req->http->conds = 0;
http_SetH(req->http, HTTP_HDR_URL, src);
if (host != NULL && *host != '\0') {
......
......@@ -182,9 +182,7 @@ cnt_deliver(struct worker *wrk, struct req *req)
assert(wrk->handling == VCL_RET_DELIVER);
if (IS_TOPREQ(req) &&
http_IsStatus(req->resp, 200) &&
req->http->conds && RFC2616_Do_Cond(req))
if (IS_TOPREQ(req) && RFC2616_Do_Cond(req))
http_PutResponse(req->resp, "HTTP/1.1", 304, NULL);
req->req_step = R_STP_TRANSMIT;
......
......@@ -260,6 +260,9 @@ RFC2616_Do_Cond(const struct req *req)
const char *p, *e;
vtim_real ims, lm;
if (!http_IsStatus(req->resp, 200))
return (0);
/*
* We MUST ignore If-Modified-Since if we have an If-None-Match
* header [RFC7232 3.3 p16].
......
......@@ -115,7 +115,6 @@ http1_dissect_hdrs(struct http *hp, char *p, struct http_conn *htc,
assert(p > htc->rxbuf_b);
assert(p <= htc->rxbuf_e);
hp->nhd = HTTP_HDR_FIRST;
hp->conds = 0;
r = NULL; /* For FlexeLint */
for (; p < htc->rxbuf_e; p = r) {
......@@ -173,11 +172,6 @@ http1_dissect_hdrs(struct http *hp, char *p, struct http_conn *htc,
return (400);
}
if ((p[0] == 'i' || p[0] == 'I') &&
(p[1] == 'f' || p[1] == 'F') &&
p[2] == '-')
hp->conds = 1;
while (q > p && vct_issp(q[-1]))
q--;
*q = '\0';
......
......@@ -535,7 +535,6 @@ h2_do_req(struct worker *wrk, void *priv)
CAST_OBJ_NOTNULL(r2, req->transport_priv, H2_REQ_MAGIC);
THR_SetRequest(req);
req->http->conds = 1;
wrk->stats->client_req++;
if (CNT_Request(wrk, req) != REQ_FSM_DISEMBARK) {
AZ(req->ws->r);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment