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
636ef51b
Commit
636ef51b
authored
Apr 03, 2018
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compile error with -Wunused-function
parent
400934e5
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
22 additions
and
0 deletions
+22
-0
examples/client.c
examples/client.c
+2
-0
examples/libevent-client.c
examples/libevent-client.c
+2
-0
examples/libevent-server.c
examples/libevent-server.c
+2
-0
src/HttpServer.cc
src/HttpServer.cc
+2
-0
src/asio_client_tls_context.cc
src/asio_client_tls_context.cc
+4
-0
src/asio_server_tls_context.cc
src/asio_server_tls_context.cc
+4
-0
src/h2load.cc
src/h2load.cc
+2
-0
src/nghttp.cc
src/nghttp.cc
+2
-0
src/shrpx_tls.cc
src/shrpx_tls.cc
+2
-0
No files found.
examples/client.c
View file @
636ef51b
...
...
@@ -345,6 +345,7 @@ static void setup_nghttp2_callbacks(nghttp2_session_callbacks *callbacks) {
callbacks
,
on_data_chunk_recv_callback
);
}
#ifndef OPENSSL_NO_NEXTPROTONEG
/*
* Callback function for TLS NPN. Since this program only supports
* HTTP/2 protocol, if server does not offer HTTP/2 the nghttp2
...
...
@@ -365,6 +366,7 @@ static int select_next_proto_cb(SSL *ssl, unsigned char **out,
}
return
SSL_TLSEXT_ERR_OK
;
}
#endif
/* !OPENSSL_NO_NEXTPROTONEG */
/*
* Setup SSL/TLS context.
...
...
examples/libevent-client.c
View file @
636ef51b
...
...
@@ -308,6 +308,7 @@ static int on_stream_close_callback(nghttp2_session *session, int32_t stream_id,
return
0
;
}
#ifndef OPENSSL_NO_NEXTPROTONEG
/* NPN TLS extension client callback. We check that server advertised
the HTTP/2 protocol the nghttp2 library supports. If not, exit
the program. */
...
...
@@ -322,6 +323,7 @@ static int select_next_proto_cb(SSL *ssl, unsigned char **out,
}
return
SSL_TLSEXT_ERR_OK
;
}
#endif
/* !OPENSSL_NO_NEXTPROTONEG */
/* Create SSL_CTX. */
static
SSL_CTX
*
create_ssl_ctx
(
void
)
{
...
...
examples/libevent-server.c
View file @
636ef51b
...
...
@@ -109,6 +109,7 @@ struct app_context {
static
unsigned
char
next_proto_list
[
256
];
static
size_t
next_proto_list_len
;
#ifndef OPENSSL_NO_NEXTPROTONEG
static
int
next_proto_cb
(
SSL
*
ssl
,
const
unsigned
char
**
data
,
unsigned
int
*
len
,
void
*
arg
)
{
(
void
)
ssl
;
...
...
@@ -118,6 +119,7 @@ static int next_proto_cb(SSL *ssl, const unsigned char **data,
*
len
=
(
unsigned
int
)
next_proto_list_len
;
return
SSL_TLSEXT_ERR_OK
;
}
#endif
/* !OPENSSL_NO_NEXTPROTONEG */
#if OPENSSL_VERSION_NUMBER >= 0x10002000L
static
int
alpn_select_proto_cb
(
SSL
*
ssl
,
const
unsigned
char
**
out
,
...
...
src/HttpServer.cc
View file @
636ef51b
...
...
@@ -1984,6 +1984,7 @@ HttpServer::HttpServer(const Config *config) : config_(config) {
};
}
#ifndef OPENSSL_NO_NEXTPROTONEG
namespace
{
int
next_proto_cb
(
SSL
*
s
,
const
unsigned
char
**
data
,
unsigned
int
*
len
,
void
*
arg
)
{
...
...
@@ -1993,6 +1994,7 @@ int next_proto_cb(SSL *s, const unsigned char **data, unsigned int *len,
return
SSL_TLSEXT_ERR_OK
;
}
}
// namespace
#endif // !OPENSSL_NO_NEXTPROTONEG
namespace
{
int
verify_callback
(
int
preverify_ok
,
X509_STORE_CTX
*
ctx
)
{
...
...
src/asio_client_tls_context.cc
View file @
636ef51b
...
...
@@ -35,6 +35,7 @@ namespace nghttp2 {
namespace
asio_http2
{
namespace
client
{
#ifndef OPENSSL_NO_NEXTPROTONEG
namespace
{
int
client_select_next_proto_cb
(
SSL
*
ssl
,
unsigned
char
**
out
,
unsigned
char
*
outlen
,
const
unsigned
char
*
in
,
...
...
@@ -46,6 +47,7 @@ int client_select_next_proto_cb(SSL *ssl, unsigned char **out,
return
SSL_TLSEXT_ERR_OK
;
}
}
// namespace
#endif // !OPENSSL_NO_NEXTPROTONEG
boost
::
system
::
error_code
configure_tls_context
(
boost
::
system
::
error_code
&
ec
,
...
...
@@ -54,7 +56,9 @@ configure_tls_context(boost::system::error_code &ec,
auto
ctx
=
tls_ctx
.
native_handle
();
#ifndef OPENSSL_NO_NEXTPROTONEG
SSL_CTX_set_next_proto_select_cb
(
ctx
,
client_select_next_proto_cb
,
nullptr
);
#endif // !OPENSSL_NO_NEXTPROTONEG
#if OPENSSL_VERSION_NUMBER >= 0x10002000L
auto
proto_list
=
util
::
get_default_alpn
();
...
...
src/asio_server_tls_context.cc
View file @
636ef51b
...
...
@@ -35,12 +35,14 @@ namespace nghttp2 {
namespace
asio_http2
{
namespace
server
{
#ifndef OPENSSL_NO_NEXTPROTONEG
namespace
{
std
::
vector
<
unsigned
char
>
&
get_alpn_token
()
{
static
auto
alpn_token
=
util
::
get_default_alpn
();
return
alpn_token
;
}
}
// namespace
#endif // !OPENSSL_NO_NEXTPROTONEG
#if OPENSSL_VERSION_NUMBER >= 0x10002000L
namespace
{
...
...
@@ -82,6 +84,7 @@ configure_tls_context_easy(boost::system::error_code &ec,
}
#endif
/* OPENSSL_NO_EC */
#ifndef OPENSSL_NO_NEXTPROTONEG
SSL_CTX_set_next_protos_advertised_cb
(
ctx
,
[](
SSL
*
s
,
const
unsigned
char
**
data
,
unsigned
int
*
len
,
void
*
arg
)
{
...
...
@@ -93,6 +96,7 @@ configure_tls_context_easy(boost::system::error_code &ec,
return
SSL_TLSEXT_ERR_OK
;
},
nullptr
);
#endif // !OPENSSL_NO_NEXTPROTONEG
#if OPENSSL_VERSION_NUMBER >= 0x10002000L
// ALPN selection callback
...
...
src/h2load.cc
View file @
636ef51b
...
...
@@ -1565,6 +1565,7 @@ std::string get_reqline(const char *uri, const http_parser_url &u) {
}
}
// namespace
#ifndef OPENSSL_NO_NEXTPROTONEG
namespace
{
int
client_select_next_proto_cb
(
SSL
*
ssl
,
unsigned
char
**
out
,
unsigned
char
*
outlen
,
const
unsigned
char
*
in
,
...
...
@@ -1579,6 +1580,7 @@ int client_select_next_proto_cb(SSL *ssl, unsigned char **out,
return
SSL_TLSEXT_ERR_NOACK
;
}
}
// namespace
#endif // !OPENSSL_NO_NEXTPROTONEG
namespace
{
constexpr
char
UNIX_PATH_PREFIX
[]
=
"unix:"
;
...
...
src/nghttp.cc
View file @
636ef51b
...
...
@@ -2222,6 +2222,7 @@ id responseEnd requestStart process code size request path)"
}
}
// namespace
#ifndef OPENSSL_NO_NEXTPROTONEG
namespace
{
int
client_select_next_proto_cb
(
SSL
*
ssl
,
unsigned
char
**
out
,
unsigned
char
*
outlen
,
const
unsigned
char
*
in
,
...
...
@@ -2245,6 +2246,7 @@ int client_select_next_proto_cb(SSL *ssl, unsigned char **out,
return
SSL_TLSEXT_ERR_OK
;
}
}
// namespace
#endif // !OPENSSL_NO_NEXTPROTONEG
namespace
{
int
communicate
(
...
...
src/shrpx_tls.cc
View file @
636ef51b
...
...
@@ -80,6 +80,7 @@ const unsigned char *ASN1_STRING_get0_data(ASN1_STRING *x) {
}
// namespace
#endif // !OPENSSL_1_1_API
#ifndef OPENSSL_NO_NEXTPROTONEG
namespace
{
int
next_proto_cb
(
SSL
*
s
,
const
unsigned
char
**
data
,
unsigned
int
*
len
,
void
*
arg
)
{
...
...
@@ -89,6 +90,7 @@ int next_proto_cb(SSL *s, const unsigned char **data, unsigned int *len,
return
SSL_TLSEXT_ERR_OK
;
}
}
// namespace
#endif // !OPENSSL_NO_NEXTPROTONEG
namespace
{
int
verify_callback
(
int
preverify_ok
,
X509_STORE_CTX
*
ctx
)
{
...
...
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