Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
PREVIEW: The new async-ified HttpWebRequest. #5200
[System]: Async-ify and mostly rewrite HttpWebRequest and friends.
HttpWebRequest and its helper classes (WebConnection, WebConnectionStream) have received a major overhaul.
There were two main objectives for this patch: fixing https://bugzilla.xamarin.com/show_bug.cgi?id=55872 and various issues that random people reported regarding nuget restore printing random error messages - while also modernizing the code-base in a way where it's easier to read, understand and maintain.
This code is very old, most of it was written in 2004 and 2012, and it was using a lot of chained APM async methods which were very hard to understand, debug and fix. The underlying issue in the bug was that some "EndSomething" was called after the request had been canceled and the connection reused, but some of the code didn't check whether the underlying state had changed.