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

Method session

crates/stdlib/src/openssl.rs:3092–3106  ·  view source on GitHub ↗
(&self, _vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

3090
3091 #[pygetset]
3092 fn session(&self, _vm: &VirtualMachine) -> PyResult<Option<PySslSession>> {
3093 let stream = self.connection.read();
3094 unsafe {
3095 // Use SSL_get1_session which returns an owned reference (ref count already incremented)
3096 let session_ptr = SSL_get1_session(stream.ssl().as_ptr());
3097 if session_ptr.is_null() {
3098 Ok(None)
3099 } else {
3100 Ok(Some(PySslSession {
3101 session: session_ptr,
3102 ctx: self.ctx.read().clone(),
3103 }))
3104 }
3105 }
3106 }
3107
3108 #[pygetset(setter)]
3109 fn set_session(&self, value: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {

Callers

nothing calls this directly

Calls 5

sslMethod · 0.80
SomeClass · 0.50
readMethod · 0.45
as_ptrMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected