@@ -13,12 +13,11 @@ use std::slice;
13
13
14
14
use ngx:: core:: { Pool , Status } ;
15
15
use ngx:: ffi:: {
16
- nginx_version, ngx_atoi, ngx_command_t, ngx_conf_t, ngx_connection_t, ngx_event_free_peer_pt,
17
- ngx_event_get_peer_pt, ngx_http_module_t, ngx_http_upstream_init_peer_pt, ngx_http_upstream_init_pt,
18
- ngx_http_upstream_init_round_robin, ngx_http_upstream_module, ngx_http_upstream_srv_conf_t, ngx_http_upstream_t,
19
- ngx_int_t, ngx_module_t, ngx_peer_connection_t, ngx_str_t, ngx_uint_t, NGX_CONF_NOARGS , NGX_CONF_TAKE1 ,
20
- NGX_CONF_UNSET , NGX_ERROR , NGX_HTTP_MODULE , NGX_HTTP_UPS_CONF , NGX_LOG_EMERG , NGX_RS_HTTP_SRV_CONF_OFFSET ,
21
- NGX_RS_MODULE_SIGNATURE ,
16
+ ngx_atoi, ngx_command_t, ngx_conf_t, ngx_connection_t, ngx_event_free_peer_pt, ngx_event_get_peer_pt,
17
+ ngx_http_module_t, ngx_http_upstream_init_peer_pt, ngx_http_upstream_init_pt, ngx_http_upstream_init_round_robin,
18
+ ngx_http_upstream_module, ngx_http_upstream_srv_conf_t, ngx_http_upstream_t, ngx_int_t, ngx_module_t,
19
+ ngx_peer_connection_t, ngx_str_t, ngx_uint_t, NGX_CONF_NOARGS , NGX_CONF_TAKE1 , NGX_CONF_UNSET , NGX_ERROR ,
20
+ NGX_HTTP_MODULE , NGX_HTTP_UPS_CONF , NGX_LOG_EMERG , NGX_RS_HTTP_SRV_CONF_OFFSET ,
22
21
} ;
23
22
use ngx:: http:: {
24
23
ngx_http_conf_get_module_srv_conf, ngx_http_conf_upstream_srv_conf_immutable,
@@ -110,34 +109,10 @@ ngx::ngx_modules!(ngx_http_upstream_custom_module);
110
109
#[ allow( non_upper_case_globals) ]
111
110
#[ cfg_attr( not( feature = "export-modules" ) , no_mangle) ]
112
111
pub static mut ngx_http_upstream_custom_module: ngx_module_t = ngx_module_t {
113
- ctx_index : ngx_uint_t:: MAX ,
114
- index : ngx_uint_t:: MAX ,
115
- name : std:: ptr:: null_mut ( ) ,
116
- spare0 : 0 ,
117
- spare1 : 0 ,
118
- version : nginx_version as ngx_uint_t ,
119
- signature : NGX_RS_MODULE_SIGNATURE . as_ptr ( ) as * const c_char ,
120
-
121
- ctx : & NGX_HTTP_UPSTREAM_CUSTOM_CTX as * const _ as * mut _ ,
112
+ ctx : std:: ptr:: addr_of!( NGX_HTTP_UPSTREAM_CUSTOM_CTX ) as _ ,
122
113
commands : unsafe { & NGX_HTTP_UPSTREAM_CUSTOM_COMMANDS [ 0 ] as * const _ as * mut _ } ,
123
- type_ : NGX_HTTP_MODULE as ngx_uint_t ,
124
-
125
- init_master : None ,
126
- init_module : None ,
127
- init_process : None ,
128
- init_thread : None ,
129
- exit_thread : None ,
130
- exit_process : None ,
131
- exit_master : None ,
132
-
133
- spare_hook0 : 0 ,
134
- spare_hook1 : 0 ,
135
- spare_hook2 : 0 ,
136
- spare_hook3 : 0 ,
137
- spare_hook4 : 0 ,
138
- spare_hook5 : 0 ,
139
- spare_hook6 : 0 ,
140
- spare_hook7 : 0 ,
114
+ type_ : NGX_HTTP_MODULE as _ ,
115
+ ..ngx_module_t:: default ( )
141
116
} ;
142
117
143
118
// http_upstream_init_custom_peer
0 commit comments