@@ -76,7 +76,6 @@ impl Default for UpstreamPeerData {
76
76
}
77
77
}
78
78
79
- #[ no_mangle]
80
79
static ngx_http_upstream_custom_ctx: ngx_http_module_t = ngx_http_module_t {
81
80
preconfiguration : Some ( Module :: preconfiguration) ,
82
81
postconfiguration : Some ( Module :: postconfiguration) ,
@@ -88,7 +87,6 @@ static ngx_http_upstream_custom_ctx: ngx_http_module_t = ngx_http_module_t {
88
87
merge_loc_conf : Some ( Module :: merge_loc_conf) ,
89
88
} ;
90
89
91
- #[ no_mangle]
92
90
static mut ngx_http_upstream_custom_commands: [ ngx_command_t ; 2 ] = [
93
91
ngx_command_t {
94
92
name : ngx_string ! ( "custom" ) ,
@@ -106,8 +104,8 @@ static mut ngx_http_upstream_custom_commands: [ngx_command_t; 2] = [
106
104
#[ cfg( feature = "export-modules" ) ]
107
105
ngx:: ngx_modules!( ngx_http_upstream_custom_module) ;
108
106
109
- #[ no_mangle]
110
107
#[ used]
108
+ #[ cfg_attr( not( feature = "export-modules" ) , no_mangle) ]
111
109
pub static mut ngx_http_upstream_custom_module: ngx_module_t = ngx_module_t {
112
110
ctx_index : ngx_uint_t:: MAX ,
113
111
index : ngx_uint_t:: MAX ,
@@ -191,7 +189,6 @@ http_upstream_init_peer_pt!(
191
189
// ngx_http_usptream_get_custom_peer
192
190
// For demonstration purposes, use the original get callback, but log this callback proxies through
193
191
// to the original.
194
- #[ no_mangle]
195
192
unsafe extern "C" fn ngx_http_upstream_get_custom_peer ( pc : * mut ngx_peer_connection_t , data : * mut c_void ) -> ngx_int_t {
196
193
let hcpd: * mut UpstreamPeerData = unsafe { mem:: transmute ( data) } ;
197
194
@@ -217,7 +214,6 @@ unsafe extern "C" fn ngx_http_upstream_get_custom_peer(pc: *mut ngx_peer_connect
217
214
// ngx_http_upstream_free_custom_peer
218
215
// For demonstration purposes, use the original free callback, but log this callback proxies
219
216
// through to the original.
220
- #[ no_mangle]
221
217
unsafe extern "C" fn ngx_http_upstream_free_custom_peer (
222
218
pc : * mut ngx_peer_connection_t ,
223
219
data : * mut c_void ,
@@ -237,7 +233,6 @@ unsafe extern "C" fn ngx_http_upstream_free_custom_peer(
237
233
// ngx_http_upstream_init_custom
238
234
// The module's custom `peer.init_upstream` callback.
239
235
// The original callback is saved in our SrvConfig data and reset to this module's `peer.init`.
240
- #[ no_mangle]
241
236
unsafe extern "C" fn ngx_http_upstream_init_custom (
242
237
cf : * mut ngx_conf_t ,
243
238
us : * mut ngx_http_upstream_srv_conf_t ,
@@ -282,7 +277,6 @@ unsafe extern "C" fn ngx_http_upstream_init_custom(
282
277
// ngx_http_upstream_commands_set_custom
283
278
// Entry point for the module, if this command is set our custom upstreams take effect.
284
279
// The original upstream initializer function is saved and replaced with this module's initializer.
285
- #[ no_mangle]
286
280
unsafe extern "C" fn ngx_http_upstream_commands_set_custom (
287
281
cf : * mut ngx_conf_t ,
288
282
cmd : * mut ngx_command_t ,
0 commit comments