Commit Graph
2195 Commits
Author SHA1 Message Date
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
Stephen Toub 616e8abdfa Disable DynamicTableSizeUpdate_Exceeds_Settings_Throws test (dotnet/corefx#39877)
Commit migrated from https://github.com/dotnet/corefx/commit/eb44b1ffe5f9aeb9852beee0fc123add3fe47492
2019-07-29 20:28:49 -04:00
Cory Nelson fa410ebdd8 HTTP2: Validate dynamic table size updates (dotnet/corefx#39669)
* Validate dynamic table size updates.
* Set dynamic table size to 0, to reduce a per-connection ~2048 byte allocation to a ~0 byte allocation.

Resolves dotnet/corefx#39666 


Commit migrated from https://github.com/dotnet/corefx/commit/14b604c5fe52e0022881a0866bf39f344d247fd7
2019-07-29 10:46:49 -07:00
Stephen Toub d24aa292ac Re-enable xunit warning 2009 (dotnet/corefx#39847)
Commit migrated from https://github.com/dotnet/corefx/commit/6737565ccbb8ceb484d349bd6844f7470bf23248
2019-07-29 09:42:13 -04:00
Ganbarukamo41 9be9c570be Enable analyzer for xUnit2000 (Constants and literals should be the expected argument) (dotnet/corefx#39842)
* Enable xUnit2000 analyzer

This commit enables xUnit2000 (Constants and literals should be the expected argument) and apply fixes for the existing violating codes.
* a Massive commit fixing xUnit2000
* fixing some 2003 errors

* Fix mistakes

* Fix missed errors for unix


Commit migrated from https://github.com/dotnet/corefx/commit/93d7aa1c1737b6da29d04b78557215e18eb786d4
2019-07-28 15:47:52 -07:00
Geoff Kizer 0d73813e42 Merge pull request dotnet/corefx#39834 from geoffkizer/fixendstreamrace
HTTP2: Ensure we never send EndStream after RST_STREAM

Commit migrated from https://github.com/dotnet/corefx/commit/57df8b38e4e70fc25aabe3d061cd1745cff0b26b
2019-07-27 21:25:40 -07:00
Geoff Kizer b8d599c6b7 ensure we never send EndStream after RST_STREAM
Commit migrated from https://github.com/dotnet/corefx/commit/9389088720e38b9d4f1d126d9daaa3461ad158e8
2019-07-27 15:45:17 -07:00
Stephen Toub e1417b0e56 Fix SendAsync_SuppressedGlobalStaticPropagationNoListenerAppCtx test (dotnet/corefx#39795)
Commit migrated from https://github.com/dotnet/corefx/commit/8a6389529afdc0dd53d4c94fe665695ec54c21af
2019-07-26 22:24:39 -04:00
Eirik Tsarpalis 8a8bdca968 Merge pull request dotnet/corefx#39774 from eiriktsarpalis/httpserver-add-echo-header-endpoint
HttpStress: Add randomized request headers

Commit migrated from https://github.com/dotnet/corefx/commit/3ebfae3ed729af13e59c0525e7b794327bfd227f
2019-07-26 22:05:57 +01:00
Eirik Tsarpalis 563726e051 take HttpClient.BaseAddress into account when bounding request uri sizes
Commit migrated from https://github.com/dotnet/corefx/commit/d5a0fb96a026447dcf201dc7c19b0b8d41be60f5
2019-07-26 21:40:48 +01:00
Eirik Tsarpalis 39beda7d70 maxRequestLineSize -> MaxRequestUriSize
Commit migrated from https://github.com/dotnet/corefx/commit/920292cf7c763a6963119e7cb7cd2faa149a1cb1
2019-07-26 21:08:57 +01:00
Eirik Tsarpalis 484084df56 respect kestrel request line size
Commit migrated from https://github.com/dotnet/corefx/commit/261ff104b73439fda85a950e2dfb3f5bc8e23c5b
2019-07-26 20:44:31 +01:00
Eirik Tsarpalis 36410dbf1a merge headers and echo headers operations
Commit migrated from https://github.com/dotnet/corefx/commit/e22fbde5ebe4000d682bcb679a3a372050c2bc16
2019-07-26 15:49:09 +01:00
Eirik Tsarpalis f424b22c15 address feedback
Commit migrated from https://github.com/dotnet/corefx/commit/b32c61aa4741668d6f4009649412ff80f5d64f85
2019-07-26 14:12:26 +01:00
Eirik Tsarpalis 6546a083dd address feedback
Commit migrated from https://github.com/dotnet/corefx/commit/88de39071ec291e67f1c5829ea7e9dd30c913da1
2019-07-25 21:54:15 +01:00
Geoff Kizer efd5aca94c Merge pull request dotnet/corefx#39745 from geoffkizer/requesterrorfix
HTTP2: fix race between request failure and response body read

Commit migrated from https://github.com/dotnet/corefx/commit/64a9e2ccf5e590e0a3a3d6dc9c2a7c828850c912
2019-07-25 12:07:05 -07:00
Eirik Tsarpalis fbf7c6e796 HttpStress: add randomized header operation
Aguments the stress suite with an "Echo Header" operation
which sends and receives a randomly generated set of headers.
Additionally expands random string to full alphanumeric or ascii range.
Fixes a bug where `n - 1` workers were being initialized.


Commit migrated from https://github.com/dotnet/corefx/commit/ac3e0d6f35dfccdd70bacfc09941fef791192da5
2019-07-25 18:21:30 +01:00
Eirik Tsarpalis b558ceb022 Merge pull request dotnet/corefx#39632 from eiriktsarpalis/httpstress-segregate-client-server
HttpStress: Allow standalone client and server processes

Commit migrated from https://github.com/dotnet/corefx/commit/b5483cb5280235a94b534c93e678e647cfcecd0c
2019-07-25 12:12:15 +01:00
Stephen Toub bf9054c38c Re-enable xUnit1025 (duplicate InlineData) (dotnet/corefx#39737)
Commit migrated from https://github.com/dotnet/corefx/commit/47d96f89df41ce18d3ba77b38007ec68f7f66fc6
2019-07-25 10:45:20 +02:00
Ahson Khan c59af1de67 Auto-generate the reference assemblies to normalize them (dotnet/corefx#39681)
* Update Microsoft.VisualBasic.Core ref

* Update System.Collections.Concurrent ref

* Update System.Collections.Immutable ref

* Update System.Collections ref

* Update System.ComponentModel.Composition ref

* Update System.Data.Common ref

* Update System.Data.OleDb ref

* Update System.Data.SqlClient ref for netcoreapp

* Update System.Diagnostics.DiagnosticSource ref and DiagnosticSourceActivity.cs

* Update System.IO.Packaging ref for netcoreapp

* Update System.IO.Pipelines ref

* Update System.Linq ref

* Update System.Net.Http ref

* Update System.Net.Security ref

* Update System.Numerics.Tensors ref

* Update System.Reflection.Emit for netcore

* Update System.Security.AccessControl ref

* Update System.Security.Permissions ref

* Update System.ServiceModel.Syndication ref

* Update System.Text.Encodings.Web ref

* Update System.Threading.Channels ref for netcoreapp

* Update System.Utf8String.Experimental ref

* Update System.Utf8String.Experimental csproj to reference new file.

* Upat eSystem.Runtime ref and Manual ref

* Update Microsoft.Bcl.AsyncInterfaces ref

* Disable warning CS8617 for missing nullability annotations within
explicit interface methods.

* Revert System.Runtime.cs back to what's in master.

* Update System.Runtime ref (single change - System.Char -> char).

* Revert System.Collections.Immutable back to what's in master (keep
readonly on private fields).

* Update System.Runtime ref and add comment in Manual ref file for
TypedReference.


Commit migrated from https://github.com/dotnet/corefx/commit/bdd0814360d4c3a58860919f292a306242f27da1
2019-07-25 03:44:48 +00:00
Geoff Kizer d0b3696b1f fix race between request failure and response body read
Commit migrated from https://github.com/dotnet/corefx/commit/a327d792c1590bd9ef744c197dfbb311961d5eef
2019-07-24 13:58:28 -07:00
Geoff Kizer 24ee76b516 Merge pull request dotnet/corefx#39638 from geoffkizer/streamshutdownfixes4
HTTP2: Rework shutdown handling

Commit migrated from https://github.com/dotnet/corefx/commit/ca3fe6738ae6afc56e1f8fb5477a57a8dc2e183c
2019-07-24 02:28:18 -07:00
Geoff Kizer 1e37ef09c1 address review feedback and fix test issue
Commit migrated from https://github.com/dotnet/corefx/commit/d6e6f52c928f56b424b08fcf6e08ea84a74748ab
2019-07-24 00:47:35 -07:00
Stephen Toub cd3ca6f991 Re-enable xunit warning 2004 (dotnet/corefx#39698)
* Replace "Assert.Equal(true, " with "Assert.True("

* Replace "Assert.Equal(false, " with "Assert.False("

And fix a few Assert.Equal(true cases that deal with objects and thus need to be reverted.

* Replace "Assert.StrictEqual(true, " with "Assert.True("

* Revert a few changes where true/false was being compared to object

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/1296bc8386a7283e319ddf723282f16651f9ea5f
2019-07-23 17:05:15 -04:00
Geoff Kizer 5ab9a06717 fix race in request body completion
Commit migrated from https://github.com/dotnet/corefx/commit/29328b71b65abe3a199f0daf62f6ee71ca916e78
2019-07-23 13:19:35 -07:00