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);
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)
{
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));