| 313 | } |
| 314 | |
| 315 | void |
| 316 | on_write( |
| 317 | bool keep_alive, |
| 318 | beast::error_code ec, |
| 319 | std::size_t bytes_transferred) |
| 320 | { |
| 321 | boost::ignore_unused(bytes_transferred); |
| 322 | |
| 323 | if(ec) |
| 324 | return fail(ec, "write"); |
| 325 | |
| 326 | if(! keep_alive) |
| 327 | { |
| 328 | // This means we should close the connection, usually because |
| 329 | // the response indicated the "Connection: close" semantic. |
| 330 | return derived().do_eof(); |
| 331 | } |
| 332 | |
| 333 | // Read another request |
| 334 | do_read(); |
| 335 | } |
| 336 | }; |
| 337 | |
| 338 | // Handles a plain HTTP connection |