Merge pull request #962 from sfackler/static-str

SslSessionRef methods return static strings
This commit is contained in:
Steven Fackler 2018-07-19 21:26:12 -07:00 committed by GitHub
commit 0725cbb165
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -1265,7 +1265,10 @@ impl SslContextBuilder {
} }
} }
#[deprecated(since = "0.10.10", note = "renamed to `set_psk_client_callback`")] #[deprecated(
since = "0.10.10",
note = "renamed to `set_psk_client_callback`"
)]
#[cfg(not(osslconf = "OPENSSL_NO_PSK"))] #[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
pub fn set_psk_callback<F>(&mut self, callback: F) pub fn set_psk_callback<F>(&mut self, callback: F)
where where
@ -1792,7 +1795,7 @@ impl SslCipherRef {
/// This corresponds to [`SSL_CIPHER_get_name`]. /// This corresponds to [`SSL_CIPHER_get_name`].
/// ///
/// [`SSL_CIPHER_get_name`]: https://www.openssl.org/docs/manmaster/man3/SSL_CIPHER_get_name.html /// [`SSL_CIPHER_get_name`]: https://www.openssl.org/docs/manmaster/man3/SSL_CIPHER_get_name.html
pub fn name(&self) -> &str { pub fn name(&self) -> &'static str {
let name = unsafe { let name = unsafe {
let ptr = ffi::SSL_CIPHER_get_name(self.as_ptr()); let ptr = ffi::SSL_CIPHER_get_name(self.as_ptr());
CStr::from_ptr(ptr as *const _) CStr::from_ptr(ptr as *const _)
@ -1806,7 +1809,7 @@ impl SslCipherRef {
/// This corresponds to [`SSL_CIPHER_get_version`]. /// This corresponds to [`SSL_CIPHER_get_version`].
/// ///
/// [`SSL_CIPHER_get_version`]: https://www.openssl.org/docs/manmaster/man3/SSL_CIPHER_get_name.html /// [`SSL_CIPHER_get_version`]: https://www.openssl.org/docs/manmaster/man3/SSL_CIPHER_get_name.html
pub fn version(&self) -> &str { pub fn version(&self) -> &'static str {
let version = unsafe { let version = unsafe {
let ptr = ffi::SSL_CIPHER_get_version(self.as_ptr()); let ptr = ffi::SSL_CIPHER_get_version(self.as_ptr());
CStr::from_ptr(ptr as *const _) CStr::from_ptr(ptr as *const _)