Commit Graph
2279 Commits
Author SHA1 Message Date
Marie Píchová ad8115d577 Removed WinHttpHandler from System.Net.Http (#397)
* Removed WinHttpHandler from System.Net.Http.

* Disabled tests for WinHttpHandler.

* Removed UseSocketsHttpHandler settings

* Removed UseSocketsHttpHandler from tests (all tests use SocketsHttpHandler)

* Removed IsWinHttpHandler from tests.

* Updated WinHttpHandler project file.

* Fixed Linux build/tests.

* Fixed Win build of WinHttpHandler.

* Removed todos.
2019-12-02 17:35:23 +01:00
Alexander Nikolaev 3cec4f50af Current user identity in added to HttpConnectionKey (#303)
On retrieving a connection from a pool, HttpConnectionPoolManager adds the current user identity to the HttpConnectionKey for direct and proxy connections when the default credentials is used on Windows platform. Since on Unix there is not the concept of a user identity on the thread, the identity component in the key is always set to string.Empty.

Fixes dotnet/corefx#39621
2019-12-02 15:15:43 +01:00
Santiago Fernandez Madero 2e5d4eff3b Disable tests on CoreCLR using new attribute (#261)
* Disable tests on CoreCLR using new attribute

* Address PR Feedback
2019-11-27 11:02:52 -08:00
Drew Noakes 12894380bb Remove references to gender (#262) 2019-11-26 15:33:12 +01:00
Eirik Tsarpalis 14bd9a3f15 HttpStress: Use Windows containers and docker-compose (#209) 2019-11-25 20:59:16 +00:00
Eirik Tsarpalis 71e32c5046 httpstress: fix load-corefx-testhost.ps1 2019-11-19 14:34:08 +00:00
Stephen Toub e90b018a3b Fix up a bunch of repo references in docs (#60)
This is just prelminary, as all of the docs need to be rationalized with each other now that they're all in the same repo.  But it at least keeps most of the links working for now.
2019-11-15 19:15:37 +01:00
Viktor Hofer d8f6d63e34 Remove IsRuntimeRepository checks (#43)
* Remove IsRuntimeRepository checks

* Remove YAML bits needed for building in core-setup.

* Remove remaining consolidation branches in yml
2019-11-15 01:50:43 +01:00
Santiago Fernandez Madero d8adaeeff2 Fix test build of test project that referenced corefx shared corelib directly and cleanup common path usages (#47)
* Fix test build break and update common path usages to use property

* Use normalize directory for CommonPath and CommonTestPath

* Update instances of CommonPath and CommonTestPath to not use trailing \
2019-11-14 21:03:07 +01:00
Viktor Hofer 8e3694fbdd Fix CodeAnalysis.ruleset path (#35) 2019-11-14 15:38:15 +01:00
Viktor Hofer 00d3a3b733 Update CoreLib path for consolidation (dotnet/corefx#42577)
Commit migrated from https://github.com/dotnet/corefx/commit/dc6136f34c7d4ebbc493a7bb6cf1d15bc82250e6
2019-11-13 20:48:15 +01:00
Stephen Toub 9524bb599e Fix StyleCop rule SA1129 ("Do not use default value type constructor") (dotnet/corefx#42531)
Commit migrated from https://github.com/dotnet/corefx/commit/88f40addc220c73794f962f10d288c20c416ede1
2019-11-11 18:49:48 -05:00
Anirudh Agnihotry 3679e373a3 Bumping the assembly version to 5.0.0.0 (dotnet/corefx#41723)
* bumping the assembly Version

* correcting the resx file

* keeping netfx for oleDb

* fiixing the netfx tests as well

* fixing the DataSetExtensionsVersion

* removing netstandard2.0 from ref in datasetextensions


Commit migrated from https://github.com/dotnet/corefx/commit/9a4ed0d00bc642b015974684c32b00650426429f
2019-11-11 10:43:58 -08:00
Stephen Toub 401815ed1c Clean up after CurlHandler removal (dotnet/corefx#42506)
Also fix some stragglers from the netfx and uap handler removals.

Commit migrated from https://github.com/dotnet/corefx/commit/c63fbb73226ae3de3ee38d9b25de24ed3e41b6e2
2019-11-09 08:19:42 -05:00
Santiago Fernandez Madero 50d8a5f65d Cleanup MSBuild conditional operators to be all in lowercase (dotnet/corefx#42491)
Commit migrated from https://github.com/dotnet/corefx/commit/ab01852685e659a685af2ace33af5b3cefdf8430
2019-11-08 14:43:17 -08:00
Marie Píchová 19538490d0 Remove CurlHandler fallback from HttpClientHandler (dotnet/corefx#42451)
* Removed native curl usage and CurlHandler.

* More CURL removal in test code.

* More test fixing.

* Addressing PR comments

* Comments and typos.

* Removed constant bool fields with all occurences.


Commit migrated from https://github.com/dotnet/corefx/commit/8888c74e34f9a7df060258664dffe7ac29916443
2019-11-08 17:09:46 -05:00
Alexander Nikolaev 81bc60b7a3 HttpResponseHeaders validates trailing headers by names (dotnet/corefx#42229)
HttpResponseMessage.TrailingHeaders property is set to a new special instance of HttpResponseHeaders configured to validate trailing headers based on their names instead of types. When a header is being added via an explicit Add call, it checks the header type for the NonTrailing flag indicating a prohibited trailing header and throws an exception if it is found. In contrast, when a header arrives on the wire and is being added with TryAddWithoutValidation call, no extra check is performed because HttpConnection validates trailing headers in this scenario.
Fixes dotnet/corefx#41262

Commit migrated from https://github.com/dotnet/corefx/commit/805d06affd41715db4fb6102e05345d6323fcdf1
2019-11-08 13:41:11 +01:00
Santiago Fernandez Madero 7699e7ef6f Update azure pipelines to account for paths in consolidated repo (dotnet/corefx#42418)
Commit migrated from https://github.com/dotnet/corefx/commit/94a60d5238f654ab22f162ad3d6dac01adcdaeb8
2019-11-07 08:07:26 +01:00
Stephen Toub f6239ca84c Simplify Array.Copy(a, 0, b, 0, c) to Array.Copy(a, b, c) (dotnet/corefx#42343)
VS regex search and replace from `Array.Copy\((.+), 0, (.+), 0` to `Array.Copy($1, $2`, then manually reviewed.  The only changes I reverted were those to the tests for Array itself.

Commit migrated from https://github.com/dotnet/corefx/commit/5ac93ba0cc5843e4a544c8a23b5a9fcb05d0d69d
2019-11-04 06:16:06 -05:00
David Shulman 63dc7462d9 Merge pull request dotnet/corefx#42322 from davidsh/cert_tests
Cleanup HttpClient certificate tests

Commit migrated from https://github.com/dotnet/corefx/commit/897e15d9417e122658cd68bfad7407c56ecbe881
2019-11-03 18:42:42 -08:00
David Shulman 48cd6a8d29 Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/43f1ee20feb3db2281d2f9a338a46d8fae06202b
2019-11-03 16:48:16 -08:00
David Shulman be863f4aaa Cleanup HttpClient certificate tests
Some of the client certificate tests weren't running because they were conditioned on having
the "test root" installed. But that isn't needed for these tests.

Moved test to the loopback server. Also, cleaned up code which assumed the tests ran against
.NET Framework or UAP which isn't true anymore.


Commit migrated from https://github.com/dotnet/corefx/commit/a6c0e516956acd30bf412fc23bcb6b82cbb490ae
2019-11-03 09:24:36 -08:00
David Shulman 420e273807 Merge pull request dotnet/corefx#42324 from davidsh/disable_hanging_tests
Disable hanging tests

Commit migrated from https://github.com/dotnet/corefx/commit/d65822a3f6aa21844aceeedb7fce9cdf10af96c2
2019-11-02 14:31:29 -07:00
David Shulman a7c95ab9a6 Disable hanging tests
Contributes to dotnet/corefx#42323


Commit migrated from https://github.com/dotnet/corefx/commit/2c3cb3c1b05626ecd8c0df3e1a06466e34621ba8
2019-11-02 14:29:55 -07:00
Chris Ross 3e8cb443f3 Setup HTTP/2 code for sharing (dotnet/corefx#42070)
Commit migrated from https://github.com/dotnet/corefx/commit/832dfd260bdebffdff91cb67eecbb8b02d5eaff2
2019-11-01 17:31:16 -07:00
Viktor Hofer 926874e00a Use Package suffix instead of PackageId and Version suffix instead of PackageVersion (dotnet/corefx#42289)
* Use Package suffix instead of PackageId

* Manual darc update from build '20191101.2'


Commit migrated from https://github.com/dotnet/corefx/commit/931f79e4670cb73c9347e14714fd892907be6630
2019-11-01 18:27:23 +01:00
Eirik TsarpalisandStephen Halter 791f01a0d7 HttpStress: add docker documentation (dotnet/corefx#42268)
* httpstress: add documentation on dockerized stress runs

* fix stress yml issue

* fix doc issues

* remove commented out code

* remove accidental change

* yaml pipeline variables naming consistency

* Update eng/pipelines/stress/http-linux.yml

Co-Authored-By: Stephen Halter <[email protected]>


Commit migrated from https://github.com/dotnet/corefx/commit/4c3bd8a0533a2e35df371b91045a1a5f0ada7d54
2019-10-31 22:46:28 +00:00
Eirik Tsarpalis 5a7ed95219 Use docker-compose for running stress tests (dotnet/corefx#42186)
HttpStress: add docker-compose scenario


Commit migrated from https://github.com/dotnet/corefx/commit/df648522fd1a1bfaa14e9d1ae7c2eaf4a9c87a7c
2019-10-29 16:46:09 +00:00
Viktor Hofer d2999dc804 Remove versionless netstandard target group (dotnet/corefx#41984)
Commit migrated from https://github.com/dotnet/corefx/commit/26d7b6626ab0385a1158e674855f81ab73f628e0
2019-10-27 17:08:59 +01:00
Stephen Toub 3908711d1d Remove ILLinkTrim.xml from System.Net.Http (dotnet/corefx#42126)
The file was there to keep anonymous types used by DiagnosticsHandler from having their getters removed.  But a) it was relying on the implementation detail name generated by Roslyn, and b) it was keeping alive other state from other anonymous types in the assembly.  I changed it to use concrete types instead.  This also happens to result in less code, because we don't need the generated Equals/GetHashCode methods generated for anonymous types.

Commit migrated from https://github.com/dotnet/corefx/commit/b8a21f62f29ca98394c30151bdd72ff36f10765c
2019-10-26 16:02:39 -04:00
Eirik Tsarpalis ca723882d4 HttpStress: Add Stress Pipelines (dotnet/corefx#41833)
Commit migrated from https://github.com/dotnet/corefx/commit/f41ba828c76126a871d986cb5b7e9c44ddf6f3d7
2019-10-25 00:02:30 +01:00
Stephen Toub d7a062e5cd Fix a rare GetAwaiter().GetResult() on a ValueTask in System.Net.Http (dotnet/corefx#41958)
* Fix a rare GetAwaiter().GetResult() on a ValueTask in System.Net.Http

If someone's custom HttpContent-derived type is implementing their async SerializeToStreamAsync with synchronous Write calls on the destination stream, and if that WriteAsync method returns an IValueTaskSource-based ValueTask that's not yet completed, this could throw an exception.   This is unlikely to actually negative impact anyone right now, but it's worth fixing.  This is one of the patterns an analyzer around ValueTasks will help find and fix.

* Update src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpBaseStream.cs


Commit migrated from https://github.com/dotnet/corefx/commit/f37f05d4a7d916f14980456e9ddb95d2708efa24
2019-10-22 10:23:15 -04:00
Viktor Hofer e8803ace6e Disabling TaskCanceledQuickly timing out test (dotnet/corefx#41941)
Commit migrated from https://github.com/dotnet/corefx/commit/69fc7edb110a69345253060bb611deb3d4bec417
2019-10-21 15:06:57 +02:00
Viktor Hofer 9b88ca1d72 Remove UAP target (dotnet/corefx#41759)
* Remove Uap target

* Remove RemoteInvokeForUap wrapper calls entirely

* Harvest S.D.SqlClient on UWP

* Disable UWP PInvoke analyzer

* Enable WindowsRuntime* tests on netcoreapp

Commit migrated from https://github.com/dotnet/corefx/commit/3b6ec2ba944fb72f921f95b99b6ebf2e7bb3dc5a
2019-10-17 15:04:39 +02:00
Cory Nelson 4ab1d46ca8 HTTP2: Support receiving dynamic table headers (dotnet/corefx#41295)
Support HTTP2 dynamic table header decode. Improve some exception messaging in HPACK decoder. Resolves dotnet/corefx#41208

Commit migrated from https://github.com/dotnet/corefx/commit/7487aec03dc27b910ad4ea096544b850afc74876
2019-10-16 15:28:50 -07:00
Eriawan Kusumawardhono 89174f25b0 Replace tfm based constants with SDK ones (dotnet/corefx#41601)
* replace DefineConstants with SDK ones

Commit migrated from https://github.com/dotnet/corefx/commit/2133679ff62222ba2734232ab8fa4c65765e82a2
2019-10-15 19:11:40 +02:00
Stephen Toub 7ff3a1100a Reduce RemoteInvoke usage in tests (dotnet/corefx#41741)
Many of our RemoteInvokes are there purely because of needing to change the current thread culture but on UAP that actually impacting the whole process.  Until that's addressed, we can at least avoid the RemoteInvoke on all platforms other than UAP. There are also some RemoteInvokes that can be avoided by just serializing all of the (small number of) tests in a test assembly. And there's some additional cleanup to be done as well around not explicitly returning an exit code unless required.

This helps measurably with test performance.  Consider the System.ComponentModel.Annotations test suite.  On my machine, prior to these changes, it took ~25 seconds; after these changes, it takes ~0.3. It helps even more when running against a checked runtime, where all of our test costs are magnified.  With a checked runtime, prior to these changes, it takes ~196 seconds; after these changes, it takes ~2.5 seconds.  This should help measurably with CI time in coreclr.

Commit migrated from https://github.com/dotnet/corefx/commit/cd18bafbabf7fe47601f6f790d157409034a2477
2019-10-15 12:09:06 -04:00
Eirik Tsarpalis 41a0c3d337 HttpStress: Add scripts for loading the corefx testhost in the environment (dotnet/corefx#41721)
HttpStress: add testhost environment loader scripts


Commit migrated from https://github.com/dotnet/corefx/commit/faefe04a1cd88053cb8d63028494dfe7ea1a97ec
2019-10-14 13:59:16 +01:00
Stephen Toub 48c5afd0e5 Make WebRequest.GetSystemWebProxy() return a working proxy (dotnet/corefx#41692)
* Make WebRequest.GetSystemWebProxy() return a working proxy

Today it returns a singleton on .NET Core that throws PlatformNotSupportedExceptions, and is only used for its reference identity by the WebRequest implementation.  This is problematic for existing code that's taking this proxy and passing it to, for example, ClientWebSocket's Proxy, as it will end up being an expensive nop.  In fact, there's currently no way when targeting netstandard2.0 to tell ClientWebSocket to use a default proxy.

With this fix, WebRequest.DefaultWebProxy (which just defaults to GetSystemWebProxy()) will now return HttpClient.DefaultProxy, which is actually a working proxy implementation.

* Stop throwing NotSupportedException from HttpClient.DefaultProxy.set_Credentials

The OS and how the environment is configured determines what concrete type is returned from HttpClient's DefaultProxy property.  And currently these different types behave differently from set_Credentials.  Two of them are throwing NotSupportedException, which is not expected from the IWebProxy interface.  We should just roundtrip the credentials set, even if they're not used.


Commit migrated from https://github.com/dotnet/corefx/commit/8d21b79b924d29088dbde46d42737a657d466b5e
2019-10-12 08:15:05 -04:00
David Shulman b457137b1e Re-enable NoCallback_RevokedCertificate_NoRevocationChecking_Succeeds test
The third-party server we use for this test, revoked.badssl.com, now has a new
certificate that is good for another two years and is also revoked. So, we can
re-enable this test.

Fixes dotnet/corefx#41108


Commit migrated from https://github.com/dotnet/corefx/commit/0dd95fc3d4bd24db0fd860295c5873703d7738f5
2019-10-10 12:34:49 -07:00
Stephen Toub 6adeb9be60 Change some internal async Task methods to be async ValueTask (dotnet/corefx#40527)
We have some internal and private `async Task` methods that are only ever `await`ed.  Today there's no benefit to making them `async ValueTask` methods, so we've kept them as `async Task`.  However, if we end up changing the implementation of `async ValueTask` to pool underlying objects, there becomes a potential benefit to using `async ValueTask` for these instead of `async Task`.  This PR changes those in a variety of libraries where we care more about performance and allocations.  There are likely a few more methods we'd want to convert based on profiling, but I believe this represents the bulk of them.

Commit migrated from https://github.com/dotnet/corefx/commit/97d9fb9d6c7e1d50f527e290ef8e18767dbc6bbf
2019-10-10 06:04:01 -04:00
Stephen ToubandDavid Shulman 08b76ee2b9 Remove unnecessary length restriction on Uri.Escape{Data/Uri}String (dotnet/corefx#41686)
* Remove unnecessary length restriction on Uri.Escape{Data/Uri}String

* Address PR feedback

Co-Authored-By: David Shulman <[email protected]>


Commit migrated from https://github.com/dotnet/corefx/commit/1d49632bc213416d27ed6c567fd8dd08e00170a1
2019-10-10 06:03:29 -04:00
Eirik Tsarpalis efb1df60cf Httpstress: add max execution time argument (dotnet/corefx#41643)
HttpStress: add max execution time arg

Adds -maxExecutionTime cli argument.
Enables nullable annotations.

Commit migrated from https://github.com/dotnet/corefx/commit/630924d0ccfbac62195927c0f4514fe33d47c729
2019-10-09 11:53:42 +01:00
Stephen Toub 108bf6bbf7 Several improvements to SocketsHttpHandler perf (dotnet/corefx#41640)
* Do not force-parse TryAddWithoutValidation headers in SocketsHttpHandler

When enumerating headers to write them out, do not force them to be parsed if the user explicitly asked for them not to be with "WithoutValidation".  If the key/values are incorrectly formatted, the request may end up being written incorrectly on the wire, but that's up to the developer explicitly choosing it.

* Revert HttpRequestHeaders.ExpectContinue optimization

Several releases ago, when we weren't paying attention to ExpectContinue, we optimized away the backing field for it into a lazily-initialized collection; that made it cheaper when not accessed but more expensive when accessed, which was fine, as we wouldn't access it from the implementation and developers would rarely set it.  But now SocketsHttpHandler checks it on every request, which means we're paying for the more expensive thing always. So, revert the optimization for this field.

* Avoid allocating a string[] per header

When we enumerate the headers to write them out, we currently allocate a string[] for each.  We can instead just fill the same array over and over and over.


Commit migrated from https://github.com/dotnet/corefx/commit/4d346a9ab7b6e619dae3784283acb87bb7a825c9
2019-10-08 21:22:47 -04:00
Stephen Toub 1e7fc68275 Add ConcurrentDictionary.TryRemove(KeyValuePair) (dotnet/corefx#41597)
Commit migrated from https://github.com/dotnet/corefx/commit/a62579502cb9e86b761c2249d0d04af3d827b3a3
2019-10-07 14:19:57 -04:00
Stephen Toub 95022c31b5 Expose, test, and use ExceptionDispatchInfo.SetCurrentStackTrace
Commit migrated from https://github.com/dotnet/corefx/commit/615990343a9400e46122debf48a5fb08ec452787
2019-10-05 17:07:51 -04:00
Adeel Mujahid d65600b4b0 Replace PrintF with Console.WriteLine and cleanups (dotnet/corefx#41540)
* Replace PrintF with Console.WriteLine and cleanups

* PR feedback: simplify WriteLine arguments


Commit migrated from https://github.com/dotnet/corefx/commit/c28a9e69902bcbc0d742732630bd6e82ac922d5b
2019-10-04 14:48:15 -04:00
Justin Kotalik 9c4e678eb8 Synchronize Http/2 HPack implementation between CoreFx and ASP.NET Core (dotnet/corefx#41069)
Commit migrated from https://github.com/dotnet/corefx/commit/547a2936f07203ad7ac03603fa96d443542ee307
2019-10-02 07:36:01 +09:00
Stephen Toub e851484147 Remove unnecessary dependencies from System.Net.Http (dotnet/corefx#41470)
Commit migrated from https://github.com/dotnet/corefx/commit/e4cfb1761f20b182919db2aeb6ba92b48492c469
2019-10-01 15:43:41 -04:00
Eirik Tsarpalis 534b8d8681 HttpClientHandler functional test: replace remote server dependency (dotnet/corefx#41229)
* HttpClientHandler functional test: replace remote server dependency

Replaces remote server dependency for HttpClientHandler_MaxResponseHeadersLength_Test.SetAfterUse_Throws.
Fixes dotnet/corefx#41148

Commit migrated from https://github.com/dotnet/corefx/commit/b020d0033ffe755f779c564186fc2d98b0af31cc
2019-09-20 18:32:06 +03:00