aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/tls_session_manager.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2011-12-31 02:15:18 +0000
committerlloyd <[email protected]>2011-12-31 02:15:18 +0000
commit074ea8fdee34a668c57b19b474468a7e4d581567 (patch)
tree56a6c62787c51ac2d5aa64316d91c2f20010c8a9 /src/tls/tls_session_manager.cpp
parentbf41971fe4ee6a38609e0ea142010b03017e0329 (diff)
Add support for client-side session resumption
Diffstat (limited to 'src/tls/tls_session_manager.cpp')
-rw-r--r--src/tls/tls_session_manager.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/tls/tls_session_manager.cpp b/src/tls/tls_session_manager.cpp
index 7503b7c28..4a0126fc0 100644
--- a/src/tls/tls_session_manager.cpp
+++ b/src/tls/tls_session_manager.cpp
@@ -9,6 +9,8 @@
#include <botan/hex.h>
#include <botan/time.h>
+#include <stdio.h>
+
namespace Botan {
bool TLS_Session_Manager_In_Memory::load_from_session_str(
@@ -21,7 +23,7 @@ bool TLS_Session_Manager_In_Memory::load_from_session_str(
// session has expired, remove it
const u64bit now = system_time();
- if(i->second.start_time() + session_lifetime >= now)
+ if(i->second.start_time() + session_lifetime < now)
{
sessions.erase(i);
return false;
@@ -32,7 +34,7 @@ bool TLS_Session_Manager_In_Memory::load_from_session_str(
}
bool TLS_Session_Manager_In_Memory::load_from_session_id(
- const MemoryVector<byte>& session_id, TLS_Session& session)
+ const MemoryRegion<byte>& session_id, TLS_Session& session)
{
return load_from_session_str(hex_encode(session_id), session);
}
@@ -60,7 +62,7 @@ bool TLS_Session_Manager_In_Memory::load_from_host_info(
}
void TLS_Session_Manager_In_Memory::remove_entry(
- const MemoryVector<byte>& session_id)
+ const MemoryRegion<byte>& session_id)
{
std::map<std::string, TLS_Session>::iterator i =
sessions.find(hex_encode(session_id));