| 470 | } |
| 471 | |
| 472 | void |
| 473 | do_read() |
| 474 | { |
| 475 | // Construct a new parser for each message |
| 476 | parser_.emplace(); |
| 477 | |
| 478 | // Apply a reasonable limit to the allowed size |
| 479 | // of the body in bytes to prevent abuse. |
| 480 | parser_->body_limit(10000); |
| 481 | |
| 482 | // Set the timeout. |
| 483 | beast::get_lowest_layer( |
| 484 | derived().stream()).expires_after(std::chrono::seconds(30)); |
| 485 | |
| 486 | // Read a request using the parser-oriented interface |
| 487 | http::async_read( |
| 488 | derived().stream(), |
| 489 | buffer_, |
| 490 | *parser_, |
| 491 | beast::bind_front_handler( |
| 492 | &http_session::on_read, |
| 493 | derived().shared_from_this())); |
| 494 | } |
| 495 | |
| 496 | void |
| 497 | on_read(beast::error_code ec, std::size_t bytes_transferred) |
no test coverage detected