internal void Flush (HttpWorkerRequest wr, bool final_flush)
{
if (total == 0 && !final_flush)
return;
if (response.use_chunked)
SendChunkSize (total, false);
for (Bucket b = first_bucket; b != null; b = b.Next) {
b.Send (wr);
}
if (response.use_chunked) {
SendChunkSize (-1, false);
if (final_flush)
SendChunkSize (0, true);
}
wr.FlushResponse (final_flush);
Clear ();
}