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
9672bc32
Commit
9672bc32
authored
Feb 21, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: Remove unused functions
parent
b68be1e1
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
0 additions
and
118 deletions
+0
-118
src/http2.cc
src/http2.cc
+0
-45
src/http2.h
src/http2.h
+0
-17
src/http2_test.cc
src/http2_test.cc
+0
-47
src/http2_test.h
src/http2_test.h
+0
-3
src/shrpx-unittest.cc
src/shrpx-unittest.cc
+0
-6
No files found.
src/http2.cc
View file @
9672bc32
...
...
@@ -768,51 +768,6 @@ void index_header(HeaderIndex &hdidx, int32_t token, size_t idx) {
hdidx
[
token
]
=
idx
;
}
bool
check_http2_request_pseudo_header
(
const
HeaderIndex
&
hdidx
,
int32_t
token
)
{
switch
(
token
)
{
case
HD__AUTHORITY
:
case
HD__METHOD
:
case
HD__PATH
:
case
HD__SCHEME
:
return
hdidx
[
token
]
==
-
1
;
default:
return
false
;
}
}
bool
check_http2_response_pseudo_header
(
const
HeaderIndex
&
hdidx
,
int32_t
token
)
{
switch
(
token
)
{
case
HD__STATUS
:
return
hdidx
[
token
]
==
-
1
;
default:
return
false
;
}
}
bool
http2_header_allowed
(
int32_t
token
)
{
switch
(
token
)
{
case
HD_CONNECTION
:
case
HD_KEEP_ALIVE
:
case
HD_PROXY_CONNECTION
:
case
HD_TRANSFER_ENCODING
:
case
HD_UPGRADE
:
return
false
;
default:
return
true
;
}
}
bool
http2_mandatory_request_headers_presence
(
const
HeaderIndex
&
hdidx
)
{
if
(
hdidx
[
HD__METHOD
]
==
-
1
||
hdidx
[
HD__PATH
]
==
-
1
||
hdidx
[
HD__SCHEME
]
==
-
1
||
(
hdidx
[
HD__AUTHORITY
]
==
-
1
&&
hdidx
[
HD_HOST
]
==
-
1
))
{
return
false
;
}
return
true
;
}
const
Headers
::
value_type
*
get_header
(
const
HeaderIndex
&
hdidx
,
int32_t
token
,
const
Headers
&
nva
)
{
auto
i
=
hdidx
[
token
];
...
...
src/http2.h
View file @
9672bc32
...
...
@@ -279,23 +279,6 @@ void init_hdidx(HeaderIndex &hdidx);
// Indexes header |token| using index |idx|.
void
index_header
(
HeaderIndex
&
hdidx
,
int32_t
token
,
size_t
idx
);
// Returns true if HTTP/2 request pseudo header |token| is not indexed
// yet and not -1.
bool
check_http2_request_pseudo_header
(
const
HeaderIndex
&
hdidx
,
int32_t
token
);
// Returns true if HTTP/2 response pseudo header |token| is not
// indexed yet and not -1.
bool
check_http2_response_pseudo_header
(
const
HeaderIndex
&
hdidx
,
int32_t
token
);
// Returns true if header field denoted by |token| is allowed for
// HTTP/2.
bool
http2_header_allowed
(
int32_t
token
);
// Returns true that |hdidx| contains mandatory HTTP/2 request
// headers.
bool
http2_mandatory_request_headers_presence
(
const
HeaderIndex
&
hdidx
);
// Returns header denoted by |token| using index |hdidx|.
const
Headers
::
value_type
*
get_header
(
const
HeaderIndex
&
hdidx
,
int32_t
token
,
const
Headers
&
nva
);
...
...
src/http2_test.cc
View file @
9672bc32
...
...
@@ -271,53 +271,6 @@ void test_http2_lookup_token(void) {
CU_ASSERT
(
http2
::
HD_EXPECT
==
http2
::
lookup_token
(
"expect"
));
}
void
test_http2_check_http2_pseudo_header
(
void
)
{
http2
::
HeaderIndex
hdidx
;
http2
::
init_hdidx
(
hdidx
);
CU_ASSERT
(
http2
::
check_http2_request_pseudo_header
(
hdidx
,
http2
::
HD__METHOD
));
hdidx
[
http2
::
HD__PATH
]
=
0
;
CU_ASSERT
(
http2
::
check_http2_request_pseudo_header
(
hdidx
,
http2
::
HD__METHOD
));
hdidx
[
http2
::
HD__METHOD
]
=
1
;
CU_ASSERT
(
!
http2
::
check_http2_request_pseudo_header
(
hdidx
,
http2
::
HD__METHOD
));
CU_ASSERT
(
!
http2
::
check_http2_request_pseudo_header
(
hdidx
,
http2
::
HD_VIA
));
http2
::
init_hdidx
(
hdidx
);
CU_ASSERT
(
http2
::
check_http2_response_pseudo_header
(
hdidx
,
http2
::
HD__STATUS
));
hdidx
[
http2
::
HD__STATUS
]
=
0
;
CU_ASSERT
(
!
http2
::
check_http2_response_pseudo_header
(
hdidx
,
http2
::
HD__STATUS
));
CU_ASSERT
(
!
http2
::
check_http2_response_pseudo_header
(
hdidx
,
http2
::
HD_VIA
));
}
void
test_http2_http2_header_allowed
(
void
)
{
CU_ASSERT
(
http2
::
http2_header_allowed
(
http2
::
HD__PATH
));
CU_ASSERT
(
http2
::
http2_header_allowed
(
http2
::
HD_CONTENT_LENGTH
));
CU_ASSERT
(
!
http2
::
http2_header_allowed
(
http2
::
HD_CONNECTION
));
}
void
test_http2_mandatory_request_headers_presence
(
void
)
{
http2
::
HeaderIndex
hdidx
;
http2
::
init_hdidx
(
hdidx
);
CU_ASSERT
(
!
http2
::
http2_mandatory_request_headers_presence
(
hdidx
));
hdidx
[
http2
::
HD__AUTHORITY
]
=
0
;
CU_ASSERT
(
!
http2
::
http2_mandatory_request_headers_presence
(
hdidx
));
hdidx
[
http2
::
HD__METHOD
]
=
1
;
CU_ASSERT
(
!
http2
::
http2_mandatory_request_headers_presence
(
hdidx
));
hdidx
[
http2
::
HD__PATH
]
=
2
;
CU_ASSERT
(
!
http2
::
http2_mandatory_request_headers_presence
(
hdidx
));
hdidx
[
http2
::
HD__SCHEME
]
=
3
;
CU_ASSERT
(
http2
::
http2_mandatory_request_headers_presence
(
hdidx
));
hdidx
[
http2
::
HD__AUTHORITY
]
=
-
1
;
hdidx
[
http2
::
HD_HOST
]
=
0
;
CU_ASSERT
(
http2
::
http2_mandatory_request_headers_presence
(
hdidx
));
}
void
test_http2_parse_link_header
(
void
)
{
{
// only URI appears; we don't extract URI unless it bears rel=preload
...
...
src/http2_test.h
View file @
9672bc32
...
...
@@ -40,9 +40,6 @@ void test_http2_rewrite_location_uri(void);
void
test_http2_parse_http_status_code
(
void
);
void
test_http2_index_header
(
void
);
void
test_http2_lookup_token
(
void
);
void
test_http2_check_http2_pseudo_header
(
void
);
void
test_http2_http2_header_allowed
(
void
);
void
test_http2_mandatory_request_headers_presence
(
void
);
void
test_http2_parse_link_header
(
void
);
void
test_http2_path_join
(
void
);
void
test_http2_normalize_path
(
void
);
...
...
src/shrpx-unittest.cc
View file @
9672bc32
...
...
@@ -89,12 +89,6 @@ int main(int argc, char *argv[]) {
shrpx
::
test_http2_index_header
)
||
!
CU_add_test
(
pSuite
,
"http2_lookup_token"
,
shrpx
::
test_http2_lookup_token
)
||
!
CU_add_test
(
pSuite
,
"http2_check_http2_pseudo_header"
,
shrpx
::
test_http2_check_http2_pseudo_header
)
||
!
CU_add_test
(
pSuite
,
"http2_http2_header_allowed"
,
shrpx
::
test_http2_http2_header_allowed
)
||
!
CU_add_test
(
pSuite
,
"http2_mandatory_request_headers_presence"
,
shrpx
::
test_http2_mandatory_request_headers_presence
)
||
!
CU_add_test
(
pSuite
,
"http2_parse_link_header"
,
shrpx
::
test_http2_parse_link_header
)
||
!
CU_add_test
(
pSuite
,
"http2_path_join"
,
shrpx
::
test_http2_path_join
)
||
...
...
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