Commit Graph
33 Commits
Author SHA1 Message Date
Stephen Toub 30b7c8d127 Fix downlevel build-break in System.Net.WebSockets.WebSocketProtocol (dotnet/corefx#38138)
Commit migrated from https://github.com/dotnet/corefx/commit/dfd3eb6b0c4786b8b4a70a1ea6c6bed8bfb919a0
2019-06-01 09:44:24 -04:00
Viktor Hofer b661c58b1c Replace netstandard test projects with tfms
Netstandard test projects are broken by design and don't support the
Microsoft.Net.Test.SDK. Replacing the netstandard tfm with the concrete
implementation tfms.


Commit migrated from https://github.com/dotnet/corefx/commit/d29c16c99c6045ee67444a7a693dd4476861c463
2019-05-30 16:18:41 +02:00
Stephen Toub 377c37c140 Use CancellationToken.UnsafeRegister in a few more places (dotnet/corefx#37551)
CancellationToken.Register captures the current ExecutionContext and uses it to invoke the callback if/when it's invoked.  That's generally desirable and is the right default, but in cases where we know for certain the callback doesn't care about EC (e.g. we're not invoking any 3rd-party code), we can use UnsafeRegister instead (newly added in 3.0), which skips capturing the ExecutionContext, as if Capture returned null.  This helps few a couple of small costs:
- Avoids thread local lookups to capture the current EC.
- Avoids additional delegate invocations and thread local gets/sets to invoke the callback with the captured EC.
- Avoids holding on to the EC in case it's needed, which can potentially keep alive an unbounded amount of state due to AsyncLocals.

Commit migrated from https://github.com/dotnet/corefx/commit/b1a1bfa0997ce35e8540fbbe74276858e315807e
2019-05-16 11:08:10 -07:00
Viktor Hofer f8a8530d0f Project msbuild syntax cleanup (dotnet/corefx#35686)
* Remove license header from non-shipping files

* Remove obsolete Project attributes

* Remove xml header and remove DefaultTargets


Commit migrated from https://github.com/dotnet/corefx/commit/c390ce7df50252e11f5d322276e9d19e046d1332
2019-03-03 18:55:25 +01:00
Stephen Toub 8fd85a520b Set ILLinkClearInitLocals across repo
Enable it for all C# src projects.


Commit migrated from https://github.com/dotnet/corefx/commit/4b5b5c163b925400b884dac2bf207d189b69bd3b
2019-01-08 09:49:57 -05:00
Stanislav Ushakov ac76a68271 Removed global suppression of CS1573 and CS1591 warnings (dotnet/corefx#34232)
* Removed global suppression of CS1573 and CS1591, moved suppression to the project level.

* Fixes for netfx build, added 2 projects


Commit migrated from https://github.com/dotnet/corefx/commit/adb4d48fe65d48b6dd1c2ff15c8a60e5f96bf266
2018-12-24 12:17:29 -05:00
Stanislav Ushakov 232de53a7c Fixed suppressed XML documentation errors (dotnet/corefx#34020)
* Fixed XML documentation tags for CoreFx.Private.TestUtilities

* Fixed XML documentation tags for System.Diagnostics.Process

* Fixed XML documentation tags for System.ComponentModel.Composition

* Fixed XML documentation tags for System.ComponentModel.Primitives

* Fixed XML documentation tags for System.ComponentModel.TypeConverter

* Fixed XML documentation tags for System.Data.Common

* Fixed XML documentation tags for System.Data.SqlClient

* Fixed XML documentation tags for System.Diagnostics.PerformanceCounter

* Fixed XML documentation tags for System.Diagnostics.StackTrace

* Fixed XML documentation for System.Diagnostics.TraceSource

* Fixed XML documentation for System.IO.Compression.ZipFile

* Fixed XML documentation for System.IO.Compression

* Fixed XMl documentation reference according to review notes

* Fixed XML documentation tags for System.IO.MemoryMappedFiles

* Fixed XML documentation tags for System.IO.Pipes

* Fixed XML documentation tag for OSX interop in System.Diagnostics.Process

* Fixed XML documentation tags for CoreFx.Private.TestUtilities for Unix

* Fixed XML documentation tags for System.Linq.Expressions

* Fixed XML documentation for System.Linq.Parallel

* Fixed XML documentationt ags for System.Linq

* Fixed XML documentation tags for System.Management

* Fixed XMl documentation tags for System.Net.Http (left CS1573)

* Fixed XMl documentation tags for System.Net.Mail

* Fixed XML documentation tags for System.Net.NameResolution

* Fixed XML documentation tags for System.Net.Primitives - added T prefix for Socket as Primitives do not reference System.Net.Sockets

* Fixed XML documentation tags for System.Net.Sockets

* Fixed XML documentation tags for Unix interop files

* Fixed XML documentation tags for System.Net.Http (Unix)

* Fixed XML documentation tags for PlatformDetection.Unix.cs according to review notes

* Fixed XML documentation tags for OSX interop

* Ignore CS1574 for System.Linq as there is no ConcatIterator{TSource}.ToList for uap.

* Fixed XML documentation tags for FreeBSD interop

* Fixed XML documentation tags for System.Net.WebSockets

* Fixed XMLm documentation tags for System.Transactions.Local

* Fixed XML documentation for System.Security.Principal.Windows

* Fixed XML documentation for System.Drawing.Common

* Fixed XML documentation for System.Net.NetworkInformation

* Fixed XML documentation tags for System.Private.XML (left CS1589)

* Fixed XML documentation tags for System.Security.Cryptography

* Fixed XML documentation for System.Runtime.WindowsRuntime

* Fixed XML documentation tags for System.Security.Cryptography.Xml

* Fixed XML documentation tags for System.Security.Cryptography.Primitives
CS3016 was added by mistake as part of dotnet/corefx#32934 so I removed it.

* Fixed XML documentation tags for System.Linq: added M to ToList method as it is not accessible by uap builds.

* Fixed XML documentation tags for System.IO.FileSystem

* Fixed XML documentation tags for System.Security.Cryptography.*

* Fixed XML documentation for System.IO.Ports

* Fixed XML documentation tags for System.Private.Reflection.Metadata.Ecma335

* Fixed XML documentation tags for System.Windows.Extensions

* Fixed XMl documentation tags for System.Console

* Fixed XML documentation for System.IO.FileSystem.DriveInfo

* Fixed XML documentation tags for System.Runtime.Extensions

* Fixed XML documentation tags for System.Drawing.Primitives.
Left CS1589 as there is no 'doc\KnownColor.uex' file.

* Fixed XMl documentation for System.Runtime.WindowsRuntime.
Had to add M prefix to 'Windows.Foundation.IAsyncAction' as Windows.Foundation is not accessible at compilation time.

* Fixed XML documentation tags for System.Private.Xml

* Fixed XML documentation tags for System.Private.Reflection.Metadata.Ecma335
Had to add a prefixes to: 'T:System.Collections.Immutable' and 'M:Enumerable.ToArray{TSource}' as they are not available for uap at compilation time.

* Fixed XML documentation tags for System.Net.WebSockets.WebSocketProtocol

* Fixed XML documentation tags for System.Net.WebSockets.WebSocketProtocol

* XML documentation tags fixes: changes after review.


Commit migrated from https://github.com/dotnet/corefx/commit/f7539b726c4bc2385b7f49e5751c1cff2f2c7368
2018-12-17 09:15:22 -08:00
AraHaan f108845249 Turn on xml documentation validation globally. (dotnet/corefx#32934)
* Turn on xml documentation validation globally.

* Ignore warning 1591 globally.

* Fixed build failures.

* Move the Original DocumentationFile Condition to the Group.

Now NoWarn has no Condition on it.

* Fixed NoWarn overwrite.

* Update Directory.Build.props

* Update System.Runtime.CompilerServices.Unsafe.ilproj

* Update file on github web.

Sadly it seems I can only do this on my phone now. RIP

* Update System.Security.Cryptography.Csp.csproj

* Update Directory.Build.props

* Suppress some warnings.

* Fixed remaining compile errors.

* Update System.Diagnostics.StackTrace.csproj

* Update System.Security.Cryptography.Xml.csproj

* Fixed xml documentation typo in Microsoft.VisualBasic.

* Fixed missing suppressions.

* Suppress more errors.

* Suppress more errors.

* Suppress more errors.

* Suppress even more errors.

* Suppress more errors.

* Update Directory.Build.props

* Suppress more errors.

Also fix a documentation issue specific to OSX.

* Suppress more errors.

* Suppress more errors.

* Disable xml documentation for System.Diagnostics.Process.

* Do not overwrite NoWarn.

* Enable docs for S.D.P


Commit migrated from https://github.com/dotnet/corefx/commit/6abb4cd0bafa2a3c7486fb23bcc611bd211d0f8e
2018-12-08 22:21:50 -08:00
Wes Haggard 954fb511b3 Rename AssemblyKey properties to StrongNameKeyId as part of arcade work
Commit migrated from https://github.com/dotnet/corefx/commit/7edd861bf2dd59ecdb4284e0fd291d7458198a9d
2018-10-30 15:14:01 -07:00
Wes Haggard 6dcf8b8bfb Update the configurations properties in projects
Commit migrated from https://github.com/dotnet/corefx/commit/fea86686c620242ce7e1911418f2fba7c4d52d4d
2018-08-29 09:45:04 -07:00
Wes Haggard b888acf76d Add netcoreapp2.1 build for System.Net.WebSockets.WebSocketProtocol
Commit migrated from https://github.com/dotnet/corefx/commit/0cb09ad87ce1e685700430d8065a6285af7ad1ae
2018-08-29 09:39:06 -07:00
Viktor Hofer d2dc7643f6 Update System.Memory as inbox & expose LastIndexOf (dotnet/corefx#30897)
* Remove netstandard configurations from System.Memory

* Binplace harvested System.Memory

* Update packageIndex.json versions

* Replace some wrongly copied IndexOf calls


Commit migrated from https://github.com/dotnet/corefx/commit/56dfb8834fa50f3bc61ea9b4bfdc9dcc759b6ec9
2018-07-17 22:58:37 +02:00
Eric Erhardt 8b6d5baf20 Change .csproj to new Configurations property
Change .sln to use the managed C# project system GUID.


Commit migrated from https://github.com/dotnet/corefx/commit/e05508a62d28f4807f85abe9cb7adf8382f792b4
2018-06-28 17:49:22 -05:00
Eric Erhardt 2053139c9a merge master into SdkProj
Commit migrated from https://github.com/dotnet/corefx/commit/1c91f96ec67a78a33268181d99a73a736b48c13e
2018-06-15 22:24:40 -05:00
Eric Erhardt 1df03e5bbd Rename dir files to Directory.Build
dir.props => Directory.Build.props
dir.targets => Directory.Build.targets


Commit migrated from https://github.com/dotnet/corefx/commit/204a8dbbc23bfc51d419c93f2f2ddaf50db8020f
2018-06-15 17:07:48 -05:00
Stephen Toub 5caaeb4f97 Fix WebSocket server split header parsing with large payload (dotnet/corefx#30402)
* Refactor WebSocket{Protocol}.CreateFromStream tests to be shared

We have the WebSocket.CreateFromStream and WebSocketProtocol.CreateFromStream methods, which are identical, except that the former is netcoreapp-only and the latter is in a separate NuGet package for downlevel use.  However, tests for them were separate, with some tests only for one and some tests for the other.

This commit centralizes those tests so they're shared by and apply to both methods.  There are no code changes to the actual bodies of tests, just moving code around to have it apply to both.

* Fix WebSocket server split header parsing with large payload

When ReceiveAsync is called, as a fast path it checks to see whether there's already enough data in the buffer to satisfy any possible header, skipping subsequent checks if there is.  The max header size differs between client and server, though.  The maximum size header a client can send to the server is 14 bytes, which includes a 4-byte masking value; the maximum size header a server can send to a client is 10 bytes, as it doesn't include a masking value.  However, the code currently has those values reversed.  If the code is running on the client, this means that we end up falling back to the slow-path unnecessarily if there are 10, 11, 12, or 13 bytes already in the buffer when ReceiveAsync is called.  However, on the server, this means we end up potentially throwing an exception or misinterpreting the payload if 10, 11, 12, or 13 bytes are in the buffer and the packet contains a large payload (in which case it'll be using an 8-byte length and be the full 14 byte header), as we'll end up erroneously taking the fast path when we should have taken the slow path to read more data from the network.

The fix is simply to swap the branches of the conditional.

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/d6d925e750a4e099ada6d3c32e15b15978518439
2018-06-14 20:08:33 -04:00
Eric Erhardt 70091b9c8b Merge master into SdkProj
Commit migrated from https://github.com/dotnet/corefx/commit/ad505eb98c6a887db2d2932fec256d9e4e394169
2018-06-11 17:20:10 -05:00
BrennanConroy 2fe6020023 Fix WebSocket split UTF8 read dotnet/corefx#29834 (dotnet/corefx#29840)
* Fix WebSocket split UTF8 read dotnet/corefx#29834

* feedback

* cache computed value

* feedback


Commit migrated from https://github.com/dotnet/corefx/commit/7c8df77ff6ae44b76ac35a2ac8db85df081724b9
2018-05-22 14:26:56 -04:00
wtgodbe f38ceb30be Convert all .csproj files in src to SDK-style projects
Commit migrated from https://github.com/dotnet/corefx/commit/91d7e62bbf28094a2b419b87847bcd6a7658564d
2018-05-21 11:53:46 -07:00
Stephen Toub b90fae078b Add more missing overrides to refs (dotnet/corefx#29738)
Ran /t:GenerateReferenceSource and undid irrelevant changes, though I kept a few files where the changes were trivial (e.g. whitespace) and it seemed better to just accept the change to stay in sync with GenerateReferenceSource.

In general I only added missing overrides on non-sealed classes, but when there were already overrides included on sealed classes, I added them back for consistency.

Commit migrated from https://github.com/dotnet/corefx/commit/10aa8277de2521fb1e6a5b42d053ad8cc947be81
2018-05-16 22:11:33 -04:00
Wes Haggard fc526e8605 Bump assembly versions for libraries with packages
Commit migrated from https://github.com/dotnet/corefx/commit/6a1b5c0aeee747a535579da7374c05b8d878fb65
2018-04-27 14:56:18 -07:00
Stephen Toub 30cf8987ce Remove buffer argument from WebSocket.CreateFromStream (dotnet/corefx#28649)
Commit migrated from https://github.com/dotnet/corefx/commit/bf38b7b8c56e7fbe10796dcfa1918a36377a1cd6
2018-03-30 14:23:56 -07:00
Eric StJohn 30c6fc00fb Merge pull request dotnet/corefx#27831 from ericstj/updateVSConfigs
Update SLNs and projects to be in sync with configurations

Commit migrated from https://github.com/dotnet/corefx/commit/b5628b45c42de887b24bd11a3aad7af20e2b89de
2018-03-08 09:54:52 -08:00
Jose Perez Rodriguez 2b978b922f Updating the package index for UAP and updating buildtools (dotnet/corefx#27787)
* Updating the package index for UAP and updating buildtools

* Having System.Reflection.DispatchProxy crosscompile for uap RS3

* Updating buildtools and fixing PR feedback

* Re-add support for uap to the assemblies that already had a netcoreapp2.0 config for Windows


Commit migrated from https://github.com/dotnet/corefx/commit/7be44d2de8661cd925955e540d940b4eb47e5753
2018-03-08 09:43:06 -08:00
Eric St. John 98c0015605 Update SLNs and projects to be in sync with configurations
Commit migrated from https://github.com/dotnet/corefx/commit/8ce7e620e1b5001be002598f4d10d4becdd77a49
2018-03-08 08:25:31 -08:00
ahsonkhan 01bd7382a9 Move TryGetString to MemoryMarshal, remove TryGetArray and update tests
Commit migrated from https://github.com/dotnet/corefx/commit/e31e796208c1e23d0087ebb5587ce476b71fdc4e
2018-03-02 09:56:25 -08:00
Stephen Toub 7482b6a4b0 Expose and roll out ValueTask extensibility
This commit does several things:
- Exposes the new `ValueTask` extensibility model being added in coreclr.  The ValueTask-related files will separately be mirrored over to corefx to enable the netstandard build of System.Threading.Tasks.Extensions.
- Adapts all `Stream`-derived types to return `ValueTask` instead of `Task` from `WriteAsync`.
- Changes the new `WebSocket` `SendAsync` method to return `ValueTask` instead of `Task`, and updates the `ManagedWebSocket` implementation accordingly.  Most `SendAsync`s on `ManagedWebSocket` should now return a `ValueTask` that's either completed synchronously (no allocation) or using a pooled object.  It now uses the underlying transport's new `WriteAsync` overload that returns `ValueTask`.
- Switches more uses of `ReadAsync` and `WriteAsync` over to the new overloads, including in Process, DeflateStream, BrotliStream, File, HttpClient, SslStream, WebClient, BufferedStream, CryptoStream,
- Removed some unnecessary array clearing from various routines using ArrayPool (after the clearing was added we changed our minds and decided clearing was only necessary in very specific circumstances)
- Implements a custom `IValueTaskSource` in Socket, such that async receives and sends become allocation-free (ammortized).  `NetworkStream` then inherits this functionality, such that its new `ReadAsync` and `WriteAsync` are also allocation-free (in the unbounded channel implementations; we can subsequently add it in for bounded).
- Implements a custom `IValueTaskSource` in System.Threading.Channels, such that reading and writing are ammortized allocation-free up to one concurrent reader and writer.
- A few random things I noticed as I was going through, e.g. missing ConfigureAwait, some incorrect synchronization in tests, etc.
- Adds a ton of new tests, mainly in System.Threading.Tasks.Extensions, System.Threading.Channels, and System.Net.Sockets.


Commit migrated from https://github.com/dotnet/corefx/commit/6d1671b2cfcf130b7bc6c059bb0508073426532a
2018-03-02 09:56:25 -08:00
Stephen Toub f8e6f41b81 Clear initlocals in a bunch of assemblies (dotnet/corefx#26993)
* Clear initlocals in a bunch of assemblies

Sets
```XML
<ILLinkClearInitLocals>true</ILLinkClearInitLocals>
```
for the assemblies:
    - System.IO.FileSystem
    - System.IO.Pipes
    - System.Memory
    - System.Net.Http
    - System.Net.Http.WinHttpHandler
    - System.Net.NameResolution
    - System.Net.NetworkInformation
    - System.Net.Primitives
    - System.Net.Requests
    - System.Net.Security
    - System.Net.Sockets
    - System.Net.WebSockets
    - System.Net.WebSockets.Client
    - System.Net.WebSockets.WebSocketsProtocol
    - System.Private.Uri
    - System.Runtime
    - System.Runtime.Extensions

Eventually we'd ideally set the flag for the whole repo; these are just the ones I audited thus far.  In a few cases I had to make code changes to adapt, where the code was expecting stackallocs to be cleared.  I also looked at a few other projects (System.Collections, System.Runtime.Numerics) where there were more significant dependencies on clearing and I decided to leave those for later.

* Disable ILLinkClearInitLocals running on Unix until it works there


Commit migrated from https://github.com/dotnet/corefx/commit/f0a032e4a1c8a848574a5db3e69e8a6fa0aae91e
2018-02-13 06:30:25 -05:00
Stephen Toub 4ad4edd1e7 Fix WebSocketProtocol test that never worked on netfx
Commit migrated from https://github.com/dotnet/corefx/commit/f6f5188044b126f3f6058ce361b060fc0b83257e
2018-02-08 19:12:51 -05:00
Stephen Toub 89dfde815e Expose SocketsHttpHandler
- Renames ManagedHandler to SocketsHttpHandler
- Moves a bunch of files around accordingly
- Updates System.Net.WebSockets.Client to use SocketsHttpHandler directly
- Updates System.Net.Http's tests with a reflection-based rather than TLS-based method for instantiating an HttpClientHandler backed by a SocketsHttpHandler.


Commit migrated from https://github.com/dotnet/corefx/commit/852d40e723c849e8d0c486676d40332343e12ca5
2018-02-08 19:12:50 -05:00
Stephen Toub 3e942132d9 Fix ManagedHandler env var / AppContext handling (dotnet/corefx#26763)
* Fix ManagedHandler env var / AppContext handling

* Update two names

* Update README.md


Commit migrated from https://github.com/dotnet/corefx/commit/473a4cf05c28f95d8a93b826647f755dbdec8728
2018-02-01 22:04:16 -05:00
Lakshmi Priya Sekar 92b2506c1c Use Debug.Assert
Commit migrated from https://github.com/dotnet/corefx/commit/5ea2021bec9ad75556bd5ce2c23784f35f4fafb5
2018-01-17 15:46:47 -08:00
Lakshmi Priya Sekar ee29bab529 Add System.Net.WebSocket.Protocol initial commit.
Commit migrated from https://github.com/dotnet/corefx/commit/97916801cd9f8e94d9ef77b738a647b2e394df2d
2018-01-17 15:46:47 -08:00