| 558 | } |
| 559 | |
| 560 | void |
| 561 | on_write( |
| 562 | bool keep_alive, |
| 563 | beast::error_code ec, |
| 564 | std::size_t bytes_transferred) |
| 565 | { |
| 566 | boost::ignore_unused(bytes_transferred); |
| 567 | |
| 568 | if(ec) |
| 569 | return fail(ec, "write"); |
| 570 | |
| 571 | if(! keep_alive) |
| 572 | { |
| 573 | // This means we should close the connection, usually because |
| 574 | // the response indicated the "Connection: close" semantic. |
| 575 | return derived().do_eof(); |
| 576 | } |
| 577 | |
| 578 | // Resume the read if it has been paused |
| 579 | if(response_queue_.size() == queue_limit) |
| 580 | do_read(); |
| 581 | |
| 582 | response_queue_.pop(); |
| 583 | |
| 584 | do_write(); |
| 585 | } |
| 586 | }; |
| 587 | |
| 588 | //------------------------------------------------------------------------------ |