Commit Graph
115 Commits
Author SHA1 Message Date
David Shulman cc3124f083 Merge pull request dotnet/corefx#6291 from davidsh/readasync_fix
Response stream reads should return error for insufficient data

Commit migrated from https://github.com/dotnet/corefx/commit/0a0ea7fe57876ef47188dfe8bd76fae00e48f8e7
2016-02-21 18:03:10 -08:00
David Shulman 29ffaec8ad Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/6b4519800e1db707556a6730dc178e446e0836ba
2016-02-21 16:53:46 -08:00
David Shulman 7bdf953b91 Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/6e898758c6c03c44234ccc3ae398c432c97f5ff9
2016-02-21 16:45:39 -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
David Shulman 53aa563b67 Fix WinHttpHandler memory leaks
The WinHttpHandler was leaking a lot of objects in cases where an explicit Dispose was not done for the various HttpResponseMessage related objects. It was leaking because there was a cycle between the strong GCHandle of WinHttpRequestState and the objects contained within it.

To break the cycle, we now clear out object references within WinHttpRequestState that are no longer needed once the SendRequest phase is completed.

There was also a leak of a pinned GCHandle and related memory in WinHttpResponseStream. The free'ing of that allocated GCHandle was done in the Dispose(bool disposing) method. However, it wasn't being called when disposing=false (i.e. a finalizer). Since it is a pinned GCHandle, it needed to be freed in all cases.

Fixes dotnet/corefx#5927.


Commit migrated from https://github.com/dotnet/corefx/commit/a38ee461d2d93cc220953b3b6c4b405b188f6965
2016-02-21 11:41:42 -08: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
Justin Van Patten 0c5d4b54f3 Use nameof with MemberData tests
Commit migrated from https://github.com/dotnet/corefx/commit/2965a16a7660f90f45fbd880a430d7c5e9e086a0
2016-02-19 11:16:20 -08: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
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
Justin Van Patten 1418f94145 Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/0aab2ac0feffe1ff3adce05bda7bf6a0e9a8baac
2016-02-17 11:07:14 -08: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
Christopher Costa 881e218522 Add explicit OSGroup properties for OS specific packaging.
Commit migrated from https://github.com/dotnet/corefx/commit/5f6a78084d580225b558520c50ffb260e37147b8
2016-02-17 10:45:29 -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
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
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
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 30a19d4335 Update packages to rc3-23803
Commit migrated from https://github.com/dotnet/corefx/commit/d27ef6fb6092060e643c49a670e825e0cc01ff4d
2016-02-04 07:38:24 -05:00
stephentoub 715cbde1c2 Update dependencies to rc3-23729
Commit migrated from https://github.com/dotnet/corefx/commit/372c940deee1f81c452e69a0ad46ae9f18f6d803
2016-01-29 18:11:41 -08:00
Jose Perez Rodriguez 88f2de884f Merge pull request dotnet/corefx#5711 from joperezr/RestoreMSBuild
Use .Net Core MSBuild for OS X and Linux Builds

Commit migrated from https://github.com/dotnet/corefx/commit/ab6ec2fa803a330e73809cf478753959a36185e5
2016-01-28 15:51:39 -08:00
Jose Perez Rodriguez 0df7c31e39 Use .Net Core MSBuild for OS X and Linux Builds
Commit migrated from https://github.com/dotnet/corefx/commit/4367ec4c791928c6b2f994e9602dbc75aea7934d
2016-01-28 08:46:24 -08:00
Stephen Toub 75b957414f Merge pull request dotnet/corefx#5723 from stephentoub/update_license_headers
Update licensing headers

Commit migrated from https://github.com/dotnet/corefx/commit/ac67ffac987d0c27236c4a6cf1255c2bcbc7fe7d
2016-01-27 14:10:52 -08:00
stephentoub 9ecf277528 Update package versions to rc3-23727
Commit migrated from https://github.com/dotnet/corefx/commit/c442e611d1b4dddc12703b8b80bea9f3889f141d
2016-01-27 08:08:48 -08:00
dotnet-bot 39d1eab950 Update licensing headers
Commit migrated from https://github.com/dotnet/corefx/commit/7cad8486cbabbce0236bdf530e30db7036335524
2016-01-27 08:02:28 -08:00
Lakshmi Priya Sekar 1aa7a9ac09 Update packages version to 23726.
Commit migrated from https://github.com/dotnet/corefx/commit/213da430524eceb9e90883c3d08848f62c813a91
2016-01-26 16:30:20 -08:00
stephentoub 4ef1e70a8a Update package dependencies to rc3-23725
Commit migrated from https://github.com/dotnet/corefx/commit/fad28575225858febd3069d41582a1502c5dda07
2016-01-25 14:38:56 -05:00
stephentoub 6545572fb1 Upgrade packages to rc3-23722
Commit migrated from https://github.com/dotnet/corefx/commit/02ece5061a33a7c12113cc4a52b2321d9e6db185
2016-01-23 11:36:29 -05:00
David Shulman 51f723b25c Merge pull request dotnet/corefx#5590 from davidsh/stream_read_cancel
Fix hang when WinHttpHandler response stream reads are canceled

Commit migrated from https://github.com/dotnet/corefx/commit/9d16963865926a95c82beb4a2d779204706eaf28
2016-01-21 17:53:03 -08:00
David Shulman 7fb2e50275 Fix hang when WinHttpHandler response stream reads are canceled
The task from ReadAsync was never moving to a terminal state (i.e. "hanging") if the token was marked for cancellation after starting the task. The problem was that our task continuation wasn't being called if the token was cancelled before the continuation was scheduled.

The fix is to avoid passing in the token during the .ContinueWith call. Instead, the token is checked inside the continuation. This puts all the logic in the same place for checking the final status of the ReadAsync operation (which has multiple inner operations) including whether it should fault due to an error or have a successful completion.


Commit migrated from https://github.com/dotnet/corefx/commit/3ae96358a215023f3ecbba13fb4d860693f221c0
2016-01-21 14:56:26 -08:00
Eric Erhardt 4d42d8879e Bump ExpectedPrerelease version to latest (rc2-23713)
Commit migrated from https://github.com/dotnet/corefx/commit/ea4b19c136f3fa6355fd307b38cbe605b519b5eb
2016-01-21 09:46:18 -06:00
Ian Hays e3311742d9 Bump ExpectedPrerelease version to latest (rc2-23712)
Commit migrated from https://github.com/dotnet/corefx/commit/01c61f62988e8abf39aecc64b0a97ea4e384de3f
2016-01-14 10:36:27 -08:00
dagood e401efd6af Add portable-net45+win8 import to tests.
Specifically, add the import to dnxcore50 frameworks entries where "xunit" is mentioned in the project.json.
This fixes `xunit.abstractions 2.0.0 is not compatible with DNXCore,Version=v5.0.`


Commit migrated from https://github.com/dotnet/corefx/commit/da2e8eb34efcaf70069223bc431d80909a2fc91d
2016-01-12 14:04:32 -06:00
Wes Haggard a3e67fdf73 Update .builds files to include OSGroups
This these .builds files were updated and generated from a script
based on the configurations defined in the matching csproj files.

This updates the builds files to specify OSGroup and TargetGroup
as metadata instead of using AdditionalProperties and also sorts them by
TargetGroup followed by OSGroup.


Commit migrated from https://github.com/dotnet/corefx/commit/95efe37475916016a5fc6ee6f0ba584d990c4196
2016-01-02 23:50:23 -08:00
Wes Haggard f27c7dc024 Update project files adding default configurations
This add a default configuration before the Import of dirs.props
for any projects that don't have Debug as the default configuration.

Removed Configuration and Platform properties set after dirs.props
as they would have no affect and just cause confusion.

Removed OutputType=Library property as it isn't necessary.


Commit migrated from https://github.com/dotnet/corefx/commit/9e1da13cf6d5ff4b37b1867beb3411a2fe61da6a
2016-01-02 23:50:21 -08:00
Pallavi Taneja 95a3b67166 Expose Assembly.GetEntryAssembly and TypeInfo.IsEquivalentTo()
Expose Assembly.GetEntryAssembly and TypeInfo.IsEquivalentTo() in System.Reflection.
Fixes issues dotnet/corefx#4146 , dotnet/corefx#2101


Commit migrated from https://github.com/dotnet/corefx/commit/e28fdbd9dd98810a81207c665fdc4e6b40b24e64
2015-12-21 14:56:26 -08:00
Pallavi Taneja 90c2d27bf1 Update Corefx Repo to depend on newer package versions
Disable failing tests with the tracking active issue


Commit migrated from https://github.com/dotnet/corefx/commit/98fdc29624cd791bba42ec1e0cd5c256f331adfe
2015-12-21 11:48:15 -08:00
David Shulman eafca6efa3 Fix WinHttpHandler response handling for manual cookie parsing
WinHttpHandler was losing 'Set-Cookie' response headers during auto redirection handling when the handler was in 'manual cookie' mode. I.e. `CookieUsePolicy.UseSpecifiedCookieContainer`. This is the only mode that HttpClientHandler uses.

The 'Set-Cookie' headers were currently only parsed out when a final HTTP response happened. This meant that 'Set-Cookie' headers present in interim 3xx redirection responses as well as interim 401, 407 auth responses would not be stored into the CookieContainer. Hence, those same cookies could not be sent back to the server when needed.

The fix is to make sure we parse out the 'Set-Cookie' headers whenever we get an HTTP response back from WinHTTP. As part of this fix, I re-factored out the cookie handling code into a separate class. I also added specific WinHttpHandler tests for the two different cookie modes as well as a HttpClientHandler test to validate cross-platform (i.e. CurlHandler).

Address dotnet/corefx#4960 but further fixes are needed for *NIX as well.


Commit migrated from https://github.com/dotnet/corefx/commit/8ac944afcbd35d8b489e14e1c4c7f4be08f74c72
2015-12-17 10:59:08 -08:00
stephentoub 77c4183d17 Update package validation to rc2-23610
Commit migrated from https://github.com/dotnet/corefx/commit/6f6303f0356be4d2dd4ac117373f1e37f8752248
2015-12-11 10:53:47 -05:00
Stephen Toub 5fc1ac4728 Merge pull request dotnet/corefx#4910 from davidsh/winhttphandler_todo
Optimize error handling around chain.Build in WinHttpHandler

Commit migrated from https://github.com/dotnet/corefx/commit/7f09d21ec4c566d23bde3851f3e0abfb5d10c5bd
2015-12-09 19:53:55 -05:00
dagood fbfb82cc8c Change all project.json files to validate. Remove lockfiles from source control and add to gitignore.
A few new references to pick up changes that happened over time.


Commit migrated from https://github.com/dotnet/corefx/commit/0d881222d8c3269157639e2e67056e5a83aad834
2015-12-09 16:25:26 -06:00