Commit Graph
595 Commits
Author SHA1 Message Date
Stephen Toub a0cec1f795 Merge pull request dotnet/corefx#9322 from dotnet-bot/UpdateDependencies20160610014414
Updating CoreFx dependencies to rc4-24210-04

Commit migrated from https://github.com/dotnet/corefx/commit/fdba5487475388b48e19820476e25f2466ca80d9
2016-06-10 14:03:30 -04:00
Stephen Toub dccbf3a89d Updating CoreFx dependencies to rc4-24210-04
Commit migrated from https://github.com/dotnet/corefx/commit/3473c3dce764e2aa30497e0476acdac8298822ed
2016-06-10 12:48:41 -04:00
Stephen Toub e7fad1b9dc Fix hanging System.Net.Http test
We've been plagued for the last few weeks by CI jobs on Windows that hang in System.Net.Http.Functional.Tests, causing the whole job to fail after it eventually times out after two hours. I managed to find a CI server that had a process still alive after having experienced the hang and was able to debug it.  The Dispose_DisposingHandlerCancelsActiveOperationsWithoutResponses test is creating three loopback servers and using HttpClient.GetAsync to access each of them.  It's then Disposing of the HttpClient to verify that requests which should have been canceled are canceled.  The problem is that there's a race condition.  We may end up canceling one of the requests before it even gets a chance to connect to the server.  As a result, the server remains stuck in an asynchronous accept on it socket, and at the end of the test, we're waiting for all of the servers to shutdown... deadlock.  The fix is simple: don't wait for the servers... we don't care about their results, and they'll all be torn down when we exit the inner delegate.


Commit migrated from https://github.com/dotnet/corefx/commit/99b7b5a9b9f23e8b94bd8c75ecf86bb71d24b6c4
2016-06-10 11:29:49 -04:00
Stephen Toub 7e6d3a0a5b Merge pull request dotnet/corefx#9316 from dotnet-bot/UpdateDependencies20160610080826
Updating CoreFx dependencies to rc4-24210-03

Commit migrated from https://github.com/dotnet/corefx/commit/d5572dcbd047782c8b1be93c5d729e09d0c2b837
2016-06-10 05:16:26 -04:00
Stephen Toub b4662ed689 Merge pull request dotnet/corefx#9282 from stephentoub/change_curl_seek
Change how request content is read in libcurl

Commit migrated from https://github.com/dotnet/corefx/commit/0606a316743a63b33287247d64382b6f7474b8bc
2016-06-10 05:03:00 -04:00
dotnet-bot 1a3d275bc9 Updating CoreFx dependencies to rc4-24210-03
Commit migrated from https://github.com/dotnet/corefx/commit/2358285c88c2055040b979b87475cdfbc14ada1b
2016-06-10 08:08:26 +00:00
Stephen Toub eb1d4e0d0a Add another test
This simply posts to a location that will redirect, with several hundred K of data in the request body. It reliably fails for me before the change and reliably succeeds after.


Commit migrated from https://github.com/dotnet/corefx/commit/a97d15faa7d90bae430ae920a251c23010869a22
2016-06-09 13:39:31 -04:00
David Shulman 69b587d6cf Merge pull request dotnet/corefx#8575 from davidsh/maxresponseheaderslength_uwp
Update netcore50 MaxResponseHeadersLength property

Commit migrated from https://github.com/dotnet/corefx/commit/a6fc5237f0db5dc7aecf128bbb5dd7bbe570d495
2016-06-09 09:21:41 -07:00
Stephen Toub 3d6037f313 Change how request content is read in libcurl
libcurl wants to be able to call back to CurlHandler at arbitrary times to ask it to seek in the request content stream.  This can happen for redirects, for auth challenges, etc.  Handling this has been a challenge due to the way HttpContent is designed.

HttpContent provides two modes for accessing the data via Streams:
- Push: You call CopyToAsync(Stream, TransportContext) to have the data from the HttpContent copied into the target stream.
- Pull: You call ReadAsStreamAsync to get a stream that represents the data in the HttpContent, and you can read from that.

The pull model is ideal for libcurl.  It allows us to get a stream which we can jump around in if it's seekable, and we can request a new stream if it's not seekable. The push model is challenging, as we're forced to put in plcae an intermediary, a push-pull adapter that let's us effectively read from a type that's trying to write to us.

There is however an issue with the pull model.  With the push model, StreamContent's CopyToAsync tracks whether the stream has already been accessed, and if it has and if it's non-seekable, trying to call CopyToAsync again throws to alert you that rewinding simply isn't possible.  The pull StreamContent's ReadAsStreamAsync, however, does not.  This means that if you get a non-seekable stream and you call ReadAsStreamAsync again, you get back the same stream (or, rather, a read-only wrapper around the same stream) that is at the existing position rather than the original position.  Then resending that content will end up sending less data than it should have, resulting in failure, just not abruptly.

That issue caused us to go down the path of the more challenging push model and trying to use CopyToAsync.  However, recently that's been shown to have even worse effects.  We don't have the ability to cancel CopyToAsync, which means that if the first copy is still in-flight when we try to seek, we have no choice but to fail, even if the stream is actually seekable, as most are (e.g. memory streams, file streams, etc.)  This can happen deterministically in cases where libcurl decides to redirect before it's fully sent the request content, but it's also prone to race conditions even for cases where the request content is fully sent but the copy hasn't been officially marked as complete by the time libcurl tries to redirect.   ASP.NET recently began hitting this frequently on some machines in their lab runs.

While there's no perfect solution, the best solution is to go with the one that's the simplest code, the fastest code, and the deterministic outcome: the pull model.  This commit deletes a whole bunch of code that was there in support of the push model, adds just a bit of code to enable the pull model, and fixes up a couple of tests that were written to expect the push model.


Commit migrated from https://github.com/dotnet/corefx/commit/74cd3d619b3d3b1e963ca8bd33749af3aec99c05
2016-06-09 10:18:19 -04:00
dotnet-bot ed36474dbf Updating CoreFx dependencies to rc4-24209-03
Commit migrated from https://github.com/dotnet/corefx/commit/4786e13a70b20350f77d047624384090341acfa1
2016-06-09 13:19:12 +00:00
David Shulman dfba8a47c7 Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/ffe1b9d0cd94cb6c431b700c42b270037f6a1f79
2016-06-08 12:48:43 -07:00
David Shulman 7a33ae7d77 Update comment about netcore50 MaxResponseHeadersLength property
Windows.Web.Http is built on WinINet. There is no maximum limit (except
for out of memory) for received response headers. So, returning 0
(indicating no limit) is appropriate.

Fixes dotnet/corefx#8541.


Commit migrated from https://github.com/dotnet/corefx/commit/9883a1064c1119eaa885e5b4cff20177f0f928fe
2016-06-08 12:46:25 -07:00
dotnet-bot 2e6b9dc990 Updating CoreFx dependencies to rc4-24208-04
Commit migrated from https://github.com/dotnet/corefx/commit/02515a1ace7d60e2b8b63c4b80427b0a1275503c
2016-06-08 18:43:01 +00:00
Wes Haggard cd52f14fb9 Merge pull request dotnet/corefx#9233 from chcosta/nethttp_repro
Remove keepallprojectreferences from system.net.http and system.net.security tests

Commit migrated from https://github.com/dotnet/corefx/commit/fc88bf49cf8cdaa6c5484b3e19f8f17cccd50fbb
2016-06-07 23:04:01 -07:00
Jeremy Barton cef32c6d79 Merge pull request dotnet/corefx#9226 from bartonjs/reduce_build_warnings
Fix dependency conflict warnings

Commit migrated from https://github.com/dotnet/corefx/commit/9fb78b52a0f04e56fd69f57209107163410a6b07
2016-06-07 15:10:20 -07:00
Stephen Toub 2cbd59ef6f Merge pull request dotnet/corefx#9208 from stephentoub/fix_header_parsing
Allow whitespace after HTTP response header name

Commit migrated from https://github.com/dotnet/corefx/commit/ca0075eda676f9a35f43a0c6994fc08c0b1981b3
2016-06-07 13:19:37 -04:00
Christopher Costa 80bca9a4b4 Remove keepallprojectreferences
Commit migrated from https://github.com/dotnet/corefx/commit/25d4dbf46ed63abd4ff96a8f855f21c4420ae597
2016-06-07 10:15:34 -07:00
Jeremy Barton eb5dcf3203 Fix dependency conflict warnings
The upgrade to netstandard1.6 seems to have caused some newer libraries to be preferred.


Commit migrated from https://github.com/dotnet/corefx/commit/4b2af116dd90c5b6a3faca4e87b2e86582e5089d
2016-06-07 09:48:13 -07:00
Stephen Toub 2f0636a244 Allow whitespace after HTTP response header name
Be a bit more lenient in what we allow in the formatting of response headers on Unix. The RFC states that "Each header field consists of a case-insensitive field name followed by a colon (":"), optional leading whitespace, the field value, and optional trailing whitespace." However, whitespace between the header name and the colon is accepted by WinHttpHandler, by the .NET Framework, and by all browsers on which I tried it, and servers can easily include such whitespace; if they do and we're not tolerant of it, requests to such servers will fail.


Commit migrated from https://github.com/dotnet/corefx/commit/888a01cbcb1a98377ebf6e87e89a2551aac1654d
2016-06-07 09:38:20 -04:00
dotnet-bot 349036ec6b Updating CoreFx dependencies to rc4-24207-03
Commit migrated from https://github.com/dotnet/corefx/commit/dbc9db2a3378417434c4fb9e531a788d14eb9621
2016-06-07 13:21:03 +00:00
dotnet-bot 19fa55e533 Updating CoreFx dependencies to rc4-24207-02
Commit migrated from https://github.com/dotnet/corefx/commit/1ad197d9386e4d5dcd6e2bfdc5ed753a0f965893
2016-06-07 07:19:35 +00:00
dotnet-bot 5d49d2be32 Updating CoreFx dependencies to rc4-24206-03
Commit migrated from https://github.com/dotnet/corefx/commit/684a9a1dbe3c467e170c50eff84ff09dbd964b9b
2016-06-06 13:11:57 +00:00
dotnet-bot 8e078b77e7 Updating CoreFx dependencies to rc4-24206-02
Commit migrated from https://github.com/dotnet/corefx/commit/c1bffac7c759702cadd48ae3fb883a5ef38f3275
2016-06-06 07:05:37 +00:00
dotnet-bot 9b556b2ad6 Updating CoreFx dependencies to rc4-24205-04
Commit migrated from https://github.com/dotnet/corefx/commit/130fb7ad9c1f44fa54488a287a4a835567910dc0
2016-06-05 19:06:03 +00:00
dotnet-bot 53b5786639 Updating CoreFx dependencies to rc4-24205-03
Commit migrated from https://github.com/dotnet/corefx/commit/2ac2a1abf6edc0409e0398fa907b67a658a9812c
2016-06-05 13:11:27 +00:00
dotnet-bot 1a2c5d511a Updating CoreFx dependencies to rc4-24205-02
Commit migrated from https://github.com/dotnet/corefx/commit/f543d6c01894f2ce22c46ce2f9e8e97adb7d751e
2016-06-05 07:06:42 +00:00
dotnet-bot 832c793afe Updating CoreFx dependencies to rc4-24205-01
Commit migrated from https://github.com/dotnet/corefx/commit/4638fa6cffdc05bf0efdb528b6d9e9bca1d9290d
2016-06-05 01:09:11 +00:00
dotnet-bot 44203d6255 Updating CoreFx dependencies to rc4-24204-04
Commit migrated from https://github.com/dotnet/corefx/commit/7565dc2368d20db4fd77e9b55ace3305488ed546
2016-06-04 19:07:36 +00:00
dotnet-bot bde86715af Updating CoreFx dependencies to rc4-24204-03
Commit migrated from https://github.com/dotnet/corefx/commit/3a11ec14d8aa9c33bd5fc84a81d748766c756146
2016-06-04 13:05:27 +00:00
Stephen Toub 05c80e923c Merge pull request dotnet/corefx#9109 from stephentoub/clientcert_tests
Add some HttpClientHandler client certificate tests

Commit migrated from https://github.com/dotnet/corefx/commit/a25394ed35d6484f50a063a622fa52df1553d1f0
2016-06-04 05:55:29 -04:00
Stephen Toub 9a11ee5651 Merge pull request dotnet/corefx#9140 from stephentoub/revert9102
Revert "Flow HttpClient timeouts and cancellation to the response stream"

Commit migrated from https://github.com/dotnet/corefx/commit/62d0ddefab515489010ae1464d712348b9d053a1
2016-06-04 05:55:14 -04:00
Stephen Toub 242120ab04 Merge pull request dotnet/corefx#9131 from stephentoub/fix_clientcert_crash
Fix crash in HttpClient on Unix when using client certificates

Commit migrated from https://github.com/dotnet/corefx/commit/30eee0b348e6a2ed1c3c40f94c2b5d53e769b274
2016-06-03 21:57:18 -04:00
Stephen Toub 9ec85d26d0 Revert "Flow HttpClient timeouts and cancellation to the response stream"
This reverts the product changes from commit dotnet/corefx@cc8b48c8ea.  The test changes remain.


Commit migrated from https://github.com/dotnet/corefx/commit/ef6b3490bb2d376d42eeddbc4db45414a23c7804
2016-06-03 21:33:31 -04:00
Stephen Toub 58db78235b Fix crash in HttpClient on Unix when using client certificates
In HttpClient on Unix when a client certificate is used, we add the intermediate certificates for the client authentication cert's chain so that the server can chain-verify.  When we add the extra chain certificate to the SSL handle, we're transferring ownership to that handle, which we subequently dispose... but we don't mark the original SafeHandle as invalid, so it eventually gets finalized and we end up double-free'ing, leading to seg faults and other badness.  This commit simply cleans up the handle appropriately.


Commit migrated from https://github.com/dotnet/corefx/commit/0b8dfc5774f66b8538e07813113d6c962a8d5775
2016-06-03 19:02:44 -04:00
Stephen Toub 00f486042d Fix HttpClientMiniStressTests tests
These were broken at some point (almost all of the tests fail, complaining about invalid responses from the server), but we didn't notice because they're not enabled by default.


Commit migrated from https://github.com/dotnet/corefx/commit/ef77613d8732beab380b058368bb7bcf2cc54369
2016-06-03 15:42:48 -04:00
Stephen Toub 1d23722d72 Merge pull request dotnet/corefx#9102 from stephentoub/slowread_windows_cancellation
Flow HttpClient timeouts and cancellation to the response stream

Commit migrated from https://github.com/dotnet/corefx/commit/3eb2e11d028a8b9e9e861cd595235a314c7a2560
2016-06-03 13:10:47 -04:00
Stephen Toub ea6cd05418 Add some HttpClientHandler client certificate tests
And fix a small bug discovered from this, lack of argument validation when setting the enum value.


Commit migrated from https://github.com/dotnet/corefx/commit/483aa5a3012fe78ea001ece1b0404b18c0b90a29
2016-06-03 13:09:23 -04:00
dotnet-bot bbbd91a21c Updating CoreFx dependencies to rc4-24203-06
Commit migrated from https://github.com/dotnet/corefx/commit/fa054f7d8012b5361b4614d1b2e5912291a8d6da
2016-06-03 13:06:55 +00:00
Stephen Toub b1895678eb Flow HttpClient timeouts and cancellation to the response stream
When using a timeout and/or a cancellation token with a buffered HttpClient operation, the cancellation/timeout doesn't flow through to the actual read/write operations on the underlying streams.  This means that on Windows, doing a basic operation like GetStringAsync with a server that pauses for arbitrarily long periods of time while sending the response body won't cancel or timeout until it sends more data. (We don't need to do this on Unix, as on Unix we already handle this case differently, with a single registration for the duration of the SendAsync operation.)


Commit migrated from https://github.com/dotnet/corefx/commit/cc8b48c8ea41b9cee888055483d16072f3f3a1c5
2016-06-03 07:12:28 -04:00
dotnet-bot c4da362b9c Updating CoreFx dependencies to rc4-24203-05
Commit migrated from https://github.com/dotnet/corefx/commit/18ace4063860ae0db9ff303f14609368719fa8f5
2016-06-03 07:10:21 +00:00
Davis Goodin 1418be0568 Upgrade CoreFX version to rc4-24201-04 from the build pipeline.
Commit migrated from https://github.com/dotnet/corefx/commit/7ce67d490263f936fd093b70e41a010d9be6a970
2016-06-01 13:53:46 -05:00
Stephen Toub 4077430754 Merge pull request dotnet/corefx#9024 from stephentoub/http_sendasync_tests
Add several HttpClientHandler tests related to content

Commit migrated from https://github.com/dotnet/corefx/commit/cdba60ecba957272a77ccc8245ab6ba29535380b
2016-06-01 14:19:34 -04:00
Stephen Toub ad4e7cb1ab Fix CurlHandler handling of redirects (dotnet/corefx#8946)
* Fix CurlHandler handling of redirects

- Relative urls in Location headers were not being handled correctly.  We now allow any url that TryCreate will parse using the current url as a base.
- We were only handling a subset of redirect status codes as redirects, trying to second-guess which status codes libcurl would redirect for, e.g. 300 wasn't being treated as a redirect. We now let libcurl do all the work.
- We should have been playing it safer with regards to clearing out credentials if we weren't sure a Uri redirect location was valid. Now we do.
- We were tracking state unnecessarily that we should have instead been
  asking libcurl for, e.g. the last url used in a redirect.  This also caused us to store the wrong RequestMessage.Uri in some cases where a location header came in but we didn't actually follow it.

Commit migrated from https://github.com/dotnet/corefx/commit/7bd18d682f0e201275c988e6263239ab84f6389b
2016-06-01 08:41:23 -04:00
Stephen Toub 3f7c097a58 Add several HttpClientHandler tests related to content
- Verify that request content isn't disposed until after response content is buffered
- Verify that request content isn't disposed until after request content is sent and response headers are received
- Verify that verbs which shouldn't send request content don't


Commit migrated from https://github.com/dotnet/corefx/commit/9c0eaa1b7a4812f50ac37f4adde516971d9b333a
2016-06-01 08:38:58 -04:00
Matt Ellis 94c58f546c Use correct openSUSE RID
When I added the rid, I forgot to append the -x64 part, which prevented
the openSUSE build from restoring a runtime, since that part is platform
specific.


Commit migrated from https://github.com/dotnet/corefx/commit/d02e47ec2d44fae9d45d29d49f356199ed59b406
2016-05-31 17:52:15 -07:00
Stephen Toub cec5f6a127 Merge pull request dotnet/corefx#8935 from stephentoub/move_request_dispose
Dispose of request HttpContent after buffering response

Commit migrated from https://github.com/dotnet/corefx/commit/eb4c047e43f7618bc6ecad53fbbe631fb2318a51
2016-05-31 19:10:16 -04:00
Stephen Toub f9fc17df13 Remove innerloop dependencies on www.ssllabs.com
We have several innerloop tests that make HTTP calls during System.Net.Http.Functional.Tests out to www.ssllabs.com, which has SSL endpoints for different SSL protocols.  This commit avoids using that server during innerloop tests.  The tests are moved to outerloop, and some replacements using a localhost are added to innerloop.


Commit migrated from https://github.com/dotnet/corefx/commit/8a9402b33d46166d1a3129a7c2cae0334b00c4b6
2016-05-31 17:05:10 -04:00
dotnet-bot cfde5f8d34 Updating CoreFX dependencies to rc4-24131-00
Commit migrated from https://github.com/dotnet/corefx/commit/7a16fac72dca8b3442e4425896593a0d24fd0fd2
2016-05-31 06:57:39 +00:00
Stephen Toub 0eeaf383f8 Fix client certificates-related crash
We're disposing of OpenSSL resources we shouldn't be.  When libcurl goes to close an SSL connection and doing so attempts to free these resources we already freed, it seg faults.


Commit migrated from https://github.com/dotnet/corefx/commit/ceba0e5dda567f2b2635b55db328415fd407b318
2016-05-29 08:18:04 -04:00
stephentoub 104f40f163 Dispose of request HttpContent after buffering response
Commit migrated from https://github.com/dotnet/corefx/commit/608ce0d2bc26047d8b1fd3cb65c0efaffbf79ae7
2016-05-27 18:15:01 -04:00