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
Geoff Kizer
439a7e2fc1
fix race with _requestBodyCancellationSource creation
...
Commit migrated from https://github.com/dotnet/corefx/commit/7394185c0fc8a52bebf384b933b07c1eb1fba360
2019-07-23 13:19:35 -07:00
Geoff Kizer
501a729169
rework SendHeadersAsync to address various issues
...
Commit migrated from https://github.com/dotnet/corefx/commit/2d5a9555d4888c82c653a9d7ad8368bc94adfdf2
2019-07-23 13:08:20 -07:00
Geoff Kizer
7390bf5db9
address review feedback
...
Commit migrated from https://github.com/dotnet/corefx/commit/752c1c8d8a01d22d52b1a320f9ed082049494045
2019-07-23 13:08:20 -07:00
Geoff Kizer
918413eb1d
combine into single Cancel method on stream, and ensure Dispose cancels properly when response is not read to end
...
Commit migrated from https://github.com/dotnet/corefx/commit/5973d1ee6f3b616d2af2bc80527bdf8fe76ee210
2019-07-23 13:08:19 -07:00
Geoff Kizer
78f173fae4
rework shutdown handling
...
Commit migrated from https://github.com/dotnet/corefx/commit/0cd73b77e1f31d48037b56deb0206f4e56b4232e
2019-07-23 13:08:19 -07:00
Stephen Toub
47f8f6d47d
Re-enable xunit warning 2003 ( dotnet/corefx#39696 )
...
* Replace "Assert.Equal(null, " with "Assert.Null("
* Replace "Assert.NotEqual(null, " with "Assert.NotNull("
* Replace "Assert.Same(null, " with "Assert.Null("
* Replace "Assert.StrictEqual(null, " with "Assert.Null("
Commit migrated from https://github.com/dotnet/corefx/commit/6de660a02e335eefebfcc3c81ecb0013e2a8148e
2019-07-23 15:49:33 -04:00
Eirik Tsarpalis
64b9306676
add license notice to new source files
...
Commit migrated from https://github.com/dotnet/corefx/commit/930dc991ca17b759d675c5015cd9c61bc8a725be
2019-07-23 14:59:02 +01:00
Stephen Toub
fe4dd62491
Disable SendAsync_SuppressedGlobalStaticPropagationNoListenerAppCtx test ( dotnet/corefx#39692 )
...
Commit migrated from https://github.com/dotnet/corefx/commit/687f36489c19072cd5a19d48c099f53bbc871c4d
2019-07-23 09:09:51 -04:00
Stephen Toub
c36edeac9b
Re-enable ~20 xunit analyzers ( dotnet/corefx#39671 )
...
* Re-enable ~20 xunit analyzers
All but one of these had no associated warnings firing. I fixed one warning to be able to re-enable another analyzer.
* Fix netfx build failures
Commit migrated from https://github.com/dotnet/corefx/commit/c60b8172cfcd1e7f0d8104872f279781fd288b68
2019-07-22 16:45:03 -04:00
Eirik Tsarpalis
573087767a
stress server cleanups
...
Commit migrated from https://github.com/dotnet/corefx/commit/358267704c7f6dc7a214353be151ea83e37f8fc7
2019-07-22 13:03:17 +01:00
Eirik Tsarpalis
c9fd4bb3cb
fix build
...
Commit migrated from https://github.com/dotnet/corefx/commit/01d3536ed7d2677f92f50c6fa53ccf3d8ca2f28c
2019-07-22 11:20:21 +01:00
Stephen Toub
959dc0b302
Pass CancellationToken from Http2Connection.SendHeadersAsync to StartWriteAsync ( dotnet/corefx#39635 )
...
Commit migrated from https://github.com/dotnet/corefx/commit/9597dadcea747960aba304253370a17a2218208d
2019-07-20 20:47:17 -04:00
Eirik Tsarpalis
fc30262411
regular comment
...
Commit migrated from https://github.com/dotnet/corefx/commit/4e9a2648cd0a5f116af2ecef5879866688b034cb
2019-07-20 00:15:59 +01:00
Eirik Tsarpalis
a584fb5938
address feedback
...
Commit migrated from https://github.com/dotnet/corefx/commit/1c3de2a6aee80cf5c56d4ac118ee8f7157a8d112
2019-07-20 00:12:18 +01:00
Eirik Tsarpalis
1e165d8cff
HttpStress: Segregate Client & Server into separate classes and support running standalone servers and clients
...
Commit migrated from https://github.com/dotnet/corefx/commit/371f8f2ae76308c7aad6b98eb209d06f485c2c94
2019-07-19 22:23:33 +01:00