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

Close non HTTP/1.1 request connections


git-svn-id: http://www.varnish-cache.org/svn/trunk@291 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 85252134
......@@ -171,6 +171,7 @@ void http_Delete(struct http *hp);
int http_GetHdr(struct http *hp, const char *hdr, char **ptr);
int http_GetHdrField(struct http *hp, const char *hdr, const char *field, char **ptr);
int http_GetReq(struct http *hp, char **b);
int http_GetProto(struct http *hp, char **b);
int http_GetStatus(struct http *hp);
int http_HdrIs(struct http *hp, const char *hdr, const char *val);
int http_GetTail(struct http *hp, unsigned len, char **b, char **e);
......
......@@ -164,6 +164,15 @@ http_GetURL(struct http *hp, char **b)
return (1);
}
int
http_GetProto(struct http *hp, char **b)
{
if (hp->proto == NULL)
return (0);
*b = hp->proto;
return (1);
}
int
http_GetTail(struct http *hp, unsigned len, char **b, char **e)
{
......
......@@ -116,6 +116,9 @@ CacheWorker(void *priv)
if (http_GetHdr(sp->http, "Connection", &b) &&
!strcmp(b, "close")) {
vca_close_session(sp, "Connection header");
} else if (http_GetProto(sp->http, &b) &&
strcmp(b, "HTTP/1.1")) {
vca_close_session(sp, "not HTTP/1.1");
}
AZ(pthread_mutex_lock(&sessmtx));
......
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