File tree Expand file tree Collapse file tree 3 files changed +18
-26
lines changed Expand file tree Collapse file tree 3 files changed +18
-26
lines changed Original file line number Diff line number Diff line change @@ -17,17 +17,13 @@ use std::ptr::null_mut;
17
17
static mut REQUEST_BUF : * mut u8 = null_mut ( ) ;
18
18
19
19
#[ no_mangle]
20
- pub extern "C" fn uwr_module_end_handler ( ) {
21
- unsafe {
22
- uwr_free ( REQUEST_BUF ) ;
23
- }
20
+ pub unsafe extern "C" fn uwr_module_end_handler ( ) {
21
+ uwr_free ( REQUEST_BUF ) ;
24
22
}
25
23
26
24
#[ no_mangle]
27
- pub extern "C" fn uwr_module_init_handler ( ) {
28
- unsafe {
29
- REQUEST_BUF = uwr_malloc ( uwr_mem_get_init_size ( ) ) ;
30
- }
25
+ pub unsafe extern "C" fn uwr_module_init_handler ( ) {
26
+ REQUEST_BUF = uwr_malloc ( uwr_mem_get_init_size ( ) ) ;
31
27
}
32
28
33
29
pub extern "C" fn hdr_iter_func (
Original file line number Diff line number Diff line change @@ -16,18 +16,18 @@ static mut REQUEST_BUF: *mut u8 = null_mut();
16
16
static mut TOTAL_BYTES_WROTE : u64 = 0 ;
17
17
18
18
#[ no_mangle]
19
- pub extern "C" fn uwr_module_end_handler ( ) {
20
- unsafe { uwr_free ( REQUEST_BUF ) ; }
19
+ pub unsafe extern "C" fn uwr_module_end_handler ( ) {
20
+ uwr_free ( REQUEST_BUF ) ;
21
21
}
22
22
23
23
#[ no_mangle]
24
- pub extern "C" fn uwr_module_init_handler ( ) {
25
- unsafe { REQUEST_BUF = uwr_malloc ( uwr_mem_get_init_size ( ) ) ; }
24
+ pub unsafe extern "C" fn uwr_module_init_handler ( ) {
25
+ REQUEST_BUF = uwr_malloc ( uwr_mem_get_init_size ( ) ) ;
26
26
}
27
27
28
28
#[ no_mangle]
29
- pub extern "C" fn uwr_response_end_handler ( ) {
30
- unsafe { TOTAL_BYTES_WROTE = 0 ; }
29
+ pub unsafe extern "C" fn uwr_response_end_handler ( ) {
30
+ TOTAL_BYTES_WROTE = 0 ;
31
31
}
32
32
33
33
#[ no_mangle]
Original file line number Diff line number Diff line change @@ -18,22 +18,18 @@ static mut TOTAL_RESPONSE_SENT: usize = 0;
18
18
static mut REQUEST_BUF : * mut u8 = null_mut ( ) ;
19
19
20
20
#[ no_mangle]
21
- pub extern "C" fn uwr_response_end_handler ( ) {
22
- unsafe {
23
- TOTAL_RESPONSE_SENT = 0 ;
24
- }
21
+ pub unsafe extern "C" fn uwr_response_end_handler ( ) {
22
+ TOTAL_RESPONSE_SENT = 0 ;
25
23
}
26
24
27
25
#[ no_mangle]
28
- pub extern "C" fn uwr_request_end_handler ( ) {
29
- unsafe {
30
- if REQUEST_BUF . is_null ( ) {
31
- return ;
32
- }
33
-
34
- uwr_free ( REQUEST_BUF ) ;
35
- REQUEST_BUF = null_mut ( ) ;
26
+ pub unsafe extern "C" fn uwr_request_end_handler ( ) {
27
+ if REQUEST_BUF . is_null ( ) {
28
+ return ;
36
29
}
30
+
31
+ uwr_free ( REQUEST_BUF ) ;
32
+ REQUEST_BUF = null_mut ( ) ;
37
33
}
38
34
39
35
pub fn upload_reflector ( ctx : * mut luw_ctx_t ) -> i32 {
You can’t perform that action at this time.
0 commit comments