Commit Graph
1363 Commits
Author SHA1 Message Date
Stephen Toub a013bc3765 Make ConnectHelper.ConnectAsync return ValueTask<Stream> (dotnet/corefx#24244)
Minor optimization via playing a bit better perf-wise with changes being made in coreclr.

Commit migrated from https://github.com/dotnet/corefx/commit/c45e6b3d58af63299aea992848370fced532c6e8
2017-09-26 10:30:44 -04:00
Stephen Toub 1677c52028 Fix some missing ConfigureAwaits in ManagedHandler (dotnet/corefx#24248)
Commit migrated from https://github.com/dotnet/corefx/commit/2f981c6efcd00b4ecee5309697ef07d58605993a
2017-09-26 10:30:13 -04:00
Alfred Myers 185367ce23 Updated link to HTTP Protocol proposal and minor fixes (dotnet/corefx#24216)
Commit migrated from https://github.com/dotnet/corefx/commit/b3033e6bd586fb7bdc2e1afdd1694e790272ce6e
2017-09-25 09:41:07 -04:00
Stephen Toub fc2f8b26e9 Use stackalloc directly into Span (dotnet/corefx#24212)
* Use stackalloc directly into Span

We have a few places in corefx where we were stackalloc'ing into a temporary pointer and then creating a Span from that.  Now that we're using a C# compiler which supports stackalloc'ing directly into span, use that feature instead.

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/a7f6f470cb2c4cdaafdc3ad85e2520992a8db265
2017-09-24 09:45:07 -04:00
Stephen Toub a1491f5511 Merge pull request dotnet/corefx#24173 from stephentoub/managedhandler_optin
Provide an (at least temporary) non-global ManagedHandler opt-in mechanism

Commit migrated from https://github.com/dotnet/corefx/commit/1adc5b27283de6e9627e183ef24e0631ee7bab9a
2017-09-21 20:14:57 -07:00
Stephen Toub e16c674170 Increase file descriptor limit in S.N.Http tests on macOS
Commit migrated from https://github.com/dotnet/corefx/commit/2bce06e38f5c16ec6d6eed96a2c4410110fe5ec6
2017-09-21 21:31:49 -04:00
ahsonkhan 12a9b427d1 Change AsSpan to property Span and rename AsMemory to Memory
Commit migrated from https://github.com/dotnet/corefx/commit/786195a51ca0b751f5aec127faf655fe358c6993
2017-09-21 15:47:42 -04:00
Stephen Toub 7be9b5bb5f Switch tests to use thread-local switch for ManagedHandler
And as a result re-enable parallelism of the test suite, which on my machine reduces the running time of the outerloop tests from 150s to 45s.


Commit migrated from https://github.com/dotnet/corefx/commit/3db504ec31fb03162b33e0658870aef5af4e4abe
2017-09-21 08:26:44 -04:00
Stephen Toub 7d1e89d2b9 Add thread-local based switch to opt-in to ManagedHandler
Commit migrated from https://github.com/dotnet/corefx/commit/7c851fcea84b3e10528c8da9fe4a6edb503e8773
2017-09-20 13:51:14 -04:00
Stephen Toub f87da3dfe0 Wrap exceptions from ManagedHandler's server validation callback (dotnet/corefx#24111)
To match other handlers' behaviors.

Commit migrated from https://github.com/dotnet/corefx/commit/e0b912e37439118651ae12e5685b0ef7efd8f1fd
2017-09-18 11:12:48 -07:00
David Shulman a10c42c864 Wrap cert callback leaked exceptions in WinHttpHandler (dotnet/corefx#24107)
Similar to the fix done for CurlHandler (dotnet/corefx#21938), fix WinHttpHandler so
that leaked exceptions from the user-provided certificate callback are
properly wrapped.

The ManagedHandler still needs to be fixed since it is not wrapping
properly.

Contributes to dotnet/corefx#21904

Commit migrated from https://github.com/dotnet/corefx/commit/ca5d83ec2855afa7ce4f60d9c5b0dd46e1cb2faf
2017-09-17 23:19:28 -04:00
Stephen Toub 29b6641eeb Add ReadOnlyMemoryContent to System.Net.Http (dotnet/corefx#24006)
* Add ReadOnlyMemoryContent to System.Net.Http

Allows `{ReadOnly}Memory<byte>`s to be uploaded in HttpClient requests.

* Address PR feedback

* Address more PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/d183fd34074fba9633f025fe2251e7d7883c7f25
2017-09-13 13:01:15 -07:00
Lakshmi Priya Sekar bf69088386 Merge pull request dotnet/corefx#23868 from Priya91/credentialmh
Remove duplicate bug ids in source code.

Commit migrated from https://github.com/dotnet/corefx/commit/82a45b73d9754ae5e82ce1c699b0c86db712e4fa
2017-09-12 18:55:50 -07:00
Lakshmi Priya Sekar 82a42d0e68 Move test to windows specific.
Commit migrated from https://github.com/dotnet/corefx/commit/b95d60789528d2d920e4d58238ee3fd3260585de
2017-09-12 17:36:53 -07:00
David Shulman c8fcec1e55 Disable unreliable Http diagnostics logging test (dotnet/corefx#23977)
The Http test, SendAsync_ExpectedDiagnosticCancelledLogging, has been
failing at times.

I am going to disable this test until it can be made more robust. It is
not a reliable test because cancellation cannot be guaranteed to occur
with a certain time especially on a busy machine.

dotnet/corefx#23209

Commit migrated from https://github.com/dotnet/corefx/commit/839ace982010b10bef94c9aac1d2eb991f76c383
2017-09-12 13:09:51 -04:00
Lakshmi Priya Sekar cfece7ec46 Move DefaultCredentialsTest to windows only.
Commit migrated from https://github.com/dotnet/corefx/commit/d961c15b20539f5638953e9506d35f49d038237a
2017-09-07 17:25:43 -07:00
Lakshmi Priya Sekar 6ea808c117 Remove duplicate bug ids in source code.
Commit migrated from https://github.com/dotnet/corefx/commit/22c66999a49f73002f8e6b04e54c10c7e5f2fe15
2017-09-07 15:20:41 -07:00
Lakshmi Priya Sekar 23c60bac8f Merge pull request dotnet/corefx#23821 from Priya91/credentialmh
Use only CredentialCache for authentication when redirecting Uris in ManagedHandler.

Commit migrated from https://github.com/dotnet/corefx/commit/2b889c4a2d9877b7112d9a57061b92366d9c257a
2017-09-07 15:11:59 -07:00
Lakshmi Priya Sekar 7bf96b53d4 Consolidate code between different Http handlers.
Commit migrated from https://github.com/dotnet/corefx/commit/5ef59053709ef8b6f5b30b709bffbe38fcb19823
2017-09-07 11:18:43 -07:00
Stephen Toub d37b1e463d Respect UseProxy better in ManagedHandler (dotnet/corefx#23750)
To match CurlHandler, we should only be using environment variable-based proxy configuration if UseProxy is true, but we're currently using it regardless.  This commit fixes that and adds a test for it.

Commit migrated from https://github.com/dotnet/corefx/commit/7615a2c1dde51e0797ed3ffbca70191af2aef79e
2017-09-07 00:11:34 -04:00
David Shulman da2de2ec4a Disable default proxy test on Desktop
HttpClient test ProxyExplicitlyProvided_DefaultCredentials_Ignored has
started failing on Desktop due to build system changes. Disabling for
now.

dotnet/corefx#23702


Commit migrated from https://github.com/dotnet/corefx/commit/2c50d92d6d07173db6ec5c8a6a17085613972a3b
2017-09-06 10:41:14 -07:00
Lakshmi Priya Sekar ec142d891b Use only CredentialCache when redirecting Uris in ManagedHandler.
Commit migrated from https://github.com/dotnet/corefx/commit/9d5f5d1f8630e3c50404647926496b0d45cf1203
2017-09-05 18:26:43 -07:00
Stephen Toub 45558100d1 Enable disabled HttpClientEKUTests on ManagedHandler (dotnet/corefx#23754)
They appear to all be passing now.

Commit migrated from https://github.com/dotnet/corefx/commit/2443b0d5f2a25f9c619aff9dca8ec2625eba1c96
2017-09-03 19:07:47 -04:00
David Shulman c3dbc2406e Disable some networking tests
Disabling tests.
dotnet/corefx#23765 dotnet/corefx#23766 dotnet/corefx#23767 dotnet/corefx#23768 dotnet/corefx#23769 dotnet/corefx#23770 dotnet/corefx#23771


Commit migrated from https://github.com/dotnet/corefx/commit/acafae51592f7e09fba003a3684d550dba155a2e
2017-09-02 16:50:54 -07:00
David Shulman f571a92730 Merge pull request dotnet/corefx#23752 from davidsh/22735_1
Re-enable HTTP/2 test

Commit migrated from https://github.com/dotnet/corefx/commit/e35c540f90daa70604d54df72223ce11cb230cea
2017-09-02 16:33:45 -07:00
Justin Van Patten a28887915b System.Net.Http: Remove unnecessary null validator check (dotnet/corefx#23675)
A null validator is never passed-in when creating `ObjectCollection<T>`
instances internally, so we can avoid the unnecessary null checks.

Commit migrated from https://github.com/dotnet/corefx/commit/fa71a8d698df216b625391198b726e06b5232459
2017-09-01 16:57:17 -04:00
David Shulman 7df69b01b9 Re-enable HTTP/2 test
Turning back on the HTTP/2 test that relied on www.microsoft.com being
HTTP/2 now that the HTTP/2 server farm processing those requests is
working again.

Fixes dotnet/corefx#22735


Commit migrated from https://github.com/dotnet/corefx/commit/169daaad2062ab623fdafa738c3fdbc778d3652e
2017-09-01 12:33:26 -07:00
Eric StJohn 93a519b14b Merge pull request dotnet/corefx#23611 from ericstj/removeNetFxSupportLibs
Remove NetFx support libs

Commit migrated from https://github.com/dotnet/corefx/commit/70201d1f97465882eda716c66da09d22c3933edc
2017-08-30 11:24:25 -07:00
Brian Chavez 88875187b0 XML doc spelling corrections - D through H. 🚿 (dotnet/corefx#23638)
Commit migrated from https://github.com/dotnet/corefx/commit/a27929935d2782cdc3e7be21653e8c4530274c6f
2017-08-29 17:10:01 -07:00
Brian Chavez f866987b74 XML doc spelling corrections - I through P. 🚿 (dotnet/corefx#23651)
Commit migrated from https://github.com/dotnet/corefx/commit/b09fab5799bb1ca4bea4b4bb086d2c9870dd5191
2017-08-29 15:42:23 -07:00
Eric St. John b2dae07f2b Update VS configurations
Commit migrated from https://github.com/dotnet/corefx/commit/238bf3302817a910fac3968f4ac826424294ab0c
2017-08-29 08:49:24 -07:00
Eric St. John 20a117e4cc Remove NetFx support libs
Now that we've shipped the NETStandard support package we will no longer build its content
from `master`.

It will be serviced from the `release/2.0.0` branch and the only netfx builds in `master` will
correspond to package content.


Commit migrated from https://github.com/dotnet/corefx/commit/eade3b36725c8d463a40589ff749af5bb0cab8f4
2017-08-29 08:46:22 -07:00
Brian Chavez ba2326f831 XML doc spelling corrections - A through C. (dotnet/corefx#23634)
Commit migrated from https://github.com/dotnet/corefx/commit/afcbd9a5b9e4ecde2db3a69afd093631f1db91c5
2017-08-28 23:42:20 -07:00
Joseph Tremoulet 080969b562 Undo a few JIT layout workarounds (dotnet/corefx#23510)
Remove some `goto`s that were added to work around dotnet/coreclrdotnet/corefx#9692
(poor code layout for loop exit paths) -- the JIT's layout decisions
were improved in dotnet/coreclrdotnet/corefx#13314, and these particular `goto`s are
no longer needed; the same machine code is generated with or without
this change.
Some `goto`s previously tagged as workarounds for dotnet/coreclrdotnet/corefx#9692 are
still relevant for keeping codesize down pending dotnet/coreclrdotnet/corefx#13549;
update their comments accordingly.

Part of dotnet/corefx#23395.

Commit migrated from https://github.com/dotnet/corefx/commit/d90ebb8bcfc24827c7eb478c178d8f98a8b98dd3
2017-08-23 20:35:58 -07:00
Stephen Toub 262530fb1d Override Read/Write(span) on System.Net.Http streams (dotnet/corefx#23345)
Commit migrated from https://github.com/dotnet/corefx/commit/c351ba1f094871e4ae97f23f20f26648662cc4e6
2017-08-18 09:06:05 -04:00
Stephen Daudell 3ad7c43d5a ManagedHandler: Only run connection pool cleanup timer when needed (dotnet/corefx#23174)
* Only run the cleanup timer if we have pools to cleanup.

* Addressed race condition and performance concerns.

* Addressed review feedback.

* Remove redundant initialization.


Commit migrated from https://github.com/dotnet/corefx/commit/6e0f8dcfe62aa587c4b52087861c0d789a5b9124
2017-08-16 16:50:41 -04:00
Stephen Toub 0cc0231751 Avoid manually pinning spans in crypto interop (dotnet/corefx#23259)
My recent PRs to add span-based overloads to crypto types employed a pattern where span-based interop signatures pinned the spans manually and then passed pointers to the actual P/Invoke declaration accepting a `byte*`.  We can instead let the runtime handle the pinning by declaring the P/Invokes in terms of `ref byte`.  In addition to reducing the code involved, there's also the tiny benefit in several cases of the data being pinned for less time.

Commit migrated from https://github.com/dotnet/corefx/commit/36afe5506def3fb49c84945faf0732ec0ec45b16
2017-08-16 09:18:41 -04:00
Geoff Kizer 7b2f25856c address PR feedback and fix issue in ReadCrLfAsync
Commit migrated from https://github.com/dotnet/corefx/commit/88c3ab50da4518f1f89506934039f24be4284b02
2017-08-15 14:00:49 -07:00
Geoff Kizer 3d177b6d67 make FillAsync throw on EOF
Commit migrated from https://github.com/dotnet/corefx/commit/01b543ef084ee4ec5c61570d8090a3097a5c203f
2017-08-15 13:21:26 -07:00
Geoff Kizer 47fedb0ad6 Merge pull request dotnet/corefx#23186 from geoffkizer/headerdescriptor2
HttpClient: several HeaderDescriptor-related improvements

Commit migrated from https://github.com/dotnet/corefx/commit/c54cf8989aebe539ac9c7929fea14c4a0b62c721
2017-08-14 16:02:37 -07:00
Geoff Kizer 7c48a9bb07 address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/b29703658f43e9b01638aa4cdf0176f48c5c0fc3
2017-08-14 15:26:08 -07:00
Geoff Kizer 1f2121892b fix netfx build
Commit migrated from https://github.com/dotnet/corefx/commit/0589dfd640c1c2e40ea878efae44a74494222522
2017-08-14 13:42:23 -07:00
Geoff Kizer 7322dc6125 fix netfx build
Commit migrated from https://github.com/dotnet/corefx/commit/3ddc7bf88acdc432db2a3265bb98bcca4f1e484e
2017-08-14 12:11:17 -07:00
Stephen Toub d7e1498910 Fix ManagedHandler redirect post->get behavior (dotnet/corefx#23216)
Commit migrated from https://github.com/dotnet/corefx/commit/2f4faed916caa8d70a72ad7518705aeac7c68257
2017-08-14 13:12:48 -04:00
Tarek Mahmoud Sayed 78e14f5cea Modify High Sierra Check and Fix TZ Test (dotnet/corefx#23171)
Commit migrated from https://github.com/dotnet/corefx/commit/bdb3ef6ec7a7106c439796a27ec448e0e406310c
2017-08-14 08:46:56 -07:00
Stephen Toub e2218fc078 Add Expect: 100-continue support to ManagedHandler (dotnet/corefx#23196)
Commit migrated from https://github.com/dotnet/corefx/commit/791f81d2d8eb45e5077d2c0c17e784ad597c5e3a
2017-08-14 08:42:01 -04:00
Stephen Toub 945d60b1f5 Enable full duplex communication with ManagedHandler (dotnet/corefx#23180)
* Enable full duplex communication with ManagedHandler

ManagedHandler currently waits for all of the request content to be sent before it processes any response content.  While that matches with what many servers do (not sending any response content until all request content has been received), some sites and situations do benefit from or even require full duplex communication, such that the response can be processed even while the request content is being sent.  This change is also a necessary step towards enabling Expect: 100-continue, as we need to be able to receive the response header before having sent the content, and even without Expect: 100-continue, this allows us to stop sending a large request body if a server quickly sends back a status indicating the transfer isn't needed (e.g. a redirect).

This change also improves on the cancellation support for sending the request body.  The send cancellation token is now embedded in the request content stream and uses that token for all operations.

* Address PR feedback

- Don't force flush the headers before sending content.
- Skip the write buffer when using ContentLengthWriteStream
- Fix some typos


Commit migrated from https://github.com/dotnet/corefx/commit/a326d79a4fac6e82839ab1d672a2e536b6c81754
2017-08-13 06:07:13 -04:00
Geoff Kizer 32beab592f several HeaderDescriptor-related improvements
Commit migrated from https://github.com/dotnet/corefx/commit/3d04b0f3cd6bd94d4677babcc9404bf1937d6b63
2017-08-12 23:24:50 -07:00
Geoff Kizer 64b0d71cc3 Merge pull request dotnet/corefx#23091 from geoffkizer/httpheaderdescriptor
add HeaderDescriptor and use as key for header store

Commit migrated from https://github.com/dotnet/corefx/commit/3e72ee5971db5d0bd46606fa672969adde29e307
2017-08-12 21:17:41 -07:00
Geoff Kizer 77f5a27b11 more PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/cf3f5468d547f609e4e54731664c7a12e4ed23ed
2017-08-12 19:19:02 -07:00