Get or create an ex_data index for SNI callback data
()
| 570 | |
| 571 | // Get or create an ex_data index for SNI callback data |
| 572 | fn get_sni_ex_data_index() -> libc::c_int { |
| 573 | use rustpython_common::lock::LazyLock; |
| 574 | static SNI_EX_DATA_IDX: LazyLock<libc::c_int> = LazyLock::new(|| unsafe { |
| 575 | sys::SSL_get_ex_new_index( |
| 576 | 0, |
| 577 | std::ptr::null_mut(), |
| 578 | None, |
| 579 | None, |
| 580 | Some(sni_callback_data_free), |
| 581 | ) |
| 582 | }); |
| 583 | *SNI_EX_DATA_IDX |
| 584 | } |
| 585 | |
| 586 | // Free function for callback data |
| 587 | // NOTE: We don't free the data here because it's managed manually in do_handshake |
no test coverage detected