-/* $OpenBSD: httpd.c,v 1.71 2021/01/27 07:21:52 deraadt Exp $ */
+/* $OpenBSD: httpd.c,v 1.72 2022/03/02 11:10:43 florian Exp $ */
/*
* Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org>
struct kv *
kv_find(struct kvtree *keys, struct kv *kv)
{
- struct kv *match;
- const char *key;
-
- if (kv->kv_flags & KV_FLAG_GLOBBING) {
- /* Test header key using shell globbing rules */
- key = kv->kv_key == NULL ? "" : kv->kv_key;
- RB_FOREACH(match, kvtree, keys) {
- if (fnmatch(key, match->kv_key, FNM_CASEFOLD) == 0)
- break;
- }
- } else {
- /* Fast tree-based lookup only works without globbing */
- match = RB_FIND(kvtree, keys, kv);
- }
-
- return (match);
+ return (RB_FIND(kvtree, keys, kv));
}
int
-/* $OpenBSD: httpd.h,v 1.159 2022/02/27 20:30:30 bluhm Exp $ */
+/* $OpenBSD: httpd.h,v 1.160 2022/03/02 11:10:43 florian Exp $ */
/*
* Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org>
char *kv_key;
char *kv_value;
-#define KV_FLAG_INVALID 0x01
-#define KV_FLAG_GLOBBING 0x02
- uint8_t kv_flags;
-
struct kvlist kv_children;
struct kv *kv_parent;
TAILQ_ENTRY(kv) kv_entry;
-/* $OpenBSD: server_fcgi.c,v 1.89 2021/10/23 15:52:44 benno Exp $ */
+/* $OpenBSD: server_fcgi.c,v 1.90 2022/03/02 11:10:43 florian Exp $ */
/*
* Copyright (c) 2014 Florian Obser <florian@openbsd.org>
const char *key;
int ret;
- if (hdr->kv_flags & KV_FLAG_INVALID)
- return (0);
-
/* The key might have been updated in the parent */
if (hdr->kv_parent != NULL && hdr->kv_parent->kv_key != NULL)
key = hdr->kv_parent->kv_key;
-/* $OpenBSD: server_http.c,v 1.149 2021/11/11 15:52:33 claudio Exp $ */
+/* $OpenBSD: server_http.c,v 1.150 2022/03/02 11:10:43 florian Exp $ */
/*
* Copyright (c) 2020 Matthias Pressfreund <mpfr@fn.de>
char *ptr;
const char *key;
- if (hdr->kv_flags & KV_FLAG_INVALID)
- return (0);
-
/* The key might have been updated in the parent */
if (hdr->kv_parent != NULL && hdr->kv_parent->kv_key != NULL)
key = hdr->kv_parent->kv_key;