Commit Graph
2312 Commits
Author SHA1 Message Date
Anirudh Agnihotry bc2d80c6f4 Removed netcoreappaot configuration from corefx (dotnet/corefx#36739)
* netcoreappaot-Windows_NT regex removed

* netcoreappaot-WebAssembly;\n regex removed

* netcoreappaot-Windows_NT-Debug;netcoreappaot-Windows_NT-Release;
regex removed

* netcoreappaot; regex removed

* netcoreappaot-Debug;netcoreappaot-Release; removed

* removing rest of occurences of netcoreappaot

* deleteing the netcoreappaot apicompat files


Commit migrated from https://github.com/dotnet/corefx/commit/e9d1a10ed1d38a8b1ed599b3b5be09b8349f8ea8
2019-04-09 14:07:31 -07:00
Krzysztof Wicher 3a7631cff4 Negotiated ciphersuite (dotnet/corefx#35029)
* NegotiatedCiphersuite implementation

* fix after merge conflict

* fix netfx

* add more expected Tls 1.0 ciphersuites (rfc5289)

* change TlsCipherSuite API to nullable

* apply self-feedback

* apply feedback

* Revert "change TlsCipherSuite API to nullable"

This reverts commit dotnet/corefx@c8bffccb5b.

* simplification around nullables

* msbuild /t:GenerateReferenceSource instead of copy & paste

* revert badly generated APIs

* fix codegen after moving tt files

* apply feedback


Commit migrated from https://github.com/dotnet/corefx/commit/f9fbe70f05b6ca89e94dcc91126d5fd4829a100e
2019-04-05 13:05:34 -07:00
Viktor 7e4b5f9b01 Update src folder
Commit migrated from https://github.com/dotnet/corefx/commit/817c36a05ef2d92e59ce6f5a37e2be50076361b3
2019-04-02 19:21:57 +02:00
Tomas Weinfurt 89884400c0 handle multi-valued headers correctly (dotnet/corefx#35202)
* handle multi-valued headers correctly

* feedback from review

* enable SendAsync_UserAgent_CorrectlyWritten test for HTTP/2

* fix Cookie tests

* feedback from review and test updates

* udpdates from review

* fix itteration

* feedback from review

* remove Streamreader from LoopbackServer

* fix System.Net.WebSockets.Client tests

* feedback from review

* fix tests built for netstandard

* fix one more test

* feedback from review

* feedback from review


Commit migrated from https://github.com/dotnet/corefx/commit/85cec01822bc70fbc45a25001997b0c1e71b1d22
2019-04-01 23:06:34 -07:00
Tomas Weinfurt 8117643cc6 stabilize Http2GetAsync_TrailerHeaders_TrailingHeaderNoBody test (dotnet/corefx#36534)
Commit migrated from https://github.com/dotnet/corefx/commit/b0cbc1be82316f768c6d9876f3e566355a93df68
2019-04-01 17:05:51 -07:00
Tomas Weinfurt 13c9a7cf06 fixes to CurlHandler to pass on Alpine.39 Docker container (dotnet/corefx#36468)
Fixes to curl to pass on Alpine.39 Docker container.

Fixes dotnet/corefx#36428

Commit migrated from https://github.com/dotnet/corefx/commit/105b70a2ee48cca52fef404449f350a4be485b40
2019-04-01 14:23:13 -07:00
Tomas Weinfurt c939090840 Add TrailingHeaders support for HTTP/2 (dotnet/corefx#36128)
* add trailing header tests for HTTP/2

* initial implementation

* more fixes and tests

* style cleanup

* feedback from review

* feedback from review


Commit migrated from https://github.com/dotnet/corefx/commit/57cb805d1fd7b7f602b6dc13a681cc8e726b15df
2019-04-01 09:18:23 -07:00
Stephen Toub 1de0f651e4 Improve StaticTestGenerator and fix some visibility (dotnet/corefx#36472)
Worked through a bunch of additional assemblies and fixed cases where StaticTestGenerator was doing the wrong thing.  Also fixed the visibility on a bunch of test methods it wasn't able to access.

Commit migrated from https://github.com/dotnet/corefx/commit/475542441df2f054d5e9aa39576019775a5d2f52
2019-03-29 17:40:05 -04:00
Max Kerr d349951b26 HTTP2: Don't send RST_STREAM in response to window update on closed stream (dotnet/corefx#36410)
Commit migrated from https://github.com/dotnet/corefx/commit/b867bfef3f7e3951b47134c75ebbaae0a5ca9dd3
2019-03-28 10:31:18 -07:00
David Shulman 33c5db650d Fix Kerberos/NTLM for multiple domain/realm environments in Linux (dotnet/corefx#36329)
This PR addresses some issues reported by a customer (not thru GitHub). They noticed that
multiple domain scenarios were working in .NET Core 2.0 but broke in .NET Core 2.1 on Linux.

While the previous PR dotnet/corefx#35383 solved the Negotiate Kerberos to NTLM fallback issue,
it added more complexity than necessary. The retry logic I added wasn't really necessary
because the original code that used GSS_KRB5_NT_PRINCIPAL_NAME format for the target name
was wrong. That logic only works for pure Kerberos environments and doesn't handle domain
or realm referrals. So, it only handles the default Kerberos realm on the the single Linux
client. In addition, using GSS_KRB5_NT_PRINCIPAL_NAME defeats the logic of the SPNEGO mechanism. That is why I originally needed to add the retry logic using GSS_C_NT_HOSTBASED_SERVICE format for the target name.

The multiple domain/realm scenario worked in .NET Core 2.0 because it used CurlHandler.
And libcurl always uses GSS_C_NT_HOSTBASED_SERVICE format for target name.

This PR reworks the logic to use the GSS_C_NT_HOSTBASED_SERVICE format. It also removes the
now unneeded retry logic. I tested this against Windows and Linux as well as pure Kerberos
and Kerberos to NTLM fallback (using SPNEGO).

I added more tests. These tests are currently part of the enterprise scenario tests we are
building. They are activated via environment variables.

By defining all of the environment variables below, I am able to run the System.Net.Security
and System.Net.Http enterprise-scenario tests. Both SocketsHttpHandler in System.Net.Http and
NegotiateStream in System.Net.Security use the same common GSS-API logic in CoreFx.

Define domain-joined server remote endpoint:
* COREFX_NET_SECURITY_NEGOSERVERURI
* COREFX_DOMAINJOINED_HTTPHOST
* COREFX_NET_AD_DOMAINNAME
* COREFX_NET_AD_PASSWORD
* COREFX_NET_AD_USERNAME

Define standalone server remote endpoint:
* COREFX_WINDOWSSERVER_HTTPHOST
* COREFX_NET_SERVER_PASSWORD
* COREFX_NET_SERVER_USERNAME


Commit migrated from https://github.com/dotnet/corefx/commit/658ec735698affec9ce99a59a9342bf7ac5778db
2019-03-25 11:39:33 -07:00
Nick Schonning 53b0062880 typo: Double word "this" (dotnet/corefx#36273)
Commit migrated from https://github.com/dotnet/corefx/commit/97e6256f05945f7b20025e5c14cae6a8871c87ef
2019-03-24 13:40:35 -07:00
Nick Schonning c4db72fc2e typo: Double word "the" (dotnet/corefx#36274)
* typo: Double word "the"

* Apply suggestions from code review

Co-Authored-By: nschonni <[email protected]>


Commit migrated from https://github.com/dotnet/corefx/commit/aa67d40064f652b48f7ee0cd85dbfe39c7deebac
2019-03-24 13:40:10 -07:00
Nick Schonning 0d80416a74 typo: Double word "over" (dotnet/corefx#36296)
Commit migrated from https://github.com/dotnet/corefx/commit/5bddeb29c4821ab13c2b26338a90e9ff18c9afb8
2019-03-24 13:32:44 -07:00
Nick Schonning 0313843c0a typo: Double word "Version" (dotnet/corefx#36297)
Looks like old commented out code

Commit migrated from https://github.com/dotnet/corefx/commit/3ff2bf2051e030c8e30c1e98550fa45736b9b143
2019-03-24 13:27:03 -07:00
Max Kerr e63ec91ded Add additional diagnostics to PostAsync_RedirectWith307_LargePayload (dotnet/corefx#36239)
* Add additional diagnostics.

* Remove redundant check.


Commit migrated from https://github.com/dotnet/corefx/commit/eca5e9b5399475750d0562752428885220a3c927
2019-03-22 17:56:14 -04:00
Liudmila Molkova 345e589943 Ignore invalid correlation context tokens in Http Diagnostics Listener (dotnet/corefx#35906)
* Fix 31687: ignore invalid correlation context tokens

* add comments

* Add outerloop category

* url-encode correlation context keys and values


Commit migrated from https://github.com/dotnet/corefx/commit/fcbd6804cee9ededfb9db50d7540749640137952
2019-03-21 10:50:50 -07:00
Adam Sitnik 4bf4932b00 Merge remote-tracking branch 'upstream/master' into removePerfTests
Commit migrated from https://github.com/dotnet/corefx/commit/48478bb1ae934e0a4949c71a13ddc7724eef7455
2019-03-19 16:46:37 +01:00
Nikita Potapenko 28f63d6f4e Fix typo (dotnet/corefx#36107)
.Net -> .NET

Commit migrated from https://github.com/dotnet/corefx/commit/d29ae79fb13b4df9078400ac49b460e011f96404
2019-03-17 15:43:21 -07:00
Caesar Chen 52de487b17 Http trailer support for HTTP/1.x (dotnet/corefx#35337)
* http trailer for http/1.1

* address feedback

* address feedback

* pr feedback

* stop blocking context

* fix framework test failiure

* address feedback

* seperate tests

* address some feedback

* more feedback from review

* correct ReadAsync

* feedback from review

* handle short ReadAsync()

* more feedback


Commit migrated from https://github.com/dotnet/corefx/commit/ac9c746c44a5c0decf551fe33fb2acbdc895d021
2019-03-16 15:56:39 -04:00
Marco Rossignoli 76dd5a6434 Optimize recursion of System.Net.Http.HttpRuleParser.GetExpressionLength (dotnet/corefx#35959)
Optimize recursion of System.Net.Http.HttpRuleParser.GetExpressionLength


Commit migrated from https://github.com/dotnet/corefx/commit/4636de3b8595ad10eaebf00cbeed715684e7fd1b
2019-03-14 10:39:24 -07:00
David Shulman 94d443763c Disable some proxy tests (dotnet/corefx#36037)
Disable some problematic proxy related tests.

Contributes to issue dotnet/corefx#32809

Commit migrated from https://github.com/dotnet/corefx/commit/b97e1b696cb9bf6bf288b4fd28481a2026b0dd7a
2019-03-14 09:48:55 -04:00
Stephen Toub e7e11b10e1 Remove remaining usage of Contract.* (dotnet/corefx#36002)
Only remaining use of System.Diagnostics.Contracts in corefx is tests for the library itself, and usage of the [Pure] attribute.

Commit migrated from https://github.com/dotnet/corefx/commit/940ecee40b64ab93c92f87a7e8909771c013f1a5
2019-03-14 09:47:04 -04:00
David Shulman dd2c47fc44 Clean up some tests and move to new Azure endpoint (dotnet/corefx#36018)
This PR changes the Azure test endpoint for HTTP/1.1 and WebSocket tests to use
Azure App Service instead of the classic Azure Cloud Service endpoint. This now
matches the HTTP/2.0 endpoint architecture.

We are deprecating the use of Azure Cloud Service endpoints because they are hard
to deploy and maintain. Azure App Service, on the other hand, provides a lot of benefits
including built in production/staging slots, TLS certificate handling and easier
integration with Azure DevOps deployment models.

There are a few downsides to Azure App Service which are known feature limitations.
Since it uses ARR (reverse proxy), it causes websocket connections to be proxied.
This results in some behavior changes for some edge condition tests we have. For example,
when a websocket handshake fails (due to subprotocol mismatch for example), the client
side doesn't see a TCP disconnect. Instead, due to the reverse proxy, we end up getting
an HTTP status code (like 500). Either way, it is a websocket handshake failure. So, I've
updated a few tests to be less brittle for that. I also opened another issue dotnet/corefx#36016 to
track moving a few websocket tests to the loopback websocket server which doesn't yet
have full capability.

I also converted an HTTP statusline test to use the loopback server.

Commit migrated from https://github.com/dotnet/corefx/commit/689e58ec123d8c730d48d1c35c8f7ecbba6c22cf
2019-03-13 20:57:55 -07:00
Stephen Toub 440cb8cf44 Disable tests failing on WSL (dotnet/corefx#36017)
This is on Windows 10 Version 10.0.17763 Build 17763.

Commit migrated from https://github.com/dotnet/corefx/commit/cf5c3b0282c07ab13da79f04ee83d39f20bac431
2019-03-13 21:09:42 -04:00
Liudmila Molkova 8f347c6f90 Inject W3C headers in HTTP diagnostics handler (dotnet/corefx#35882)
* Inject W3C headers in corefx Htpp Diagnostics HAndler

* Inject W3C headers if activity format is W3C

* fix style and indentation

* review: fix issue


Commit migrated from https://github.com/dotnet/corefx/commit/7314001fd1ebfb25b500774d1551170a17c7a209
2019-03-11 15:15:08 -07:00
Stephen Toub dce7647bbc Clean up lots of string.Format / SR.Format usage (dotnet/corefx#35777)
* Clean up lots of string.Format usage

This PR does a few things:
- Adds new SR.Format overloads, in particular to support accepting an IFormatProvider as the first argument.
- Fixes a bunch of calls to string.Format that should have been using SR.Format.  This not only helps in AOT builds where we want to be able to more cleanly remove resource strings, it enables easier auditing of the remaining string.Format uses to determine whether there are more appropriate implementations.
- Replaces some string.Format uses, in particular in asserts, with easier to read and maintain string interpolation
- Replaces some string.Format uses with string concatenation where it's simple and cheaper
- Fixes a bunch of SR.Format(SR.Something) calls where the SR.Format part is extraneous and should just be removed.
- Replaces a bunch of Debug.Assert(false, ...) calls with Debug.Fail(...).  This isn't directly related to string.Format, but I started this cleanup as part of cleaning up asserts that were using string.Format, and then ended up accidentally merging the chain into the same commit, and decided it was simple enough that I should just leave it rather than trying to separate it out again.

* Address PR feedback

* Fix breaks due to lower netstandard builds


Commit migrated from https://github.com/dotnet/corefx/commit/a6f76f4f620cbe74821c6445af3f13e048361658
2019-03-06 12:03:00 -08:00
Adam Sitnik 7f1ccc4507 remove System.Net.Http.PerformanceTests
Commit migrated from https://github.com/dotnet/corefx/commit/4dee2229eae448d0ba024340448d6acdf93c9d31
2019-03-05 07:33:28 +01:00
Viktor Hofer f8a8530d0f Project msbuild syntax cleanup (dotnet/corefx#35686)
* Remove license header from non-shipping files

* Remove obsolete Project attributes

* Remove xml header and remove DefaultTargets


Commit migrated from https://github.com/dotnet/corefx/commit/c390ce7df50252e11f5d322276e9d19e046d1332
2019-03-03 18:55:25 +01:00
Geoff Kizer 8aab5832e0 Merge pull request dotnet/corefx#35623 from MarcoRossignoli/fixuseragentparsing
Fix bug: UserAgent malformed parsing

Commit migrated from https://github.com/dotnet/corefx/commit/cb54ad963cc655d4c783033a2ab3dc3576d0dc65
2019-03-01 15:40:58 -08:00
Marco Rossignoli 357812cea2 continue parsing after nested call
Commit migrated from https://github.com/dotnet/corefx/commit/b2865f5e4dcda0a3745b96d704aebec82ab22d60
2019-03-01 23:11:29 +01:00
Marco Rossignoli 68952502ce add some tests
Commit migrated from https://github.com/dotnet/corefx/commit/12fc04b6f8c20d901f9c89a1b8d8a540fa22dd0d
2019-02-28 16:13:24 +01:00
Ahson Khan 4fed6ab881 Auto-generate the reference assemblies and separate type forwards (dotnet/corefx#35557)
* Auto-generate the reference assemblies

* Add back type forwards.

* Revert "Add back type forwards."

This reverts commit dotnet/corefx@3acf74aabb.

* Add back TypeForwardedTo in .Forward.cs files

* Add new type forward files to the csproj files

* Add back if-defs and move TestUtilities comment from ref to source

* Remove duplicate definitions, delete unnecessary manual files,

* Fix build breaks

* Add back missing AsyncMethodBuilderAttr to S.Runtime ref

* Fix typo between XmlDocument and XPath.XDocument

* Add type forward fild missed from previous commit

* Fix ECDiffieHellmanCngPublicKey internal ctor for netfx 4.6.1

* Remove "this type was moved to comments" from the type forwards.

* Add back the Xml and Debugger* attributes to Xml.ReaderWriter

* Add back struct layout attributes

* Add back attributes missing (highlighted from api compat)

* Add missing toolbox item attribute in s.data.common.

* Add missing struct layout attributes and remove unnecessary additions

* Add back InterfaceTypeAttribute


Commit migrated from https://github.com/dotnet/corefx/commit/16689aa0a933517dc45465fc6edb6223222414a6
2019-02-27 19:39:21 -08:00
Marco Rossignoli 2f1d983a55 fix UserAgent parsing
Commit migrated from https://github.com/dotnet/corefx/commit/840d29c05243f5afe31e43e2415d6dce5b3c71fd
2019-02-27 12:00:17 +01:00
Tomas Weinfurt a41f64dab6 enable GetAsync_AllowedSSLVersion_Succeeds for SocketHttpHandler (dotnet/corefx#35605)
* enable GetAsync_AllowedSSLVersion_Succeeds for SocketHttpHandler and skip Curl on RH6


Commit migrated from https://github.com/dotnet/corefx/commit/f44142b855330ca9274827a230b8ad9a3ccda357
2019-02-26 22:41:05 -08:00
Tomas Weinfurt 19fc9cb9ed improve Ssl3 detection (dotnet/corefx#35574)
* improve sslv3 detection

* updates to pass all tests

* correct catch


Commit migrated from https://github.com/dotnet/corefx/commit/0fa22d4b6753c47b6139980255e932341353179e
2019-02-25 23:02:20 -08:00
Stephen Toub 6751207cca Remove Task{CompletionSource} allocations from Http2Stream (dotnet/corefx#35522)
* Remove Task{CompletionSource} allocations from Http2Stream

This change makes the Http2Stream instance itself awaitable via ValueTask, such that we don't need to allocate any additional TaskCompletionSource or Task objects for such internal await'ing, regardless of how many times the Http2Connection or Http2ReadStream needs to wait for headers or response data to arrive.

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/aacff5212204ee54e3b3e0172fcf364c3fe253e3
2019-02-23 05:00:31 -05:00
Jeremy Barton 46ae7ef229 Add support for OCSP on Linux, overhaul Linux X509Chain processing
This change moves a lot of the chain building work from managed code into the native shim, largely to cut down on the number of P/Invokes required to set up the chain builder.

Once a chain has been built to a point where only one issuer will be considered, if revocation was requested and a CRL is not available, attempt an OCSP request if the certificate indicates the CA has an OCSP endpoint.

Based on CA/Browser Forum's requirements this expects CRL for all intermediates and only attempts OCSP for the end-entity certificate.

"Conforming" OCSP requests are opportunistically cached on the basis that local filesystem re-reads are more reliable (and faster) than doing a live request to the CA.

Commit migrated from https://github.com/dotnet/corefx/commit/0fbbb68a3f7be82d26e4b2dff5c25c192e3a2023
2019-02-22 12:51:22 -08:00
Geoff Kizer d97476b640 Merge pull request dotnet/corefx#35485 from geoffkizer/http2streamstate
add StreamState and rework HTTP2 stream state handling

Commit migrated from https://github.com/dotnet/corefx/commit/cab8d6bbfe49c7571f682234622f4ea3bfcf5010
2019-02-21 16:03:00 -08:00
Geoff Kizer 3a5f3c641e address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/333fabaffeabf3b4de5d6ba45e54b2078f57adcf
2019-02-21 13:52:02 -08:00
Geoff Kizer 294a0381c5 add StreamState and rework HTTP2 stream state handling
cleanup


Commit migrated from https://github.com/dotnet/corefx/commit/1eba83637d47fde09c8e1748b0ebb4ca42da5ca4
2019-02-21 03:59:36 -08:00
Geoff Kizer fcd7836937 don't dispose the HTTP2 connection writer lock, to avoid race (dotnet/corefx#35468)
* don't dispose the writer lock, to avoid race

* Update Http2Connection.cs


Commit migrated from https://github.com/dotnet/corefx/commit/c4c8f72cd8d18d6ec00afea6644ae2077d442869
2019-02-20 21:23:19 -05:00
Stephen Toub d66ba991e0 Simplify ConnectHelper.ConnectAsync to just return Stream (dotnet/corefx#35411)
* Simplify ConnectHelper.ConnectAsync to just return Stream

SocketsHttpHandler's ConnectHelper.ConnectAsync currently returns a tuple of (Socket, Stream).  We can instead just have it return the Stream and allow the call site to fish out the Socket from the Stream if it can.  This is slightly more efficient memory-wise, in that the state machine involved will be smaller, but it also allows for a potential extensibility point that's simpler (abstracting out the ConnectAsync as a callback) and potentially allows us to in the future get a Socket in more cases, e.g. any connection helper handing back a NetworkStream.

Unfortunately, NetworkStream.Socket is protected rather than public.  Until such time that there's a public property for this, there are two options here:
1. Use reflection to create a delegate we can then use to get at the property; "Socket" is part of the exposed surface area, so the only dependency here is on documented surface area.
2. Create a custom NetworkStream-derived type that exposes the protected as a public.

I started with (2), which works fine for our own internal needs currently, but shifted to (1), as it's more flexible.

* Don't use reflection


Commit migrated from https://github.com/dotnet/corefx/commit/d9cdbc3cca0f75e5d7692f9ae03978dd0ed9b2e9
2019-02-20 14:38:31 -05:00
Geoff Kizer 1546a5a5fe Merge pull request dotnet/corefx#35432 from geoffkizer/windowupdatethreshold
defer sending WINDOW_UDPATE frames until a minimum threshold has been met

Commit migrated from https://github.com/dotnet/corefx/commit/852602a3cebc2bfa14199cf6c39368bad1903c6c
2019-02-20 11:26:12 -08:00
Geoff Kizer eb18055ef3 PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/8b4d2f58cd89efbe0d0b2a487d5ce96353c83150
2019-02-19 19:54:30 -08:00
Stephen Toub 58d340f4de Make Http2Connection.SendFrameAsync return ValueTask (dotnet/corefx#35426)
This method frequently completes synchronously, and in such cases we can avoid the task allocation.

Commit migrated from https://github.com/dotnet/corefx/commit/52993e52f9d3ab30da54884f7c5e0cdea2518e28
2019-02-19 20:27:49 -05:00
Geoff Kizer c839ef5edd defer sending WINDOW_UDPATE frames until a minimum threshold has been met
Commit migrated from https://github.com/dotnet/corefx/commit/99f8d99738f78b6791e2b30b9fababa9f8daa643
2019-02-19 16:02:55 -08:00
David Shulman ad957976ed Improve HTTP2 connection diagnostics in SocketsHttpHandler (dotnet/corefx#35423)
Modified the top-level exception being returned (HttpRequestException) to always include
the inner exception.

Contributes to dotnet/corefx#35422

Commit migrated from https://github.com/dotnet/corefx/commit/fcf46bea903c78accd9586fa2fb355ade70c485e
2019-02-19 17:33:43 -05:00
David Shulman 6167d604af Fix Negotiate/SPNEGO Kerberos to NTLM fallback on Linux (dotnet/corefx#35383)
This PR adds support to our Linux gssapi layer so that we properly handle the Negotiate
protocol (SPNEGO) being able to to fall back from Kerberos to NTLM.

Windows Negotiate SSPI implements the SPNEGO protocol. However, it has built-in error
handling for dealing with quick fallback from Kerberos to NTLM in error cases such as where
the client is not on a domain/Kerberos realm, the client is using a local credential, the
client is talking to a non-domain server, etc.

However, the Linux implementation of SPNEGO doesn't handle those error cases very well.
So, I added the proper retry logic when generating the initial context token. Now, we will
be able to fall back from SPNEGO-wrapped Kerberos to SPNEGO-wrapped NTLM protocol blobs.

A similar bug exists in libcurl which is why Curl and CurlHandler are unable to connect to
Negotiate servers when not part of the Kerberos realm. I am considering proposing my fixes
to the libcurl repo as well.

I added more tests to support this PR and did manual testing. I added some additional
EventSource tracing as well.

Contributes to dotnet/corefx#34878


Commit migrated from https://github.com/dotnet/corefx/commit/1fd3ba126538c2fed76d2279db26dc7ba5ceed41
2019-02-19 09:14:44 -08:00
Stephen Toub facab81dc9 Use Environment.TickCount instead of DateTime{Offset}.UtcNow in SocketsHttpHandler (dotnet/corefx#35401)
We don't need the accuracy of UtcNow nor the absolute time when getting a time stamp in order to determine whether a connection should be retired; rather, we only need an approximate difference in time.  This means the resolution of TickCount is fine, and the worst that happens if a connection happens to be alive for more than its ~49 day period is we may allow the connection to then live even longer than we otherwise would.  In exchange, we get a much cheaper mechanism (~20x on Windows) mechanism for computing the connection age.

Commit migrated from https://github.com/dotnet/corefx/commit/dca39727b02ceb4413d0fde11467965099ab4a2f
2019-02-19 00:38:07 -05:00
Stephen Toub a7cd5b22b1 Address PR feedback and additional cleanup
Commit migrated from https://github.com/dotnet/corefx/commit/c0f24cf4136f22e508e1b9289062e541bad6af88
2019-02-15 15:39:49 -05:00