From 8625a93bb08056f2fdf4ecbdddf67db10ddf6195 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 10 Mar 2018 17:20:28 +0900 Subject: [PATCH] Add NGHTTP2_TOKEN__PROTOCOL --- genlibtokenlookup.py | 1 + lib/nghttp2_hd.c | 9 +++++++++ lib/nghttp2_hd.h | 1 + 3 files changed, 11 insertions(+) diff --git a/genlibtokenlookup.py b/genlibtokenlookup.py index 267a30b4..9477d07d 100755 --- a/genlibtokenlookup.py +++ b/genlibtokenlookup.py @@ -67,6 +67,7 @@ HEADERS = [ ('keep-alive',None), ('proxy-connection', None), ('upgrade', None), + (':protocol', None), ] def to_enum_hd(k): diff --git a/lib/nghttp2_hd.c b/lib/nghttp2_hd.c index 1eb3be33..af409896 100644 --- a/lib/nghttp2_hd.c +++ b/lib/nghttp2_hd.c @@ -271,6 +271,15 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) { break; } break; + case 9: + switch (name[8]) { + case 'l': + if (memeq(":protoco", name, 8)) { + return NGHTTP2_TOKEN__PROTOCOL; + } + break; + } + break; case 10: switch (name[9]) { case 'e': diff --git a/lib/nghttp2_hd.h b/lib/nghttp2_hd.h index c64a1f2b..14ae9807 100644 --- a/lib/nghttp2_hd.h +++ b/lib/nghttp2_hd.h @@ -111,6 +111,7 @@ typedef enum { NGHTTP2_TOKEN_KEEP_ALIVE, NGHTTP2_TOKEN_PROXY_CONNECTION, NGHTTP2_TOKEN_UPGRADE, + NGHTTP2_TOKEN__PROTOCOL, } nghttp2_token; struct nghttp2_hd_entry;