| 135 | } |
| 136 | |
| 137 | void Connection::handle_write() |
| 138 | { |
| 139 | auto self = shared_from_this(); |
| 140 | |
| 141 | stream_.expires_after(std::chrono::seconds(keepalive_timeout_)); |
| 142 | |
| 143 | bhttp::async_write(stream_, |
| 144 | response_, |
| 145 | [self](boost::beast::error_code ec, std::size_t) |
| 146 | { |
| 147 | if (!ec) |
| 148 | { |
| 149 | if (self->should_keep_alive()) |
| 150 | { |
| 151 | self->handle_read(); |
| 152 | } |
| 153 | else |
| 154 | { |
| 155 | self->handle_close(); |
| 156 | } |
| 157 | } |
| 158 | else |
| 159 | { |
| 160 | util::Log(logDEBUG) << "Connection write error: " << ec.message(); |
| 161 | } |
| 162 | }); |
| 163 | } |
| 164 | |
| 165 | void Connection::handle_close() |
| 166 | { |
nothing calls this directly
no test coverage detected