File tree Expand file tree Collapse file tree 1 file changed +2
-21
lines changed
Expand file tree Collapse file tree 1 file changed +2
-21
lines changed Original file line number Diff line number Diff line change @@ -2749,32 +2749,13 @@ impl Ssl {
27492749 }
27502750 }
27512751
2752- /// Creates a new `Ssl`.
2753- ///
2754- // FIXME should take &SslContextRef
2755- #[ corresponds( SSL_new ) ]
2756- pub fn new ( ctx : & SslContext ) -> Result < Ssl , ErrorStack > {
2757- unsafe {
2758- let ptr = cvt_p ( ffi:: SSL_new ( ctx. as_ptr ( ) ) ) ?;
2759- let mut ssl = Ssl :: from_ptr ( ptr) ;
2760- ssl. set_ex_data ( * SESSION_CTX_INDEX , ctx. clone ( ) ) ;
2761-
2762- Ok ( ssl)
2763- }
2764- }
2765-
27662752 /// Creates a new [`Ssl`].
2767- ///
2768- /// This function does the same as [`Self:new`] except that it takes &[SslContextRef].
2769- // Both functions exist for backward compatibility (no breaking API).
27702753 #[ corresponds( SSL_new ) ]
2771- pub fn new_from_ref ( ctx : & SslContextRef ) -> Result < Ssl , ErrorStack > {
2754+ pub fn new ( ctx : & SslContextRef ) -> Result < Ssl , ErrorStack > {
27722755 unsafe {
27732756 let ptr = cvt_p ( ffi:: SSL_new ( ctx. as_ptr ( ) ) ) ?;
27742757 let mut ssl = Ssl :: from_ptr ( ptr) ;
2775- SSL_CTX_up_ref ( ctx. as_ptr ( ) ) ;
2776- let ctx_owned = SslContext :: from_ptr ( ctx. as_ptr ( ) ) ;
2777- ssl. set_ex_data ( * SESSION_CTX_INDEX , ctx_owned) ;
2758+ ssl. set_ex_data ( * SESSION_CTX_INDEX , ctx. to_owned ( ) ) ;
27782759
27792760 Ok ( ssl)
27802761 }
You can’t perform that action at this time.
0 commit comments