Commit Graph
294 Commits
Author SHA1 Message Date
stephentoub 9b4473ede7 Upgrade package versions to rc3-23901
Commit migrated from https://github.com/dotnet/corefx/commit/55246a7fc60807d021fded5e333784956a662a51
2016-03-02 07:40:12 -05:00
Eric St. John 7c5ac76238 Add support for new Xamarin frameworks
The latest build tools contains framework lists for two new Xamarin fxs:
  Xamarin.TVOS
  Xamarin.WatchOS

This adds placeholders for those frameworks so that they can support
the packages with inbox facades.


Commit migrated from https://github.com/dotnet/corefx/commit/baf425fa935f4ecd32712448be627604067cf1d3
2016-02-29 14:43:27 -08:00
Eric St. John 19554adc35 Update buildtools and change validation framework
Update BuildTools to 1.0.25-prerelease-00180

Change validation framework moniker from dnxcore50 to
netstandardapp1.5.


Commit migrated from https://github.com/dotnet/corefx/commit/7c50768be0a2008480aa22ddb8038fdcb0e8039b
2016-02-29 14:43:26 -08:00
Eric St. John afdeaf78b0 Remove use of DNXCore from packages
This changes every package that used the DNXCore50 moniker to use a
NETStandard moniker instead.


Commit migrated from https://github.com/dotnet/corefx/commit/6008326984df7bddff751d0fec678ee29d821a59
2016-02-29 14:43:25 -08:00
Pallavi Taneja 38e2f4de64 Update the packages
Commit migrated from https://github.com/dotnet/corefx/commit/be7151b45a54577c2e28c56977408d7d61ed0ea9
2016-02-29 13:09:16 -08:00
Stephen Toub 84f73c7035 Merge pull request dotnet/corefx#6322 from justinvp/curl_headers
Reduce CurlHandler header parse allocations

Commit migrated from https://github.com/dotnet/corefx/commit/0d639c39f884de45f4325c6a9218b849b834a4fb
2016-02-25 20:50:32 -05:00
Stephen Toub 834f1fb44a Merge pull request dotnet/corefx#6389 from stephentoub/arg_names
Fix use of nameof with ArgumentException

Commit migrated from https://github.com/dotnet/corefx/commit/581d8ec923f57a33c43f3fbccdf47cd527010c47
2016-02-25 17:21:44 -05:00
Justin Van Patten 34b6ba7acb Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/0291b44d95777cc3ea5521194a7f9c88be987959
2016-02-25 10:41:06 -08:00
Justin Van Patten fb984b77d4 Reduce CurlHandler header parse allocations
Use existing known header and reason phrase instances instead of
always allocating new strings and avoid unnecessary intermediate
string allocations.


Commit migrated from https://github.com/dotnet/corefx/commit/8aab95829d92185966ec9b79702101a2f167cd49
2016-02-25 10:41:05 -08:00
Stephen A. Imhoff 811f903c18 Fix use of nameof with ArgumentException
Correct instances of new "ArgumentException(nameof(..." so names are in the correct parameter.  Where possible, I chose the resource string I felt best fit the situation.  Otherwise, I created a new entry (I'm assuming there's some extra work that needs to be done there, but don't know what it is offhand).


Commit migrated from https://github.com/dotnet/corefx/commit/368fdfd86ee3a3bf1bca2a6c339ee590f3d6505d
2016-02-25 10:35:40 -05:00
Eric Mellino 45736b2647 Fix compilation issues in various libraries when compiling without PCL reference assemblies
Commit migrated from https://github.com/dotnet/corefx/commit/e49f570bf97d0d81f3c461970155dc6cdd6aee8c
2016-02-24 18:29:17 -08:00
Eric St. John 5af200cd50 Rename "dotnet" to "NETStandard"
Fixes https://github.com/dotnet/corefx/issues/5707

We are changing the .NET packages to no longer use the ‘dotnet’, ‘dotnet5.x’, and ‘dnxcore50’ monikers.  This is thee first stage of the change for dotnet->netstandard.

The replacements are as follows

Old moniker | New moniker
----------------- | ------------------
dotnet5.x | netstandard1.y  (where y = x -1)
DNXCore50 | netstandardapp1.5
dotnet | netstandard1.3

To prepare for this change you can do the following to your project.json.  This change will require a recent build of NuGet or dotnet.exe and can be done prior to consuming the packages with the breaking change.  These packages will not work with DNX.

For a project targeting dotnet5.6
```
    "frameworks": {
        "netstandard1.5": {
            "imports": [ "dotnet5.6" ]
        }
    },
```

For a project targeting dnxcore50
```
    "frameworks": {
        "netstandardapp1.5": {
            "imports": [ "dnxcore50", "portable-net45+win8" ]
        }
    },
```

[tfs-changeset: 1578321]


Commit migrated from https://github.com/dotnet/corefx/commit/4435f9f2776ae007e05f4454675e56cf76a51975
2016-02-23 20:18:17 -08:00
David Shulman 19962646b8 Response stream reads should return error for insufficient data
WinHttpResponseStream was not tracking the amount of data read when the response used 'Content-Length' semantics. So, if the amount of bytes read from the server was less than expected, we did not return an error. This was different behavior than .NET Framework.

Fixed WinHttpResponseStream so that it will track the total number of bytes read and compare it to the expected number of bytes if using 'Content-Length' semantics. Note that we don't do this checking if the HTTP request is a HEAD request. That is because the definition of that HTTP verb is to return headers "as-if" it was returning a real response body. So, the 'Content-Length' might be set but there is no response body for a HEAD request.

For cases of using 'Transfer-Encoding: chunked' semantics for the response body, there is already error checking at the lower HTTP layer in WinHTTP.

Fixes dotnet/corefx#6231.


Commit migrated from https://github.com/dotnet/corefx/commit/7f5d6b643996306062836a17ddad643fd7e40ff2
2016-02-21 15:36:38 -08:00
Stephen Toub 1d7305c701 Merge pull request dotnet/corefx#6269 from stephentoub/curl_errors
Improve several areas of CurlHandler error handling

Commit migrated from https://github.com/dotnet/corefx/commit/2eb9d0ebbf97456fdbf0e2fc118abc9d3fcaed7f
2016-02-21 09:06:08 -05:00
David Shulman 3c429d38af Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/e1847ee878dcd48ce66f330761f50a96e7e9b2b0
2016-02-20 20:32:45 -08:00
David Shulman 1127bdc413 Add more Http response stream tests
Building on PR dotnet/corefx#6250, added more response stream tests dealing with
invalid response body transfer semantics.


Commit migrated from https://github.com/dotnet/corefx/commit/42e5f468e86f7d62fe1c62194bfd473d30cf06b7
2016-02-20 19:21:10 -08:00
stephentoub 647a074469 improve several areas of CurlHandler error handling
While tracking down an issue related to exception handling in CurlHandler, I fixed up a few issues:
- On older libcurl's curl_multi_perform can return an error code that means to retry curl_multi_perform, but we were treating it as an actual error.
- Several places we were creating an HttpRequestException with a null inner exception, even if we had additional information about the cause.  I've fixed those call sites to include an appropriate inner exception.
- Cleaned up a few error messages.
- Fixed one place where I was overzealous in mapping exceptions to IOException


Commit migrated from https://github.com/dotnet/corefx/commit/1faaea86f0684452a874bcd58ce259763135c6b9
2016-02-20 07:25:58 -05:00
Stephen Toub f87bde7d1a Merge pull request dotnet/corefx#6250 from stephentoub/curlhandler_ioexception
Change CurlHandler to use IOExceptions for Stream failures

Commit migrated from https://github.com/dotnet/corefx/commit/4375b158e5d0498afb7edd1f3dc320bedbf9bf29
2016-02-19 21:26:21 -05:00
stephentoub 951b06b86c Add test for invalid response content length
Commit migrated from https://github.com/dotnet/corefx/commit/f9d488485d2bb7edeb43f918af1746d9ecb5e758
2016-02-19 17:32:27 -05:00
Christopher Costa b7275a6e29 Merge branch 'master' of https://github.com/dotnet/corefx into open_pkgs
Commit migrated from https://github.com/dotnet/corefx/commit/7df55caaad1d1e21866ec31b0e7161db9ae2179c
2016-02-19 14:21:24 -08:00
stephentoub 7365591fd7 Change CurlHandler to use IOExceptions for Stream failures
As with WinHttpHandler, CurlHandler wraps exceptions in HttpRequestException.  But WinHttpHandler switches to using IOException when sending exceptions out via Stream.Read/WriteAsync.  This change does the same for CurlHandler.


Commit migrated from https://github.com/dotnet/corefx/commit/e39e43a3809775c41a223ffa679e4f9e693676e1
2016-02-19 14:11:51 -05:00
Stephen Toub 26c1962d0d Merge pull request dotnet/corefx#6209 from stephentoub/nameof_exceptions
Deploy nameof throughout corefx

Commit migrated from https://github.com/dotnet/corefx/commit/1bd332f2e5f559c2eab276acb0d9e4256085ec2f
2016-02-19 14:10:39 -05:00
Christopher Costa 8d91794cf8 Merge branch 'master' of https://github.com/dotnet/corefx into open_pkgs
Commit migrated from https://github.com/dotnet/corefx/commit/6c7226985ebea63f36d3d24e4c65e331a2e277c1
2016-02-19 10:56:24 -08:00
stephentoub 7385fb7563 Fix two build warnings
Commit migrated from https://github.com/dotnet/corefx/commit/499960b0345be841d0eb5bd174d68045a2c8d5f0
2016-02-19 10:42:25 -05:00
dotnet-bot b32ddb5d98 Deploy nameof throughout corefx in MemberData
Commit migrated from https://github.com/dotnet/corefx/commit/9c3156b9ada06b8e58ac53d48fc303500bf3e476
2016-02-18 23:58:15 -05:00
dotnet-bot 3184718282 Deploy nameof throughout corefx in exception construction
Mostly automated replacement of parameter name string literals with corresponding usage of nameof.


Commit migrated from https://github.com/dotnet/corefx/commit/396b41ddec99d01505c1bc4fa02fb0f0c5844990
2016-02-18 23:58:06 -05:00
David Shulman 52476494de Merge pull request dotnet/corefx#3199 from justinvp/winhttphandler_parseresponseheaders
Reduce allocations when parsing response headers in WinHttpHandler

Commit migrated from https://github.com/dotnet/corefx/commit/35f7ef05a8022358ec435152e7099d8263a4422a
2016-02-18 15:52:45 -08:00
Christopher Costa d95b14a3c4 Merge branch 'master' of https://github.com/dotnet/corefx into open_pkgs
Commit migrated from https://github.com/dotnet/corefx/commit/b70432898b7a00edb3303c0fbf4a1b98ebe442b4
2016-02-18 10:28:54 -08:00
stephentoub 95d7cc7534 Update packages to rc3-23818
Commit migrated from https://github.com/dotnet/corefx/commit/380a2ebf4a498f9ab0a819c71d8717377e601bfb
2016-02-18 07:28:09 -05:00
Christopher Costa 23ac6d7e8d Merge branch 'master' of https://github.com/dotnet/corefx into open_pkgs
Commit migrated from https://github.com/dotnet/corefx/commit/ddcd78f8f2ccd3debefefb5e10164d7a038bb7e0
2016-02-17 10:46:00 -08:00
Justin Van Patten 8e6b8806d3 Reduce response message allocations in WinHttpHandler
Reduce allocations associated with interop calls to
WinHttpQueryHeaders and parsing response headers.


Commit migrated from https://github.com/dotnet/corefx/commit/ce63f30fcc11eca57b13753effbb057ce6547688
2016-02-16 18:47:54 -08:00
stephentoub b6b5cfd1c0 Fix HttpClient diagnostic listener issues
- Fix Assert that was throwing in a background thread due to mistmatched type (it was looking explicitly for HttpResponseMessage rather than any type in its inheritance hierarchy, and CurlHandler uses a derived type).
- Update project.json package versions
- Unsubscribe the listener when done with it


Commit migrated from https://github.com/dotnet/corefx/commit/9a8d97852bcce9be0b4b6b5eff5ed87f4e36119e
2016-02-16 18:13:49 -05:00
nbilling 4401926ae3 Http request/response DiagnosticSource logging.
- Added logging to WinHttpHandler, CurlHandler, and HttpHandlerToFilter
  for HTTP request/response.
- Added functional tests for HttpClient (WinHttpHandler is exercised by
  these tests on desktop).


Commit migrated from https://github.com/dotnet/corefx/commit/edbd7ba720699bbe20753872ac430f0b3fdaf3a9
2016-02-16 15:57:17 -05:00
stephentoub 180fba592f Update packages to rc3-23816
Commit migrated from https://github.com/dotnet/corefx/commit/c2e6426b9b9494d5478f656396f4da5711e8729a
2016-02-16 11:05:43 -05:00
stephentoub a024728bfe Use Buffer.BlockCopy with byte[]
In particular after https://github.com/dotnet/coreclr/pull/3118, Buffer.BlockCopy has less overhead than Array.Copy when copying byte[]s, such that there's no benefit to using Array.Copy and potential benefit to using Buffer.BlockCopy.

This commit replaces usage of Array.Copy(byte[], ...) in corefx with Buffer.BlockCopy(byte[], ...).  A lot of places were already using it.

(In a few places where we weren't passing lower bounds to Array.Copy with T[] arguments, I added explicit lower bounds as well to avoid the overload needing to call GetLowerBound.)


Commit migrated from https://github.com/dotnet/corefx/commit/3ab3bd6efcba669bf04d42f738fe5a495ec62940
2016-02-14 09:04:00 -05:00
Stephen Toub 4843d966db Merge pull request dotnet/corefx#6040 from stephentoub/add_review_headers
Add API review headers to ref files

Commit migrated from https://github.com/dotnet/corefx/commit/39471b56bd0241e60a33b4179a04187b96481547
2016-02-11 18:47:35 -05:00
Christopher Costa 1df6eaae43 Open package conversions for corefx.
Commit migrated from https://github.com/dotnet/corefx/commit/030e29992f6be20ffb9d9d3e799118f3354bce22
2016-02-11 13:37:45 -08:00
stephentoub 685d9f5063 Add API review headers to ref files
Commit migrated from https://github.com/dotnet/corefx/commit/5240b324e50f9aabaa11d4b0c46acc34e370a724
2016-02-11 10:50:44 -05:00
stephentoub 1744d93462 Allow CurlHandler to opt-in to NTLM via CredentialCache
libcurl supports four auth types (Negotiate, NTLM, Digest, and Basic), but today our CurlHandler implementation only enables three (Negotiate, Digest, and Basic), with NTLM explicitly disabled to match what was done in WinHttpHandler in corefx (the full framework enables it).

However, there are a few key differences that need to be taken into account for CurlHandler. For example, popular implementations of gssapi and Negotiate on Unix do not include implementations for fallback to NTLM.  So whereas including "Negotiate" in WinHttpHandler often allows code on Windows to use NTLM if Kerberos is not available, the current state of CurlHandler often does not.  And although NTLM has some known issues, if it's the only option for a scenario where a Unix front-end needs to communicate with a Windows back-end (say because the front-end doesn't have kerberos infrastructure available and the back-end only has Windows authentication enabled), we still want it to be possible for a developer to write an app that communicates with that back-end.  The underlying platform supports it, the developer explicitly wants it, CurlHandler sitting in the middle shouldn't get in the way.

As such, this commit enables NTLM to be used, essentially removing the blocking of it that was previously done.  However, it's not enabled by default for arbitrary credentials; rather, it's only enabled when a credential added to a CredentialCache explicitly specifies "NTLM".  That way, it's available for a dev to opt-in to if desired, but just providing a NetworkCredential to CurlHandler will not use NTLM.


Commit migrated from https://github.com/dotnet/corefx/commit/6e765b2b84dcf0b6e7e3d1e0cbee6a7499a585f5
2016-02-11 10:39:07 -05:00
Stephen Toub f581539eca Merge pull request dotnet/corefx#6016 from stephentoub/remove_cctors
Remove ~20 explicit static cctors across corefx

Commit migrated from https://github.com/dotnet/corefx/commit/11efc0d43d56e1c280653934b27ae5c1ef05af8c
2016-02-11 08:48:15 -05:00
stephentoub 0dc4f0e58f Remove a handful of explicit static cctors across corefx
Explicit static cctors cause the C# compiler to not mark types as beforefieldinit, which in turn means that the backend compiler needs to add checks to static methods to ensure that the type has been initialized.  We have a bunch of such cctors across corefx that can be easily removed; this commit does so.  In a few places, it also presizes some collections to help avoid unnecessary memory pressure.


Commit migrated from https://github.com/dotnet/corefx/commit/79ae21b1b9a113230da7ebfbffa4e3c3fe36f0ac
2016-02-11 07:59:21 -05:00
Stephen Toub 36e072e26f Merge pull request dotnet/corefx#6001 from stephentoub/http_logging
Enable EventSource logging in CurlHandler

Commit migrated from https://github.com/dotnet/corefx/commit/b50ddae49d917e9a3c7c3d244ece87d7cb805d0b
2016-02-10 23:34:27 -05:00
stephentoub 0970c41a6a Address PR feedback
Also removed a bit of gratuitous tracing. We can always add more later if/when we need it.


Commit migrated from https://github.com/dotnet/corefx/commit/7e21fb6673c8371f538cb456378d63cc71e7fc5c
2016-02-10 15:14:35 -05:00
stephentoub ab49739fb6 Enable EventSource logging in CurlHandler
We currently have a bunch of tracing in CurlHandler, but it's all guarded behind compile-time flags, making it difficult to use to diagnose issues.  This converts that to all be EventSource-based logging.  It also enables libcurl to provide its debug info via a callback, which is then routed to the EventSource as well, and mapped to the easy handles with which the info is associated.


Commit migrated from https://github.com/dotnet/corefx/commit/9c9120d7e4368d5a627a09ae4285c66432f5e4d2
2016-02-09 22:58:55 -05:00
Davis Goodin 1bc755f9e7 Adds custom xplat nuget that can restore from VSTS feed, adds the VSTS feed, and upgrades project.jsons throughout NDP\FxCore to pass new nuget compatability checks.
Some fixes (adding imports, adding Platforms package) were tooled, but more complex ones (forking project.jsons, editing csproj's) were not.

Also makes dependency version validation rules case-insensitive. (I used this fix to update the versions of some packages.)

[tfs-changeset: 1573868]


Commit migrated from https://github.com/dotnet/corefx/commit/84af04317505d48feaa1e83dd5dc27ddc0f6de76
2016-02-09 14:20:02 -08:00
Cristian Pop 01d61b736f Fixing and adding tests for the in-memory VirtualNetwork/Stream. Adding
TaskTimeoutExtensions and fixing the System.Net.Security timeout pattern.


Commit migrated from https://github.com/dotnet/corefx/commit/27954497d635ff0f01fbb16e1b485156c51398ea
2016-02-08 16:02:01 -08:00
stephentoub 2e521c57c9 Update packages to rc3-23808
Commit migrated from https://github.com/dotnet/corefx/commit/31bb3a0cd271aebc9a4336a53b0fc3bb900fe22f
2016-02-08 07:26:49 -05:00
stephentoub d4ec167e63 Use OpenSSL for cert chain verification in CurlHandler
Our certificate chain verification includes the ability to check user store certificates in addition to the root store, but it's more expensive than the default verification provided by OpenSSL, which only includes the system store.  This commit modifies our CurlHandler's VerifyCertChain implementation to first use the OpenSSL implementation, and only fall back to ours if it fails, resulting in much faster processing in https cases.


Commit migrated from https://github.com/dotnet/corefx/commit/65fa1710ebf14711a7ec9b03e00b24014e8e97eb
2016-02-05 13:46:57 -05:00
stephentoub 30a19d4335 Update packages to rc3-23803
Commit migrated from https://github.com/dotnet/corefx/commit/d27ef6fb6092060e643c49a670e825e0cc01ff4d
2016-02-04 07:38:24 -05:00
David Shulman 71baeeede4 Fix HttpClientHandler UseDefaultCredentials=false
HttpClientHandler (on Windows) was attempting to use default credentials against a server that needed auth even when the property .UseDefaultCredentials was set to false.

In order to map the different HttpClientHandler properties to the WinHttpHandler properties, the HttpClientHandler .UseDefaultCredentials. needs to turn on/off two credentials related properties of WinHttpHandler, .ServerCredentials and .DefaultProxyCredentials. However, it was only toggling the single .ServerCredentials property. The fix is to update both properties accordingly.

Fixes dotnet/corefx#5045.


Commit migrated from https://github.com/dotnet/corefx/commit/010801cbdfcb4f64152d2ba29da541ca395d0a8e
2016-02-02 11:12:03 -08:00