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
cc6f7591
Commit
cc6f7591
authored
Sep 20, 2017
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: Add static to constexpr char[]
parent
c23fc86a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
src/shrpx_exec.cc
src/shrpx_exec.cc
+2
-2
src/shrpx_tls_test.cc
src/shrpx_tls_test.cc
+5
-3
src/util.h
src/util.h
+1
-1
No files found.
src/shrpx_exec.cc
View file @
cc6f7591
...
@@ -84,7 +84,7 @@ int exec_read_command(Process &proc, char *const argv[]) {
...
@@ -84,7 +84,7 @@ int exec_read_command(Process &proc, char *const argv[]) {
rv
=
shrpx_signal_unblock_all
();
rv
=
shrpx_signal_unblock_all
();
if
(
rv
!=
0
)
{
if
(
rv
!=
0
)
{
constexpr
char
msg
[]
=
"Unblocking all signals failed
\n
"
;
static
constexpr
char
msg
[]
=
"Unblocking all signals failed
\n
"
;
while
(
write
(
STDERR_FILENO
,
msg
,
str_size
(
msg
))
==
-
1
&&
errno
==
EINTR
)
while
(
write
(
STDERR_FILENO
,
msg
,
str_size
(
msg
))
==
-
1
&&
errno
==
EINTR
)
;
;
nghttp2_Exit
(
EXIT_FAILURE
);
nghttp2_Exit
(
EXIT_FAILURE
);
...
@@ -95,7 +95,7 @@ int exec_read_command(Process &proc, char *const argv[]) {
...
@@ -95,7 +95,7 @@ int exec_read_command(Process &proc, char *const argv[]) {
rv
=
execv
(
argv
[
0
],
argv
);
rv
=
execv
(
argv
[
0
],
argv
);
if
(
rv
==
-
1
)
{
if
(
rv
==
-
1
)
{
constexpr
char
msg
[]
=
"Could not execute command
\n
"
;
static
constexpr
char
msg
[]
=
"Could not execute command
\n
"
;
while
(
write
(
STDERR_FILENO
,
msg
,
str_size
(
msg
))
==
-
1
&&
errno
==
EINTR
)
while
(
write
(
STDERR_FILENO
,
msg
,
str_size
(
msg
))
==
-
1
&&
errno
==
EINTR
)
;
;
nghttp2_Exit
(
EXIT_FAILURE
);
nghttp2_Exit
(
EXIT_FAILURE
);
...
...
src/shrpx_tls_test.cc
View file @
cc6f7591
...
@@ -70,7 +70,7 @@ void test_shrpx_tls_create_lookup_tree(void) {
...
@@ -70,7 +70,7 @@ void test_shrpx_tls_create_lookup_tree(void) {
CU_ASSERT
(
-
1
==
tree
->
lookup
(
StringRef
{}));
CU_ASSERT
(
-
1
==
tree
->
lookup
(
StringRef
{}));
CU_ASSERT
(
5
==
tree
->
lookup
(
hostnames
[
5
]));
CU_ASSERT
(
5
==
tree
->
lookup
(
hostnames
[
5
]));
CU_ASSERT
(
6
==
tree
->
lookup
(
hostnames
[
6
]));
CU_ASSERT
(
6
==
tree
->
lookup
(
hostnames
[
6
]));
constexpr
char
h6
[]
=
"pdylay.sourceforge.net"
;
static
constexpr
char
h6
[]
=
"pdylay.sourceforge.net"
;
for
(
int
i
=
0
;
i
<
7
;
++
i
)
{
for
(
int
i
=
0
;
i
<
7
;
++
i
)
{
CU_ASSERT
(
-
1
==
tree
->
lookup
(
StringRef
{
h6
+
i
,
str_size
(
h6
)
-
i
}));
CU_ASSERT
(
-
1
==
tree
->
lookup
(
StringRef
{
h6
+
i
,
str_size
(
h6
)
-
i
}));
}
}
...
@@ -119,7 +119,8 @@ void test_shrpx_tls_create_lookup_tree(void) {
...
@@ -119,7 +119,8 @@ void test_shrpx_tls_create_lookup_tree(void) {
void
test_shrpx_tls_cert_lookup_tree_add_ssl_ctx
(
void
)
{
void
test_shrpx_tls_cert_lookup_tree_add_ssl_ctx
(
void
)
{
int
rv
;
int
rv
;
constexpr
char
nghttp2_certfile
[]
=
NGHTTP2_SRC_DIR
"/test.nghttp2.org.pem"
;
static
constexpr
char
nghttp2_certfile
[]
=
NGHTTP2_SRC_DIR
"/test.nghttp2.org.pem"
;
auto
nghttp2_ssl_ctx
=
SSL_CTX_new
(
SSLv23_server_method
());
auto
nghttp2_ssl_ctx
=
SSL_CTX_new
(
SSLv23_server_method
());
auto
nghttp2_ssl_ctx_del
=
defer
(
SSL_CTX_free
,
nghttp2_ssl_ctx
);
auto
nghttp2_ssl_ctx_del
=
defer
(
SSL_CTX_free
,
nghttp2_ssl_ctx
);
auto
nghttp2_tls_ctx_data
=
make_unique
<
tls
::
TLSContextData
>
();
auto
nghttp2_tls_ctx_data
=
make_unique
<
tls
::
TLSContextData
>
();
...
@@ -129,7 +130,8 @@ void test_shrpx_tls_cert_lookup_tree_add_ssl_ctx(void) {
...
@@ -129,7 +130,8 @@ void test_shrpx_tls_cert_lookup_tree_add_ssl_ctx(void) {
CU_ASSERT
(
1
==
rv
);
CU_ASSERT
(
1
==
rv
);
constexpr
char
examples_certfile
[]
=
NGHTTP2_SRC_DIR
"/test.example.com.pem"
;
static
constexpr
char
examples_certfile
[]
=
NGHTTP2_SRC_DIR
"/test.example.com.pem"
;
auto
examples_ssl_ctx
=
SSL_CTX_new
(
SSLv23_server_method
());
auto
examples_ssl_ctx
=
SSL_CTX_new
(
SSLv23_server_method
());
auto
examples_ssl_ctx_del
=
defer
(
SSL_CTX_free
,
examples_ssl_ctx
);
auto
examples_ssl_ctx_del
=
defer
(
SSL_CTX_free
,
examples_ssl_ctx
);
auto
examples_tls_ctx_data
=
make_unique
<
tls
::
TLSContextData
>
();
auto
examples_tls_ctx_data
=
make_unique
<
tls
::
TLSContextData
>
();
...
...
src/util.h
View file @
cc6f7591
...
@@ -716,7 +716,7 @@ template <typename OutputIt, typename Generator>
...
@@ -716,7 +716,7 @@ template <typename OutputIt, typename Generator>
OutputIt
random_alpha_digit
(
OutputIt
first
,
OutputIt
last
,
Generator
&
gen
)
{
OutputIt
random_alpha_digit
(
OutputIt
first
,
OutputIt
last
,
Generator
&
gen
)
{
// If we use uint8_t instead char, gcc 6.2.0 complains by shouting
// If we use uint8_t instead char, gcc 6.2.0 complains by shouting
// char-array initialized from wide string.
// char-array initialized from wide string.
constexpr
char
s
[]
=
static
constexpr
char
s
[]
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
;
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
;
std
::
uniform_int_distribution
<>
dis
(
0
,
26
*
2
+
10
-
1
);
std
::
uniform_int_distribution
<>
dis
(
0
,
26
*
2
+
10
-
1
);
for
(;
first
!=
last
;
++
first
)
{
for
(;
first
!=
last
;
++
first
)
{
...
...
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