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
cd69ed20
Commit
cd69ed20
authored
Apr 26, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Select SPDY protocol in ALPN
parent
a8a2236d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
4 deletions
+30
-4
src/shrpx_ssl.cc
src/shrpx_ssl.cc
+30
-4
No files found.
src/shrpx_ssl.cc
View file @
cd69ed20
...
...
@@ -41,6 +41,10 @@
#include <nghttp2/nghttp2.h>
#ifdef HAVE_SPDYLAY
#include <spdylay/spdylay.h>
#endif // HAVE_SPDYLAY
#include "shrpx_log.h"
#include "shrpx_client_handler.h"
#include "shrpx_config.h"
...
...
@@ -158,11 +162,33 @@ int alpn_select_proto_cb(SSL* ssl,
const
unsigned
char
*
in
,
unsigned
int
inlen
,
void
*
arg
)
{
if
(
nghttp2_select_next_protocol
(
const_cast
<
unsigned
char
**>
(
out
),
outlen
,
in
,
inlen
)
==
-
1
)
{
return
SSL_TLSEXT_ERR_NOACK
;
int
rv
;
rv
=
nghttp2_select_next_protocol
(
const_cast
<
unsigned
char
**>
(
out
),
outlen
,
in
,
inlen
);
if
(
rv
==
1
)
{
// HTTP/2 was selected
return
SSL_TLSEXT_ERR_OK
;
}
return
SSL_TLSEXT_ERR_OK
;
#ifdef HAVE_SPDYLAY
rv
=
spdylay_select_next_protocol
(
const_cast
<
unsigned
char
**>
(
out
),
outlen
,
in
,
inlen
);
if
(
rv
>
0
)
{
// SPDY was selected
return
SSL_TLSEXT_ERR_OK
;
}
#endif // HAVE_SPDYLAY
if
(
rv
==
-
1
)
{
// No selection was made
return
SSL_TLSEXT_ERR_OK
;
}
// We selected http/1.1
return
SSL_TLSEXT_ERR_NOACK
;
}
}
// namespace
#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L
...
...
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