httpaf
httpaf copied to clipboard
give the body direct access to its sink writer
We normally indirectly gain access to the writer in two ways: one is
through the when_ready_to_write callback, and the other through
transfer_to_writer as an argument. Instead, just give the writer to
the body writer directly but continue to drive it from the outside.
This is mostly a simple refactor, but it gives us the ability to do something smarter in another branch, which is to query the writer to see if a flush will succeed or not and report back to the user so they can act appropriately.