diff options
| author | Steven Fackler <[email protected]> | 2016-10-23 20:55:31 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2016-10-23 20:55:31 -0700 |
| commit | ca71e008789027893654029fcc57346393e9d324 (patch) | |
| tree | 86d4181c07b46d22d8a670df5bfca48d66772922 /openssl/src/ssl/mod.rs | |
| parent | Merge pull request #487 from sfackler/update (diff) | |
| download | rust-openssl-ca71e008789027893654029fcc57346393e9d324.tar.xz rust-openssl-ca71e008789027893654029fcc57346393e9d324.zip | |
Fix Send + Sync-ness of SslStream
Diffstat (limited to 'openssl/src/ssl/mod.rs')
| -rw-r--r-- | openssl/src/ssl/mod.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index 6e5a2c09..92e0c159 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -13,7 +13,7 @@ use std::ops::{Deref, DerefMut}; use std::path::Path; use std::ptr; use std::str; -use std::sync::{Mutex, Arc}; +use std::sync::Mutex; use libc::{c_uchar, c_uint}; use std::slice; use std::marker::PhantomData; @@ -1023,6 +1023,9 @@ impl SslRef { pub struct Ssl(*mut ffi::SSL); +unsafe impl Sync for Ssl {} +unsafe impl Send for Ssl {} + impl fmt::Debug for Ssl { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { let mut builder = fmt.debug_struct("Ssl"); @@ -1128,12 +1131,10 @@ impl Ssl { /// A stream wrapper which handles SSL encryption for an underlying stream. pub struct SslStream<S> { ssl: Ssl, - _method: Arc<BioMethod>, // NOTE: this *must* be after the Ssl field so things drop right + _method: BioMethod, // NOTE: this *must* be after the Ssl field so things drop right _p: PhantomData<S>, } -unsafe impl<S: Send> Send for SslStream<S> {} - impl<S> fmt::Debug for SslStream<S> where S: fmt::Debug { |