shawnburke/AgFx — pull request #6 by stebet (2012-03-19 09:42:41+00:00)
Title: AgFx trusts web server to return valid ContentLength at all times. Some servers are evil :(

So I fixed the loading of the response since HttpResponseStream.ContentLength is not guaranteed to be a correct value. One should rather rely on reading from the actual stream.

Had an issue where a server replied the ContentLength to be some enormous number (think it was 4gigs , unsigned int max value), which was a lie.

AgFx tried to create a 4gig byte buffer resulting in an OverflowException.

Fixed the loading by creating a 16k temp buffer to use while reading the response from the result into a memory stream.