This improves handling of edge cases around flushing buffers:
- Distingush clearly between "headers sent" and "all output sent"
states.
- Warn when trying to flush output after output was already sent to the
client.
- Avoid looping indefinitely when failing to delete a buffer, to work
around a quirk of PHP's zlib.compression buffer.
Follow-up: I4ea116d60030da92be14f0283ce4dc4877c4ca13
Bug: T356578
Change-Id: Iaf34a48b89e969b8e26328f0d2512ad22ef48212
The goal is to unify the high level control flow in entry points by
making them use a shared base class. Eventually, this will allow
us to test all aspects of request handling, including response
headers and output buffer handling. That will however require
us to move quite a bit of logic from ApiMain into ApiEntryPoint.
Bug: T354216
Change-Id: I4ea1cbb8b2786c24deade7d5029d95fe0c2abc57