这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all 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
24 changes: 1 addition & 23 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1028,10 +1028,7 @@ unsafe extern "C" fn ngx_http_vts_init(cf: *mut ngx_conf_t) -> ngx_int_t {
return NGX_ERROR as ngx_int_t;
}

// Register LOG_PHASE handler for real-time statistics collection
if register_log_phase_handler(cf).is_err() {
return NGX_ERROR as ngx_int_t;
}
// LOG_PHASE handler registration is handled externally if needed

NGX_OK as ngx_int_t
}
Expand Down Expand Up @@ -1087,25 +1084,6 @@ unsafe fn initialize_upstream_zones_from_config(_cf: *mut ngx_conf_t) -> Result<
Ok(())
}

/// Register LOG_PHASE handler for real-time request statistics collection
///
/// NOTE: Due to nginx-rust FFI limitations, this function exports the necessary
/// hooks for external integration. The actual LOG_PHASE registration should be
/// done by a companion C module that calls vts_track_upstream_request().
unsafe fn register_log_phase_handler(_cf: *mut ngx_conf_t) -> Result<(), &'static str> {
// For now, we rely on external C code to register the LOG_PHASE handler
// The external handler should call vts_track_upstream_request() for each upstream request
//
// Future implementations can use direct nginx FFI once compatibility issues are resolved
//
// Alternative approaches:
// 1. nginx logging module extension that calls our C API
// 2. Custom nginx module that wraps our Rust functionality
// 3. Direct FFI integration when nginx-rust supports it

Ok(())
}

/// Module context configuration
#[no_mangle]
static NGX_HTTP_VTS_MODULE_CTX: ngx_http_module_t = ngx_http_module_t {
Expand Down