Commit Graph
415 Commits
Author SHA1 Message Date
Eric St. John 608e8a43cd Add support for PCL profiles
Adds support for profile-based PCL using placeholders.


Commit migrated from https://github.com/dotnet/corefx/commit/5853b8f459c5b07d543274cd16137375970356ae
2016-04-12 14:49:26 -07:00
Eric Mellino 3c5e57e248 Merge pull request dotnet/corefx#7651 from mellinoe/test-runtime-projectref-rebase2
Overhaul usage of test-runtime, Update buildtools

Commit migrated from https://github.com/dotnet/corefx/commit/9f90fdbdb3cc623dda7dc89f749172f619d0a767
2016-04-12 14:47:07 -07:00
Stephen Toub 061cdacc56 Merge pull request dotnet/corefx#7681 from stephentoub/fix_connecttimeout_test
Fix ConnectTimeout_TimesOut_Throws test

Commit migrated from https://github.com/dotnet/corefx/commit/20d6f81f7d03202cf62dc48e7ba42ea67a18d191
2016-04-12 17:41:37 -04:00
stephentoub 716f5ee544 Fix ConnectTimeout_TimesOut_Throws test
This test wasn't actually running because it was incorrectly annotated as a [Theory] but without any data.  When changed to be a [Fact], it failed because the test depends on the Socket's listening backlog being filled so that a subsequent connect will time out, but Listen(1) doesn't actually force the OS to use a queue of max size of 1, its just advisory.  The fix is to flood the server with requests that don't get accepted, filling the listen queue.


Commit migrated from https://github.com/dotnet/corefx/commit/883a32630a21c83bb91735cebf1d87c76691bd7d
2016-04-12 13:55:55 -04:00
Eric Mellino f57a495784 Overhaul usage of test-runtime.
This change uses some features available in an updated version of
buildtools. Instead of resolving the test-runtime for each of our test
projects as a separate step, we will now add a "reference" to it from the
project.json of each test project. This will allow us to resolve the nuget
assets from both it and the test project at the same time. This will be
more robust than our current process, which is very fragile and
error-prone.

The above is made possible by an updated version of
"PrereleaseResolveNuGetPackageAssets", which is the buildtools task
responsible for resolving test assets from nuget packages. This task also
has a lot of additional validation, which triggers a lot of warnings in
corefx. I've made various changes to csproj's and to project.json's around
the repository in order to satisfy those warnings.


Commit migrated from https://github.com/dotnet/corefx/commit/622ee8f512497fc07621de15e41c6bd575f387c9
2016-04-12 07:12:36 -07:00
dotnet-bot 203d37ef1e Updating CoreFX dependencies to rc3-24012-00
Commit migrated from https://github.com/dotnet/corefx/commit/f89a8267334562ab363ce19d4a2bfa0618bb1f00
2016-04-12 05:34:15 +00:00
stephentoub 014be97bdf Improve HttpContent tests
The tests are doing work in a way where if an async exception is changed to be synchronous, it likely goes unnoticed, and vice versa.  Tightening the tests.


Commit migrated from https://github.com/dotnet/corefx/commit/448a201f339137356e76bdb105916ea7459341d6
2016-04-11 21:59:22 -04:00
stephentoub cde2f4498a Fix HttpContent.CopyToAsync to return rather than throw exception
I broke this as part of my async/await refactorings.  It was supposed to return a Task.FromException but instead was throwing.


Commit migrated from https://github.com/dotnet/corefx/commit/e17479f350c54ef9e54524782c53bdbee7f9f1b6
2016-04-11 21:57:45 -04:00
dotnet-bot 83f02c753f Updating CoreFX dependencies to rc3-24011-00
Commit migrated from https://github.com/dotnet/corefx/commit/406378b88f0485b549ec2b8c242c79329a5b3ef5
2016-04-11 16:13:03 +00:00
dotnet-bot 6883e89fc3 Updating CoreFX dependencies to rc3-24008-00
Commit migrated from https://github.com/dotnet/corefx/commit/30b74738cdac9c75a2dd165d339f206b1070f3cd
2016-04-08 06:40:37 +00:00
stephentoub 1ab13b9661 Address PR feedback
And some additional cleanup, including removing a Tuple allocation when starting a new worker and fixing up some Debug.Asserts to be more informative.


Commit migrated from https://github.com/dotnet/corefx/commit/274feb64c9e91539f4b5c912b762ae337e2eb7a5
2016-04-07 19:38:42 -04:00
stephentoub ea83470915 Improve reliability of CurlHandler MultiAgent worker
If something unexpectedly goes wrong in our worker loop, and in particular when queueing a replacement worker, we may end up leaving a request sitting in the request queue with no one to process it.  This commit ensures that if something does go horribly wrong, the agent is left in a state where subsequent incoming requests can still kick off another worker, and in the meantime any pending requests in the queue are failed, so that code blocking on them doesn't simply hang.

As I was looking at this and some of our dispose usage, I also cleaned up a few places that could be simplified using the C# 6 ?. syntax.


Commit migrated from https://github.com/dotnet/corefx/commit/ad4afcf61aa62aa85c26b2c058953fe18328ffd4
2016-04-07 17:28:16 -04:00
stephentoub b9c430844f Only call curl_multi_wait if there are active operations
The CurlHandler work is sometimes hitting brief pauses unnecessary, where it finishes processing the last active request and then calls curl_multi_wait to wait for more work to do.  This is purely wasteful and can be skipped when we know there aren't any more active operations.


Commit migrated from https://github.com/dotnet/corefx/commit/8075d3a1b54121b9f656e033fe6308de05eb7381
2016-04-07 17:28:16 -04:00
stephentoub 317c18111d Extend DNS cache timeout in CurlHandler
Now that we're allowing the multi handle to live for as long as the CurlHandler, the DNS cache timeout starts to matter much more.  libcurl will cache the results of DNS lookups, and by default will timeout entries after 1 minute.  Our Windows implementation defaults to 10 minutes, so I'm extending our Unix implementation to match that.


Commit migrated from https://github.com/dotnet/corefx/commit/184792734ebb89d95425e37c7d1631a84e05e624
2016-04-07 17:28:16 -04:00
stephentoub 8197041ce0 Match SafeCurlMultiHandle lifetime to its MultiAgent
Today each time we spin up a worker in CurlHandler, we create a new SafeCurlMultiHandle, use it for the lifetime of that worker, and then when the worker goes away, the multi handle is torn down. This was done for simplicity of resource management, but it also leads to significant overheads due to everything that libcurl caches associated with the multi handle, e.g. when the multi handle goes away, so does it connection cache, its DNS cache, etc.  This commit addresses that by extending the lifetime of the multi handle to match that of the CurlHandler.  We still lazily create the handle when the first worker is spun up, but then we keep it alive until the handler is disposed.  As before, we ensure that as long as a worker is running, the multi handle will be kept alive, even if the handler is disposed.


Commit migrated from https://github.com/dotnet/corefx/commit/8d911b76c2ba05eb1ef22cebd6fef5cad2a21893
2016-04-07 17:28:16 -04:00
dotnet-bot 0f0193e356 Updating CoreFX dependencies to rc3-24007-00
Commit migrated from https://github.com/dotnet/corefx/commit/d9fdf25de0e1cf35219a26d4f840302e5379f292
2016-04-07 05:37:12 +00:00
Stephen Toub d3980a698e Merge pull request dotnet/corefx#7523 from ellismg/run-tests
Remove "UnsupportedPlatforms" metadata

Commit migrated from https://github.com/dotnet/corefx/commit/0cdc8e39f80a749bfa25eb559ab014be4f7ec557
2016-04-06 09:21:15 -04:00
dotnet-bot be7ca463ae Updating CoreFX dependencies to rc3-24006-00
Commit migrated from https://github.com/dotnet/corefx/commit/aff79bf3fa8ce8c13b6084d82aca30e534142b81
2016-04-06 05:21:19 +00:00
Matt Ellis e631e1c680 Remove UnsupportedPlatforms metadata
Commit migrated from https://github.com/dotnet/corefx/commit/f5252c0c0d19622132e0edcf0b64783b798e3bbf
2016-04-05 14:38:52 -07:00
Matt Ellis 68e4373e9a Reconsile .builds and UnsupportedPlatform metadata
There were a handful of test projects that just didn't have .builds
files and some other cases where the data in the .builds file did not
match what was in the UnsupportedPlatforms metadata.

Some of the projects said the tests were unsupported on FreeBSD and
nowhere else. Given that these tests should most likely be supported on
FreeBSD (given that OSX and Linux both supported them), I've not moved
that logic into the .builds files.

If there ends up being a specific set of tests that the FreeBSD port
team wants to disable long term, they can add .builds metadata as they
see fit.


Commit migrated from https://github.com/dotnet/corefx/commit/836c6f12e1a05749d7d5bf27d02bd28f98eb76aa
2016-04-05 11:51:49 -07:00
stephentoub b559a6d703 Change ConnectTimeout default back to infinite
We'll keep it as infinite until we determine how this property is being exposed.  Otherwise, we're overriding the HttpClient.Timeout without giving a way to control it.


Commit migrated from https://github.com/dotnet/corefx/commit/dd3426f7b3cc4ef48b698c252acd16bec98f2e6f
2016-04-05 09:55:52 -04:00
stephentoub 8b16b341a4 Add CurlHandler.MaxResponseHeadersLength
Adds the MaxResponseHeadersLength property.


Commit migrated from https://github.com/dotnet/corefx/commit/8840bc7b3961cbaae547da068bd47d452a8a5dfe
2016-04-05 09:53:41 -04:00
Stephen Toub 7557aa945c Merge pull request dotnet/corefx#7510 from dotnet-bot/UpdateDependencies20160405051812
Updating CoreFX dependencies to rc3-24005-00

Commit migrated from https://github.com/dotnet/corefx/commit/92c2ebd01c926e4d63c27d2efbdc51b2141199e1
2016-04-05 07:43:33 -04:00
dotnet-bot 8c6d7acd5d Updating CoreFX dependencies to rc3-24005-00
Commit migrated from https://github.com/dotnet/corefx/commit/afbf526ac0fae250fc47623f2c43d2caa1abb803
2016-04-05 06:23:55 -04:00
stephentoub aba16573e8 Address PR feedback and fix test
Commit migrated from https://github.com/dotnet/corefx/commit/9854f2ac6fc75c67b4e414783a08067f8e2cd782
2016-04-04 22:30:28 -04:00
stephentoub bf66904b51 Add CurlHandler.MaxConnectionsPerServer option
Adds MaxConnectionsPerServer to CurlHandler.


Commit migrated from https://github.com/dotnet/corefx/commit/cf89034e4425fcd5bc4d00819e29c8c06a47d954
2016-04-04 22:18:07 -04:00
Stephen Toub 8f452c4b3c Merge pull request dotnet/corefx#7502 from dotnet-bot/UpdateDependencies20160404102117
Updating CoreFX dependencies to rc3-24004-00

Commit migrated from https://github.com/dotnet/corefx/commit/a2443bcbe3aa410007c1f1fc4f2c4394e5ce189e
2016-04-04 21:56:26 -04:00
Stephen Toub 44b8eb2705 Merge pull request dotnet/corefx#7462 from stephentoub/curl_contentlength
Fix CurlHandler Content-Length handling on redirects

Commit migrated from https://github.com/dotnet/corefx/commit/8992e73cf1bf09f93cd65ed2b0598c2508afa9e1
2016-04-04 20:23:12 -04:00
dotnet-bot 9f65b1e1ef Updating CoreFX dependencies to rc3-24004-00
Commit migrated from https://github.com/dotnet/corefx/commit/9fd2c8863f2be58ee5d1431f0c658de61e991551
2016-04-04 20:19:10 -04:00
Stephen Toub 4b74e9a08a Merge pull request dotnet/corefx#7503 from stephentoub/curlhandler_defaultproxycredentials
Add CurlHandler.DefaultProxyCredentials

Commit migrated from https://github.com/dotnet/corefx/commit/4bd8d0fcacce9a49a44c9b32022e892c109c7e15
2016-04-04 20:08:20 -04:00
stephentoub 15145110b1 Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/d6ec5160a2112fcc0b28ceecc89b678c28b66ff8
2016-04-04 19:06:36 -04:00
stephentoub f44dff3e55 Fix CurlHandler Content-Length handling
CurlHandler was explicitly setting the Content-Length header, which overrides libcurl's default handling of Content-Length.  This means that  Content-Length was being sent even when it shouldn't have been, such as when redirecting a POST to a GET.  This commit changes how we handle Content-Length.  Rather than explicitly setting the header ourselves, we let libcurl do it, and we tell it the length of the input via the INFILESIZE and POSTFIELDSIZE options.

A few other issues addressed as well in the act of fixing this:
- A SafeHandle wasn't being disposed of in the case of a redirect.
- 301 wasn't being considered a redirect status code for the purposes of credential handling.
- Some code could have been a bit cleaner.


Commit migrated from https://github.com/dotnet/corefx/commit/864f0926754fbb781b81b543f972e069f6295a0c
2016-04-04 19:06:33 -04:00
stephentoub 73b6baf5db Address PR feedback and clean up formatting
Commit migrated from https://github.com/dotnet/corefx/commit/fb254e65f051f02192eaa62bc0fc0ea4f8259e3a
2016-04-04 18:45:54 -04:00
stephentoub 15ccbd065a Add CurlHandler.ConnectTimeout
Adds a timeout to the connection phase of CurlHandler.


Commit migrated from https://github.com/dotnet/corefx/commit/6880dca258fa33448983f6046b5b727ad1d56c27
2016-04-04 18:30:10 -04:00
stephentoub 63e8f36b90 Add CurlHandler.DefaultProxyCredentials
Commit migrated from https://github.com/dotnet/corefx/commit/256ecaf347b5e2b809722d1acbfb7bff1902bf06
2016-04-04 18:26:44 -04:00
Stephen Toub ba8bf6c2cd Add CurlHandlers.SslProtocols option
Add CurlHandlers.SslProtocols option

With libcurl on the OpenSSL backend (the recommended configuration), we can provide full-fidelity for this option.  With libcurl on another SSL backend, we can allow choosing all three TLS protcols or just one TLS protocol, but we can't support selecting two of the three.

Commit migrated from https://github.com/dotnet/corefx/commit/bd79e80f25923e0f2e29e07aba60b03070596bb4
2016-04-04 17:27:18 -04:00
Stephen Toub 979a030e2e Merge pull request dotnet/corefx#7494 from stephentoub/curlhandler_encodedproxycreds
Fix encoding of proxy credentials in CurlHandler

Commit migrated from https://github.com/dotnet/corefx/commit/30ac912cb2ee065192bb9c928aca74996d43546c
2016-04-04 17:26:14 -04:00
stephentoub 7f83f8ddc6 Fix encoding of proxy credentials in CurlHandler
We need to URL encode the username/password for a proxy.  Otherwise, for example, a colon in the name could mess up how the concatenated username and password are parsed.  libcurl URL decodes them.


Commit migrated from https://github.com/dotnet/corefx/commit/9b4f73c0e9b4e671a2d47a5b4f53e68a9d93240d
2016-04-04 15:54:12 -04:00
stephentoub 425957d45e Tweak SSL context callback in CurlHandler
- Perf.  We were creating a SafeHandle for the SSL context, but it didn't own the underlying handle, and we were then just passing it back to two native functions.  We can skip the SafeHandle altogether, saving on the allocation and marshaling costs for all SSL connections.
- Error handling.  For robustness, we should be ensuring that any problems related to getting the state from the GCHandle result in returning an error code rather than propagating an exception, which will likely crash.
- Naming.  The name of the callback method is no longer correct, as it's use for more than just cert verification.


Commit migrated from https://github.com/dotnet/corefx/commit/b736f46255000a40219f3c5be864782cdb450d59
2016-04-04 08:57:13 -04:00
James Ko 3c397e122e Use nameof in WinRT's HttpClientHandler
Commit migrated from https://github.com/dotnet/corefx/commit/2f767c97104e16790c618a950ac04895cef47c53
2016-04-03 10:52:14 -04:00
Stephen Toub be0ad5fb0d Remove stale TODO from CurlHandler
Based on decision in https://github.com/dotnet/corefx/issues/6408.

Commit migrated from https://github.com/dotnet/corefx/commit/aa35622312605b6872a0fb50ca2e4ee2c5bce9f0
2016-04-03 08:00:25 -04:00
stephentoub 0687204ddb Refactor HttpContent with async/await
Commit migrated from https://github.com/dotnet/corefx/commit/d44015edc83042c8b34b1cf051b9371753fdc528
2016-04-02 17:39:05 -04:00
Lakshmi Priya Sekar f452ecd1cd Fix project dependencies from the xunit extensions update.
Commit migrated from https://github.com/dotnet/corefx/commit/1939982be59ede355131c9d85684dba4b0449c50
2016-04-01 14:58:15 -07:00
Lakshmi Priya Sekar 2a3abf12b4 Update xunit.netcore.extensions to latest.
Commit migrated from https://github.com/dotnet/corefx/commit/a7bb9eb3327f5cc791d39b4cff764dd7dd29fda5
2016-04-01 14:04:56 -07:00
Stephen Toub 93152ee66a Merge pull request dotnet/corefx#7405 from stephentoub/getasync_tasks
Further reduce Task allocations in GetString/ByteArrayAsync

Commit migrated from https://github.com/dotnet/corefx/commit/43350da9750b3a7ce5e674aaf828a8c487cde7d9
2016-04-01 07:37:01 -04:00
stephentoub b6c4853a6b Further reduce Task allocations in GetString/ByteArrayAsync
The HttpContent ReadAsStringAsync and ReadAsByteArrayAsync methods ensure that the data is loaded into the buffer, via an async operation, and then process that buffer synchronously.  This refactors that synchronous processing into its own method, and changes ReadAs methods to use a simple async method that does the await on LoadIntoBufferAsync and then calls these methods.  This avoids any task-related allocations if the data is already buffered.  It also makes those synchronous methods callable from the GetString/ByteArrayAsync directly, such that these methods can avoid an extra layer of continuations, as they already do their own buffering.


Commit migrated from https://github.com/dotnet/corefx/commit/1334af155c3892a45e42505a85a1eaf194344572
2016-03-31 15:49:21 -04:00
Jonathan Miller 0e43cc624e Merge pull request dotnet/corefx#6572 from sokket/builds
Adding builds files to the test projects

Commit migrated from https://github.com/dotnet/corefx/commit/e8326c3dab65e2e8eac466f346a9693788d41ca9
2016-03-31 11:41:43 -07:00
Jonathan Miller 7c2ce6913c Adding builds files for the test projects
Commit migrated from https://github.com/dotnet/corefx/commit/752599494fce80b5d0059a9090fdc010d8c7f45b
2016-03-31 10:46:26 -07:00
David Shulman 7eb1b02cbe Merge pull request dotnet/corefx#7302 from stephentoub/streamtostreamcopy
Improve memory usage of HttpClient's StreamToStreamCopy

Commit migrated from https://github.com/dotnet/corefx/commit/1f43828ee4797aeb434c525eb036bde1f69a5e3c
2016-03-31 09:24:01 -07:00
Stephen Toub 695186abcb Merge pull request dotnet/corefx#7379 from stephentoub/multipart_async
Refactor MultipartContent to use async/await

Commit migrated from https://github.com/dotnet/corefx/commit/963a99a2250195cb772979b5a020ac53d0f2288c
2016-03-31 10:22:59 -04:00