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
34efc6b7
Commit
34efc6b7
authored
May 29, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More constexpr
parent
7582640f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
12 deletions
+13
-12
src/HttpServer.cc
src/HttpServer.cc
+6
-5
src/http2.h
src/http2.h
+1
-1
src/nghttp.cc
src/nghttp.cc
+1
-1
src/shrpx_config.h
src/shrpx_config.h
+1
-1
src/shrpx_ssl.cc
src/shrpx_ssl.cc
+4
-4
No files found.
src/HttpServer.cc
View file @
34efc6b7
...
...
@@ -69,8 +69,9 @@
namespace
nghttp2
{
namespace
{
const
std
::
string
DEFAULT_HTML
=
"index.html"
;
const
std
::
string
NGHTTPD_SERVER
=
"nghttpd nghttp2/"
NGHTTP2_VERSION
;
// TODO could be constexpr
constexpr
char
DEFAULT_HTML
[]
=
"index.html"
;
constexpr
char
NGHTTPD_SERVER
[]
=
"nghttpd nghttp2/"
NGHTTP2_VERSION
;
}
// namespace
namespace
{
...
...
@@ -739,7 +740,7 @@ int Http2Handler::submit_file_response(const std::string &status,
std
::
string
content_length
=
util
::
utos
(
file_length
);
std
::
string
last_modified_str
;
auto
nva
=
make_array
(
http2
::
make_nv_ls
(
":status"
,
status
),
http2
::
make_nv_l
s
(
"server"
,
NGHTTPD_SERVER
),
http2
::
make_nv_l
l
(
"server"
,
NGHTTPD_SERVER
),
http2
::
make_nv_ls
(
"content-length"
,
content_length
),
http2
::
make_nv_ll
(
"cache-control"
,
"max-age=3600"
),
http2
::
make_nv_ls
(
"date"
,
sessions_
->
get_cached_date
()),
...
...
@@ -769,7 +770,7 @@ int Http2Handler::submit_response(const std::string &status, int32_t stream_id,
auto
nva
=
std
::
vector
<
nghttp2_nv
>
();
nva
.
reserve
(
3
+
headers
.
size
());
nva
.
push_back
(
http2
::
make_nv_ls
(
":status"
,
status
));
nva
.
push_back
(
http2
::
make_nv_l
s
(
"server"
,
NGHTTPD_SERVER
));
nva
.
push_back
(
http2
::
make_nv_l
l
(
"server"
,
NGHTTPD_SERVER
));
nva
.
push_back
(
http2
::
make_nv_ls
(
"date"
,
sessions_
->
get_cached_date
()));
for
(
auto
&
nv
:
headers
)
{
nva
.
push_back
(
http2
::
make_nv
(
nv
.
name
,
nv
.
value
,
nv
.
no_index
));
...
...
@@ -782,7 +783,7 @@ int Http2Handler::submit_response(const std::string &status, int32_t stream_id,
int
Http2Handler
::
submit_response
(
const
std
::
string
&
status
,
int32_t
stream_id
,
nghttp2_data_provider
*
data_prd
)
{
auto
nva
=
make_array
(
http2
::
make_nv_ls
(
":status"
,
status
),
http2
::
make_nv_l
s
(
"server"
,
NGHTTPD_SERVER
));
http2
::
make_nv_l
l
(
"server"
,
NGHTTPD_SERVER
));
return
nghttp2_submit_response
(
session_
,
stream_id
,
nva
.
data
(),
nva
.
size
(),
data_prd
);
}
...
...
src/http2.h
View file @
34efc6b7
...
...
@@ -109,7 +109,7 @@ nghttp2_nv make_nv(const std::string &name, const std::string &value,
// Create nghttp2_nv from string literal |name| and |value|.
template
<
size_t
N
,
size_t
M
>
nghttp2_nv
make_nv_ll
(
const
char
(
&
name
)[
N
],
const
char
(
&
value
)[
M
])
{
constexpr
nghttp2_nv
make_nv_ll
(
const
char
(
&
name
)[
N
],
const
char
(
&
value
)[
M
])
{
return
{(
uint8_t
*
)
name
,
(
uint8_t
*
)
value
,
N
-
1
,
M
-
1
,
NGHTTP2_NV_FLAG_NONE
};
}
...
...
src/nghttp.cc
View file @
34efc6b7
...
...
@@ -89,7 +89,7 @@ enum {
};
namespace
{
auto
anchors
=
std
::
array
<
Anchor
,
5
>
{{
constexpr
auto
anchors
=
std
::
array
<
Anchor
,
5
>
{{
{
3
,
0
,
201
},
{
5
,
0
,
101
},
{
7
,
0
,
1
},
{
9
,
7
,
1
},
{
11
,
3
,
1
},
}};
}
// namespace
...
...
src/shrpx_config.h
View file @
34efc6b7
...
...
@@ -59,7 +59,7 @@ class CertLookupTree;
}
// namespace ssl
#define SHRPX_UNIX_PATH_PREFIX "unix:"
constexpr
char
SHRPX_UNIX_PATH_PREFIX
[]
=
"unix:"
;
extern
const
char
SHRPX_OPT_PRIVATE_KEY_FILE
[];
extern
const
char
SHRPX_OPT_PRIVATE_KEY_PASSWD_FILE
[];
...
...
src/shrpx_ssl.cc
View file @
34efc6b7
...
...
@@ -298,10 +298,10 @@ int alpn_select_proto_cb(SSL *ssl, const unsigned char **out,
#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L
namespace
{
const
char
*
tls_names
[]
=
{
"TLSv1.2"
,
"TLSv1.1"
,
"TLSv1.0"
};
const
size_t
tls_namelen
=
array_size
(
tls_names
);
const
long
int
tls_masks
[]
=
{
SSL_OP_NO_TLSv1_2
,
SSL_OP_NO_TLSv1_1
,
SSL_OP_NO_TLSv1
};
const
expr
const
char
*
tls_names
[]
=
{
"TLSv1.2"
,
"TLSv1.1"
,
"TLSv1.0"
};
const
expr
size_t
tls_namelen
=
array_size
(
tls_names
);
const
expr
long
int
tls_masks
[]
=
{
SSL_OP_NO_TLSv1_2
,
SSL_OP_NO_TLSv1_1
,
SSL_OP_NO_TLSv1
};
}
// namespace
long
int
create_tls_proto_mask
(
const
std
::
vector
<
char
*>
&
tls_proto_list
)
{
...
...
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