Bug 47549 - Chunked encoding error when writing zero buffer
Summary: Chunked encoding error when writing zero buffer
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System (show other bugs)
Version: unspecified
Hardware: PC All
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2016-11-20 13:20 UTC by Alexander Udovichenko
Modified: 2016-11-23 16:44 UTC (History)
2 users (show)

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


Attachments
reproduce code (561 bytes, text/plain)
2016-11-20 13:20 UTC, Alexander Udovichenko
Details
pcap dump (4.12 KB, application/octet-stream)
2016-11-20 13:24 UTC, Alexander Udovichenko
Details

Description Alexander Udovichenko 2016-11-20 13:20:38 UTC
Created attachment 18554 [details]
reproduce code

When using chunked encoding in response, then writing zero buffer to output Stream will result
writing Chunk End Mark to client ("0\r\n"). This happens because count argument of ResponseStream class in Write method (https://github.com/mono/mono/blob/master/mcs/class/System/System.Net/ResponseStream.cs) is tested for zero after chunk prefix is writed to lower stream. 
I tested this case in MS.NET, it worked well.
I attach code sample to reproduce this and also I have a pcap dump of wrong respose.
Comment 1 Alexander Udovichenko 2016-11-20 13:24:40 UTC
Created attachment 18555 [details]
pcap dump
Comment 2 Marek Safar 2016-11-23 16:44:18 UTC
Fixed in master

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