Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,21 @@ fn add_ldap_status_section(ctx: &InfoContext, _for_crash_report: bool) -> Valkey

Ok(())
}

/// C-callable entry point that runs this crate's collected INFO section
/// handlers against a host-provided info context.
///
/// Redis permits only a single module info callback. When this crate is
/// embedded into a host C module, the host owns that callback so it can also
/// report its own metrics; the dispatcher registered by the generated
/// `RedisModule_OnLoad` (renamed to `LDAP_OnLoad`) is therefore overwritten.
/// The host invokes this shim from its own callback so the LDAP INFO sections
/// are still emitted.
#[cfg(feature = "embed")]
#[unsafe(no_mangle)]
pub extern "C" fn LDAP_AddInfo(
ctx: *mut valkey_module::raw::RedisModuleInfoCtx,
Comment thread
dudizimber marked this conversation as resolved.
Outdated
for_crash_report: std::os::raw::c_int,
) {
valkey_module::basic_info_command_handler(&InfoContext::new(ctx), for_crash_report == 1);
Comment thread
dudizimber marked this conversation as resolved.
Outdated
}
Loading