pub fn acquire_body(headers: &Headers, body: Body)
                   -> Box<Future<Item=Vec<u8>, Error=HyperError>> {
    let mut bytes = vec![];
    if let Some(l) = headers.get::<ContentLength>() {
        bytes.reserve(**l as usize);
    }

    let f = body.fold(bytes, |mut acc, ref chunk| {
        acc.extend_from_slice(chunk);
        future::ok::<_, HyperError>(acc)
    });

    Box::new(f)
}
/// Return a `Future` that acquires the accumulated request body.
/// FIXME: Prone to DDoS attack! Restrict content length?
Return a `Future` that acquires the accumulated request body.
FIXME: Prone to DDoS attack.
Return a ` Future ` that acquires the accumulated request body . FIXME : Prone to DDoS attack .
pub fn acquire_body(headers: &Headers, body: Body)
                   -> Box<Future<Item=Vec<u8>, Error=HyperError>> {
    let mut bytes = vec![];
    if let Some(l) = headers.get::<ContentLength>() {
        bytes.reserve(**l as usize);
    }
    let f = body.fold(bytes, |mut acc, ref chunk| {
        acc.extend_from_slice(chunk);
        future::ok::<_, HyperError>(acc)
    });
    Box::new(f)
}
pub fn acquire_body ( headers : & Headers , body : Body ) -> Box < Future < Item = Vec < u8 > , Error = HyperError > > { let mut bytes = vec ! [ ] ; if let Some ( l ) = headers . get :: < ContentLength > ( ) { bytes . reserve ( * * l as usize ) ; } let f = body . fold ( bytes , | mut acc , ref chunk | { acc . extend_from_slice ( chunk ) ; future :: ok :: < _ , HyperError > ( acc ) } ) ; Box :: new ( f ) }
Return a `Future` that acquires the accumulated request body.
Return a ` Future ` that acquires the accumulated request body .
headers
&Headers
body
Body