| 364 | |
| 365 | private: |
| 366 | void |
| 367 | do_read() |
| 368 | { |
| 369 | // Construct a new parser for each message |
| 370 | parser_.emplace(); |
| 371 | |
| 372 | // Apply a reasonable limit to the allowed size |
| 373 | // of the body in bytes to prevent abuse. |
| 374 | parser_->body_limit(10000); |
| 375 | |
| 376 | // Set the timeout. |
| 377 | stream_.expires_after(std::chrono::seconds(30)); |
| 378 | |
| 379 | // Read a request using the parser-oriented interface |
| 380 | http::async_read( |
| 381 | stream_, |
| 382 | buffer_, |
| 383 | *parser_, |
| 384 | beast::bind_front_handler( |
| 385 | &http_session::on_read, |
| 386 | shared_from_this())); |
| 387 | } |
| 388 | |
| 389 | void |
| 390 | on_read(beast::error_code ec, std::size_t bytes_transferred) |
nothing calls this directly
no test coverage detected