Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
3f31424e
Commit
3f31424e
authored
Aug 09, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/weliu/nghttp2
into weliu-master
parents
60cae325
e0119452
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
58 deletions
+58
-58
genlibtokenlookup.py
genlibtokenlookup.py
+1
-1
lib/nghttp2_hd.c
lib/nghttp2_hd.c
+57
-57
No files found.
genlibtokenlookup.py
View file @
3f31424e
...
...
@@ -122,7 +122,7 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) {
case '{}':'''
.
format
(
c
)
for
k
in
headers
:
print
'''
\
if (
lstr
eq("{}", name, {})) {{
if (
mem
eq("{}", name, {})) {{
return {};
}}'''
.
format
(
k
[:
-
1
],
size
-
1
,
to_enum_hd
(
k
))
print
'''
\
...
...
lib/nghttp2_hd.c
View file @
3f31424e
...
...
@@ -121,7 +121,7 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) {
case
2
:
switch
(
name
[
1
])
{
case
'e'
:
if
(
lstr
eq
(
"t"
,
name
,
1
))
{
if
(
mem
eq
(
"t"
,
name
,
1
))
{
return
NGHTTP2_TOKEN_TE
;
}
break
;
...
...
@@ -130,12 +130,12 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) {
case
3
:
switch
(
name
[
2
])
{
case
'a'
:
if
(
lstr
eq
(
"vi"
,
name
,
2
))
{
if
(
mem
eq
(
"vi"
,
name
,
2
))
{
return
NGHTTP2_TOKEN_VIA
;
}
break
;
case
'e'
:
if
(
lstr
eq
(
"ag"
,
name
,
2
))
{
if
(
mem
eq
(
"ag"
,
name
,
2
))
{
return
NGHTTP2_TOKEN_AGE
;
}
break
;
...
...
@@ -144,32 +144,32 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) {
case
4
:
switch
(
name
[
3
])
{
case
'e'
:
if
(
lstr
eq
(
"dat"
,
name
,
3
))
{
if
(
mem
eq
(
"dat"
,
name
,
3
))
{
return
NGHTTP2_TOKEN_DATE
;
}
break
;
case
'g'
:
if
(
lstr
eq
(
"eta"
,
name
,
3
))
{
if
(
mem
eq
(
"eta"
,
name
,
3
))
{
return
NGHTTP2_TOKEN_ETAG
;
}
break
;
case
'k'
:
if
(
lstr
eq
(
"lin"
,
name
,
3
))
{
if
(
mem
eq
(
"lin"
,
name
,
3
))
{
return
NGHTTP2_TOKEN_LINK
;
}
break
;
case
'm'
:
if
(
lstr
eq
(
"fro"
,
name
,
3
))
{
if
(
mem
eq
(
"fro"
,
name
,
3
))
{
return
NGHTTP2_TOKEN_FROM
;
}
break
;
case
't'
:
if
(
lstr
eq
(
"hos"
,
name
,
3
))
{
if
(
mem
eq
(
"hos"
,
name
,
3
))
{
return
NGHTTP2_TOKEN_HOST
;
}
break
;
case
'y'
:
if
(
lstr
eq
(
"var"
,
name
,
3
))
{
if
(
mem
eq
(
"var"
,
name
,
3
))
{
return
NGHTTP2_TOKEN_VARY
;
}
break
;
...
...
@@ -178,17 +178,17 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) {
case
5
:
switch
(
name
[
4
])
{
case
'e'
:
if
(
lstr
eq
(
"rang"
,
name
,
4
))
{
if
(
mem
eq
(
"rang"
,
name
,
4
))
{
return
NGHTTP2_TOKEN_RANGE
;
}
break
;
case
'h'
:
if
(
lstr
eq
(
":pat"
,
name
,
4
))
{
if
(
mem
eq
(
":pat"
,
name
,
4
))
{
return
NGHTTP2_TOKEN__PATH
;
}
break
;
case
'w'
:
if
(
lstr
eq
(
"allo"
,
name
,
4
))
{
if
(
mem
eq
(
"allo"
,
name
,
4
))
{
return
NGHTTP2_TOKEN_ALLOW
;
}
break
;
...
...
@@ -197,20 +197,20 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) {
case
6
:
switch
(
name
[
5
])
{
case
'e'
:
if
(
lstr
eq
(
"cooki"
,
name
,
5
))
{
if
(
mem
eq
(
"cooki"
,
name
,
5
))
{
return
NGHTTP2_TOKEN_COOKIE
;
}
break
;
case
'r'
:
if
(
lstr
eq
(
"serve"
,
name
,
5
))
{
if
(
mem
eq
(
"serve"
,
name
,
5
))
{
return
NGHTTP2_TOKEN_SERVER
;
}
break
;
case
't'
:
if
(
lstr
eq
(
"accep"
,
name
,
5
))
{
if
(
mem
eq
(
"accep"
,
name
,
5
))
{
return
NGHTTP2_TOKEN_ACCEPT
;
}
if
(
lstr
eq
(
"expec"
,
name
,
5
))
{
if
(
mem
eq
(
"expec"
,
name
,
5
))
{
return
NGHTTP2_TOKEN_EXPECT
;
}
break
;
...
...
@@ -219,33 +219,33 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) {
case
7
:
switch
(
name
[
6
])
{
case
'd'
:
if
(
lstr
eq
(
":metho"
,
name
,
6
))
{
if
(
mem
eq
(
":metho"
,
name
,
6
))
{
return
NGHTTP2_TOKEN__METHOD
;
}
break
;
case
'e'
:
if
(
lstr
eq
(
":schem"
,
name
,
6
))
{
if
(
mem
eq
(
":schem"
,
name
,
6
))
{
return
NGHTTP2_TOKEN__SCHEME
;
}
if
(
lstr
eq
(
"upgrad"
,
name
,
6
))
{
if
(
mem
eq
(
"upgrad"
,
name
,
6
))
{
return
NGHTTP2_TOKEN_UPGRADE
;
}
break
;
case
'h'
:
if
(
lstr
eq
(
"refres"
,
name
,
6
))
{
if
(
mem
eq
(
"refres"
,
name
,
6
))
{
return
NGHTTP2_TOKEN_REFRESH
;
}
break
;
case
'r'
:
if
(
lstr
eq
(
"refere"
,
name
,
6
))
{
if
(
mem
eq
(
"refere"
,
name
,
6
))
{
return
NGHTTP2_TOKEN_REFERER
;
}
break
;
case
's'
:
if
(
lstr
eq
(
":statu"
,
name
,
6
))
{
if
(
mem
eq
(
":statu"
,
name
,
6
))
{
return
NGHTTP2_TOKEN__STATUS
;
}
if
(
lstr
eq
(
"expire"
,
name
,
6
))
{
if
(
mem
eq
(
"expire"
,
name
,
6
))
{
return
NGHTTP2_TOKEN_EXPIRES
;
}
break
;
...
...
@@ -254,17 +254,17 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) {
case
8
:
switch
(
name
[
7
])
{
case
'e'
:
if
(
lstr
eq
(
"if-rang"
,
name
,
7
))
{
if
(
mem
eq
(
"if-rang"
,
name
,
7
))
{
return
NGHTTP2_TOKEN_IF_RANGE
;
}
break
;
case
'h'
:
if
(
lstr
eq
(
"if-matc"
,
name
,
7
))
{
if
(
mem
eq
(
"if-matc"
,
name
,
7
))
{
return
NGHTTP2_TOKEN_IF_MATCH
;
}
break
;
case
'n'
:
if
(
lstr
eq
(
"locatio"
,
name
,
7
))
{
if
(
mem
eq
(
"locatio"
,
name
,
7
))
{
return
NGHTTP2_TOKEN_LOCATION
;
}
break
;
...
...
@@ -273,25 +273,25 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) {
case
10
:
switch
(
name
[
9
])
{
case
'e'
:
if
(
lstr
eq
(
"keep-aliv"
,
name
,
9
))
{
if
(
mem
eq
(
"keep-aliv"
,
name
,
9
))
{
return
NGHTTP2_TOKEN_KEEP_ALIVE
;
}
if
(
lstr
eq
(
"set-cooki"
,
name
,
9
))
{
if
(
mem
eq
(
"set-cooki"
,
name
,
9
))
{
return
NGHTTP2_TOKEN_SET_COOKIE
;
}
break
;
case
'n'
:
if
(
lstr
eq
(
"connectio"
,
name
,
9
))
{
if
(
mem
eq
(
"connectio"
,
name
,
9
))
{
return
NGHTTP2_TOKEN_CONNECTION
;
}
break
;
case
't'
:
if
(
lstr
eq
(
"user-agen"
,
name
,
9
))
{
if
(
mem
eq
(
"user-agen"
,
name
,
9
))
{
return
NGHTTP2_TOKEN_USER_AGENT
;
}
break
;
case
'y'
:
if
(
lstr
eq
(
":authorit"
,
name
,
9
))
{
if
(
mem
eq
(
":authorit"
,
name
,
9
))
{
return
NGHTTP2_TOKEN__AUTHORITY
;
}
break
;
...
...
@@ -300,7 +300,7 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) {
case
11
:
switch
(
name
[
10
])
{
case
'r'
:
if
(
lstr
eq
(
"retry-afte"
,
name
,
10
))
{
if
(
mem
eq
(
"retry-afte"
,
name
,
10
))
{
return
NGHTTP2_TOKEN_RETRY_AFTER
;
}
break
;
...
...
@@ -309,12 +309,12 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) {
case
12
:
switch
(
name
[
11
])
{
case
'e'
:
if
(
lstr
eq
(
"content-typ"
,
name
,
11
))
{
if
(
mem
eq
(
"content-typ"
,
name
,
11
))
{
return
NGHTTP2_TOKEN_CONTENT_TYPE
;
}
break
;
case
's'
:
if
(
lstr
eq
(
"max-forward"
,
name
,
11
))
{
if
(
mem
eq
(
"max-forward"
,
name
,
11
))
{
return
NGHTTP2_TOKEN_MAX_FORWARDS
;
}
break
;
...
...
@@ -323,32 +323,32 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) {
case
13
:
switch
(
name
[
12
])
{
case
'd'
:
if
(
lstr
eq
(
"last-modifie"
,
name
,
12
))
{
if
(
mem
eq
(
"last-modifie"
,
name
,
12
))
{
return
NGHTTP2_TOKEN_LAST_MODIFIED
;
}
break
;
case
'e'
:
if
(
lstr
eq
(
"content-rang"
,
name
,
12
))
{
if
(
mem
eq
(
"content-rang"
,
name
,
12
))
{
return
NGHTTP2_TOKEN_CONTENT_RANGE
;
}
break
;
case
'h'
:
if
(
lstr
eq
(
"if-none-matc"
,
name
,
12
))
{
if
(
mem
eq
(
"if-none-matc"
,
name
,
12
))
{
return
NGHTTP2_TOKEN_IF_NONE_MATCH
;
}
break
;
case
'l'
:
if
(
lstr
eq
(
"cache-contro"
,
name
,
12
))
{
if
(
mem
eq
(
"cache-contro"
,
name
,
12
))
{
return
NGHTTP2_TOKEN_CACHE_CONTROL
;
}
break
;
case
'n'
:
if
(
lstr
eq
(
"authorizatio"
,
name
,
12
))
{
if
(
mem
eq
(
"authorizatio"
,
name
,
12
))
{
return
NGHTTP2_TOKEN_AUTHORIZATION
;
}
break
;
case
's'
:
if
(
lstr
eq
(
"accept-range"
,
name
,
12
))
{
if
(
mem
eq
(
"accept-range"
,
name
,
12
))
{
return
NGHTTP2_TOKEN_ACCEPT_RANGES
;
}
break
;
...
...
@@ -357,12 +357,12 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) {
case
14
:
switch
(
name
[
13
])
{
case
'h'
:
if
(
lstr
eq
(
"content-lengt"
,
name
,
13
))
{
if
(
mem
eq
(
"content-lengt"
,
name
,
13
))
{
return
NGHTTP2_TOKEN_CONTENT_LENGTH
;
}
break
;
case
't'
:
if
(
lstr
eq
(
"accept-charse"
,
name
,
13
))
{
if
(
mem
eq
(
"accept-charse"
,
name
,
13
))
{
return
NGHTTP2_TOKEN_ACCEPT_CHARSET
;
}
break
;
...
...
@@ -371,12 +371,12 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) {
case
15
:
switch
(
name
[
14
])
{
case
'e'
:
if
(
lstr
eq
(
"accept-languag"
,
name
,
14
))
{
if
(
mem
eq
(
"accept-languag"
,
name
,
14
))
{
return
NGHTTP2_TOKEN_ACCEPT_LANGUAGE
;
}
break
;
case
'g'
:
if
(
lstr
eq
(
"accept-encodin"
,
name
,
14
))
{
if
(
mem
eq
(
"accept-encodin"
,
name
,
14
))
{
return
NGHTTP2_TOKEN_ACCEPT_ENCODING
;
}
break
;
...
...
@@ -385,23 +385,23 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) {
case
16
:
switch
(
name
[
15
])
{
case
'e'
:
if
(
lstr
eq
(
"content-languag"
,
name
,
15
))
{
if
(
mem
eq
(
"content-languag"
,
name
,
15
))
{
return
NGHTTP2_TOKEN_CONTENT_LANGUAGE
;
}
if
(
lstr
eq
(
"www-authenticat"
,
name
,
15
))
{
if
(
mem
eq
(
"www-authenticat"
,
name
,
15
))
{
return
NGHTTP2_TOKEN_WWW_AUTHENTICATE
;
}
break
;
case
'g'
:
if
(
lstr
eq
(
"content-encodin"
,
name
,
15
))
{
if
(
mem
eq
(
"content-encodin"
,
name
,
15
))
{
return
NGHTTP2_TOKEN_CONTENT_ENCODING
;
}
break
;
case
'n'
:
if
(
lstr
eq
(
"content-locatio"
,
name
,
15
))
{
if
(
mem
eq
(
"content-locatio"
,
name
,
15
))
{
return
NGHTTP2_TOKEN_CONTENT_LOCATION
;
}
if
(
lstr
eq
(
"proxy-connectio"
,
name
,
15
))
{
if
(
mem
eq
(
"proxy-connectio"
,
name
,
15
))
{
return
NGHTTP2_TOKEN_PROXY_CONNECTION
;
}
break
;
...
...
@@ -410,12 +410,12 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) {
case
17
:
switch
(
name
[
16
])
{
case
'e'
:
if
(
lstr
eq
(
"if-modified-sinc"
,
name
,
16
))
{
if
(
mem
eq
(
"if-modified-sinc"
,
name
,
16
))
{
return
NGHTTP2_TOKEN_IF_MODIFIED_SINCE
;
}
break
;
case
'g'
:
if
(
lstr
eq
(
"transfer-encodin"
,
name
,
16
))
{
if
(
mem
eq
(
"transfer-encodin"
,
name
,
16
))
{
return
NGHTTP2_TOKEN_TRANSFER_ENCODING
;
}
break
;
...
...
@@ -424,7 +424,7 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) {
case
18
:
switch
(
name
[
17
])
{
case
'e'
:
if
(
lstr
eq
(
"proxy-authenticat"
,
name
,
17
))
{
if
(
mem
eq
(
"proxy-authenticat"
,
name
,
17
))
{
return
NGHTTP2_TOKEN_PROXY_AUTHENTICATE
;
}
break
;
...
...
@@ -433,15 +433,15 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) {
case
19
:
switch
(
name
[
18
])
{
case
'e'
:
if
(
lstr
eq
(
"if-unmodified-sinc"
,
name
,
18
))
{
if
(
mem
eq
(
"if-unmodified-sinc"
,
name
,
18
))
{
return
NGHTTP2_TOKEN_IF_UNMODIFIED_SINCE
;
}
break
;
case
'n'
:
if
(
lstr
eq
(
"content-dispositio"
,
name
,
18
))
{
if
(
mem
eq
(
"content-dispositio"
,
name
,
18
))
{
return
NGHTTP2_TOKEN_CONTENT_DISPOSITION
;
}
if
(
lstr
eq
(
"proxy-authorizatio"
,
name
,
18
))
{
if
(
mem
eq
(
"proxy-authorizatio"
,
name
,
18
))
{
return
NGHTTP2_TOKEN_PROXY_AUTHORIZATION
;
}
break
;
...
...
@@ -450,7 +450,7 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) {
case
25
:
switch
(
name
[
24
])
{
case
'y'
:
if
(
lstr
eq
(
"strict-transport-securit"
,
name
,
24
))
{
if
(
mem
eq
(
"strict-transport-securit"
,
name
,
24
))
{
return
NGHTTP2_TOKEN_STRICT_TRANSPORT_SECURITY
;
}
break
;
...
...
@@ -459,7 +459,7 @@ static int32_t lookup_token(const uint8_t *name, size_t namelen) {
case
27
:
switch
(
name
[
26
])
{
case
'n'
:
if
(
lstr
eq
(
"access-control-allow-origi"
,
name
,
26
))
{
if
(
mem
eq
(
"access-control-allow-origi"
,
name
,
26
))
{
return
NGHTTP2_TOKEN_ACCESS_CONTROL_ALLOW_ORIGIN
;
}
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment