Fix compilation for older OpenSSL versions.

For instance OpenSSL 0.9.7 does not have SSL_set_tlsext_host_name.

Also add the missing EVENT__DISABLE_SAMPLES CMake option.
This commit is contained in:
Joakim Soderberg 2014-09-24 13:46:09 +02:00
parent 89c1a3b7fe
commit 5c7282f7a5
2 changed files with 3 additions and 0 deletions

View File

@ -48,6 +48,7 @@ option(EVENT__DISABLE_OPENSSL "Define if libevent should build without support f
option(EVENT__DISABLE_BENCHMARK "Defines if libevent should build without the benchmark exectuables" OFF)
option(EVENT__DISABLE_TESTS "If tests should be compiled or not" OFF)
option(EVENT__DISABLE_REGRESS "Disable the regress tests" OFF)
option(EVENT__DISABLE_SAMPLES "Disable sample files" OFF)
option(EVENT__FORCE_KQUEUE_CHECK "When crosscompiling forces running a test program that verifies that Kqueue works with pipes. Note that this requires you to manually run the test program on the the cross compilation target to verify that it works. See cmake documentation for try_run for more details" OFF)
option(EVENT__COVERAGE "Enable running gcov to get a test coverage report (only works with GCC/CLang). Make sure to enable -DCMAKE_BUILD_TYPE=Debug as well." OFF)
# TODO: Add --disable-largefile omit support for large files

View File

@ -346,8 +346,10 @@ main(int argc, char **argv)
die_openssl("SSL_new()");
}
#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
// Set hostname for SNI extension
SSL_set_tlsext_host_name(ssl, host);
#endif
if (strcasecmp(scheme, "http") == 0) {
bev = bufferevent_socket_new(base, -1, BEV_OPT_CLOSE_ON_FREE);