@@ -7,8 +7,9 @@ use ngx::ffi::{
7
7
use ngx:: http:: MergeConfigError ;
8
8
use ngx:: { core, core:: Status , http, http:: HTTPModule } ;
9
9
use ngx:: { http_request_handler, ngx_log_debug_http, ngx_modules, ngx_null_command, ngx_string} ;
10
- use std:: borrow:: { Borrow , BorrowMut } ;
10
+ use std:: borrow:: Borrow ;
11
11
use std:: os:: raw:: { c_char, c_void} ;
12
+ use std:: ptr:: addr_of_mut;
12
13
use std:: sync:: atomic:: AtomicBool ;
13
14
use std:: sync:: Arc ;
14
15
use std:: time:: Instant ;
@@ -132,7 +133,7 @@ unsafe extern "C" fn check_async_work_done(event: *mut ngx_event_t) {
132
133
// this doesn't have have good performance but works as a simple thread-safe example and doesn't causes
133
134
// segfault. The best method that provides both thread-safety and performance requires
134
135
// an nginx patch.
135
- post_event ( event, ngx_posted_events . borrow_mut ( ) ) ;
136
+ post_event ( event, addr_of_mut ! ( ngx_posted_events ) ) ;
136
137
}
137
138
}
138
139
@@ -204,7 +205,7 @@ http_request_handler!(async_access_handler, |request: &mut http::Request| {
204
205
event. data = Arc :: into_raw( event_data. clone( ) ) as _;
205
206
event. log = ( * ngx_cycle) . log;
206
207
207
- post_event( event, ngx_posted_events . borrow_mut ( ) ) ;
208
+ post_event( event, addr_of_mut! ( ngx_posted_events ) ) ;
208
209
}
209
210
210
211
ngx_log_debug_http!( request, "async module enabled: {}" , co. enable) ;
0 commit comments