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
ede0f6aa
Commit
ede0f6aa
authored
Feb 07, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: Remove verbose const
parent
4e7271a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
14 deletions
+13
-14
src/shrpx_client_handler.cc
src/shrpx_client_handler.cc
+1
-1
src/util.cc
src/util.cc
+6
-7
src/util.h
src/util.h
+6
-6
No files found.
src/shrpx_client_handler.cc
View file @
ede0f6aa
...
...
@@ -975,7 +975,7 @@ int ClientHandler::proxy_protocol_read() {
--
end
;
constexpr
c
onst
c
har
HEADER
[]
=
"PROXY "
;
constexpr
char
HEADER
[]
=
"PROXY "
;
if
(
static_cast
<
size_t
>
(
end
-
rb_
.
pos
)
<
str_size
(
HEADER
))
{
if
(
LOG_ENABLED
(
INFO
))
{
...
...
src/util.cc
View file @
ede0f6aa
...
...
@@ -66,15 +66,15 @@ namespace util {
const
char
UPPER_XDIGITS
[]
=
"0123456789ABCDEF"
;
bool
in_rfc3986_unreserved_chars
(
const
char
c
)
{
static
constexpr
c
onst
c
har
unreserved
[]
=
{
'-'
,
'.'
,
'_'
,
'~'
};
static
constexpr
char
unreserved
[]
=
{
'-'
,
'.'
,
'_'
,
'~'
};
return
is_alpha
(
c
)
||
is_digit
(
c
)
||
std
::
find
(
std
::
begin
(
unreserved
),
std
::
end
(
unreserved
),
c
)
!=
std
::
end
(
unreserved
);
}
bool
in_rfc3986_sub_delims
(
const
char
c
)
{
static
constexpr
c
onst
c
har
sub_delims
[]
=
{
'!'
,
'$'
,
'&'
,
'\''
,
'('
,
')'
,
'*'
,
'+'
,
','
,
';'
,
'='
};
static
constexpr
char
sub_delims
[]
=
{
'!'
,
'$'
,
'&'
,
'\''
,
'('
,
')'
,
'*'
,
'+'
,
','
,
';'
,
'='
};
return
std
::
find
(
std
::
begin
(
sub_delims
),
std
::
end
(
sub_delims
),
c
)
!=
std
::
end
(
sub_delims
);
}
...
...
@@ -117,15 +117,14 @@ std::string percent_encode_path(const std::string &s) {
}
bool
in_token
(
char
c
)
{
static
constexpr
const
char
extra
[]
=
{
'!'
,
'#'
,
'$'
,
'%'
,
'&'
,
'\''
,
'*'
,
'+'
,
'-'
,
'.'
,
'^'
,
'_'
,
'`'
,
'|'
,
'~'
};
static
constexpr
char
extra
[]
=
{
'!'
,
'#'
,
'$'
,
'%'
,
'&'
,
'\''
,
'*'
,
'+'
,
'-'
,
'.'
,
'^'
,
'_'
,
'`'
,
'|'
,
'~'
};
return
is_alpha
(
c
)
||
is_digit
(
c
)
||
std
::
find
(
std
::
begin
(
extra
),
std
::
end
(
extra
),
c
)
!=
std
::
end
(
extra
);
}
bool
in_attr_char
(
char
c
)
{
static
constexpr
c
onst
c
har
bad
[]
=
{
'*'
,
'\''
,
'%'
};
static
constexpr
char
bad
[]
=
{
'*'
,
'\''
,
'%'
};
return
util
::
in_token
(
c
)
&&
std
::
find
(
std
::
begin
(
bad
),
std
::
end
(
bad
),
c
)
==
std
::
end
(
bad
);
}
...
...
src/util.h
View file @
ede0f6aa
...
...
@@ -54,14 +54,14 @@ namespace nghttp2 {
// The additional HTTP/2 protocol ALPN protocol identifier we also
// supports for our applications to make smooth migration into final
// h2 ALPN ID.
constexpr
c
onst
c
har
NGHTTP2_H2_16_ALPN
[]
=
"\x5h2-16"
;
constexpr
c
onst
c
har
NGHTTP2_H2_16
[]
=
"h2-16"
;
constexpr
char
NGHTTP2_H2_16_ALPN
[]
=
"\x5h2-16"
;
constexpr
char
NGHTTP2_H2_16
[]
=
"h2-16"
;
constexpr
c
onst
c
har
NGHTTP2_H2_14_ALPN
[]
=
"\x5h2-14"
;
constexpr
c
onst
c
har
NGHTTP2_H2_14
[]
=
"h2-14"
;
constexpr
char
NGHTTP2_H2_14_ALPN
[]
=
"\x5h2-14"
;
constexpr
char
NGHTTP2_H2_14
[]
=
"h2-14"
;
constexpr
c
onst
c
har
NGHTTP2_H1_1_ALPN
[]
=
"\x8http/1.1"
;
constexpr
c
onst
c
har
NGHTTP2_H1_1
[]
=
"http/1.1"
;
constexpr
char
NGHTTP2_H1_1_ALPN
[]
=
"\x8http/1.1"
;
constexpr
char
NGHTTP2_H1_1
[]
=
"http/1.1"
;
namespace
util
{
...
...
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