Commit Graph
1027 Commits
Author SHA1 Message Date
Stephen Toub 40573ec3da Disable frequently failing GetAsync_SupportedSSLVersion_Succeeds test
Commit migrated from https://github.com/dotnet/corefx/commit/031e40a64bd7a148f43e5a49055abbf5743b4543
2018-03-31 01:01:45 -04:00
Stephen Toub fd20c03b0c Stop blocking explicit opt-in to Ssl2/3 in SslStream and HttpClient (dotnet/corefx#28639)
By default, .NET Core defaults to allowing TLSv1, TLSv1.1, and TLSv1.2.  However, whereas .NET Framework allows a developer to opt-in to SSLv2/SSLv3, .NET Core currently blocks it.  This means developers are unable to use .NET Core when they need to communicate with an endpoint they don't control and that's unfortunately limited to one of these protocols, which blocks adoption of .NET Core.

This commit stops blocking these protocols.  They're still disabled by default, and compiling against them still results in a deprecation warning, but if a developer chooses to ignore the warning and explicitly sets SslProtocols, they are at least able to use the protocols, subject to whatever the underlying operating system allows (e.g. Windows stops supporting SSLv2 as of v1607).

Commit migrated from https://github.com/dotnet/corefx/commit/3cc6fda0c6abe76eea222c165ebdf816e83df564
2018-03-30 22:00:37 -07:00
Ahson Khan fc292cfab0 Split OwnedMemory into MemoryManager and IMemoryOwner (dotnet/corefx#28640)
* Update IRetainable, OwnedMemory, and MemoryHandle APIs

* Split OwnedMemory into MemoryManager and IMemoryOwner

* Update ReadOnlySequence, ArrayMemoryPool, and BufferSegment

* Update System.Memory and System.IO.Pipeline tests

* Temporarily skipping the failing Pipelines tests until impl is corrected.

* Update the reference assembly to match implementation and cleanup

* Update API compat baseline for UAPAOT and add GenFacadesIgnoreMissingTypes

* Fix the System.Runtime ref

* Add back the Pin methods to the uapaot api compat baseline

* Clone the API compat baseline from uapaot and add it for uap as well.

* Update BuildTools, CoreClr, CoreFx, CoreSetup, ProjectNTfs, ProjectNTfsTestILC to preview3-02630-01, preview3-26330-08, preview3-26330-06, preview3-26330-04, beta-26330-00, beta-26330-00, respectively

* Fix pipelines tests and update the api compat baseline shim for uapaot

* Add empty Unpin override to pipe pool test.

* Fix the System.Net.Http Functional tests


Commit migrated from https://github.com/dotnet/corefx/commit/f592e887e2349ed52af6a83070c42adb9d26408c
2018-03-30 14:30:48 -07:00
Max Kerr 5887c6de13 Make it clear that the default proxy cannot by set via environment variable on Windows (dotnet/corefx#28610)
* Remove ActiveIssue tag to make it clear this is by design.

* Disable test using attribute.


Commit migrated from https://github.com/dotnet/corefx/commit/620d01432fd37e69cb106752524bed24185a422b
2018-03-29 15:41:18 -07:00
Max Kerr 1080d31cde Enable digest test runs on CurlHandler. (dotnet/corefx#28571)
Now that the authentication test failures have been diagnosed, re-enable most of the Digest authentication test cases on CurlHandler. Four additional cases had to be moved to the SocketsHttpHandler only tests, since they fail on CurlHandler and do not have fixes yet.

The digest test cases have to use credentials without a domain when run against CurlHandler. This is because Curl does not allow us to set the realm parameter used to send the domain along with a digest authorization header.


Commit migrated from https://github.com/dotnet/corefx/commit/0257e6cc85c3a0421cb99a473fa187a43eb46b6a
2018-03-29 11:25:02 -07:00
Paulo Janotti 6382bdb453 Disable Selectedsites test by default (dotnet/corefx#28599)
These tests were not intended to be enabled by default, control them via a env var.

Commit migrated from https://github.com/dotnet/corefx/commit/45fb8a627e727df337580291b45317ee5e66b5a5
2018-03-29 09:15:23 -07:00
Paulo Janotti c79012a5e5 CurlHandler is deadlocking like WinHttpHandler (dotnet/corefx#28587)
* CurlHandler is deadlocking like WinHttpHandler

This repros consistently for Release on High Sierra. Issue dotnet/corefx#27746 already tracks it.

* Adding a comment to clarify scope


Commit migrated from https://github.com/dotnet/corefx/commit/50d4e1ce620f26ec4aebe26c121a769fc8e724ab
2018-03-28 23:29:23 -07:00
Paulo Janotti b85ab9824d Add test to visit sites with SocketsHttpHandler (dotnet/corefx#28480)
Adds a small test to visit a list of sites using SocketsHttpHandler and allow easy debugging and comparison with platform handlers in case one needs to investigate. The tests are disabled by default and are controlled by Xunit traits.

Commit migrated from https://github.com/dotnet/corefx/commit/8e18a0e0453654ed88c3729ffad580dff984601a
2018-03-28 08:22:08 -07:00
Tomas Weinfurt bcf90e9e92 improve handling of proxy environmental variables (dotnet/corefx#28088)
* improve handling of proxy environmental variables
* feedback from reviews
* update port parsing
* use Span instead of Substring to parse port
* fix more feedback


Commit migrated from https://github.com/dotnet/corefx/commit/d5ecebef316f2be53a25894d8f1b4c6b91698e36
2018-03-27 13:48:19 -07:00
Stephen Toub 78ca1d62b3 Add test for SocketsHttpHandler Brotli response (dotnet/corefx#28494)
SocketsHttpHandler doesn't currently automatically decode Brotli responses, but add tests to validate we can at least do so manually.

Commit migrated from https://github.com/dotnet/corefx/commit/175984f5c05de918effd97bf322fb002e0da925b
2018-03-27 07:20:08 -07:00
David Shulman 879f046c38 Disable some failing/hanging HTTP tests (dotnet/corefx#28425)
Opened some issues dotnet/corefx#28423 dotnet/corefx#28424. These tests are failing/hanging on my
dev box all the time.

Commit migrated from https://github.com/dotnet/corefx/commit/4a549f7fe7e8ea19f4fea8a233e525ebe0df7abb
2018-03-23 15:30:11 -07:00
Tom Deseyn 6c1f181e7c CurlHandler: set ssl options to match X509 machine store certificates (dotnet/corefx#28312)
* CurlHandler: set ssl options to match X509 machine store certificates

* Rework HttpClientUsesSslCertEnvironmentVariables test

* PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/1b588ca420d881d8c20db69022b1c64bc5223588
2018-03-22 22:51:51 -04:00
Stephen Toub a6932f9f28 Ensure SocketsHttpHandler throws TaskCanceledExceptions instead of OperationCanceledExceptions (dotnet/corefx#28075)
To increase compatibility, as other handlers often throw the derived type instead of the base type, as a side-effect of how they were implemented.

Commit migrated from https://github.com/dotnet/corefx/commit/1f93d2a1c5f3bdeb8c091863236fe2071e5e66f5
2018-03-22 22:11:23 -04:00
Tomas Weinfurt 11740681f6 Improve HTTP proxy tests (dotnet/corefx#28048)
* refactor some proxy tests using new loppback server and new auth function

* feedback from reviews

* correct split() use. My local build did not fail for what ever reason

* disable ProxyExplicitlyProvided_DefaultCredentials_Ignored as it used to be

* refactor some proxy tests using new loppback server and new auth function

* feedback from reviews

* disable ProxyExplicitlyProvided_DefaultCredentials_Ignored as it used to be

* add test case for dotnet/corefx#27870

* skip new test on WindowNano

* add limit on Split() so it always splits to two tokens to avoid problems with : in the value

*  update Split() as it seems not all c# flavors has the righ overload

* small improvement on header split

* feedback from review


Commit migrated from https://github.com/dotnet/corefx/commit/b2a119950cb52dd744f84b552de1da2df07b937b
2018-03-22 18:01:15 -07:00
David Shulman 1e1b3a1e05 Fix WinHttpHandler error handling (dotnet/corefx#28367)
This PR addresses some error handling problems in WinHttpHandler as well as
improves the error messages generated for WinHttpException.

This was root caused to a bug in WinHttp where it can't do a GET request with a
request body using chunked encoding. However, this exception was masked due to
an error handling bug caused by an inconsistency in how WinHttp associates
context values for callbacks during the WinHttpSendRequest API call. This PR now
fixes the error handling around synchronous errors being returned from
WinHttpSendRequest. The root WinHttp bug itself can't be fixed. So, doing a GET request
will still throw an exception, but it will be a catchable HttpRequestException.

Another bug was discovered while investigating dotnet/corefx#26278. WinHttpCloseHandle should only be
called once and should never race between threads. This is normally protected when
the request handle is closed via SafeHandle Dispose(). But there was a place in the
callback method where we called WinHttpCloseHandle directly against the raw handle.

Finally, the error messages for WinHttpExceptions have been improved to show the
error number and the probable WinHttp API call that generated the error. This will
save diagnostic time.

I also moved the WinHttpException source code back from Common. It was originally shared
between WinHttpHandler and ClientWebSocket. But then ClientWebSocket moved away from
WinHttp implementation. So, it makes more sense for this class to be under WinHttpHandler.

Example:

Original WinHttpException message: "The parameter is incorrect"
New WinHttpException message: "Error 87 calling WinHttpSendRequest, 'The parameter is incorrect'."

Closes dotnet/corefx#28156
Contributes to dotnet/corefx#26278


Commit migrated from https://github.com/dotnet/corefx/commit/ce4ebdfbf2080a38855ab8df5c9bb553db8724af
2018-03-22 12:58:54 -07:00
Stephen Toub fe0f884df4 Fix sporadically failing PreAuthenticate test on WinHttpHandler (dotnet/corefx#28226)
The PreAuthenticate_FirstRequestNoHeader_SecondRequestVariousStatusCodes_ThirdRequestPreauthenticates tests a bunch of status codes, some of which are sporadically failing in CI with WinHttpHandler.  According to the RFC, several of these status codes require that there not be a response body, but the test is sending one, and it would seem there are then race conditions that are causing WinHttp to fail here and there for these status codes, e.g. 204 and 304.  This just fixes the test to not send a body.

Commit migrated from https://github.com/dotnet/corefx/commit/ca07fd9545336610e9768d76261c64c67f244721
2018-03-19 21:18:10 -04:00
Stephen Toub 5c6a7591de Fix sporadic WinHttpHandler failures with cookie tests (dotnet/corefx#28213)
Commit migrated from https://github.com/dotnet/corefx/commit/9ae8e66c1f0beb89f80bade2555dc5b0fbd86fe1
2018-03-19 21:15:44 -04:00
Stephen Toub 85e7f4e1aa Re-enable SocketsHttpHandler proxy test (dotnet/corefx#28186)
Commit migrated from https://github.com/dotnet/corefx/commit/089a8890c4f4d20dde6ee0ab6acfb3056f4887e6
2018-03-19 12:56:14 -04:00
Max Kerr afb835886e Check available credentials when choosing authentication scheme (dotnet/corefx#28105)
When choosing what authentication scheme to use, WinHttpHandler picks the most secure scheme supported by the server. When the client does not support this scheme it closes the connection. This fix updates the authentication logic to instead pick the most secure scheme offered by the server that is also supported by the client.

This change also adds a test of the relevant behavior.

Fixes: dotnet/corefx#27672

Commit migrated from https://github.com/dotnet/corefx/commit/6d031a04f3df8fadd5b82d9c23d904182eea94e4
2018-03-16 14:35:50 -07:00
Caesar Chen 2a43f06ed0 replace issue number (dotnet/corefx#28036)
Commit migrated from https://github.com/dotnet/corefx/commit/fbb328ba694795a87e0a3e1abe859945f0c04ab8
2018-03-15 10:15:44 -07:00
Stephen Toub 181faf7284 Fix SocketsHttpHandler.PreAuthenticate behavior (dotnet/corefx#28047)
* Use named arguments for more bool arguments

* Dispose of new HttpConnectionPool if we lose race condition

If two threads are racing to create the first connection for a specific pool, one of them will end up creating a pool object that's then discarded. Make sure we dispose it.  Right now it doesn't really matter as there aren't any resources in an empty pool that need to be cleaned up, but it's a good measure and will help in the future if that changes.

* Fix SocketsHttpHandler.PreAuthenticate behavior

Previously SocketsHttpHandler.PreAuthenticate was causing SocketsHttpHandler to always add a basic auth header on every request if a basic credential could be retrieved from the supplied credentials.  This is not how PreAuthenticate is supposed to work.  Rather, the handler is supposed to track credentials that have previously been used to successfully authenticate, and then on subsequent requests use credentials from that successfully-authenticated cache.

* Add more tests


Commit migrated from https://github.com/dotnet/corefx/commit/e2ed932d985badf1551affc868f965d2f774bf4d
2018-03-15 10:46:49 -04:00
Caesar Chen 9df60dc56a Make SocketsHttpHandler default Handler (dotnet/corefx#27821)
* set SocketsHttpHandler to default

* address feedback

* fix if check for 28002


Commit migrated from https://github.com/dotnet/corefx/commit/2b850f6fe5fd3171c2554da965cb07070e1d648e
2018-03-14 00:34:56 -04:00
Stephen Toub 1e3e61f57b Expose SocketsHttpHandler.ResponseDrainTimeout (dotnet/corefx#28011)
Commit migrated from https://github.com/dotnet/corefx/commit/9cde05ff84d118a9cc5629b85d4a319dd32172ae
2018-03-13 15:21:16 -04:00
David Shulman 0cb5ccfce2 Change behavior of SocketsHttpHandler for redirects (dotnet/corefx#28008)
When exceeding the max number of redirecs, .NET Framework will
not throw an exception. Instead, it will return the 3xx response.
This PR changes the behavior of SocketsHttpHandler to match.

Fixes dotnet/corefx#27285


Commit migrated from https://github.com/dotnet/corefx/commit/6e3a4143c221cba5f0f1b433b96477d24b7e9b02
2018-03-13 12:02:18 -07:00
Max Kerr 9485277884 CurlHandler: Remove Transfer-Encoding on redirect from POST to GET (dotnet/corefx#27988)
This fix removes the TransferEncoding header from a request when it is redirected from POST to GET.

Fixes: dotnet/corefx#27301

Commit migrated from https://github.com/dotnet/corefx/commit/94e4bc6e888825d2ad8f373c9bbc1b279608349b
2018-03-13 09:55:36 -07:00
Stephen Toub 700bbfd8dd Change CurlHandler to only request HTTP/2 over TLS (dotnet/corefx#27934)
* Change CurlHandler to only request HTTP/2 over TLS

* Add test that 2.0 request with http:// doesn't request Upgrade


Commit migrated from https://github.com/dotnet/corefx/commit/431475b8e5462fe7d6cf9e8d424d6624c08d6a3f
2018-03-12 12:46:09 -04:00
Geoff Kizer 93099d3857 fix NTLM auth and add some manually enabled tests (dotnet/corefx#27958)
Commit migrated from https://github.com/dotnet/corefx/commit/036608dfd9edc15d9de22e45e4c548e3cc45a451
2018-03-12 09:38:43 -04:00
Stephen Toub 87d65bc88d Eat exceptions from SocketsHttpHandler's readahead task (dotnet/corefx#27898)
When SocketsHttpHandler puts a connection back into the pool, it issues a pre-emptive asynchronous read on the transport stream.  This enables us to check whether any unexpected data has arrived on the connection, whether the connection has been closed, etc., and without polling (which could be done with a NetworkStream but not well with an SslStream).  However, when we dispose of a connection from the pool, this task will potentially end up getting faulted, and while it won't crash the application by default, it will end up invoking the TaskScheduler.UnobservedException event.

This commit address this by ensuring that we always observe any exceptions that come from the read ahead task when the connection is disposed of (in the rare case where an HttpConnection is instead left for finalization, the event may still be raised, which is arguably a good thing, as the developer should be disposing responses.)

(The alternative would be to stop using the read ahead, and instead poll every time we wanted to know if the connection was still valid.  That would mean storing the socket in addition to the stream on the connection, and would mean we might miss some errant data that was already pulled from the socket into an SslStream.  It would also mean at least one more syscall for each request, as we'd check whether a connection from the pool was valid.  For now I'm sticking with the read ahead.)

Commit migrated from https://github.com/dotnet/corefx/commit/850c1d76e7c5371c5a6e015afa7f25da32f9cdaa
2018-03-09 13:33:49 -05:00
Christian Weiss 4347b1f5a1 Activity for HttpClient calls not stopped if inner handler does not use async/await (PR 2) (dotnet/corefx#27775)
* Moves call to InnerHandler into try-catch

* Code compiles; added test

* "return await" instead of two separate calls


Commit migrated from https://github.com/dotnet/corefx/commit/e1f304886a8315fd3303ff0e75dc7595c42b8cd0
2018-03-09 06:48:09 -05:00
Geoff Kizer 31a1adf119 fix SocketsHttpHandler to ignore invalid Set-Cookie (dotnet/corefx#27865)
* fix SocketsHttpHandler to ignore invalid Set-Cookie

* log when invalid cookie is ignored

* disable test for netfx


Commit migrated from https://github.com/dotnet/corefx/commit/59c2fab00e135f9311a0f3d8a87585a3cd81722e
2018-03-08 20:09:48 -05:00
David Shulman 8952db56ec Renable some TLS callback tests with SocketsHttpHandler (dotnet/corefx#27828)
The UseCallback_BadCertificate_ExpectedPolicyErrors tests had been
disabled when running against SocketsHttpHandler. The reason in the
comments was that the tests were not returning the proper
SslPolicyErrors.

These particular tests use external third party servers (*.badssl.com).
Running these tests now against the latest code shows no errors.  It's
possible this was a problem related to those external servers. Renabling
the tests for now.

Fixes dotnet/corefx#23137

Commit migrated from https://github.com/dotnet/corefx/commit/a51680e39a871cbdf3f63bbd28adb3d1abe435f5
2018-03-07 16:38:52 -08:00
Stephen Toub a04cb1ef89 Disable hanging Proxy_UseSecureProxyTunnel_Success test on netfx (dotnet/corefx#27815)
Commit migrated from https://github.com/dotnet/corefx/commit/2660a4690f70c6278cbdb5564c3e62e51cc1a651
2018-03-07 09:52:11 -05:00
David Shulman a8c1ba9b4f Fix SocketsNetHttpHandler TLS client cert handling (dotnet/corefx#27753)
SocketNetHttpHandler was not filtering down the client certificates when sending in
"Manual" mode. This caused a client certificate to be sent to a server when it
didn't have the proper EKU OID for "Client Authentication".

Changed this so that both "Manual" and "Automatic" modes will use the CertificateHelper
GetEligibleCertificate() API.

Fixes dotnet/corefx#23128

Commit migrated from https://github.com/dotnet/corefx/commit/d0cb45113979a22b216d630dbe9200d19b401691
2018-03-06 07:43:44 -08:00
Stephen Toub 4c75f5d1cd Add response drain max time to SocketsHttpHandler (dotnet/corefx#27708)
* Add response drain max time to SocketsHttpHandler

Adds support for a max time limit on how long we'll try to drain a connection before returning it to the pool, and adds a (currently non-public) knob for controlling that limit.

This also fixes a race condition with regards to cancellation and chunked responses.  If cancellation was requested after returning the connection to the pool but before we disposed of the cancellation registration, someone else could get the pooled connection and then cancellation of one request could end up canceling the other request.

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/4ca662cf7ed1bff8e423839936083838d705008d
2018-03-06 07:38:06 -05:00
Geoff Kizer d02b3a1091 Merge pull request dotnet/corefx#27748 from geoffkizer/testplatformfixes
fix some conditional test logic related to SocketsHttpHandler

Commit migrated from https://github.com/dotnet/corefx/commit/0ad6968adb463fa1470ba4af09f270311c8a25a3
2018-03-05 19:31:46 -08:00
Geoff Kizer e83463359d fix some conditional test logic to ensure we're not disabling SocketsHttpHandler tests
Commit migrated from https://github.com/dotnet/corefx/commit/c2db57418b02cb03c2f27a38567d86436746a275
2018-03-05 14:22:55 -08:00
Stephen Toub 38cfd8b969 Add folded response header support to SocketsHttpHandler (dotnet/corefx#27727)
* Add folded response header support to SocketsHttpHandler

The feature is deprecated by RFC 7230, but some servers still utilize it, and if they do, SocketsHttpHandler currently fails (WinHttpHandler and the netfx handler both allow it, CurlHandler currently fails as well).  This commit updates the header parsing logic to allow for them.

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/dc355e96d61d98dee48a809571edda3c1c7e5525
2018-03-05 15:32:52 -05:00
Stephen Toub 7482b6a4b0 Expose and roll out ValueTask extensibility
This commit does several things:
- Exposes the new `ValueTask` extensibility model being added in coreclr.  The ValueTask-related files will separately be mirrored over to corefx to enable the netstandard build of System.Threading.Tasks.Extensions.
- Adapts all `Stream`-derived types to return `ValueTask` instead of `Task` from `WriteAsync`.
- Changes the new `WebSocket` `SendAsync` method to return `ValueTask` instead of `Task`, and updates the `ManagedWebSocket` implementation accordingly.  Most `SendAsync`s on `ManagedWebSocket` should now return a `ValueTask` that's either completed synchronously (no allocation) or using a pooled object.  It now uses the underlying transport's new `WriteAsync` overload that returns `ValueTask`.
- Switches more uses of `ReadAsync` and `WriteAsync` over to the new overloads, including in Process, DeflateStream, BrotliStream, File, HttpClient, SslStream, WebClient, BufferedStream, CryptoStream,
- Removed some unnecessary array clearing from various routines using ArrayPool (after the clearing was added we changed our minds and decided clearing was only necessary in very specific circumstances)
- Implements a custom `IValueTaskSource` in Socket, such that async receives and sends become allocation-free (ammortized).  `NetworkStream` then inherits this functionality, such that its new `ReadAsync` and `WriteAsync` are also allocation-free (in the unbounded channel implementations; we can subsequently add it in for bounded).
- Implements a custom `IValueTaskSource` in System.Threading.Channels, such that reading and writing are ammortized allocation-free up to one concurrent reader and writer.
- A few random things I noticed as I was going through, e.g. missing ConfigureAwait, some incorrect synchronization in tests, etc.
- Adds a ton of new tests, mainly in System.Threading.Tasks.Extensions, System.Threading.Channels, and System.Net.Sockets.


Commit migrated from https://github.com/dotnet/corefx/commit/6d1671b2cfcf130b7bc6c059bb0508073426532a
2018-03-02 09:56:25 -08:00
Geoff Kizer e16aef7038 Merge pull request dotnet/corefx#27551 from geoffkizer/ntlm
SocketsHttpHandler: add ntlm auth and proxy auth for tunnel, and rework auth handling generally

Commit migrated from https://github.com/dotnet/corefx/commit/8ce711e455f33f7a4bcb9cdb0c5374984e11035e
2018-03-01 11:22:24 -08:00
Geoff Kizer c2e259c898 disable proxy test for WinHttpHandler on Win7
Commit migrated from https://github.com/dotnet/corefx/commit/3a361591e034962cf2ce34d374beefc04bd83c72
2018-03-01 09:48:55 -08:00
Geoff Kizer b948297e59 fix netfx test build
Commit migrated from https://github.com/dotnet/corefx/commit/271326fe70b08119b1463128db1e43c73a1fbad3
2018-02-28 13:22:42 -08:00
Geoff Kizer e59a5d3bb0 fix trace conflict issue
Commit migrated from https://github.com/dotnet/corefx/commit/0288644ee8b16e54a9d6bd1fad8b8a50a24bf6d0
2018-02-28 11:42:23 -08:00
Geoff Kizer f88c886479 Merge pull request dotnet/corefx#27536 from geoffkizer/curldrainfix
disable drain test variation for CurlHandler

Commit migrated from https://github.com/dotnet/corefx/commit/e3ecae6e2ae38425d6a98e86d3f9f3be378661a6
2018-02-28 03:11:25 -08:00
Geoff Kizer ec56dd2753 Merge pull request dotnet/corefx#27545 from stephentoub/exposedrainsize
Expose SocketsHttpHandler.MaxResponseDrainSize

Commit migrated from https://github.com/dotnet/corefx/commit/32e4f8e9b8fd1421e199166bf41a37f21a646fac
2018-02-28 03:05:11 -08:00
Geoff Kizer 64ea71c544 add ntlm auth and proxy auth for tunnel, and rework auth handling generally
Commit migrated from https://github.com/dotnet/corefx/commit/5d209e6e6280ced6c3ef4afda57c6f486ae36118
2018-02-28 02:57:05 -08:00
Geoff Kizer c92b7d0e1c disable Expect: 100-continue test on WinHttpHandler (dotnet/corefx#27538)
Commit migrated from https://github.com/dotnet/corefx/commit/c0cf481d1ca8532745124ffde3b16f6ea19639b0
2018-02-28 01:42:19 -05:00
Stephen Toub 25fcf57620 Expose SocketsHttpHandler.MaxResponseDrainSize
Commit migrated from https://github.com/dotnet/corefx/commit/900f9aabac877ec67efb13fbe8af8e07f71dcd95
2018-02-28 01:39:08 -05:00
Geoff Kizer a945f1b324 disable drain test variation for CurlHandler
Commit migrated from https://github.com/dotnet/corefx/commit/05e3ec4e001a1754facfd44ac78c6aa33b5fe86a
2018-02-27 19:06:38 -08:00
Stephen Toub 49571aef5e Add MaxResponseDrainSize, and fix a few draining bugs (dotnet/corefx#27476)
* Add MaxResponseDrainSize, and fix a few draining bugs

I've added MaxResponseDrainSize to make the setting configurable rather than a const; I left it internal until the API is approved.

In adding tests for it, I found a few existing bugs in draining that I fixed:
- HttpConnectionResponseContent nulls out its Stream when the Stream is consumed.  Then when the response content is disposed, the Stream is null, so it's not disposed, so it's not drained.
- HttpContentReadStream's Dispose wasn't checking whether it was already called, and would kick off a new draining operation if the connection was still associated.  So if the stream was disposed multiple times, which happens if the response content and stream are both disposed (since the content disposes of the stream), we end up corrupting the response due to multiple threads concurrently accessing and draining it.

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/eb80d133d066e72626643dddb3171bf9bb6a7c42
2018-02-27 08:35:03 -05:00
Geoff Kizer fe3585d9c5 Merge pull request dotnet/corefx#27220 from wfurt/ssl_Proxy2
support for CONNECT method in SocketHttpHandler 

Commit migrated from https://github.com/dotnet/corefx/commit/8e88850940605ef7d57cfc7b570bdf9bf2b8d822
2018-02-24 22:20:16 -08:00