Bug 28630 - Chunked Encoding does not work if System.Web.HttpResponse.BufferOutput is set to false
Summary: Chunked Encoding does not work if System.Web.HttpResponse.BufferOutput is set...
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Web (show other bugs)
Version: 2.10.x
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-04-01 10:35 UTC by mono-bugzilla.20.qq
Modified: 2015-04-01 10:35 UTC (History)
1 user (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description mono-bugzilla.20.qq 2015-04-01 10:35:41 UTC
I have written a custom web server using sockets. I do not use mono-xsp.

If the property System.Web.HttpResponse.BufferOutput is set to false and a file is send using System.Web.HttpResponse.BinaryWrite() afterwards, then no chunked encoding is applied any more. Web browsers receive invalid data. If BufferOutput is set to true, everything works fine.

In .NET, chunked encoding is applied in both cases - if BufferOutput is set to true as well as if it is set to false.

Sample code:

httpResponse.Clear();
httpResponse.BufferOutput = false; // this will fail
httpResponse.AddHeader("Cache-Control", "public");
httpResponse.BinaryWrite(bytes);

Note You need to log in before you can comment on or make changes to this bug.