1
- use std:: ffi:: { c_char, c_void} ;
2
1
use std:: ptr:: addr_of;
3
2
4
3
use http:: HeaderMap ;
5
4
use 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:: * ;
12
8
use ngx:: http:: * ;
13
9
use ngx:: { http_request_handler, ngx_log_debug_http, ngx_null_command, ngx_string} ;
14
10
@@ -22,8 +18,7 @@ impl HTTPModule for Module {
22
18
unsafe extern "C" fn postconfiguration ( cf : * mut ngx_conf_t ) -> ngx_int_t {
23
19
let cmcf = ngx_http_conf_get_module_main_conf ( cf, & * addr_of ! ( ngx_http_core_module) ) ;
24
20
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 ;
27
22
if h. is_null ( ) {
28
23
return core:: Status :: NGX_ERROR . into ( ) ;
29
24
}
@@ -47,39 +42,39 @@ static mut NGX_HTTP_AWSSIGV4_COMMANDS: [ngx_command_t; 6] = [
47
42
name : ngx_string ! ( "awssigv4" ) ,
48
43
type_ : ( NGX_HTTP_LOC_CONF | NGX_HTTP_SRV_CONF | NGX_CONF_TAKE1 ) as ngx_uint_t ,
49
44
set : Some ( ngx_http_awssigv4_commands_set_enable) ,
50
- conf : NGX_RS_HTTP_LOC_CONF_OFFSET ,
45
+ conf : NGX_HTTP_LOC_CONF_OFFSET ,
51
46
offset : 0 ,
52
47
post : std:: ptr:: null_mut ( ) ,
53
48
} ,
54
49
ngx_command_t {
55
50
name : ngx_string ! ( "awssigv4_access_key" ) ,
56
51
type_ : ( NGX_HTTP_LOC_CONF | NGX_HTTP_SRV_CONF | NGX_CONF_TAKE1 ) as ngx_uint_t ,
57
52
set : Some ( ngx_http_awssigv4_commands_set_access_key) ,
58
- conf : NGX_RS_HTTP_LOC_CONF_OFFSET ,
53
+ conf : NGX_HTTP_LOC_CONF_OFFSET ,
59
54
offset : 0 ,
60
55
post : std:: ptr:: null_mut ( ) ,
61
56
} ,
62
57
ngx_command_t {
63
58
name : ngx_string ! ( "awssigv4_secret_key" ) ,
64
59
type_ : ( NGX_HTTP_LOC_CONF | NGX_HTTP_SRV_CONF | NGX_CONF_TAKE1 ) as ngx_uint_t ,
65
60
set : Some ( ngx_http_awssigv4_commands_set_secret_key) ,
66
- conf : NGX_RS_HTTP_LOC_CONF_OFFSET ,
61
+ conf : NGX_HTTP_LOC_CONF_OFFSET ,
67
62
offset : 0 ,
68
63
post : std:: ptr:: null_mut ( ) ,
69
64
} ,
70
65
ngx_command_t {
71
66
name : ngx_string ! ( "awssigv4_s3_bucket" ) ,
72
67
type_ : ( NGX_HTTP_LOC_CONF | NGX_HTTP_SRV_CONF | NGX_CONF_TAKE1 ) as ngx_uint_t ,
73
68
set : Some ( ngx_http_awssigv4_commands_set_s3_bucket) ,
74
- conf : NGX_RS_HTTP_LOC_CONF_OFFSET ,
69
+ conf : NGX_HTTP_LOC_CONF_OFFSET ,
75
70
offset : 0 ,
76
71
post : std:: ptr:: null_mut ( ) ,
77
72
} ,
78
73
ngx_command_t {
79
74
name : ngx_string ! ( "awssigv4_s3_endpoint" ) ,
80
75
type_ : ( NGX_HTTP_LOC_CONF | NGX_HTTP_SRV_CONF | NGX_CONF_TAKE1 ) as ngx_uint_t ,
81
76
set : Some ( ngx_http_awssigv4_commands_set_s3_endpoint) ,
82
- conf : NGX_RS_HTTP_LOC_CONF_OFFSET ,
77
+ conf : NGX_HTTP_LOC_CONF_OFFSET ,
83
78
offset : 0 ,
84
79
post : std:: ptr:: null_mut ( ) ,
85
80
} ,
0 commit comments