@@ -81,11 +81,11 @@ cfg_if! {
81
81
use std:: io:: IoSlice ;
82
82
83
83
#[ derive( Clone , Debug ) ]
84
- struct SendfileHeaderTrailer <' a>(
85
- libc:: sf_hdtr,
86
- Option <Vec <IoSlice <' a>>>,
87
- Option <Vec <IoSlice <' a>>>,
88
- ) ;
84
+ struct SendfileHeaderTrailer <' a> {
85
+ raw : libc:: sf_hdtr,
86
+ _headers : Option <Vec <IoSlice <' a>>>,
87
+ _trailers : Option <Vec <IoSlice <' a>>>,
88
+ }
89
89
90
90
impl <' a> SendfileHeaderTrailer <' a> {
91
91
fn new(
@@ -96,8 +96,9 @@ cfg_if! {
96
96
headers. map( |s| s. iter( ) . map( |b| IoSlice :: new( b) ) . collect( ) ) ;
97
97
let mut trailer_iovecs: Option <Vec <IoSlice <' _>>> =
98
98
trailers. map( |s| s. iter( ) . map( |b| IoSlice :: new( b) ) . collect( ) ) ;
99
- SendfileHeaderTrailer (
100
- libc:: sf_hdtr {
99
+
100
+ SendfileHeaderTrailer {
101
+ raw: libc:: sf_hdtr {
101
102
headers: {
102
103
header_iovecs
103
104
. as_mut( )
@@ -113,9 +114,9 @@ cfg_if! {
113
114
} ,
114
115
trl_cnt: trailer_iovecs. as_ref( ) . map( |v| v. len( ) ) . unwrap_or( 0 ) as i32
115
116
} ,
116
- header_iovecs,
117
- trailer_iovecs,
118
- )
117
+ _headers : header_iovecs,
118
+ _trailers : trailer_iovecs,
119
+ }
119
120
}
120
121
}
121
122
} else if #[ cfg( solarish) ] {
@@ -221,7 +222,7 @@ cfg_if! {
221
222
let flags: u32 = ( ra32 << 16 ) | ( flags. bits( ) as u32 ) ;
222
223
let mut bytes_sent: off_t = 0 ;
223
224
let hdtr = headers. or( trailers) . map( |_| SendfileHeaderTrailer :: new( headers, trailers) ) ;
224
- let hdtr_ptr = hdtr. as_ref( ) . map_or( ptr:: null( ) , |s| & s. 0 as * const libc:: sf_hdtr) ;
225
+ let hdtr_ptr = hdtr. as_ref( ) . map_or( ptr:: null( ) , |s| & s. raw as * const libc:: sf_hdtr) ;
225
226
let return_code = unsafe {
226
227
libc:: sendfile( in_fd. as_fd( ) . as_raw_fd( ) ,
227
228
out_sock. as_fd( ) . as_raw_fd( ) ,
@@ -264,7 +265,7 @@ cfg_if! {
264
265
) -> ( Result <( ) >, off_t) {
265
266
let mut bytes_sent: off_t = 0 ;
266
267
let hdtr = headers. or( trailers) . map( |_| SendfileHeaderTrailer :: new( headers, trailers) ) ;
267
- let hdtr_ptr = hdtr. as_ref( ) . map_or( ptr:: null( ) , |s| & s. 0 as * const libc:: sf_hdtr) ;
268
+ let hdtr_ptr = hdtr. as_ref( ) . map_or( ptr:: null( ) , |s| & s. raw as * const libc:: sf_hdtr) ;
268
269
let return_code = unsafe {
269
270
libc:: sendfile( in_fd. as_fd( ) . as_raw_fd( ) ,
270
271
out_sock. as_fd( ) . as_raw_fd( ) ,
@@ -310,7 +311,7 @@ cfg_if! {
310
311
) -> ( Result <( ) >, off_t) {
311
312
let mut len = count. unwrap_or( 0 ) ;
312
313
let hdtr = headers. or( trailers) . map( |_| SendfileHeaderTrailer :: new( headers, trailers) ) ;
313
- let hdtr_ptr = hdtr. as_ref( ) . map_or( ptr:: null( ) , |s| & s. 0 as * const libc:: sf_hdtr) ;
314
+ let hdtr_ptr = hdtr. as_ref( ) . map_or( ptr:: null( ) , |s| & s. raw as * const libc:: sf_hdtr) ;
314
315
let return_code = unsafe {
315
316
libc:: sendfile( in_fd. as_fd( ) . as_raw_fd( ) ,
316
317
out_sock. as_fd( ) . as_raw_fd( ) ,
0 commit comments