Support multiple calls to Response::send
Currently, successive calls to Response::send
may queue data to be sent twice. For example, the following will send "foo.foo.foo.bar.bar.baz.", when it should only send "foo.bar.baz.":
*response << "foo.";
response->send();
*response << "bar.";
response->send();
*response << "baz.";
response->send();
This pull request fixes the issue by taking a snapshot of the buffer before sending it. It also contains a unit test that fails with the old code but passes with the new. No other unit tests are broken by this code.