aboutsummaryrefslogtreecommitdiff
path: root/openssl/src/ssl
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2016-10-14 23:09:11 -0700
committerGitHub <[email protected]>2016-10-14 23:09:11 -0700
commit64b8e5e55398b2411ee7ad7fc715b6db37adfba1 (patch)
tree26c6af539a68c5651cebcb669b52808fea654154 /openssl/src/ssl
parentCheck feature compatibility in build script (diff)
parentHandle OPENSSL_NO_COMP (diff)
downloadrust-openssl-64b8e5e55398b2411ee7ad7fc715b6db37adfba1.tar.xz
rust-openssl-64b8e5e55398b2411ee7ad7fc715b6db37adfba1.zip
Merge pull request #471 from sfackler/no-comp
Handle OPENSSL_NO_COMP
Diffstat (limited to 'openssl/src/ssl')
-rw-r--r--openssl/src/ssl/mod.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs
index b042d81e..076ac400 100644
--- a/openssl/src/ssl/mod.rs
+++ b/openssl/src/ssl/mod.rs
@@ -952,6 +952,11 @@ impl<'a> SslRef<'a> {
/// The result will be either None, indicating no compression is in use, or
/// a string with the compression name.
pub fn compression(&self) -> Option<String> {
+ self._compression()
+ }
+
+ #[cfg(not(osslconf = "OPENSSL_NO_COMP"))]
+ fn _compression(&self) -> Option<String> {
let ptr = unsafe { ffi::SSL_get_current_compression(self.as_ptr()) };
if ptr == ptr::null() {
return None;
@@ -965,6 +970,11 @@ impl<'a> SslRef<'a> {
Some(s)
}
+ #[cfg(osslconf = "OPENSSL_NO_COMP")]
+ fn _compression(&self) -> Option<String> {
+ None
+ }
+
/// Returns the server's name for the current connection
pub fn servername(&self) -> Option<String> {
let name = unsafe { ffi::SSL_get_servername(self.as_ptr(), ffi::TLSEXT_NAMETYPE_host_name) };