Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
298db23e
Commit
298db23e
authored
May 26, 2017
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Conditionally support OpenSSL back to 1.0.2.
parent
d624d56e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
3 deletions
+27
-3
tls.c++
c++/src/kj/compat/tls.c++
+27
-3
No files found.
c++/src/kj/compat/tls.c++
View file @
298db23e
...
...
@@ -34,6 +34,12 @@
#include <kj/debug.h>
#include <kj/vector.h>
#if OPENSSL_VERSION_NUMBER < 0x10100000L
#define BIO_set_init(x,v) (x->init=v)
#define BIO_get_data(x) (x->ptr)
#define BIO_set_data(x,v) (x->ptr=v)
#endif
namespace
kj
{
namespace
{
...
...
@@ -333,11 +339,28 @@ private:
return
1
;
}
static
BIO_METHOD
*
getBioVtable
()
{
static
BIO_METHOD
*
vtable
=
makeBioVtable
();
#if OPENSSL_VERSION_NUMBER < 0x10100000L
static
const
BIO_METHOD
*
getBioVtable
()
{
static
const
BIO_METHOD
VTABLE
{
BIO_TYPE_SOURCE_SINK
,
"KJ stream"
,
TlsConnection
::
bioWrite
,
TlsConnection
::
bioRead
,
nullptr
,
// puts
nullptr
,
// gets
TlsConnection
::
bioCtrl
,
TlsConnection
::
bioCreate
,
TlsConnection
::
bioDestroy
,
nullptr
};
return
&
VTABLE
;
}
#else
static
const
BIO_METHOD
*
getBioVtable
()
{
static
const
BIO_METHOD
*
const
vtable
=
makeBioVtable
();
return
vtable
;
}
static
BIO_METHOD
*
makeBioVtable
()
{
static
const
BIO_METHOD
*
makeBioVtable
()
{
BIO_METHOD
*
vtable
=
BIO_meth_new
(
BIO_TYPE_SOURCE_SINK
,
"KJ stream"
);
BIO_meth_set_write
(
vtable
,
TlsConnection
::
bioWrite
);
BIO_meth_set_read
(
vtable
,
TlsConnection
::
bioRead
);
...
...
@@ -346,6 +369,7 @@ private:
BIO_meth_set_destroy
(
vtable
,
TlsConnection
::
bioDestroy
);
return
vtable
;
}
#endif
};
// =======================================================================================
...
...
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