This change uses some features available in an updated version of
buildtools. Instead of resolving the test-runtime for each of our test
projects as a separate step, we will now add a "reference" to it from the
project.json of each test project. This will allow us to resolve the nuget
assets from both it and the test project at the same time. This will be
more robust than our current process, which is very fragile and
error-prone.
The above is made possible by an updated version of
"PrereleaseResolveNuGetPackageAssets", which is the buildtools task
responsible for resolving test assets from nuget packages. This task also
has a lot of additional validation, which triggers a lot of warnings in
corefx. I've made various changes to csproj's and to project.json's around
the repository in order to satisfy those warnings.
Commit migrated from https://github.com/dotnet/corefx/commit/622ee8f512497fc07621de15e41c6bd575f387c9
There were a handful of test projects that just didn't have .builds
files and some other cases where the data in the .builds file did not
match what was in the UnsupportedPlatforms metadata.
Some of the projects said the tests were unsupported on FreeBSD and
nowhere else. Given that these tests should most likely be supported on
FreeBSD (given that OSX and Linux both supported them), I've not moved
that logic into the .builds files.
If there ends up being a specific set of tests that the FreeBSD port
team wants to disable long term, they can add .builds metadata as they
see fit.
Commit migrated from https://github.com/dotnet/corefx/commit/836c6f12e1a05749d7d5bf27d02bd28f98eb76aa
We removed the lifting from the lineup so tests should reference the
latest packages in order to ensure an implementation is available.
The latest pacakges exclude implementation dependencies so I needed to
add these to projects that were depending on them coming in transitively.
Commit migrated from https://github.com/dotnet/corefx/commit/bef9061fd1238adf47b864d8924d121e4134465b
In order to support WindowsProxyUsePolicy.UseWinInetProxy, WinHTTP provides the WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY option. This allows for reading the per-user registry settings to determine how to find a proxy for a given url. This includes using WPAD protocol to find and execute a Javascript PAC file. The WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY only works on Windows 8.1 and above. For Windows 7 and Windows 8, we have to manually do the work and the WinInetProxyHelper class provides for that by calling various WinHTTP APIs.
This fix is about having the AUTOMATIC_PROXY behaviors work the same whether done automatically by WinHTTP or manually using the WinInetProxyHelper class. In general, errors processing the auto discovery logic should be ignored and the proxy settings should fallback to manual settings if present in the registry.
This is difficult to test in an Xunit test since registry settings need to be changed as well as recycling the "WinHTTP Web Proxy Autodiscover Discovery Service" since it caches PAC file processing. So, this was tested manually for now and additional traces were added to the WinInetProxyHelper class.
Fixesdotnet/corefx#6011
Commit migrated from https://github.com/dotnet/corefx/commit/25ebb1bff1526bbc81d622ba7fc7749181c458fa
The fix made in PR dotnet/corefx#6285 for this memory leak turned out to be insufficient. The request handle object for the stream (SafeWinHttpHandle) was part of the strong root chain in WinHttpRequestState. And even when the WinHttpResponseStream object was finalized (implicit Dispose), the request handle was not finalized and thus leaks were happening.
To address this, the request handle object reference is now cleared from the WinHttpRequestState object (along with other object references) once the WinHttpResponseStream is created. WinHttpResponseStream then gets passed the request handle reference. Then normal finalizer rules can apply to both WinHttpResponseStream and the request handle. Once the request handle gets disposed (via finalizing), native WinHTTP will send a final status callback (HANDLE_CLOSING) and that is how the state object will then get unrooted and freed.
Tested this fix with WCF streaming scenarios and used WinDBG to verify the heaps.
There are future plans to improve this code via refactoring as part of dotnet/corefx#2501.
Fixes 5927.
Commit migrated from https://github.com/dotnet/corefx/commit/f2b47770d9014423ab830285b0fee47b75c44c02
WinHttpResponseStream was not tracking the amount of data read when the response used 'Content-Length' semantics. So, if the amount of bytes read from the server was less than expected, we did not return an error. This was different behavior than .NET Framework.
Fixed WinHttpResponseStream so that it will track the total number of bytes read and compare it to the expected number of bytes if using 'Content-Length' semantics. Note that we don't do this checking if the HTTP request is a HEAD request. That is because the definition of that HTTP verb is to return headers "as-if" it was returning a real response body. So, the 'Content-Length' might be set but there is no response body for a HEAD request.
For cases of using 'Transfer-Encoding: chunked' semantics for the response body, there is already error checking at the lower HTTP layer in WinHTTP.
Fixesdotnet/corefx#6231.
Commit migrated from https://github.com/dotnet/corefx/commit/7f5d6b643996306062836a17ddad643fd7e40ff2
- Fix Assert that was throwing in a background thread due to mistmatched type (it was looking explicitly for HttpResponseMessage rather than any type in its inheritance hierarchy, and CurlHandler uses a derived type).
- Update project.json package versions
- Unsubscribe the listener when done with it
Commit migrated from https://github.com/dotnet/corefx/commit/9a8d97852bcce9be0b4b6b5eff5ed87f4e36119e
Some fixes (adding imports, adding Platforms package) were tooled, but more complex ones (forking project.jsons, editing csproj's) were not.
Also makes dependency version validation rules case-insensitive. (I used this fix to update the versions of some packages.)
[tfs-changeset: 1573868]
Commit migrated from https://github.com/dotnet/corefx/commit/84af04317505d48feaa1e83dd5dc27ddc0f6de76