1- use std:: ffi:: { c_char, c_void} ;
21use std:: ptr:: addr_of;
32
43use http:: HeaderMap ;
54use ngx:: core;
6- use ngx:: ffi:: {
7- nginx_version, ngx_array_push, ngx_command_t, ngx_conf_t, ngx_http_core_module, ngx_http_handler_pt,
8- ngx_http_module_t, ngx_http_phases_NGX_HTTP_PRECONTENT_PHASE, ngx_int_t, ngx_module_t, ngx_str_t, ngx_uint_t,
9- NGX_CONF_TAKE1 , NGX_HTTP_LOC_CONF , NGX_HTTP_MODULE , NGX_HTTP_SRV_CONF , NGX_RS_HTTP_LOC_CONF_OFFSET ,
10- NGX_RS_MODULE_SIGNATURE ,
11- } ;
5+ use ngx:: core:: prelude:: * ;
6+ use ngx:: ffi:: { ngx_array_push, NGX_RS_MODULE_SIGNATURE } ;
7+ use ngx:: http:: prelude:: * ;
128use ngx:: http:: * ;
139use ngx:: { http_request_handler, ngx_log_debug_http, ngx_null_command, ngx_string} ;
1410
@@ -22,8 +18,7 @@ impl HTTPModule for Module {
2218 unsafe extern "C" fn postconfiguration ( cf : * mut ngx_conf_t ) -> ngx_int_t {
2319 let cmcf = ngx_http_conf_get_module_main_conf ( cf, & * addr_of ! ( ngx_http_core_module) ) ;
2420
25- let h = ngx_array_push ( & mut ( * cmcf) . phases [ ngx_http_phases_NGX_HTTP_PRECONTENT_PHASE as usize ] . handlers )
26- as * mut ngx_http_handler_pt ;
21+ let h = ngx_array_push ( & mut ( * cmcf) . phases [ NGX_HTTP_PRECONTENT_PHASE ] . handlers ) as * mut ngx_http_handler_pt ;
2722 if h. is_null ( ) {
2823 return core:: Status :: NGX_ERROR . into ( ) ;
2924 }
@@ -47,39 +42,39 @@ static mut NGX_HTTP_AWSSIGV4_COMMANDS: [ngx_command_t; 6] = [
4742 name : ngx_string ! ( "awssigv4" ) ,
4843 type_ : ( NGX_HTTP_LOC_CONF | NGX_HTTP_SRV_CONF | NGX_CONF_TAKE1 ) as ngx_uint_t ,
4944 set : Some ( ngx_http_awssigv4_commands_set_enable) ,
50- conf : NGX_RS_HTTP_LOC_CONF_OFFSET ,
45+ conf : NGX_HTTP_LOC_CONF_OFFSET ,
5146 offset : 0 ,
5247 post : std:: ptr:: null_mut ( ) ,
5348 } ,
5449 ngx_command_t {
5550 name : ngx_string ! ( "awssigv4_access_key" ) ,
5651 type_ : ( NGX_HTTP_LOC_CONF | NGX_HTTP_SRV_CONF | NGX_CONF_TAKE1 ) as ngx_uint_t ,
5752 set : Some ( ngx_http_awssigv4_commands_set_access_key) ,
58- conf : NGX_RS_HTTP_LOC_CONF_OFFSET ,
53+ conf : NGX_HTTP_LOC_CONF_OFFSET ,
5954 offset : 0 ,
6055 post : std:: ptr:: null_mut ( ) ,
6156 } ,
6257 ngx_command_t {
6358 name : ngx_string ! ( "awssigv4_secret_key" ) ,
6459 type_ : ( NGX_HTTP_LOC_CONF | NGX_HTTP_SRV_CONF | NGX_CONF_TAKE1 ) as ngx_uint_t ,
6560 set : Some ( ngx_http_awssigv4_commands_set_secret_key) ,
66- conf : NGX_RS_HTTP_LOC_CONF_OFFSET ,
61+ conf : NGX_HTTP_LOC_CONF_OFFSET ,
6762 offset : 0 ,
6863 post : std:: ptr:: null_mut ( ) ,
6964 } ,
7065 ngx_command_t {
7166 name : ngx_string ! ( "awssigv4_s3_bucket" ) ,
7267 type_ : ( NGX_HTTP_LOC_CONF | NGX_HTTP_SRV_CONF | NGX_CONF_TAKE1 ) as ngx_uint_t ,
7368 set : Some ( ngx_http_awssigv4_commands_set_s3_bucket) ,
74- conf : NGX_RS_HTTP_LOC_CONF_OFFSET ,
69+ conf : NGX_HTTP_LOC_CONF_OFFSET ,
7570 offset : 0 ,
7671 post : std:: ptr:: null_mut ( ) ,
7772 } ,
7873 ngx_command_t {
7974 name : ngx_string ! ( "awssigv4_s3_endpoint" ) ,
8075 type_ : ( NGX_HTTP_LOC_CONF | NGX_HTTP_SRV_CONF | NGX_CONF_TAKE1 ) as ngx_uint_t ,
8176 set : Some ( ngx_http_awssigv4_commands_set_s3_endpoint) ,
82- conf : NGX_RS_HTTP_LOC_CONF_OFFSET ,
77+ conf : NGX_HTTP_LOC_CONF_OFFSET ,
8378 offset : 0 ,
8479 post : std:: ptr:: null_mut ( ) ,
8580 } ,
0 commit comments