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
6c999e6f
Commit
6c999e6f
authored
Apr 28, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Enable TLS session cache again in memcached connection
parent
4aa4fe56
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
src/shrpx_memcached_connection.cc
src/shrpx_memcached_connection.cc
+15
-1
src/shrpx_memcached_connection.h
src/shrpx_memcached_connection.h
+2
-1
No files found.
src/shrpx_memcached_connection.cc
View file @
6c999e6f
...
...
@@ -141,7 +141,7 @@ void MemcachedConnection::disconnect() {
int
MemcachedConnection
::
initiate_connection
()
{
assert
(
conn_
.
fd
==
-
1
);
if
(
ssl_ctx_
&&
!
conn_
.
tls
.
ssl
)
{
if
(
ssl_ctx_
)
{
auto
ssl
=
ssl
::
create_ssl
(
ssl_ctx_
);
if
(
!
ssl
)
{
return
-
1
;
...
...
@@ -175,6 +175,12 @@ int MemcachedConnection::initiate_connection() {
SSL_set_tlsext_host_name
(
conn_
.
tls
.
ssl
,
sni_name_
.
c_str
());
}
auto
session
=
ssl
::
reuse_tls_session
(
tls_session_cache_
);
if
(
session
)
{
SSL_set_session
(
conn_
.
tls
.
ssl
,
session
);
SSL_SESSION_free
(
session
);
}
conn_
.
prepare_client_handshake
();
}
...
...
@@ -256,6 +262,14 @@ int MemcachedConnection::tls_handshake() {
return
-
1
;
}
if
(
!
SSL_session_reused
(
conn_
.
tls
.
ssl
))
{
auto
tls_session
=
SSL_get0_session
(
conn_
.
tls
.
ssl
);
if
(
tls_session
)
{
ssl
::
try_cache_tls_session
(
tls_session_cache_
,
*
addr_
,
tls_session
,
ev_now
(
conn_
.
loop
));
}
}
do_read_
=
&
MemcachedConnection
::
read_tls
;
do_write_
=
&
MemcachedConnection
::
write_tls
;
...
...
src/shrpx_memcached_connection.h
View file @
6c999e6f
...
...
@@ -33,8 +33,8 @@
#include <ev.h>
#include "shrpx_connection.h"
#include "shrpx_ssl.h"
#include "buffer.h"
#include "network.h"
using
namespace
nghttp2
;
...
...
@@ -133,6 +133,7 @@ private:
std
::
deque
<
MemcachedSendbuf
>
sendbufv_
;
std
::
function
<
int
(
MemcachedConnection
&
)
>
do_read_
,
do_write_
;
std
::
string
sni_name_
;
ssl
::
TLSSessionCache
tls_session_cache_
;
MemcachedParseState
parse_state_
;
const
Address
*
addr_
;
SSL_CTX
*
ssl_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