Commit Graph
1021 Commits
Author SHA1 Message Date
Sepideh Khoshnood 50fea0be10 Merge pull request dotnet/corefx#15932 from sepidehMS/PlatformSpecificTests
Review all PlatformSpecific tests to ensure test coverage

Commit migrated from https://github.com/dotnet/corefx/commit/6451bed4d4a667d9c05a41c0843504d020d283ab
2017-02-08 15:53:46 -08:00
Stephen Toub decd91a5fe Merge pull request dotnet/corefx#15967 from ianhays/nethttptest_bettererrormessage
Propagate exception for failing net.http test for better diagnosis.

Commit migrated from https://github.com/dotnet/corefx/commit/0738551debef08b7b2432e80ce5b4914c901b371
2017-02-08 18:38:21 -05:00
Tarek Mahmoud Sayed addda8630e Enable tests to compile with netstandard (dotnet/corefx#15956)
* Enable tests to compile with netstandard

Most of the tests have netstandard configurations and it doesn't compile. the changes here is to fix the configurations and the tests to compile.
This is important step to get netfx tests compile too as we are in most of the time netfx fallback to netstandard configuration

The changes include some fixes to compile teh sources too.

* Fix System.Collections.Immutable

* update src configuration

* remove netstandard17 defines

* Split netcoreapp code to its own files

* Remove 17 from the test class name


Commit migrated from https://github.com/dotnet/corefx/commit/15b4f51c2f3cb924840e5407bb8d5fe03bb282ea
2017-02-08 15:32:53 -08:00
Ian Hays 37fb1cc65f Propagate exception for failing nethttp test for better diagnosis.
Commit migrated from https://github.com/dotnet/corefx/commit/a9ee22c2f293335efbad2cd3165f1cf2f2a4cd2b
2017-02-08 15:00:27 -08:00
Jose Perez Rodriguez d9c497be12 Prepare uap package (dotnet/corefx#15866)
Prepare uap package

Commit migrated from https://github.com/dotnet/corefx/commit/afaaf450d1869992dcf4f51c627f16145cf9c974
2017-02-08 10:39:37 -08:00
sepidehMS 016f9b537d Remove unnecessary PlatformSpecific labels from tests
Commit migrated from https://github.com/dotnet/corefx/commit/3294b7172c51869892debba78d774a4e1f382cd5
2017-02-07 15:46:35 -08:00
Tarek Mahmoud Sayed 77cad86b1e Remove versioned configuration from test projects (dotnet/corefx#15879)
The changes onclude some other minor clean up in the test project files

Commit migrated from https://github.com/dotnet/corefx/commit/62212cca900081173fce70991c3a0b30393994a3
2017-02-06 13:52:11 -08:00
Lakshmi Priya Sekar 846b1d406a Merge pull request dotnet/corefx#15777 from Priya91/nettests
Fix networking test activeissues in System.Net.Http

Commit migrated from https://github.com/dotnet/corefx/commit/fdbf46ca4e3ab174628772e41d7c6bfc8a8bc448
2017-02-06 11:09:24 -08:00
Wes Haggard f2fd0ea78a Update Solution files to use windows path slashes.
Commit migrated from https://github.com/dotnet/corefx/commit/f8ba7c412d06d8e4d4e6278502d4dd771a0f10bb
2017-02-03 16:31:48 -08:00
Lakshmi Priya Sekar 6bff1b3000 Fix networking test activeissues in System.Net.Http
Commit migrated from https://github.com/dotnet/corefx/commit/dd65f89ef9806067779eb63b884d9317dad68202
2017-02-03 12:31:59 -08:00
Eric St. John c2dc83e56a Sync BuildConfiguration with project PropertyGroups
Commit migrated from https://github.com/dotnet/corefx/commit/758a0e16e8c5af8741d14043f4bef1d15a79a377
2017-02-03 08:34:24 -08:00
Eric St. John f9d5dbf3fe Fix legacy build configurations
Commit migrated from https://github.com/dotnet/corefx/commit/48680c23d9669bd0735a8b374c3e459a5406eef8
2017-02-03 08:32:14 -08:00
Tarek Mahmoud Sayed 7395af32ad Enable compiling the test projects against the configuration (dotnet/corefx#15743)
* Enable compiling the test projects against the configuration

The tests were compiled using the vertical configuration and not the best configuration picked from Configurations.props. this change is fix that and have all test projects configured accordingly.
This change ensuring netcoreapp runs successfully and we'll have another rounds later for other configurations like netfx, UAP...etc.

* Fix openssl test project on Linux distros

* Update the project configurations

* Update VS solution files

* update solution files


Commit migrated from https://github.com/dotnet/corefx/commit/e79912f8b77bc22abfd85e94b74c06e5d99e8381
2017-02-02 17:54:40 -08:00
Wes Haggard c4e17cd362 Update all solution files using solution generation tool
Commit migrated from https://github.com/dotnet/corefx/commit/a822a266821cf79df96cdd77d2a3d44f1510d9a0
2017-02-02 15:44:45 -08:00
Wes Haggard 4effd546bc Add ProjectGuids for all projects and empty configs for projects without BuildConfigurations
Commit migrated from https://github.com/dotnet/corefx/commit/d00bb5d18ac91189b12ed2fb7131d0ff62da9034
2017-02-02 15:02:57 -08:00
Tarek Mahmoud Sayed eb4147f182 Stop bin placing facade assemblies to the refs for netfx builds (dotnet/corefx#15700)
we were bin placing the facade assemblies to the ref folder during netfx build. this was causing a problem while building the tests as we'll get some types defined in the referenced facade assemblies and core libs.

Commit migrated from https://github.com/dotnet/corefx/commit/6c2087f755e240758150c6c692d5d8ddc67f2832
2017-02-01 16:34:49 -08:00
Eric St. John c61e84f6ec Clean up desktop Configurations
Remove all cruft from projects related to building desktop configs which
now build in standard repo.


Commit migrated from https://github.com/dotnet/corefx/commit/93b36cc273391a40552613800b6fdaa8685179ae
2017-01-31 19:25:30 -08:00
Eric St. John 60359ed705 Make netfx build work
This fixes all src and ref projects to build when TargetGroup=netfx.


Commit migrated from https://github.com/dotnet/corefx/commit/44df137ce0a9e38883d8f9a1149bdf01e54c8956
2017-01-31 18:43:08 -08:00
Eric St. John 95a7c07d4b Fix configurations for UAP
These changes enable TargetGroup=UAP to build completely.


Commit migrated from https://github.com/dotnet/corefx/commit/17fdb439c50f4aa66a99f9b5549e9db923331e40
2017-01-31 06:27:49 -08:00
Eric StJohn a818efa124 Merge pull request dotnet/corefx#15616 from ericstj/buildMultipleConfigurations
Build multiple configurations

Commit migrated from https://github.com/dotnet/corefx/commit/ee7052769c863bebe22e281a7f77113d895c0386
2017-01-30 15:22:26 -08:00
Eric St. John 2ef0e9bfd8 Sync PropertyGroups and BuildConfigurations
Commit migrated from https://github.com/dotnet/corefx/commit/7e4792af39bd7faba20dd3390b411f3afaee3c66
2017-01-30 13:23:56 -08:00
Stephen Toub 7074546ab3 Merge pull request dotnet/corefx#15631 from stephentoub/sts_array
Use ArrayPool for CurlHandler's send transfer state

Commit migrated from https://github.com/dotnet/corefx/commit/fb4862b895086b074aef1e94bdedd0cf65bad10f
2017-01-30 13:19:13 -05:00
Stephen Toub dd818f999f Use ArrayPool for CurlHandler's send transfer state
When sending request data from something other than a byte[], CurlHandler allocates a buffer to transfer data from the request to libcurl, typically 16K (unless the request content is known to be smaller than that).  We can use a buffer from ArrayPool for that.


Commit migrated from https://github.com/dotnet/corefx/commit/6e4d5a1dbac460af9df29e2f3c839c42c503d8ff
2017-01-30 12:08:18 -05:00
Stephen Toub a8bbd7d8fe Remove ReadOnlyStream allocation from CurlHandler
CurlResponseStream is already read-only, so we don't need StreamContent wrapping it with another stream.  That just adds another allocation and another layer of indirection.


Commit migrated from https://github.com/dotnet/corefx/commit/b4863dac2851047b40c8be435fa7207e7e66ab75
2017-01-30 08:44:08 -05:00
Stephen Toub f940c093c7 Change HttpClient timeout test to use loopback server
Shorten test duration from 40 seconds to .5 seconds


Commit migrated from https://github.com/dotnet/corefx/commit/e323ff698267e22df01cb10beb49fa24eecebcce
2017-01-26 19:22:02 -05:00
Ian Hays 84438d0a3b Merge pull request dotnet/corefx#15481 from ianhays/nettest_timeouts
Increase timeouts for some failing Net tests

Commit migrated from https://github.com/dotnet/corefx/commit/076bcc22dce00936dd2e16e4dbb740f1198a9313
2017-01-26 12:47:29 -08:00
Justin Van Patten ab4379dfdf Include StringBuilderCache.cs under ProductionCode dir in HttpClient unit tests (dotnet/corefx#15498)
Commit migrated from https://github.com/dotnet/corefx/commit/73ba4c2e76fad8a34e082b81251fd96b39b761b8
2017-01-25 19:47:41 -07:00
Ian Hays 3cebd64914 Increase timeouts for some failing Net tests
These two tests are/were failing intermittently from hitting their timeouts. We can increase those timeouts to a significantly higher value without taking away from the test's value.


Commit migrated from https://github.com/dotnet/corefx/commit/fcc9f8023490f07a82886cf504f754dc24bc4b9b
2017-01-25 12:15:26 -08:00
Stephen Toub 816312f896 Fix typo in HttpClient private method name
Commit migrated from https://github.com/dotnet/corefx/commit/cede7ef5c23698d0fabc7d24c494fb01f4e03ea8
2017-01-25 07:19:43 -05:00
Stephen Toub d6e3d70ab1 Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/2712445de889b2e874d8940562e0b4d22fc49071
2017-01-24 17:20:48 -05:00
Stephen Toub 2f9c7e9423 Add debugging environment variable to trace curl messages to stderr
Commit migrated from https://github.com/dotnet/corefx/commit/752141267d38725103bac128b78490f8fade0d7e
2017-01-24 16:30:10 -05:00
Stephen Toub bec0954d54 Avoid unnecessary Uri parsing/allocation when no redirection happened
Commit migrated from https://github.com/dotnet/corefx/commit/c4acd798bc769ac795b6f61bd948b75f0269da09
2017-01-24 16:30:10 -05:00
Stephen Toub 6b8318a0ee Avoid duplicate calls to GetValuesAsStrings
Commit migrated from https://github.com/dotnet/corefx/commit/0afc1d93a0c62b8f6924d79a1763b124fbd7f15a
2017-01-24 16:30:10 -05:00
Stephen Toub bb29cec104 Avoid empty array allocation in GetValuesAsStrings
Commit migrated from https://github.com/dotnet/corefx/commit/aaf4d1110f32812d3273f8884fac6581a0a69474
2017-01-24 16:30:10 -05:00
Stephen Toub 683dab1c53 Avoid string concatenation in NameValueHeaderValue
Commit migrated from https://github.com/dotnet/corefx/commit/d75ae47f3d5325f69f1c7a1dfed8a13135fc20a2
2017-01-24 16:30:10 -05:00
Stephen Toub 919abd8dc2 Use StringBuilderCache to avoid allocations in Header ToStrings
Commit migrated from https://github.com/dotnet/corefx/commit/ee3e8a9069a655123967b2f6529e89e0a25ce6f0
2017-01-24 16:30:10 -05:00
Stephen Toub 7427dc3679 Better handle synchronously completed request content ReadAsStreamAsync
Regardless of whether we already had a content stream, we were allocating a closure object on every call to the transfer function.

And for a common case of ReadAsStreamAsync completing synchronously (as it does with StreamContent), we were unnecessarily allocating several tasks as well as a delegate.  We can instead add a fast path that does the logic synchronously when the task completes synchronously.


Commit migrated from https://github.com/dotnet/corefx/commit/8b847350441571695c00d182c692ff84c3346be2
2017-01-24 16:30:09 -05:00
Stephen Toub 313cb8cd9d Add CurlResponseStream Begin/EndRead overrides
In case these are used, they should direct to the ReadAsync override rather than using the base implementations that queue a work item to call Read (which in turn calls ReadAsync and blocks).


Commit migrated from https://github.com/dotnet/corefx/commit/3d8cd790ef02a3b9ee9dd177cc7a7fd6ab899851
2017-01-24 16:30:09 -05:00
Stephen Toub fcf8cf1fb1 Fix header parser bug to pass in correct span
We were erroneously allocating new strings for known headers due to passing in the wrong span.


Commit migrated from https://github.com/dotnet/corefx/commit/7cf37ee4daf1758266dacfe8de361d169269804a
2017-01-24 16:30:09 -05:00
Stephen Toub 3e29168b07 Use COPYPOSTFIELDS for ByteArrayContent POST content in CurlHandler
Commit migrated from https://github.com/dotnet/corefx/commit/4bf9bd067c55b17f6efc914a9cddff6d8ee8232c
2017-01-24 16:30:09 -05:00
Jose Perez Rodriguez f9d4e6795d Removing netstandard configurations for things that are bellow netstandard (dotnet/corefx#15373)
Removing netstandard configurations for things that are bellow netstandard

Commit migrated from https://github.com/dotnet/corefx/commit/c656446f01db4b902b0c06b19551cc30d9dd9c6b
2017-01-24 09:40:19 -08:00
Lakshmi Priya Sekar 194dfd28d3 Respond to PR feedback.
Commit migrated from https://github.com/dotnet/corefx/commit/3ac884af42aac1bc5152f4b2ca0c0a8604a92d98
2017-01-23 13:36:54 -08:00
Lakshmi Priya Sekar d82c7740f6 Fix centos test failures in outerloop.
Commit migrated from https://github.com/dotnet/corefx/commit/76e105181d5e5dc2d1f12b5e5b378a572809a000
2017-01-20 18:54:56 -08:00
Stephen Toub 94c802cadf Ensure CURLOPT_TCP_NODELAY is set by CurlHandler
It's set by default starting in libcurl 7.50.2.  In prior versions when it's not set, it can lead to measurable latency problems with some key scenarios.


Commit migrated from https://github.com/dotnet/corefx/commit/b12651b30e24ba6d30028ab20c188457a045ce87
2017-01-20 15:36:28 -05:00
Jose Perez Rodriguez dd708b105d Adding missing Configurations.props for refs and fixing the existing ones (dotnet/corefx#15291)
Adding missing Configurations.props for refs and fixing the existing ones

Commit migrated from https://github.com/dotnet/corefx/commit/2847e0ec9f7c9ac42d44d2bc8c6fd39e504b7a9b
2017-01-19 16:38:55 -08:00
Yaakov 72b7376251 Fix exception when parsing HTTP/2 status line (dotnet/corefx#15203)
* Fix exception when parsing HTTP/2 status line.
* Extend curl tests to cover "HTTP/2" status line

Extend existing tests to cover status line with major version only.

HttpResponseMessage.Version should still have a value of (2, 0) to ensure
compatibility with Windows (see HttpVersionInternal) and full .NET
Framework, not a value of just (2).


Commit migrated from https://github.com/dotnet/corefx/commit/8ddccab25885029a382db319ce65c54d2122d181
2017-01-18 08:34:02 -05:00
Karthik Rajasekaran 4bbdadd88a Update project configuration and sln files (dotnet/corefx#15182)
* Add ValidateVSConfigurations

* Update project config and sln files.


Commit migrated from https://github.com/dotnet/corefx/commit/f6ab339f446e37505f93ef9f430801fa1dcc05b8
2017-01-17 14:31:23 -08:00
Jose Perez Rodriguez 24a5aef91d Merge master into dev/eng
Commit migrated from https://github.com/dotnet/corefx/commit/a9dd06b73bdd71038217bb263decf2b7285fb8db
2017-01-12 10:09:09 -08:00
David Shulman 98f6a8042c Fix System.Net.Http.HttpClientHandler for net46 build (dotnet/corefx#15036)
This PR addresses the problem seen in dotnet/corefx#11100. Here is a summary:

1) The original .NET Framework (Desktop) code for the HttpClientHandler implementation has been ported for this net46 build.  It replaces the WinHttpHandler based code that is used for the other builds of .NET Core (Windows). This means that it uses the original HttpWebRequest (HWR) code in .NET Framework System.dll which is based on managed sockets. This ensures we go back to 100% app-compat behavior against .NET Framework. This also means that existing code that uses ServicePointManager to control behavior will also work 100% app-compat. One downside of this PR is that HTTP/2 protocol support is no longer available since we are reverting back to original .NET HTTP stack for the net46 build. If HTTP/2 protocol support is required on .NET Framework (Desktop), then a developer can use the separate WinHttpHandler package to get that.

2) The System.Net.Http.dll assembly is now marked as APTCA (Allow Partially Trusted Callers) similar to the original annotation of the .NET Framework version of the assembly. As part of this, a few security annotations were added to source code that is being compiled from the CoreFx repo. The SecAnnotate tool was used to verify the annotations and the tool now runs clean against this assembly.

3) This PR also addresses the problem introduced where .NET Framework WebRequestHandler wasn't compatible with the OOB System.Net.Http.dll on Desktop. I manually tested packages with this change and verified sending an HTTP request. There is no longer any "Derived types must either match the security accessibility of the base type or be less accessible" exceptions.

4) The tracing mechanism of this implementation implicitly re-activates the System.Net tracing (TraceListener based) since we are now going back to the original .NET Framework HTTP stack. However, part of the source code for the rest of the assembly compiled in from .NET Core repo also includes the new DiagnosticSource tracing as well. There didn't appear to be any negative consequences of leaving this in as it simply adds extra tracing on top of the original System.Net tracing.

5) There are 8 new properties that were added to the HttpClientHandler class compared to the original HttpClientHandler defined in .NET Framework. These new properties are part of the NETStandardard2.0 definitions. Due to switching back to the original HTTP stack implementation in Desktop, some of these new properties can not be implemented fully since there are incompatibilities between defining them as per handler instance compared to the actual underlying ServicePointManager implementation. So, some of these properties will throw PlatformNotSupportedException for now. Since these were newly added properties, the expectation is that there will be minimal app-compat affect.

6) Even with this PR, any project using an OOB (Out of Band) assembly such as System.Net.Http.dll might be REQUIRED to have binding redirects in their app.config/web.config. This is because there needs to be a way to reconcile onto ONE assembly version of the same name. In particular implicit and explicit references to something like the .NET Framework System.Net.Http.WebRequest.dll (which contains WebRequestHandler) is bound to the System.Net.Http.dll version 4.0.0.0 of the .NET Framework. Once an OOB System.Net.Http.dll is introduced, there is now another version of System.Net.Http.dll with a different version number. For the current master branch, the System.Net.Http.dll assembly version is 4.2.0.0.  Note that the assembly version is disjoint from the NuGet package version (currently at 4.4* in the master branch). So, this requires a binding redirect in the app.config/web.config similar to:

```c#
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
      </dependentAssembly>
    </assemblyBinding>
```

Tooling such as Visual Studio will normally create this binding for you. But we have seen cases where it doesn't do it automatically. Please keep this in mind.

If you don't have any binding redirects for System.Net.Http.dll, you will potentially get errors when sending an HTTP request such as this:

>System.InvalidCastException: [A]System.Net.Http.Headers.MediaTypeHeaderValue cannot be cast to [B]System.Net.Http.Headers.MediaTypeHeaderValue. Type A originates from 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' in the context 'Default' at location 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll'. Type B originates from 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

* Adding src.

* WIP: Added handler and assemblyinfo.

* Fix up string resources errors

* Remove Rtc support

Rtc only works for Windows 8 Store apps.  Windows 10 UWP dropped support
for Rtc.

* Remove unneeded source files from net46 build

* Adding back internal HttpContent.CopyTo

* Add newer HttpClientHandler properties

Compiles now.

* Removed NET_4 defines

* Reformat

Use CoreFx naming convention for fields (use underscore, etc.)
Put properties in alphabetical ordering

* Remove unneeded DEBUG hooks

* Update new property implementation

Fix up security annotations

* Fix up security annotations

Add required annotations.  SecAnnotate tool now runs clean against
System.Net.Http.dll.

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/d24ddedc5edb10d4ed385a1eb8bfb2351a117cd5
2017-01-11 11:09:57 -08:00
dotnet bot fd2b99ee2a Update CoreClr, CoreFx, ProjectNTfs to beta-24911-02, beta-24911-02, beta-24911-00, respectively (dotnet/corefx#15071)
Commit migrated from https://github.com/dotnet/corefx/commit/f4dbd9ba2d8ae56b5960a5030a2bf0328fa37b3f
2017-01-11 09:11:26 -08:00