Boost logo

Boost :

Subject: Re: [boost] [review][beast] Review of Beast starts today : July 1 - July 10
From: Peter Dimov (lists_at_[hidden])
Date: 2017-07-03 01:05:28


Niall Douglas wrote:

> What I didn't do was write essays of detail. It would take too long, it's
> not my place, and I'm pretty sure Vinnie knows ASIO internals as well as I
> do, so I am assuming he understands everything I'm writing.

I understand everything you're writing, but the complete picture still
eludes me. Specific examples:

    http::request_parser<http::string_body> parser;

    parser.header_limit( 8192 );
    parser.body_limit( 8192 );

    http::read( socket_, buffer, parser, ec );

    /*...*/

    do_request( parser.get(), ec );

How would this look like in the blobs in, blobs out model?

Same question for the reverse one:

    std::vector<unsigned char> data;

    /* ... fill data... */

    beast::string_view sv( (char*)data.data(), data.size() );
    http::response<http::string_view_body> res( sv );

    res.result( http::status::ok );

    res.set( http::field::server, BEAST_VERSION_STRING );
    res.set( http::field::content_type, "image/bmp" );
    res.set( http::field::content_length, data.size() );

    http::write( socket_, res, ec );

How does the ASIO-decoupled code look?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk