Skip to content

Commit b60be2c

Browse files
committed
fix: correct type for ngx::core::NGX_CONF_ERROR
1 parent 1e868ef commit b60be2c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

examples/awssig.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ extern "C" fn ngx_http_awssigv4_commands_set_s3_bucket(
230230
conf.s3_bucket = (*args.add(1)).to_string();
231231
if conf.s3_bucket.len() == 1 {
232232
println!("Validation failed");
233-
return ngx::core::NGX_CONF_ERROR as _;
233+
return ngx::core::NGX_CONF_ERROR;
234234
}
235235
};
236236
std::ptr::null_mut()

src/core/status.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
use core::ffi::c_char;
12
use core::fmt;
3+
use core::ptr;
24

35
use crate::ffi::*;
46

@@ -62,6 +64,7 @@ ngx_codes! {
6264
(NGX_ABORT);
6365
}
6466

65-
/// NGX_CONF_ERROR - An error occurred while parsing and validating configuration.
66-
pub const NGX_CONF_ERROR: *const () = -1isize as *const ();
67-
// pub const CONF_OK: Status = Status(NGX_CONF_OK as ngx_int_t);
67+
/// An error occurred while parsing and validating configuration.
68+
pub const NGX_CONF_ERROR: *mut c_char = ptr::null_mut::<c_char>().wrapping_offset(-1);
69+
/// Configuration handler succeeded.
70+
pub const NGX_CONF_OK: *mut c_char = ptr::null_mut();

0 commit comments

Comments
 (0)