| 447 | } |
| 448 | |
| 449 | void |
| 450 | on_write( |
| 451 | bool keep_alive, |
| 452 | beast::error_code ec, |
| 453 | std::size_t bytes_transferred) |
| 454 | { |
| 455 | boost::ignore_unused(bytes_transferred); |
| 456 | |
| 457 | if(ec) |
| 458 | return fail(ec, "write"); |
| 459 | |
| 460 | if(! keep_alive) |
| 461 | { |
| 462 | // This means we should close the connection, usually because |
| 463 | // the response indicated the "Connection: close" semantic. |
| 464 | return do_close(); |
| 465 | } |
| 466 | |
| 467 | // Resume the read if it has been paused |
| 468 | if(response_queue_.size() == queue_limit) |
| 469 | do_read(); |
| 470 | |
| 471 | response_queue_.pop(); |
| 472 | |
| 473 | do_write(); |
| 474 | } |
| 475 | |
| 476 | void |
| 477 | do_close() |