Commit 0d276b43 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Reduce the http.protover field from double to uint8_t for space reasons.

parent 4f59702c
......@@ -171,7 +171,7 @@ struct http {
unsigned char conds; /* If-* headers present */
enum httpwhence logtag;
int status;
double protover;
uint8_t protover;
unsigned shd; /* Size of hd space */
txt *hd;
......
......@@ -200,7 +200,7 @@ cnt_prepresp(struct sess *sp)
sp->wrk->res_mode |= RES_LEN;
else if (!sp->wantbody) {
/* Nothing */
} else if (sp->http->protover >= 1.1) {
} else if (sp->http->protover >= 11) {
sp->wrk->res_mode |= RES_CHUNKED;
} else {
sp->wrk->res_mode |= RES_EOF;
......
......@@ -420,7 +420,7 @@ http_DoConnection(const struct http *hp)
unsigned u;
if (!http_GetHdr(hp, H_Connection, &p)) {
if (hp->protover < 1.1)
if (hp->protover < 11)
return ("not HTTP/1.1");
return (NULL);
}
......@@ -640,11 +640,11 @@ http_ProtoVer(struct http *hp)
{
if (!strcasecmp(hp->hd[HTTP_HDR_PROTO].b, "HTTP/1.0"))
hp->protover = 1.0;
hp->protover = 10;
else if (!strcasecmp(hp->hd[HTTP_HDR_PROTO].b, "HTTP/1.1"))
hp->protover = 1.1;
hp->protover = 11;
else
hp->protover = 0.9;
hp->protover = 9;
}
......
......@@ -186,7 +186,7 @@ RFC2616_Body(const struct sess *sp)
hp = sp->wrk->beresp;
if (hp->protover < 1.1 && !http_HdrIs(hp, H_Connection, "keep-alive"))
if (hp->protover < 11 && !http_HdrIs(hp, H_Connection, "keep-alive"))
sp->wrk->do_close = 1;
else if (http_HdrIs(hp, H_Connection, "close"))
sp->wrk->do_close = 1;
......@@ -262,7 +262,7 @@ RFC2616_Body(const struct sess *sp)
return (BS_EOF);
}
if (hp->protover < 1.1) {
if (hp->protover < 11) {
/*
* With no Connection header, assume EOF.
*/
......
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