MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_ssl_ptr_for_context_change

Function get_ssl_ptr_for_context_change

crates/stdlib/src/openssl.rs:562–569  ·  view source on GitHub ↗

Get SSL pointer - either from thread-local (during handshake) or from connection

(connection: &PyRwLock<SslConnection>)

Source from the content-addressed store, hash-verified

560
561 // Get SSL pointer - either from thread-local (during handshake) or from connection
562 fn get_ssl_ptr_for_context_change(connection: &PyRwLock<SslConnection>) -> *mut sys::SSL {
563 // First check if we're in a handshake callback (lock already held)
564 if let Some(ptr) = HANDSHAKE_SSL_PTR.with(|cell| cell.get()) {
565 return ptr;
566 }
567 // Otherwise, acquire the lock normally
568 connection.read().ssl().as_ptr()
569 }
570
571 // Get or create an ex_data index for SNI callback data
572 fn get_sni_ex_data_index() -> libc::c_int {

Callers 7

set_contextMethod · 0.85
versionMethod · 0.85
cipherMethod · 0.85
shared_ciphersMethod · 0.85
compressionMethod · 0.85
session_reusedMethod · 0.85

Calls 5

withMethod · 0.80
sslMethod · 0.80
getMethod · 0.45
as_ptrMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected