Several bugs are causing tests to fail. Those bugs have been fixed, but the fixes aren't yet available in the packages being targeted by other test libraries breaking because of the bugs. This temporarily works around it by using a P2P reference to skip the packages.
Commit migrated from https://github.com/dotnet/corefx/commit/5eb4a0405e16f1cc7d2488f9106f644141f62de5
The task from ReadAsync was never moving to a terminal state (i.e. "hanging") if the token was marked for cancellation after starting the task. The problem was that our task continuation wasn't being called if the token was cancelled before the continuation was scheduled.
The fix is to avoid passing in the token during the .ContinueWith call. Instead, the token is checked inside the continuation. This puts all the logic in the same place for checking the final status of the ReadAsync operation (which has multiple inner operations) including whether it should fault due to an error or have a successful completion.
Commit migrated from https://github.com/dotnet/corefx/commit/3ae96358a215023f3ecbba13fb4d860693f221c0
This these .builds files were updated and generated from a script
based on the configurations defined in the matching csproj files.
This updates the builds files to specify OSGroup and TargetGroup
as metadata instead of using AdditionalProperties and also sorts them by
TargetGroup followed by OSGroup.
Commit migrated from https://github.com/dotnet/corefx/commit/95efe37475916016a5fc6ee6f0ba584d990c4196
This add a default configuration before the Import of dirs.props
for any projects that don't have Debug as the default configuration.
Removed Configuration and Platform properties set after dirs.props
as they would have no affect and just cause confusion.
Removed OutputType=Library property as it isn't necessary.
Commit migrated from https://github.com/dotnet/corefx/commit/9e1da13cf6d5ff4b37b1867beb3411a2fe61da6a
Adding EventSources to substitute the previous logging model using
TraceSources.
In this PR 4 event sources are added:
-NetEventSource
-SocketsEventSource
-HttpEventSource
-SecurityEventSource
Event methods for NetEventSource, SocketsEventSource and HttpEventSource
are
fully added. SecurityEventSource has only a few of
the new event methods implemented.
Changes in production code are done to match this new implementation.
(Only changes for
events in Sockets and Http are done in this iteration).
Adding missing reference to LoggingHash
Missing Reference in Security csproj
Missing reference in NetworkInformation
Adding a reference and adding a missing new line.
Adding references and readonly modifier.
Adding another missing reference.
Adding some missing blank lines and making readonly the s_log in the
EventSources.
Completing SecurityEventSource
Adding missing all the security events that will substitute PrintInfo
calls.
Doing changes in code to reflect this.
Transforming SecurityEventSource into a Partial class
Some of the events were Windows specific, because of the enums they were
using. Those events are now in a partial class that is included when
those enums are defined.
Moving events to partial SecurityEventSource class
Some more events using Interop.SecurityStatus are moved into the partial
windows specific class.
Also, a missed non event header is added for Associate method in
HttpEventSource.
Deleting Logging reference to instead use LoggingHash
Addressing some of the PR feedback
Adding the Issue number to TODO for localization, and using BlockCopy
instead of a Loop to copy array. Also, correctly passing partialBuffer
instead of Buffer to the DumpArrayAsync method.
Commit migrated from https://github.com/dotnet/corefx/commit/1cd8bf635d4b9a6d8a7d1e25cd320814c993f38b
CurlHandler has been handling cookies only from the final HTTP response.
The cookies sent during the intermediate http responses (during 3XX
redirection as well as interim 401, 407 responses) were getting ignored.
This fix ensures that the cookies from all the responses are handled.
Commit migrated from https://github.com/dotnet/corefx/commit/742f6608ad14933295b3a64cf9859c9ba961c8d1
WinHttpHandler was losing 'Set-Cookie' response headers during auto redirection handling when the handler was in 'manual cookie' mode. I.e. `CookieUsePolicy.UseSpecifiedCookieContainer`. This is the only mode that HttpClientHandler uses.
The 'Set-Cookie' headers were currently only parsed out when a final HTTP response happened. This meant that 'Set-Cookie' headers present in interim 3xx redirection responses as well as interim 401, 407 auth responses would not be stored into the CookieContainer. Hence, those same cookies could not be sent back to the server when needed.
The fix is to make sure we parse out the 'Set-Cookie' headers whenever we get an HTTP response back from WinHTTP. As part of this fix, I re-factored out the cookie handling code into a separate class. I also added specific WinHttpHandler tests for the two different cookie modes as well as a HttpClientHandler test to validate cross-platform (i.e. CurlHandler).
Address dotnet/corefx#4960 but further fixes are needed for *NIX as well.
Commit migrated from https://github.com/dotnet/corefx/commit/8ac944afcbd35d8b489e14e1c4c7f4be08f74c72
WinHttpHandler was currently ignoring the `HttpRequestMessage.Version`
property and was always sending out requests using 'HTTP/1.1' which is the
default for winhttp.
This fix now will look at the request message `Version` property and
send out the request using either 1.0 or 1.1. If neither of these
versions are specified, then the request is sent out using the default
winhttp version (which is currently 1.1 as of Windows 10).
Note: The .NET Framework (Desktop) will throw an exception if neither
1.0 nor 1.1 version is specified. Currently CoreFx including NETNative,
WinHttpHandler and CurlHandler will simply use a default instead of
throwing. While this is different behavior than Desktop, it is more
desirable in the long run.
There is a separate issue dotnet/corefx#4870 to add HTTP/2.0 support to WinHttpHandler.
Fixesdotnet/corefx#4754
Commit migrated from https://github.com/dotnet/corefx/commit/f48989bbe10dd4b24a9e3b085672c30b5251cda6
My previous change to add HTTP/2 multiplexing broke some System.Net.Http functionality on CentOS, or more specifically when using an old version of libcurl that's in our CentOS 7.1 image.
That version of libcurl is from before HTTP/2 multiplexing was introduced. When multiplexing was added to libcurl, one of the existing libcurl functions (curl_multi_setopt) was changed such that if you were to pass in the HTTP/2 multiplexing option (which didn't exist at the time), due to the way the method was implemented, you'd end up opting in to HTTP 1.1 pipelining rather than having the option just be ignored. This is not the desired behavior and ends up breaking behaviors where we issue multiple HTTP 1.1 calls on the same multi handle concurrently.
This fix exposes from the native shim whether we're using a version of libcurl that supports HTTP/2 and that knows about the multiplexing option, and only configures the multi handle for multiplexing in that case.
Commit migrated from https://github.com/dotnet/corefx/commit/6d7793e3c24a779c5dde9e9b9419c2e452c32e6c
The latest versions of libcurl have HTTP/2 support; this commit enables that to be used from HttpClient via setting the request Version. Setting the Version will now pass along that version preference to libcurl; if it's set to 2.0, libcurl will use HTTP/2 if supported, otherwise it'll fall back to its default (1.1). As part of this I also fixed CurlHandler to pass along v1.0 and v1.1 so libcurl can respect the developer's explicit wishes.
(Note that the HTTP/2 light-up is only available if libcurl supports it. libcurl relies on nghttp2, which needs to be installed, and a version of libcurl needs to be used that's built against it. To test, I built these locally from source.)
Commit migrated from https://github.com/dotnet/corefx/commit/3440aa3cdbd6f82de3746762a08eb796b8b3d90a
By default libcurl drops headers with empty values, as it uses an empty value as a sentinel to mean "remove a previously added header with this key name." If you actually want a header with an event value, it needs to have a semicolon appended to the key name.
Commit migrated from https://github.com/dotnet/corefx/commit/93a9704371ab0b45794f2faa39cefb736c9a71a5
CurlHandler's support for pausing the connection needs to be resilient against spurious unpausing. This commit just removes a faulty assert for a condition that is possible and replaces it with proper handling (repausing).
Commit migrated from https://github.com/dotnet/corefx/commit/ce27027eb8924d32b5d75d4c46d36660e98570ee
* Move more tests to the new test server
* Cleanup 'var' coding patterns
* Remove duplicate tests (*Content clas related) that are already covered with the *Content class tests
* Utiilize the newer test server VerifyUpload endpoint which does 'Content-MD5' verification of transmitted payload to the server
as well as payload from the server
* Add GZip related tests in addition to Deflate compression schemes
Commit migrated from https://github.com/dotnet/corefx/commit/773c8ae1db5aa7e5d695a74fb63968382f8529da
Instead of creating 5 safe handles to native code, only allocate a single native handle in EasyRequest. The single native object will hold all the function and user data pointers necessary to invoke the managed callbacks.
Commit migrated from https://github.com/dotnet/corefx/commit/6fa52c6daed5675662140ec23c2e76cd8f64ce5d
Since libcurl defines callbacks with varying signatures from platform to platform, we need to define a signature for the callbacks that doesn't change. Then we register our own native callbacks, which then converts the parameters from the varying signature to the unchanging signature and invokes the managed callback.
Commit migrated from https://github.com/dotnet/corefx/commit/c874d10c29ae61f7e16f8cea327c1ae14f7568ea