Commit Graph
1371 Commits
Author SHA1 Message Date
Geoff Kizer cf5033763d add some basic protocol tests for status line handling
Commit migrated from https://github.com/dotnet/corefx/commit/79709c46a1e84ccae519ca58a12f9f29f0b64db5
2017-10-17 11:49:00 -04:00
Stephen Toub defc370985 Remove netfx config from System.Net.Http.Unit.Tests
Commit migrated from https://github.com/dotnet/corefx/commit/91ec984d64908b3ab312bef6f6fa599f5ea1cee7
2017-10-09 14:52:33 -04:00
Stephen Toub c6edd8d7ce Update System.Net.Http to use Memory-based Stream methods
- Overrides Read/WriteAsync(Memory, ...) on streams
- Updates calls where relevant to use ReadAsync(Memory, ...) to avoid task allocation when possible


Commit migrated from https://github.com/dotnet/corefx/commit/cc4cb743671f2973c7c5a9bd39d7d4f8b525b979
2017-10-09 12:19:28 -04:00
David Shulman 44f7f6d8e2 Removed obsolete System.Net.Http NETFX related files (dotnet/corefx#24453)
Due to PR dotnet/corefx#23611, the master branch no longer builds a NETFX binary for
System.Net.Http. Instead this is now handled only in the release/2.0.0
branch as part of the "NETStandard support package".

This effectively means that we have already stopped OOB'ing
System.Net.Http on .NET Framework platforms as of .NET 4.7.1 since that
version of .NET Framework supports all NETStandard2.0 APIs.  And .NET
Framework versions prior to that (4.6.x, etc.) are handled with the OOB
System.Net.Http.dll that is part of the NETStandard support package.

Commit migrated from https://github.com/dotnet/corefx/commit/a6b0655b1537044d85e97a69ef80bfd661e25ca5
2017-10-05 17:33:50 -07:00
Tomas Weinfurt e12d604d93 Add minimal handling for HTTP 1.0 requests to ManagedHandler (dotnet/corefx#23653)
* add minimal handling for 1.0 requests.

* use 1.1 as default version and move some message to resource file

* fix spelling

* remove exception for 2.0 requests and fall-back to 1.1

* remove s_spaceHttp20NewlineAsciiBytes as it is not used now

* add isHttp10 bool to avoid duplicate check.


Commit migrated from https://github.com/dotnet/corefx/commit/8b266d0ca4a12428629b3a7abf79c61c29e50883
2017-10-02 23:40:30 -04:00
Stephen Toub 1457854fb7 Address PR feedback
- Have ClientWebSocket change the scheme from http{s} -> ws{s} instead of having HttpClient accept ws{s} urls.
- Use a duplex response stream only when the status code is 101
- Disable a test that relies on connection opening being cancelable


Commit migrated from https://github.com/dotnet/corefx/commit/518ea1c2f8ad882c9829c8c35d27d92063ac67f7
2017-09-28 21:08:28 -04:00
Stephen Toub 761b5f1190 Several HttpClient/ManagedHandler fixes to better support ClientWebSocket
- Allow ws:// and wss:// schemes
- Add an HttpContentDuplexStream base class to parallel the existing HttpContentReadStream and HttpContentWriteStream base classes
- Move more shared functionality down to the base HttpContentStream class
- Make ConnectionCloseStream duplex instead of read-only


Commit migrated from https://github.com/dotnet/corefx/commit/9438b0a760b1ef827729662186e107abccb7524d
2017-09-28 21:08:26 -04:00
Amit Dash 74a3b06d44 Return condition directly instead of if (condition) return true; else return false; (dotnet/corefx#24252)
Commit migrated from https://github.com/dotnet/corefx/commit/27a43b38f3f599e43d8bf845f6eb0f351da762e2
2017-09-26 16:29:06 -07:00
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