Commit Graph
2219 Commits
Author SHA1 Message Date
Cory Nelson b0c6eb77cd Support PAC scripts that return multiple proxies (dotnet/corefx#40082)
* Support PAC scripts that return multiple proxies.

Resolves dotnet/corefx#39370 

Commit migrated from https://github.com/dotnet/corefx/commit/5e97c2b50ac2b18909606ce3ea14c3e7e61db7e8
2019-09-05 02:11:47 -07:00
Tomas Weinfurt c4efc1dafd fix more tests to work with http2 (dotnet/corefx#39019)
* fix cancelation tests to work with http2

* fix more tests and feedback from review

* feedback from review

* fix issues with missing connection: close

* update body check

* feedback from review

* fix resolve

* feedback from review


Commit migrated from https://github.com/dotnet/corefx/commit/5108d9245b891deeb36a164f434f4fb6975c8baf
2019-09-04 16:48:34 -07:00
Stephen Toub 11f952306a Remove readonly from two GCHandle fields (dotnet/corefx#40807)
Due to the `readonly`, the mutations performed by `Free` will be done on a copy rather than on the data stored in the field.

Commit migrated from https://github.com/dotnet/corefx/commit/437ce88edeb835e1dbe94c6d418b6169b69745fb
2019-09-04 17:46:09 -04:00
Tomas Weinfurt c363e029ea replace CRLF with Environment.NewLine where appropriate (dotnet/corefx#40723)
* replace CRLF with Environment.NewLine where appropriate

* use sb.AppendLine

* fix more unit tests


Commit migrated from https://github.com/dotnet/corefx/commit/a6e7ffd72db078a46612afa9d085bd27ef8e2fed
2019-09-03 22:34:24 -04:00
Tomas Weinfurt efe32d48a8 surface _abortException (dotnet/corefx#40785)
Commit migrated from https://github.com/dotnet/corefx/commit/bc7e561e28839c56f7465f3382d5f60716a34bab
2019-09-03 22:11:43 -04:00
Stephen Toub f08a1c9c9b Pass a CancellationToken in a few more places (dotnet/corefx#40715)
Most of these to WaitAsync shouldn't actually matter, as the semaphores being used are there for corner cases or to protect erroneous usage, but if there's no contention, passing a token won't hurt, and if there is contention, passing the token makes it more robust.

Commit migrated from https://github.com/dotnet/corefx/commit/14a7adb23569363b94d575d64b7cb1f38cda3e4a
2019-09-03 15:24:08 -04:00
Eirik Tsarpalis ea60c15a90 Httpstress: Add more checksum validations & expose Kestrel Http2 limits configuration (dotnet/corefx#40708)
Httpstress: Add more checksum validations & expose Kestrel Http2 limits configuration

Commit migrated from https://github.com/dotnet/corefx/commit/a64e40535283d6470c2909c8f08b178454a8718b
2019-08-30 23:14:49 +02:00
Stephen Toub 4fc5d8971d Contribute to IDE0055 (fix formatting)
Commit migrated from https://github.com/dotnet/corefx/commit/b49a8a9be1d53cd9e50cb68fd8540be25c65d433
2019-08-24 07:47:35 -04:00
Stephen Toub 7bdae2162f Contribute to StyleCop SA1002 (semicolon spacing)
However, I'm not enabling the rule permanently, as it disagrees with VS IDE0055 about the spacing around semicolons at the end of empty while and for loops.

Because this also impacts `for (;;)` loops, I also searched and replaced those with `while (true)`, to standardize on that across the codebase.


Commit migrated from https://github.com/dotnet/corefx/commit/93285e4511a9656a30b92b8b6a9088608aac40e0
2019-08-24 07:47:35 -04:00
Stephen Toub bfa8c26dcb Fix StyleCop warning SA1001 (spaces around commas)
Commit migrated from https://github.com/dotnet/corefx/commit/37f351d310f07560274c63862ceaed8afd54a46f
2019-08-24 07:47:35 -04:00
Eirik Tsarpalis 2077e8783b Httpstress: Add checksum validation & support plaintext http (dotnet/corefx#40360)
Httpstress: Add checksum validation & support plaintext http

Commit migrated from https://github.com/dotnet/corefx/commit/a25beeee0af0c849eef58c45579733efa0d55f8d
2019-08-22 21:55:04 +01:00
Eirik Tsarpalis 6379ad84d3 HTTP2: fix header corruption issue (dotnet/corefx#40487)
* HTTP2: fix header corruption issue

Fixes a bug in HPackEncoder which results in header
data corruption in cases where the write buffer has
not been zeroed out. Adds HPack roundtrip tests.
Fixes dotnet/corefx#40459.

Commit migrated from https://github.com/dotnet/corefx/commit/6f9796080563c9c40359e641e3287fabe42b580c
2019-08-22 21:49:07 +01:00
madmir 018e1b82e8 Re-enable xunit warning 2017 (dotnet/corefx#40467)
* Re-enable xunit warning 2017

Use specialized assertions for checking for elements in collections.

* Revert Re-enable xunit warning 2017, revert some test changes

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/2fc48e13e87a4e68576d7df7af420ac2874e929e
2019-08-22 10:17:26 -04:00
madmir 6f12721616 Re-enable xunit warning 1019 (dotnet/corefx#40415)
Make MemberData reference IEnumerable<object[]>

Commit migrated from https://github.com/dotnet/corefx/commit/3c09762fa14249c65e5bc676a5d812c2654c8941
2019-08-19 20:59:07 -04:00
Stephen Toub 9885a60658 Fix IDE0066 across corefx (dotnet/corefx#40288)
* Fix IDE0066 across corefx

"Fix all", but then manual tweaking to accommodate places the rule doesn't work quite right.

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/f71a5a1d88214a9e2c26ff2ff8bcfb1017aa6713
2019-08-16 11:24:54 -04:00
Stephen Toub 52c39738de Fix a few missing $s for string interpolation in tracing (dotnet/corefx#40322)
Commit migrated from https://github.com/dotnet/corefx/commit/d116b2d4ee4041970943d6fffdf8a97446f8b6ff
2019-08-15 08:50:12 -04:00
Stephen Toub cae3309c0a Fix non-ASCII characters across corefx (dotnet/corefx#40318)
* Fix several non-visible characters in test files

* Replace Unicode surrogate pairs with escaped hex values

* Fix non-ASCII characters in most C# files


Commit migrated from https://github.com/dotnet/corefx/commit/027eb8e19c3498cc2c656931c3b879f5ddb63b0d
2019-08-15 08:17:46 -04:00
Stephen Toub 9548bea38a Make many fields readonly or const across corefx (dotnet/corefx#40298)
* Make many fields readonly or const

* Address PR feedback

- Updated asn.xslt
- Regenerated .xml.cs files


Commit migrated from https://github.com/dotnet/corefx/commit/0cc22ccba707d7552159363d586262fa9c4e8a2a
2019-08-14 14:19:30 -04:00
Krzysztof Wicher 8a80b68d18 Add TLS 1.3 to all protocols in GetAsync_AllowedSSLVersion_Succeeds (dotnet/corefx#40281)
Commit migrated from https://github.com/dotnet/corefx/commit/302b3283f5439907ca2586784ba32381ac312f72
2019-08-13 10:48:28 -07:00
Krzysztof Wicher c4b980aadd Fix 2 System.Net.Http tests failing on debian (dotnet/corefx#40259)
Commit migrated from https://github.com/dotnet/corefx/commit/af36939acdf751d2465358be3f892170f73f9b48
2019-08-12 23:01:21 -07:00
Stephen Toub 50b30c6f63 Avoid disposing Http2Stream's request body cancellation source (dotnet/corefx#40255)
Commit migrated from https://github.com/dotnet/corefx/commit/a4f5f13ec1fa0d51ce0964c126e35ef0046ea7be
2019-08-12 21:24:30 -04:00
Stephen Toub 6a988c7d03 Enable StyleCop rules 1205, 1411, 1026, and 1000 (dotnet/corefx#40254)
* Fix StyleCop warning SA1411 (attribute ctor shouldn't use unnecessary parens)

* Fix StyleCop warning SA1026 (new[] spacing)

* Fix StyleCop warning SA1000 (consistent spacing around if, for, switch, etc.)

* Fix StyleCop warning SA1205 (partial elements should declare an access modifier)


Commit migrated from https://github.com/dotnet/corefx/commit/0c4c234a918254d569ffb0f6a607f98193608646
2019-08-12 22:45:34 +02:00
Stephen Toub 2a47457139 Make several local functions static (dotnet/corefx#40251)
Commit migrated from https://github.com/dotnet/corefx/commit/d3155017e1fe6acdb72e2d1b30c5b2e36cf21af8
2019-08-12 15:08:18 -04:00
Viktor Hofer 555649a675 Disable two SocketsHttpHandler tests on Debian10 (dotnet/corefx#40247)
Commit migrated from https://github.com/dotnet/corefx/commit/eb58b0a0e0a45c42d67b69b44047cf60116650c3
2019-08-12 10:18:13 -04:00
Stephen Toub 182e23d123 Re-enable StyleCop warning SA1400 (elements should specify access) (dotnet/corefx#40240)
One of the more common things we "nit" in PRs.  Now the compiler will flag it for us.

Commit migrated from https://github.com/dotnet/corefx/commit/61a6264018989e06d314b68d57bd91b4b72e4360
2019-08-12 14:29:19 +02:00
Eirik Tsarpalis 3b91c9be5e HttpStress: add a 'GET Slow' operation (dotnet/corefx#40157)
* HttpStress: add a 'GET Slow' operation

Adds a 'GET Slow' operation. Additionally randomize 
the response content in GET requests. These are 
validated by having the client specify the expected 
content length in request headers.

Commit migrated from https://github.com/dotnet/corefx/commit/ba8156d2f0d206655caf0713f6bed0265f48f098
2019-08-09 19:35:03 +01:00
Geoff Kizer c2ff61e7d1 ensure we don't try to send RST_STREAM or EndStream while holding the stream lock (dotnet/corefx#40123)
Commit migrated from https://github.com/dotnet/corefx/commit/719b8fb635db44ba80ea6d5f2e7effaf5906f588
2019-08-09 05:09:37 -07:00
Stephen Toub 087592a6e8 Fix several test use of RunContinuationsAsynchronously (dotnet/corefx#40121)
Commit migrated from https://github.com/dotnet/corefx/commit/d3911035f2ba3eb5c44310342cc1d654e42aa316
2019-08-07 21:08:35 -04:00
Stephen Toub 60d1224ddd Re-enable StyleCop warnings SA1028 and SA1518 (trailing whitespace and blank lines) (dotnet/corefx#40113)
Mechanical/automated change.  The only manual changes were a) removing the two rules from the CodeAnalysis.ruleset file, b) removing spaces from one line of a .targets file that is used to generate a .cs file, and c) reverting the changes in a few test files where the naive replacement happened in the middle of a verbatim string where the whitespace actually mattered.

Commit migrated from https://github.com/dotnet/corefx/commit/09a6e66b0c2b31bd0f6e7e3170537d14027aeed0
2019-08-07 21:07:58 -04:00
Krzysztof Wicher 5fc645652b Disable System.Net.Http.FunctionalTests SetDelegate_ConnectionSucceeds on OSX (dotnet/corefx#40119)
* Disable SetDelegate_ConnectionSucceeds on OSX

* apply PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/9ac414a6781d05ce7d1d26488a72e6b8201bb071
2019-08-07 16:24:47 -07:00
Stephen Toub 34e34383a3 Re-enable StyleCop warning SA1113 (comma on same line as previous parameter)
Commit migrated from https://github.com/dotnet/corefx/commit/e83c72910b62ea31fdb4952795a5322be7a98540
2019-08-07 19:15:26 -04:00
Stephen Toub 5841b6997a Re-enable StyleCop warning SA1302 (interface names should begin with I)
Commit migrated from https://github.com/dotnet/corefx/commit/b746716a4506976d16f65d798652528ce81afa65
2019-08-07 19:15:26 -04:00
Stephen Toub e8ac02bcf5 Re-enable StyleCop warning SA1020 (++ preceded by a space)
Commit migrated from https://github.com/dotnet/corefx/commit/7813ff5a30fde8ee74dec884fdcec29864039e2a
2019-08-07 19:15:26 -04:00
Eirik Tsarpalis c19973aecb HttpStress: fixed unhandled exceptions being eaten (dotnet/corefx#40090)
Commit migrated from https://github.com/dotnet/corefx/commit/dee4e93caad860030646d4fef7812f337df6a5f4
2019-08-07 10:31:04 -04:00
Stephen Toub c8df52dd02 Re-enable xunit warning 1026 (unused theory arguments) (dotnet/corefx#40079)
* Re-enable xunit warning 1026 (unused theory arguments)

Some of these were addressed by explicitly discarding theory arguments, generally in cases where either a) the argument was being used as a description to aid in debugging failures, or b) the argument was part of a member data that was used by some theories and not by others all sharing the same member data.

However, there are quite a few legitimate bugs being fixed here, enough that highlights it's worthwhile to have the rule enabled.  Some are cases where the argument was supposed to be used but wasn't.  Some are cases where the argument isn't used at all, and in many cases where we end up running the same test over and over and wasting cycles.  Some are cases where we're unnecessarily including irrelevant inputs to the tests and making the input data more complicated than it needs to be.  Etc.

(Along the way, I also fixed some cases where VS was warning about lambdas being used instead of local functions, and in cases where I agreed I fixed them, via auto-fixers.)

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/daf93ee0e5e5233141eb762c64b6049cfd7d123e
2019-08-07 08:00:27 +02:00
Cory Nelson 9cc4a567a6 Fix DynamicTable.Resize failing when it grows the table. (dotnet/corefx#40040)
Fixes DynamicTable.Resize failing when it grows. Resolves dotnet/corefx#39967
Updates DynamicTable.EnsureAvailable to null out unused buffers. Allows earlier GC, but mainly helps debugging.
Add HeaderField.ToString() to assist with debugging.

Commit migrated from https://github.com/dotnet/corefx/commit/cc5653fcceefce5eac38dc7847b12b371027f78f
2019-08-06 18:23:03 -07:00
Eirik Tsarpalis 2caa228c48 HttpStress: Add aggregate reports to end of test runs (dotnet/corefx#39928)
* HttpStress: Add aggregate reports to end of test runs

Reworks the StressClient so that an aggregate report of
encountered stress errors are printed to stdout at the
end of a test run.

Commit migrated from https://github.com/dotnet/corefx/commit/042369feaacdb65504b58e9621d56a2d1c7ffd1c
2019-08-06 23:09:33 +01:00
Geoff Kizer 59d3e335d1 HTTP2: Fix handling of RST_STREAM with error = NO_ERROR after response EndStream (dotnet/corefx#39882)
* fix handling of RST_STREAM with error = NO_ERROR after response EndStream

* eat exception and ensure we don't cancel the response body

* add comment

* add CancelResponseBody to avoid code duplication, and add checks we are not holding the stream object lock when we don't expect to

* fix _expect100ContinueWaiter to use TaskCreationOptions.RunContinuationsAsynchronously


Commit migrated from https://github.com/dotnet/corefx/commit/ca6c44b72b868c112387b0fb7def42d91f5577aa
2019-08-05 11:13:46 -07:00
Geoff Kizer 1b56ae42cb fix exceptions thrown from SendHeadersAsync to allow retry when appropriate, and surface a useful error when retry is not allowed (dotnet/corefx#39985)
Commit migrated from https://github.com/dotnet/corefx/commit/4e7d0c32d9cedc9d1436c3d71eec8ac96ed0064d
2019-08-05 09:02:47 -07:00
Stephen Toub cd386d1dbb Remove some unused locals (dotnet/corefx#39956)
* Remove some unused locals

Trying out various analyzers, including one to flag unused locals.  There are more than this, but this is a first batch.  Some of these are just clean-up.  Others are saving unnecessary cost.  At least one appears to be a real functional bug.

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/545d9959aebded62a26d20c7c1bf86785a92e52a
2019-08-05 11:05:14 -04:00
Cory Nelson 2bbb062233 HPACK decoder fixes (dotnet/corefx#39907)
- Fix HPACK decoder failing inconsistently with 0-length header names. Fail fast with same exception message that HTTP1 uses. Resolves dotnet/corefx#39873.
- Fix `DynamicTable` returning incorrect values or throwing exceptions when it wraps its ring buffer. Resolves dotnet/corefx#39656.
- Moves HPACK encoder methods from `Http2LoopbackConnection` into their own class.
- Implement all forms of header encodings in HPACK encoder.
- Move a number of files where they belong into the ProductionCode folder in unit test project.

Commit migrated from https://github.com/dotnet/corefx/commit/b7e60c9aa17fbe043318afd68af31cd3a6d61a76
2019-08-01 19:59:51 -07:00
Stephen Toub 0d8a87d1dd Enable stylecop warnings 1205, 1212, and 1617 (dotnet/corefx#39941)
* Enable stylecop warning 1617 (void return value should not be documented)

* Enable stylecop warning 1212 (get/set accessor ordering)

* Enable stylecop warning 1205 (modifier ordering)


Commit migrated from https://github.com/dotnet/corefx/commit/6074cfc995d7968fcdbc7f707acff0c6284c6ae9
2019-08-01 18:00:12 -04:00
David Shulman fd89065fb6 Fix SocketsHttpHandler proxy auth for 'Negotiate' scheme (dotnet/corefx#39933)
Issue dotnet/corefx#39887 reported that proxy authentication with 'Negotiate' scheme broke between
.NET Core 3.0 Preview 6 and Preview 7. The base64 blob was no longer using SPNEGO protocol
but instead was always using NTLM. While 'Negotiate' scheme can use either SPNEGO or NTLM,
it should always use SPNEGO if possible. And many enterprises have a setting which requires
it and rejects NTLM protocol.

This issue was caused by PR dotnet/corefx#38465 which fixed some other SPN issues with Kerberos
authentication. That PR regressed the SPN calculation for the proxy authentication by
using the wrong host name in the SPN. A mismatch of the SPN will cause NTLM to be used
instead of SPNEGO.

The fix is to check if proxy authentication is being used instead of server authentication.
If so, it ignores any 'Host' header and always will use the uri, which in this case is the
uri of the proxy server.

This was tested manually. It is impossible right now to test Kerberos and proxy scenarios in
CI because they require machine configuration to register SPNs in a Windows Active Directory
environment.

This PR will be ported for release/3.0 for ASK mode consideration since it affects a mainline
enterprise scenario.

Fixes dotnet/corefx#39887 



Commit migrated from https://github.com/dotnet/corefx/commit/85f30cc03470691f0096d4c89ba787727aa55790
2019-08-01 13:54:45 -07:00
Stephen Toub 6e335aa872 Enable several StyleCopAnalyzers (dotnet/corefx#39921)
* Fix ordering of keywords in member signatures

* Add StyeCop.Analyzers

Most rules are disabled.  Many of them we'll want to leave disabled, however there are a handful it'll be good to enable over time.

* Use built-in type alias

* Fix straggling stylecop warnings in all configurations

* Replace tabs with spaces


Commit migrated from https://github.com/dotnet/corefx/commit/a12c557a72988070b8624cc7ecc46899629895c4
2019-07-31 19:10:59 -04:00
Stephen Toub be49ca478c Add TrailingHeaders to HttpResponseMessage.ToString output (dotnet/corefx#39902)
Commit migrated from https://github.com/dotnet/corefx/commit/a7c542f257f58e7ae41d5274a02a5e823d4492c0
2019-07-31 09:19:00 -04:00
Stephen Toub 3364838e1e Re-enable CA1823 (unused private fields) (dotnet/corefx#39899)
Commit migrated from https://github.com/dotnet/corefx/commit/e5d38a54cf21f6427ae4fe99c3841c8067139e75
2019-07-31 08:04:33 -04:00
Cory Nelson 3939dff4e2 Fix DynamicTableSizeUpdate_Exceeds_Settings_Throws (dotnet/corefx#39880)
* Update test to read different exception structure.

Resolves dotnet/corefx#39876.

Commit migrated from https://github.com/dotnet/corefx/commit/175c4b7467f4da173c732f9aaf95882b3c426665
2019-07-30 14:36:59 -07:00
Tomas Weinfurt 6185988bed improve handling of 100continue for H2 (dotnet/corefx#39869)
* improve handling of 100continue for H2

* feedback from review


Commit migrated from https://github.com/dotnet/corefx/commit/556792fdc3f76af238e3955b3d5716ede558d42f
2019-07-30 13:43:57 -07:00
Eirik Tsarpalis 118e4aa479 HttpStress: Add duplex operation that disposes response content (dotnet/corefx#39860)
HttpStress: add duplex operation that disposes response content

Commit migrated from https://github.com/dotnet/corefx/commit/5b6a74d8455aab11f64377f3200ace1df71110ea
2019-07-30 19:28:02 +01:00
Stephen Toub f78cb0b72c Re-enable xunit warning 2005 (dotnet/corefx#39866) (dotnet/corefx#39864)
Commit migrated from https://github.com/dotnet/corefx/commit/9142b477f9355ed184df326d7cd1de4963631228
2019-07-30 08:45:39 -04:00