]> err.no Git - varnish/commitdiff
Close non HTTP/1.1 request connections
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 4 Jul 2006 09:28:21 +0000 (09:28 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 4 Jul 2006 09:28:21 +0000 (09:28 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@291 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache.h
varnish-cache/bin/varnishd/cache_http.c
varnish-cache/bin/varnishd/cache_pool.c

index b8b1669cee6c1516492f2d9fff8cef8d382c4a78..502455e9bd482ee8be52e042c81a1b4535080636 100644 (file)
@@ -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);
index fa486284f9f44a35d5307c90141060c2c76fcff1..d669bfe0fb0014ea7f54a8b355621c6c399cc5d5 100644 (file)
@@ -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)
 {
index 79a66b42e6e3670b231dfa32c3209b836f8114d6..a58218399a56428fa68127e72c5d416acd3594e1 100644 (file)
@@ -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));