| 44 | } |
| 45 | |
| 46 | void read_next_request() { |
| 47 | req_ = {}; |
| 48 | buffer_.consume(buffer_.size()); |
| 49 | |
| 50 | q_.clear(); |
| 51 | writing_ = false; |
| 52 | finished_ = false; |
| 53 | header_sr_.reset(); |
| 54 | |
| 55 | http::async_read(stream_, buffer_, req_, |
| 56 | asio::bind_executor(strand_, [self = shared_from_this()](beast::error_code ec, std::size_t) { |
| 57 | if (ec == http::error::end_of_stream) { |
| 58 | self->close(); |
| 59 | return; |
| 60 | } |
| 61 | if (ec) { |
| 62 | LOG(ERROR) << "failed to read from inbound HTTP connection: " << ec.message(); |
| 63 | self->close(); |
| 64 | return; |
| 65 | } |
| 66 | self->start_next_request(); |
| 67 | })); |
| 68 | } |
| 69 | |
| 70 | void start_next_request() { |
| 71 | switch (req_.method()) { |
no test coverage detected