Commit Graph
1711 Commits
Author SHA1 Message Date
Stephen A. Imhoff fb1798288f Consolidate http date parsing (dotnet/corefx#28843)
* Add implementation to common

* Shift System.Net.Http to use common HttpDateParser

* Clean up whitespace in affected areas of System.Net.Requests

* Update System.Net.Request to use common Http date parsing

* Switch to InvariantCulture in tests

* Specify type.

* Remove unneeded file.

* Remove unneeded parameter

* Don't cache parameters.

* Let 'r' be handled like in System.Net.Http

System.Net.Http handled the 'r' format by letting a format string that didn't require leading zeros to be used, meaning one format string can be removed from consideration.


Commit migrated from https://github.com/dotnet/corefx/commit/deee13b99d441cf1906397c54d0c5afcf8385d92
2018-05-24 10:39:16 -04:00
David Shulman 698cedb4c0 Fix HttpClient TLS tests (dotnet/corefx#29851)
Native WinHTTP sometimes uses multiple TCP connections to try other TLS protocols when
getting TLS protocol failures as part of its TLS fallback algorithm. The loopback server
doesn't expect this and stops listening for more connections. This causes unexpected test failures.

I confirmed this investigation comparing with a non-loopback server and WireShark traces. I discussed
this with the WinHTTP team.

SocketsHttpHandler, which uses SslStream for TLS, is able to optimize this and looks directly at
the TLS server-hello to determine if the connection is going to be compatible with the allowed client
TLS protocols. So, it doesn't use multiple TCP connections to determine a final failure outcome.

I also cleaned up the test code removing duplicate tests.

Fixes dotnet/corefx#8538

Commit migrated from https://github.com/dotnet/corefx/commit/226b225df8873b5c7a79d027119871834b24a7d4
2018-05-22 12:37:49 -07:00
Stephen Toub 9aa30c9d3d Fix SocketsHttpHandler handling of pooling timeouts with max connections (dotnet/corefx#29822)
* Fix SocketsHttpHandler handling of pooling timeouts with max connections

Fixes two cases:
1. When a pooling timeout (lifetime or idle) is set to 0, we fail to enforce the MaxConnectionsPerServer limit.
2. When MaxConnectionsPerServer is set and the limit is reached, when a request completes and we transfer the connection from the completing request to a waiting request, we fail to check / enforce the connection lifetime limit.

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/50e30118b37db1c3a48a0920e670b9ca5f9631d4
2018-05-22 11:32:10 -04:00
Maryam Ariyan aa841d48e0 Modify corefx to use ConcurrentQueue from shared
Commit migrated from https://github.com/dotnet/corefx/commit/13e9d66f6051db2f6be532803ef3ab66807fd992
2018-05-22 09:19:22 -04:00
David Shulman e7ae16d343 Disable Http tests on UAP (dotnet/corefx#29803)
Many dozen of Http tests are failing on UAP test runs. This is not showing up during PR/CI
because the UWP leg only is building the product and test sources and not actually running
any tests. However, the test failures show up in Helix and also when run locally on a dev machine.

So, for now, I'm disabling some of these tests so that the inner and outer test runs will pass.

Contributes to dotnet/corefx#29802
Closes dotnet/corefx#27953

Commit migrated from https://github.com/dotnet/corefx/commit/3326f3f24dd083f0966c8f71c7d1e8c2caa1ddae
2018-05-20 09:33:35 -04:00
David Shulman 0de1bd3ee8 Change EnsureSuccessStatusCode to not dispose response content (dotnet/corefx#29795)
* Change EnsureSuccessStatusCode to not dispose response content

Historically, this method has always disposed the response content if it was
throwing an exception. The reason documented in the comment really doesn't
make much sense, especially to just dispose the content but not the actual
response object. The developer pattern we advise when getting an HttpResponseMessage
is to wrap it in a 'using' statement or use an explicit .Dispose() call. And
disposing the HttpResponseMessage would always dispose the inner .Content
anyways.

The use case of dotnet/corefx#26684 is that the response content should be available regardless
if this method throws an exception or not. Developers normally don't expect an object
to get disposed (partially in this case) as a side-affect of calling a method on the
object. So, we're changing the behavior to be more consistent generally with other
.NET objects.

Fixes dotnet/corefx#26684

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/b0e049cc3db252129a36648780cf78cb0641afbf
2018-05-19 13:01:12 -04:00
Stephen Toub ee5c5b4d31 Fix warning about Brotli in uap System.Net.Http build (dotnet/corefx#29775)
Commit migrated from https://github.com/dotnet/corefx/commit/fdaee74e260ebe3239b3e5c9b80d45ba1f0d650c
2018-05-18 11:59:22 -04:00
David Shulman a6af7cfd24 Fix client certificate lifetime handling in tests (dotnet/corefx#29758)
* Fix client certificate lifetime handling in tests

This was a difficult bug to track down. Our use of importing PFX files into the
tests has problems due to a combination of issues. The summary is that these
issues cause the private key (which is written to a temp file on disk) to get
corrupted/deleted. This is why we would get random errors about "invalid client
credentials" when using client certificates in HttpClient (or SslStream).

Thanks to @bartonjs for helping me work thru this.

The lifetime of the temp file containing the private key is associated with the managed
X509Certificate2 object that is created. However, our use of X509Certificate2Collection
followed by the use of the .Find() API in
[GetEligibleClientCertificate](https://github.com/dotnet/corefx/blob/dotnet/corefx@10aa8277de2521fb1e6a5b42d053ad8cc947be81/src/Common/src/System/Net/Security/CertificateHelper.cs#L55-L59)
causes new managed objects to get created including both a new collection object and
new certificate objects wrapping the existing native PCCERT_CONTEXT of the old managed
certificate object. This causes lifetime issues for the temp file containing the private
key since the old managed objects are GC'd.

In terms of fixing this for the tests, I've optimized the Configuration.Certificates
helper and removed constructs that we don't actually use in our tests. Switching from
using .Import() on the collection object to actually creating the X509Certificate2
object directly helps with managing the lifetime of the certificate.

I will be doing a follow-up PR to optimze GetEligibleClientCertificate() to switch from
using .Find() and instead directly query the certificates in the original collection.
This will result in less managed objects being created as well as avoid additional private
key lifetime issues for certificates imported that use the default X509KeyStorage.DefaultKeySet
flags.

I also fixed a problem with the test which was always failing on NETFX.

Closes dotnet/corefx#9543

* Remove Mutex


Commit migrated from https://github.com/dotnet/corefx/commit/75ba6cd878b6764e1f400c839271866f7d2a049a
2018-05-17 10:46:18 -07:00
Stephen Toub b90fae078b Add more missing overrides to refs (dotnet/corefx#29738)
Ran /t:GenerateReferenceSource and undid irrelevant changes, though I kept a few files where the changes were trivial (e.g. whitespace) and it seemed better to just accept the change to stay in sync with GenerateReferenceSource.

In general I only added missing overrides on non-sealed classes, but when there were already overrides included on sealed classes, I added them back for consistency.

Commit migrated from https://github.com/dotnet/corefx/commit/10aa8277de2521fb1e6a5b42d053ad8cc947be81
2018-05-16 22:11:33 -04:00
Stephen Toub 707aceaacc Add Brotli support to SocketsHttpHandler (dotnet/corefx#29729)
* Add Brotli support to SocketsHttpHandler

- Add DecompressionMethods.Brotli
- Add support for Brotli to SocketsHttpHandler
- Add some tests

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/91f2cd7e3de0c4eab799e4d946b1d50c4d15d930
2018-05-16 21:40:53 -04:00
David Shulman bfad67798e Disable test on NETFX (dotnet/corefx#29743)
This newly added test was always failing in NETFX (Outerloop).

.NET Framework has always had a limitation and cannot resolve DNS names with Unicode since it is p/invoking into the 'A' and not 'W' version of the native APIs. The workaround for developers is to use punnyname for the DNS name.

This is currently being tracked with internal bug 125570.

Commit migrated from https://github.com/dotnet/corefx/commit/8ab4f2c1b3bddf79ea3d206a0fec8444f0af167a
2018-05-16 12:18:52 -07:00
David Shulman 2ae1d2c874 Update System.Net tests to use newer corefx-testdata PFX files (dotnet/corefx#29724)
Updated PFX files were checked into corefx-testdata repro via
https://github.com/dotnet/corefx-testdata/pull/24. This PR removed
the friendly name attribute from the private key. This fixes the
problem in Windows dealing with parallel PFX import.

This PR updates the System.Net.* tests to use the updated corefx-testdata package.

Closes dotnet/corefx#23341
Contributes to dotnet/corefx#9543

Commit migrated from https://github.com/dotnet/corefx/commit/84883052ef0f720a8befdc8525db50c9544227d5
2018-05-16 11:42:46 -07:00
Caesar Chen a13f0cb9bd Fix a test and add a argument check for DiagnosticsHandler (dotnet/corefx#29701)
* fix test and add a check for DiagnosticsHandler

* address feedback

* improve comment


Commit migrated from https://github.com/dotnet/corefx/commit/cda3d63089ec3e1e4d51d635da444b7319b98440
2018-05-15 10:47:07 -07:00
Stephen Toub 25edfafe0e Fix TaskContinuationOptions => TaskCreationOptions in test (dotnet/corefx#29667)
Commit migrated from https://github.com/dotnet/corefx/commit/1b5782d29d18f96c20d26e5c8f2844f5d082c887
2018-05-11 18:44:31 -04:00
Stephen Toub f3656cb566 Use shared StringBuilderCache (dotnet/corefx#29657)
Commit migrated from https://github.com/dotnet/corefx/commit/03df812785e99885efde06a0f88d82578955276e
2018-05-11 17:39:06 -04:00
Max Kerr 27e33e05c0 Minor improvements to SocketsHttpHandler redirect logging (dotnet/corefx#29584)
* Minor additions to redirect logging.

* Fix logging of original request method.

* Whitespace

* Update to use the HandlerMessage format.


Commit migrated from https://github.com/dotnet/corefx/commit/fe3df48064dfe35d19b8ff98dfb4eac4f606eaf2
2018-05-10 14:29:08 -07:00
David Shulman fe2ca7b7ae Add missing ConfigureAwait(false) to UAP HttpClientHandler (dotnet/corefx#29553)
Fixes dotnet/corefx#29517

Commit migrated from https://github.com/dotnet/corefx/commit/0f3814b1c002efd94f7a81f57f8c48f2022d14be
2018-05-07 15:30:55 -07:00
Max Kerr 5d369ee93a Improve Http authentication logging (dotnet/corefx#29501)
This should help developers debug several common scenarios:

- Pre-authentication credentials rejected
- No match between client and server supported schemes
- Missing or invalid digest tokens

It also logs the value of the www-authenticate header received and the scheme selected, which should help detect a large number of errors.

Commit migrated from https://github.com/dotnet/corefx/commit/e160ef76df64a2114addf774a05af2f995f18bca
2018-05-07 14:20:50 -07:00
David Shulman 264474f8a3 Removed duplicated type HttpVersionInternal (dotnet/corefx#29545)
Removed duplicated type HttpVersionInternal

We added HttpVersionInternal back when it differed from the System.Net.Primitives HttpVersion type. But now that the two types are the same, we can remove the duplicated internal type.

Fixes dotnet/corefx#26492


Commit migrated from https://github.com/dotnet/corefx/commit/40faa4ed5c699e84afbb78f6ff96feb7b99db320
2018-05-07 14:00:19 -07:00
Stephen Toub c8e7b2312b Add missing awaits to XmlTextReaderImplAsync (dotnet/corefx#29518)
* Comment on awaits that don't need ConfigureAwait(false)

- Add comments to several awaits on tasks where ConfigureAwait is unnecessary for a variety of reasons
- Rather than commenting, change one await to GetAwaiter().GetResult() where we know the task is already completed (rather than just commenting to that effect)

* Add missing awaits to XmlTextReaderImplAsync


Commit migrated from https://github.com/dotnet/corefx/commit/b758c3b1f1293ada2e46f9e221be0b392838cc41
2018-05-04 16:08:59 -04:00
Caesar Chen f902f3ef5f Unify setting null CookieContainer behavior on HttpClientHandler (dotnet/corefx#29337)
* unify set null CookieContainer behavior

* address test issue, and address feedback

* disable a test


Commit migrated from https://github.com/dotnet/corefx/commit/e30a7494292f3e6e66c0d152ad3240fa1f6dc766
2018-05-03 14:32:32 -07:00
Caesar Chen b2d22149da miscellaneous fix (dotnet/corefx#29492)
Commit migrated from https://github.com/dotnet/corefx/commit/38ad17100349ef286edeb67ddffe4c44ba4e51e1
2018-05-03 14:31:45 -07:00
Stephen Toub 7580bf003a Delete Brotli_External_DecompressesResponse_Success test (dotnet/corefx#29486)
We have Brotli_DecompressesResponse_Success which just uses a loopback server.  I'd added Brotli_External_DecompressesResponse_Success as a way to test against another Brotli implementation, but that's not really something we need to do in the System.Net.Http tests; rather, it's up to the System.IO.Compression.Brotli tests to ensure compliance.  Given that, and this tests ends up causing failures when httpbin.org goes down, I'm just deleting it.

Commit migrated from https://github.com/dotnet/corefx/commit/e85573f9b778ba65925f17da6fc485bb43d2c055
2018-05-03 15:01:39 -04:00
Stephen Toub b9397a45ca Add two missing ConfigureAwait(false) calls in SocketsHttpHandler (dotnet/corefx#29465)
* Add two missing ConfigureAwait(false) calls in SocketsHttpHandler

ChunkedTransferEncodingReadStream's ReadAsync had one await missing a ConfigureAwait(false).  If there's a synchronization context set on the calling thread, this results in a continuation being created that posts back to that context, which can cause problems (e.g. deadlocks) if that context is blocked, e.g. if the synchronous Read method is being used to block waiting for ReadAsync to complete.  The fix is simply to add `.ConfigureAwait(false)`.

As long as I was fixing that, I also reviewed all `await`s in SocketsHttpHandler and found one more that was missing `.ConfigureAwait(false)`, in HttpConnectionPool's EstablishProxyTunnel, and so fixed that, too.

And added some tests.

* Refactor ContentMode support in tests


Commit migrated from https://github.com/dotnet/corefx/commit/9e8c200f0888a1db590da8ffa026aa7384771611
2018-05-02 19:24:56 -07:00
Marco Rossignoli 4110b40d54 Replace files with CoreLib mirror (<30% differences) (dotnet/corefx#29433)
* remove duplicates

* remove unused Interop.GetFullPathNameW.cs

* revert TupleExtensions.cs for netfx incompatibility

* replace coreclr merged

* replace constants conflicts


Commit migrated from https://github.com/dotnet/corefx/commit/5168f541d4def7c54e490a685ff5dc0e3f90e91a
2018-05-02 06:51:46 -07:00
Dan Friedman 33591df321 Clean dead code System.Net* (dotnet/corefx#29302)
* Clean dead code in System.Net

* More cleaning

* Clean dead code for HttpListener

* Clean dead code for Mail

* Clean dead code in Http

* Clean dead code for NetworkInformation

* Clean more dead code

* Various fixes

* Build fix

* Restore field

* var -> string


Commit migrated from https://github.com/dotnet/corefx/commit/71cc1ae8ba02b7b71878cb69a50c667c8ed0f50f
2018-05-01 16:49:12 -07:00
Stephen Toub e065edbe62 Re-enable the SocketsHttpHandler microbenchmarks (dotnet/corefx#29317)
The perf tests were wholesale disabled due to port exhaustion errors.  Those errors are just coming from the "connectionPerRequest" tests, which are inherently flawed in this regard, so I've just deleted them.

Commit migrated from https://github.com/dotnet/corefx/commit/d3b3d2daafe135684f7d77438dfe7d42f4f4baf8
2018-04-26 17:10:53 -07:00
Eric St. John 8fcddacb0e Update for new API compat operand names
Commit migrated from https://github.com/dotnet/corefx/commit/a9f347950a1526b28f4577f2dbf94c23b3123d5c
2018-04-25 14:26:00 -07:00
José Rivero 06e5d2213a Disabling benchmark due to issue dotnet/corefx#29308 (dotnet/corefx#29309)
- Increasing the timeout on perf.groovy
  (Running profile and diagnostic runs takes over the default of 4 hours.)

Commit migrated from https://github.com/dotnet/corefx/commit/e4e6873b04470e78a9fc0138815b86d364edfa58
2018-04-24 18:24:58 -07:00
Marco Rossignoli 87da9705a6 De-duplicate resource ID's to make Mono merge easier (dotnet/corefx#29280)
* wip

* wip

* wip

* fix System.Linq.Expressions

* revert for tests

* add powershell script

* address PR feedback

* address PR feedbacl

* address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/5a37188238e90d8566e6161b43ac483a671bb7d2
2018-04-24 13:58:42 -07:00
Stephen Toub d68f723498 Always use DnsEndPoint in SocketHttpHandler's ConnectAsync (dotnet/corefx#29286)
We had a minor optimization here, but there's a long-standing issue with Socket.ConnectAsync where it's leaving for finalization a socket when the connect with an IP address fails.  It's more important to address that issue, and using DnsEndPoint does so (it's also the code we want, anyway).

Commit migrated from https://github.com/dotnet/corefx/commit/b399fe53343295ccf475262552b6d36beafb2b4e
2018-04-23 17:41:54 -07:00
Stephen Toub d5ba24bff1 Several Http test fixes to hopefully improve test reliability (dotnet/corefx#29238)
- Add “Connection: close\r\n” response header in more cases where the loopback server explicitly closes a connection, and in particular where the client makes multiple connections.
- Change several Task.WaitAlls on paired tasks to instead use our WhenAllOrAnyFailed helper.

Commit migrated from https://github.com/dotnet/corefx/commit/cebcf436358600a4808656b142a74f57d1e8f6f0
2018-04-20 18:21:18 -04:00
Paulo Janotti c3a6cbaea6 More SSL error queue cleaning (dotnet/corefx#29171)
* Cleaning up more instances leaving errors on SSL queue

* Fixes dotnet/corefx#25676

Commit migrated from https://github.com/dotnet/corefx/commit/c0083e09903f3d1aa23598beeae5aafbdd433f1f
2018-04-18 08:52:53 -07:00
Marco Rossignoli 528e91dabf Replace identical files with CoreLib mirror (dotnet/corefx#28593)
Commit migrated from https://github.com/dotnet/corefx/commit/5041dbb272ae05b360db538cf62fc2847277fd7e
2018-04-17 16:05:44 -07:00
Marco Rossignoli 20e05bb5cd Pass Uri.IdnHost to WinHttpConnect (dotnet/corefx#28849)
* pass IdnHost

* add manual functional test

* cleanup

* fix comment

* address PR feedback

* address PR feedback

* address PR feedback

* address PR feedback

* address PR feedback

* address PR feedback

* address PR feedback

* fix IPv6 IdnHost

* address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/b2893f07cf61dae81d424dd676a0d903a36a10c2
2018-04-17 09:55:34 -07:00
Stephen Toub 975f40acce Add basic GET SocketsHttpHandler perf tests (dotnet/corefx#29105)
* Add basic GET SocketsHttpHandler perf tests

Tests for:
- http vs https
- connection: close vs keep-alive
- chunked vs content-length response
- various response lengths

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/27149e4a86ba5827229b8294f1dd19f3f7d58184
2018-04-14 12:31:58 -04:00
Caesar Chen 7669319f3f SocketsHttpHandler: Add workaround for ipv6 LLA address (dotnet/corefx#28971)
* add workaround for ipv6 LLA address

* address comment

* fix comment


Commit migrated from https://github.com/dotnet/corefx/commit/0698997390ddc15abb375eba73a5d712ccdb8266
2018-04-13 17:34:32 -07:00
Stephen Toub ed4847e6a0 Address some SocketsHttpHandler feedback (dotnet/corefx#29081)
- We were using WriteAsciiStringAsync in one place we shouldn't have been.  Change it to WriteStringAsync.
- We were potentially overflowing in a multiplication on MaxResponseHeadersLength if it was set to a very large value.  Changed it to use long multiplication and to cap the max length at int.MaxValue.
- We were accidentally using DateTimeOffset.Now instead of UtcNow when getting the current time during stale pool removal.  Change to UtcNow.
- We had an unnecessary/unreachable catch block.  Remove it.
- In a race condition where the handler and thus its pool manager was disposed while the cleaning timer callback was in flight (either already queued or already running), we could potentially dispose of the timer and then the callback attempt to change the timer and incur an ObjectDisposedException that would go unhandled on a thread pool thread.  One fix would be to track disposal under the same lock that's used to mutate the cleaning timer, but that incurs the cost of tracking disposal and taking a lock on disposal in order to deal with a rare race condition (that we've never actually seen happen).  Instead, I opt to simply catch and eat any ODEs that occur.
- If either of the connection lifetime values are set at 0, we avoid putting connections back into a pool and thus also avoid creating the cleaning timer.  But we're still putting the created pool into the pools collection, which in theory in an extreme case could be a leak.  The fix is simply to not store the pool into the pools in this case.

Commit migrated from https://github.com/dotnet/corefx/commit/c998e559dc3682bda42bedd8379442f1e457d136
2018-04-13 16:00:26 -04:00
Ahson Khan 3274fc4e6f Collapse leftover AsSpan().Slice(...) into AsSpan(...) (dotnet/corefx#29078)
Commit migrated from https://github.com/dotnet/corefx/commit/5c01da951f57ad69d64a5d7c7357d4f033cb5fea
2018-04-12 22:40:43 -07:00
David Shulman ec81e61c40 Optimize proxy PAC file discovery process for SocketsHttpHandler (dotnet/corefx#29050)
This PR will reduce the calls to WinHTTP GetProxyForUrl() if a previous call recently discovered
no PAC file within a certain timeframe. We call this API when "Automatically detect settings"
is turned on. The default configuration on Windows has this proxy setting always turned on. This
is ironic given that most network environments don't have a PAC file on the network. So, it's
important to try to optimize this common case on customers' networks.

Initial testing shows at least a 2x speed improvement with these changes.

I did not use any locking mechanisms since those would drag down performance. In the worst case,
any race condition would mean we might call GetProxyForUrl() an extra time. But since we're only
filtering on ERROR_WINHTTP_AUTODETECTION_FAILED, it is unlikely to actually change over time.
That particular error means that the WPAD protocol was able to complete on the network, but the
answer discovered is that there is no PAC file registered on the network.

Fixes dotnet/corefx#28543


Commit migrated from https://github.com/dotnet/corefx/commit/712d3065cef7f28eae96a578b8bd73870e9b2cd5
2018-04-12 17:13:22 -07:00
Max Kerr 7a12691e93 Disable SSL3 test case on RedHat 6 (dotnet/corefx#28998)
Commit migrated from https://github.com/dotnet/corefx/commit/5411a5c72920e1fac7e6315aad0ec302de0d1c55
2018-04-12 09:07:37 -07:00
Jan Kotas 0c82fdc6cb Simplify sspicli interop marshaling (dotnet/corefx#29031)
* Delete unnecessary wrapper

* Simplify sspicli interop marshaling

This makes it both faster and more AOT friendly

* CR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/437e8823028d09ad5c62ec71e2393417e3f7130c
2018-04-11 18:28:51 -04:00
Tomas Weinfurt 9546f3cbe7 fix get for UseDefaultCredentials with SockerHttpHandler (dotnet/corefx#28982)
* fix get for UseDefaultCredentials with SockerHttpHandler

* add commmet for curl/socket handler differecnes.


Commit migrated from https://github.com/dotnet/corefx/commit/0bafd875567744e84bb6c9ed114f77c0b110cfd9
2018-04-11 14:59:18 -04:00
Krzysztof Wicher c2f3338220 Handle User-Agent/Server writing similarly to HttpHeaders.GetHeaderString (dotnet/corefx#28994)
* Handle User-Agent/Server writing similarly to HttpHeaders.GetHeaderString

* add a testcase and comment for user-agent writing

* apply feedback

* further simplify test

* Update HttpClientTest.cs


Commit migrated from https://github.com/dotnet/corefx/commit/b703f310d5330bad7ae4b571175f259a3a1bc4b0
2018-04-11 01:37:40 -07:00
David Shulman 8425f3af58 Add more logging to SocketsHttpHandler (dotnet/corefx#28943)
As part of looking at the usability of .NET Core network logging (compared to
.NET Framework), I did a walkthru of the current logging in SocketsHttpHandler.
I noticed some inconsistencies in how the NetEventSource logging is being used.

For the 2.1 release, I wanted to at least add more logging to some key areas
including places where we ignore errors/exceptions.

There is still more work to do to improve the logging to make it useful for
developers. This includes doing a better job at logging for System.Net.Sockets
as well as looking into other tool options besides PerfView to look at the traces.

I also fixed the sample script for using starting the traces using Windows logman.
The default log buffer size is too small even for for simple traces. Now, using PerfView
on all the System.Net.* traces no longer shows an error about traces being dropped.

Commit migrated from https://github.com/dotnet/corefx/commit/158ed4d059a875e6828c176ce7ecc4a221b331e3
2018-04-10 17:42:42 -07:00
Paulo Janotti 3a2342d63e Clear SSL error queue after MultiDestroy and MultiRemoveHandle (dotnet/corefx#28980)
* Clear SSL error queue after MultiDestroy and MultiRemoveHandle

* nit: add blank line after #endif


Commit migrated from https://github.com/dotnet/corefx/commit/653207f5bfa725f4cd1ee862220132e79a1ec69f
2018-04-10 15:43:52 -07:00
Stephen Toub 2bcd2ef0d8 Ensure ConnectHelper creates a Segment with a min of 2 (dotnet/corefx#28983)
Commit migrated from https://github.com/dotnet/corefx/commit/e9504da892fe0b2a349e8b6a55e6bbbf6bc6e40b
2018-04-10 18:30:41 -04:00
Ahson Khan 60c0ffcd4e Update the System.Runtime and System.Memory ref based on new buildtools (dotnet/corefx#28906)
* Update the System.Runtime and System.Memory ref based on new buildtools

* Fix HttpContent TryGetBuffer and update System.Runtime ref

* Update System.Memory ref and fix PipeAwaitable (assign CancellationTokenRegistration)

* Fix 'use of unassigned local' error in System.Memory performance tests


Commit migrated from https://github.com/dotnet/corefx/commit/bd1911e9b3bf104fd9821a4fc68ea1baafe780ef
2018-04-10 15:00:26 -07:00
Ahson Khan eda3bb8370 Fix ROM Content Test to use IMemoryOwner instead of MemoryManager (dotnet/corefx#28947)
Commit migrated from https://github.com/dotnet/corefx/commit/79797279e2e293beb5d9ff60672e4d56cf7c02de
2018-04-10 13:21:11 -07:00
Tomas Weinfurt d53f22127e propagate default credentials so we can pick up default ticket if available (dotnet/corefx#28964)
Commit migrated from https://github.com/dotnet/corefx/commit/728db8f53610a9ef6e13831b8b7921a438ed08f8
2018-04-10 09:04:27 -04:00