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
b624ca6d
Commit
b624ca6d
authored
Feb 11, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Rename client TLS session cache field
parent
ba4c2681
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
src/shrpx_http_downstream_connection.cc
src/shrpx_http_downstream_connection.cc
+3
-3
src/shrpx_worker.cc
src/shrpx_worker.cc
+8
-8
src/shrpx_worker.h
src/shrpx_worker.h
+4
-4
No files found.
src/shrpx_http_downstream_connection.cc
View file @
b624ca6d
...
...
@@ -133,8 +133,8 @@ HttpDownstreamConnection::~HttpDownstreamConnection() {
if
(
conn_
.
tls
.
ssl
)
{
auto
session
=
SSL_get0_session
(
conn_
.
tls
.
ssl
);
if
(
session
)
{
worker_
->
cache_
downstream
_tls_session
(
&
addr_
->
addr
,
session
,
ev_now
(
conn_
.
loop
));
worker_
->
cache_
client
_tls_session
(
&
addr_
->
addr
,
session
,
ev_now
(
conn_
.
loop
));
}
}
}
...
...
@@ -219,7 +219,7 @@ int HttpDownstreamConnection::attach_downstream(Downstream *downstream) {
SSL_set_tlsext_host_name
(
conn_
.
tls
.
ssl
,
sni_name
.
c_str
());
}
auto
session
=
worker_
->
reuse_
downstream
_tls_session
(
&
addr_
->
addr
);
auto
session
=
worker_
->
reuse_
client
_tls_session
(
&
addr_
->
addr
);
if
(
session
)
{
SSL_set_session
(
conn_
.
tls
.
ssl
,
session
);
SSL_SESSION_free
(
session
);
...
...
src/shrpx_worker.cc
View file @
b624ca6d
...
...
@@ -312,17 +312,17 @@ std::vector<uint8_t> serialize_ssl_session(SSL_SESSION *session) {
}
}
// namespace
void
Worker
::
cache_
downstream_tls_session
(
const
Address
*
addr
,
SSL_SESSION
*
session
,
ev_tstamp
t
)
{
auto
it
=
downstream
_tls_session_cache_
.
find
(
addr
);
if
(
it
==
std
::
end
(
downstream
_tls_session_cache_
))
{
void
Worker
::
cache_
client_tls_session
(
const
Address
*
addr
,
SSL_SESSION
*
session
,
ev_tstamp
t
)
{
auto
it
=
client
_tls_session_cache_
.
find
(
addr
);
if
(
it
==
std
::
end
(
client
_tls_session_cache_
))
{
if
(
LOG_ENABLED
(
INFO
))
{
LOG
(
INFO
)
<<
"Create cache entry for SSL_SESSION="
<<
session
<<
", addr="
<<
util
::
numeric_hostport
(
&
addr
->
su
.
sa
,
addr
->
len
)
<<
"("
<<
addr
<<
"), timestamp="
<<
std
::
fixed
<<
std
::
setprecision
(
6
)
<<
t
;
}
downstream
_tls_session_cache_
.
emplace
(
client
_tls_session_cache_
.
emplace
(
addr
,
SessionCacheEntry
{
serialize_ssl_session
(
session
),
t
});
return
;
}
...
...
@@ -348,9 +348,9 @@ void Worker::cache_downstream_tls_session(const Address *addr,
ent
.
last_updated
=
t
;
}
SSL_SESSION
*
Worker
::
reuse_
downstream
_tls_session
(
const
Address
*
addr
)
{
auto
it
=
downstream
_tls_session_cache_
.
find
(
addr
);
if
(
it
==
std
::
end
(
downstream
_tls_session_cache_
))
{
SSL_SESSION
*
Worker
::
reuse_
client
_tls_session
(
const
Address
*
addr
)
{
auto
it
=
client
_tls_session_cache_
.
find
(
addr
);
if
(
it
==
std
::
end
(
client
_tls_session_cache_
))
{
return
nullptr
;
}
...
...
src/shrpx_worker.h
View file @
b624ca6d
...
...
@@ -157,11 +157,11 @@ public:
// |session| is serialized into ASN1 representation, and stored.
// |t| is used as a time stamp. Depending on the existing cache's
// time stamp, |session| might not be cached.
void
cache_
downstream
_tls_session
(
const
Address
*
addr
,
SSL_SESSION
*
session
,
ev_tstamp
t
);
void
cache_
client
_tls_session
(
const
Address
*
addr
,
SSL_SESSION
*
session
,
ev_tstamp
t
);
// Returns cached session associated |addr|. If no cache entry is
// found associated to |addr|, nullptr will be returned.
SSL_SESSION
*
reuse_
downstream
_tls_session
(
const
Address
*
addr
);
SSL_SESSION
*
reuse_
client
_tls_session
(
const
Address
*
addr
);
private:
#ifndef NOTHREADS
...
...
@@ -180,7 +180,7 @@ private:
// Client side SSL_SESSION cache. SSL_SESSION is associated to
// remote address.
std
::
unordered_map
<
const
Address
*
,
SessionCacheEntry
>
downstream
_tls_session_cache_
;
client
_tls_session_cache_
;
std
::
unique_ptr
<
MemcachedDispatcher
>
session_cache_memcached_dispatcher_
;
#ifdef HAVE_MRUBY
...
...
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