Several "mini-stress" tests that verify HttpClient doesn't completely fall over under some load:
- Use one HttpClient instance to make many requests serially and in parallel
- Use multiple HttpClient instances to make many requests serially and in parallel
- Ensure that HttpResponseMessages can be GCd even if the associated response hasn't been fully drained. This one fails right now on unix due to an open issue.
Commit migrated from https://github.com/dotnet/corefx/commit/4358712d3db870725a394478702e643018af52bf
* Force CurlHandler active operations to shutdown when handler disposed
If the CurlHandler is disposed of while active operations are in progress, fail them. This was generally already happening, but not reliably, and not with the right exception type (a cancellation exception).
Commit migrated from https://github.com/dotnet/corefx/commit/77cb6a2cddd973aeea08e0ceccb578603c1c1364
* Size CurlHandler's SendTransferState based on content length
libcurl will never request more than 16K at a time from a request content stream, so our transfer state object allocates a 16K buffer to use the first time data needs to be transferred. This size can be efficient in limiting the number of operations required in passing data around, but for small posts, it's an unnecessarily large size. This commit changes the code to inspect the request content length, and if it's known to be less than 16K, that size is used instead.
Commit migrated from https://github.com/dotnet/corefx/commit/3c362496e358a8097538d81cf8aa6f69bb5493cc
We weren't canceling the request when prematurely Dispose'ing the response stream. Because of how asynchronous transfers work, where we need to pause the connection until a reader has requested data, if no reader ever requested data (e.g. the stream was disposed without reading anything) then the connection could remain paused indefinitely, and it would sit around until the HttpClient timeout kicked in and canceled it. This could lead to unbounded growth of the number of sockets being used, as sockets couldn't be pooled or cleaned up due to still being associated with an active download. The fix is simply to cancel the request in Dispose if the request isn't already completed.
Commit migrated from https://github.com/dotnet/corefx/commit/c31660f8979e1bd16f969ac38a00d9ee35e9e51f
After further discussions, it's been decided we don't need to remove NTLM from the auth type list and do lots of gyrations to only allow it in specific circumstances. This commit simplifies the auth type handling as a result, putting NTLM back into the ordered list of auth types. A similar change will be made separately for Windows.
Commit migrated from https://github.com/dotnet/corefx/commit/1a10bb2bc2dfca668d1fa18c8f64e6f70b0f95d0
*
In WCF repo many of our test projects are more than one level below the 'tests' directory.
*
If this doesn't break anything in corefx could we take this change?
* Amending to remove corefx\src\System.Net.Sockets\tests\PerformanceTests\System.Net.Sockets.Async.Performance.Tests.builds
* Amending again with more test .builds files that needed to be removed.
Commit migrated from https://github.com/dotnet/corefx/commit/8cac0d4afab96e15837818ca1abfbd9068008458
Now that the Azure test endpoint has been updated, we can add more redirect tests that use different redirect status codes.
It isn't necessary to modify every existing test to use different codes. But I modified the important ones especially those using credentials.
Fixesdotnet/corefx#7505
Commit migrated from https://github.com/dotnet/corefx/commit/507901ff79c58c81853dd33f511921019ac62f04
The latest changes to make HttpClient an OOB implementation on desktop
were not getting the correct dependency set. This has to do with the
the way that EnsureOOBFrameworks evaluates assets to duplicate. It does
so by seeing if any placeholders are obscuring the netstandard asset and
copying the netstandard asset if that is the case. This worked fine for
the reference assembly, but not the implementation since it wasn't
actually obscured. The result was that NuGet selects the correct
assets, but is missing implementation dependencies.
For now I'm fixing this by changing the package structure to explicitly
break out the net46 implementations into their own folders. This is
essentially what we were trying to make happen automatically with
EnsureOOBFrameworks.
Longer term we might want to refactor how we generate dependencies
to do an actual nuget-asset selection in order to harvest from the
actual assemblies that NuGet will choose.
For now I'm also working around the problem that the unix shims are
being referenced everywhere even though they're only needed for Unix.
There's still a problem with this package in that we have two different
netstandard dependency groups (one meant for Windows and one meant for
Unix) but because we can't express that in a fat package the Unix one
will win, even on a windows machine, if the target framework supports
NETStandard1.4 or higher. This doesn't cause a problem at the moment
because the unix implementation is using a superset of the Windows
dependencies but we need to see about how to better handle
in lieu of the NuGet feature for RID-specific dependencies.
Commit migrated from https://github.com/dotnet/corefx/commit/0a8c4fb115246f80bcc86ddb88797bfd1c7271f7
To support important customer scenarios for CoreFx RTM, we will be updating the System.Net.Http contract from 4.0 to 4.1. We are focusing on HttpClientHandler enhancements.
We will be submitting the final proposed list of additions as part of issue dotnet/corefx#7623. As part of updating the contract to 4.1, we are also OOB'ing the Desktop (net46 Windows) implementation so that the package won't be a facade over Desktop but rather a full implementation. This is possible since System.Net.Http has always been a standalone dll in the .NET Framework. As part of this, we are changing the implementation for Desktop from the legacy HttpWebRequest sockets stack to the WinHttpHandler stack based on native WinHTTP. This will give us a good path forward as WinHttpHandler stack will be getting HTTP/2.0 support with newer versions of Windows 10.
This initial PR has a few API additions that we are definitely going to be adding. It's important to get these changes into the builds so that we can fully bake the OOB Http.dll assembly on all the platforms and continue package testing.
There is an existing System.Net.Http.WebRequestHandler class in the .NET Framework located in System.Net.Http.WebRequest.dll. This class is a subclass of HttpClientHandler. Due to this, we are being careful not to cause collisions with some of these added properties. WebRequestHandler has a 'ClientCertificates' property and a 'ServerCertificateValidationCallback' property. So, we are aligning/renaming the properties as we add them to HttpClientHandler OOB assembly. This may get altered slightly as we finalize the 4.1 System.Net.Http API.
Commit migrated from https://github.com/dotnet/corefx/commit/97c940eec1f6afe3e4af31e72d79c3a11e7b1ff1