Commit Graph
763 Commits
Author SHA1 Message Date
Huo Yaoyuan 69a4f832e5 Address System.Net.Http.WinHttpHandler's nullable warnings targeting .NETCoreApp (#54995)
* Update nullability for WinHttpHandler

* Update project file

* Use ! for PtrToStringUni

* Move assertion of _sessionHandle

* Remove false assertion about RequestHandle.
2021-07-13 20:11:58 -04:00
Stephen Toub dfd618dc64 Use interpolated strings in more places 2021-07-13 10:11:51 -04:00
Stephen Toub 1446bdb776 Fix LangVersion on several test projects 2021-07-13 10:11:51 -04:00
Stephen Toub 633e04481f Enable CA1419 (SafeHandle public parameterless ctor) (#55460) 2021-07-12 10:18:04 -04:00
Miha Zupan 9da4d075ef Remove Uri scheme validation from HttpRequestMessage (#55035)
* Remove Uri scheme validation from HttpRequestMessage

* PR feedback

Move HttpUtilities to SocketsHttpHandler

* Add request scheme check to WinHttpHandler

* Skip .NET 6 specific WinHttpHandler test on Framework

* Update InteropServices.JavaScript HttpRequestMessage test

* Guard HttpMessageInvoker from calling HttpTelemetry with invalid Uris

* PR feedback
2021-07-09 17:07:16 -07:00
Viktor Hofer b056b7b6a1 Add NetCoreAppCurrent configuration to libs (Phase 1) (#54544)
* Use property to indicate NetCoreApp min version

* Add NetCoreAppCurrent to S.Numerics.Tensors

* Add NetCoreAppCurrent to S.T.AccessControl

* Add NetCoreAppCurrent to System.Memory.Data

* Add NetCoreAppCurrent to S.Composition.* projects

* Add NetCoreAppCurrent to System.IO.Packaging

* Add NetCoreAppCurrent config to System.IO.Ports

Adding a NetCoreAppCurrent configuration to System.IO.Ports and
reducing package size, build times and platform specific assets by
using runtime checks on Unix derivates for the slightly diverging
SerialPort implementation.

Contributes to https://github.com/dotnet/runtime/issues/54012

* Add NetCoreAppCurrent to System.Data.OleDb

* Add NetCoreAppCurrent to M.W32.Registry.AccessControl

* Add NetCoreAppCurrent to S.Reflection.Context

* Add NetCoreAppCurrent to S.C.Composition.Registration

* Add NetCoreAppCurrent to S.Resources.Extensions

* Add NetCoreAppCurrent to S.N.H.WinHttpHandler
2021-06-29 22:15:47 +02:00
Tomas Weinfurt 2ac023c8e9 process more TLS frames at one when available (#50815)
* process more TLS frames when available

* add SslStream.Implementation.cs

* remove extra comment

* add back DefaultRequestHeaders_SentUnparsed

* feedback from review

* fix winhttp

* fix linker test

* feedback from review

* feedback from review

* feedback from review

* make EnsureFullTlsFrame async

* feedback from review
2021-06-24 16:31:07 +02:00
Pavel Savara 1e1951825b [wasm] Enable more networking tests (#53027)
- enable System.Net.Http.Functional.Tests on browser
- System.Net.Http.Functional.Tests to run in chrome instead of V8 via WasmTestOnBrowser
- ActiveIssue https://github.com/dotnet/runtime/issues/34690 for WebSocket on Windows Mono
- fix Quic detection in test
- disable webSocket tests on Mono/Windows
- disable tests with MaxConnectionsPerServer not supported on Browser
- disable tests with Socket not supported on Browser
- disable tests with AutomaticDecompression not supported on Browser
- disable tests with UseProxy not supported on Browser
- disable tests with PreAuthenticate not supported on Browser
- disable tests with Credentials is not supported on Browser
- disable tests with Loopback server
- run outerloop on browser, rather than V8 only
- [ActiveIssue] #37669 for missing crypto MD5
- conditional tests with PlatformDetection.IsBrowserDomSupportedOrNotBrowser to allow System.Net.Http.Functional.Tests pass on V8
- disabled tests with https://github.com/dotnet/runtime/issues/53018
- disabled tests with https://github.com/dotnet/runtime/issues/53591
- disabled tests with https://github.com/dotnet/runtime/issues/53592
2021-06-02 20:17:12 +02:00
Stephen Toub 72ff0df463 Enable recently added Microsoft.CodeAnalysis.NetAnalyzers rules (#53158) 2021-05-28 14:46:46 -04:00
James Newton-King 5a0edac8a8 WinHttpHandler: Add support for bidirectional streaming (#51094) 2021-05-18 10:58:59 +02:00
Viktor Hofer 8970941097 Stop harvesting old frameworks in some libraries (#51689)
* Stop harvesting old frameworks in some libraries

The removed configurations (few netstandard1.x, portable*, netcore50)
of the touched packages aren't built anymore. Instead
the already built matching binaries from the latest available packages
are redistributed when packaging these libraries.

Dropping these assets as the minimum supported set of platforms are ones
that support netstandard2.0. For .NET Framework, there's still a net461
configuration present to avoid binding redirect issues.

Contributes to #47530
2021-04-23 20:32:39 +02:00
Viktor Hofer fe6dd37068 Remove stale property (#51615)
The by the SDK default included netframework reference assembly are used instead of the old microsoft.netframework.targetingpack. Removing the stale property.
2021-04-21 19:30:34 +02:00
Jeff Handley c7e02f3773 Refactor build to use SupportedOSPlatforms instead of IsWindowsSpecific (#51450) 2021-04-19 21:52:12 -07:00
Geoff KizerandGeoffrey Kizer 288bfa00fe Rework request retry logic to be based on retry count limit (#48758)
* rework request retry logic to be based off a fixed retry limit (MaxConnectionFailureRetries) instead of isNewConnection logic

* be more conservative about request retries -- only allow on receiving EOF or GOAWAY from the server


Co-authored-by: Geoffrey Kizer <[email protected]>
2021-04-17 22:42:42 -07:00
Stephen Toub 0c793920f6 Clean up string formatting in a variety of places (#50267)
Mostly just replacing string.Format calls with equivalent interpolated string uses.  In some cases, I replaced lots of string creations with a StringBuilder or equivalent.
2021-04-04 23:16:23 -04:00
Jan JahodaandDan Moseley 78f980384f Credentials fix (#50230)
* Port of https://github.com/dotnet/corefx/pull/43051

* Shrink suppression file

* Fix another bugs

* Bump System.Net.TestData version

* Fix typo

* Revert casing in connection string

* Fix connection string case

* more fixes

* Change suppression messages

* Fix typo

* Remove false positive

* Fix usersecrets

Co-authored-by: Dan Moseley <[email protected]>
2021-03-25 21:18:38 -07:00
Stephen Toub 0817e748b7 Seal internal types in libraries (#50225) 2021-03-25 20:50:33 -04:00
Stephen Toub 48679143aa Seal private classes in libraries (#49969) 2021-03-23 06:14:55 -04:00
Jeremy Koritzinsky 4181533899 Use the .noRC2 cert variants in the System.Net tests when on a platform that does not support RC2. (#49461) 2021-03-11 14:02:56 -08:00
Stephen Toub 062ae9697d Add Task.WaitAsync methods (#48842) 2021-03-11 12:11:15 -05:00
Anton Firszov 423f5e1eb1 WinHttpHandler: Read HTTP/2 trailing headers
Fixes #44778
2021-03-10 11:54:22 +01:00
Lakshan FernandoandEric Erhardt 07ea61f581 Suppresses the trimmer warning on TypeAnalysis ctor (#48823)
* eh fix

* test change that inadvertently got checked in earlier

* Suppresses the trimmer warning on TypeAnalysis ctor

* Incorporating FB

* Update src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs

Co-authored-by: Eric Erhardt <[email protected]>

* Update src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs

Co-authored-by: Eric Erhardt <[email protected]>

* Update src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs

Co-authored-by: Eric Erhardt <[email protected]>

* Fix DynamicDependency as per PR feedback

* an earlier change got reverted

* fixed proj file netcore app condition check

* fixed NETCORE_ENGINEERING_TELEMETRY build failures

* fixeing another NETCORE_ENGINEERING_TELEMETRY build failures

* Adding RequiresUnreferencedCode to TypeAnalysis ctor instead of suppressing the warning to get FB, not fully fixed

* PR FB and suppressing warnings for safe calls

* propagated the warning all the way up

* CI build break fix for one file

* excluding NativeRTEventSrc from being build in a project

* Missed couple of supppressions on NativeRTEventSrc

* build break fixes

Co-authored-by: Eric Erhardt <[email protected]>
2021-03-08 14:40:58 -08:00
Anton Firszov c003837341 WinHttpHandler tests: AllowAllCertificates should not be static (#48817)
Altering the global state can break prerequisites of unrelated tests.
2021-03-02 12:09:19 +01:00
Geoff KizerandGeoffrey Kizer 57acd56766 Refactor some HTTP remote server tests (#47252)
move existing remote server tests in HttpClientHandlerTest.cs into a new file, HttpClientHandlerTest.RemoteServer.cs

Co-authored-by: Geoffrey Kizer <[email protected]>
2021-01-22 12:43:37 -08:00
Viktor Hofer ceaa8ae8f7 Inline package descriptions and remove descriptions.json files across the repo (#46306)
* Support runtime package descriptions

* Update arcade Packaging pkg

* Inline pkg descriptions for coreclr

* Inline pkg descriptions for mono

* Inline pkg descriptions for installer

* Inline pkg descriptions for libraries
2020-12-22 16:07:56 +01:00
Anton Firszov 18d1527c07 WinHttpHandler: apply [SupportedOSPlatform("windows10.0.19041")] on TcpKeepAlive properties (#45494)
WINHTTP_OPTION_TCP_KEEPALIVE is only available since the May 2020 Update, so it's reasonable to decorate the TcpKeepalive API with [SupportedOSPlatform]
2020-12-08 19:09:03 +01:00
Anton FirszovandJan Kotas 35744328d0 WinHttpHandler: fix double -> uint conversions for ARM64 (#45480)
* extend ReceiveDataTimeout functional coverage

* fix double -> uint conversions

* more comments + remove 'unchecked'

* Comment suggestion

Co-authored-by: Jan Kotas <[email protected]>

* Comment suggestion

Co-authored-by: Jan Kotas <[email protected]>

Co-authored-by: Jan Kotas <[email protected]>
2020-12-02 16:41:21 -08:00
Anirudh AgnihotryandViktor Hofer 659c5fbc7f disable restore in vs for projects targeting platform specific old frameworks (#44932)
* disable vs restore in vs for projects targeting platform specific older frameworks

* Add infra to auto-update solution files for restore

* Add NuGet.config files for solutions affected by restore issue

Co-authored-by: Viktor Hofer <[email protected]>
2020-12-02 23:18:52 +01:00
Anton Firszov 837785f9ca Implement TCP Keep-Alive for WinHttpHandler (#44889)
Implements the final version of the API proposal in #44025 except the [SupportedOSPlatform("windows10.0.2004")] bits
2020-11-25 15:13:09 +01:00
Viktor Hofer ed295782bf Add workflow to update solution files with SlnGen and update them initially (#44703)
* Add slngen infra

* Update all solution files
2020-11-17 18:23:30 +01:00
Anirudh Agnihotry b37f10a504 Changing Windows_NT -> Windows for enabling TargetPlatformMoniker feature of the sdk for platform specific tfms. (#43651)
* eng change

* coreclr change

* libraries change

* tests change

* installer & mono change

* py files changed

* .md change

* .yml change

* remove redundant targetos property

* Windows_NT -> windows after ninja change

* fixing runtime build failure
2020-11-02 14:25:58 -08:00
Marie Píchová c9dda914b9 Removed unnecessary WINHTTPHANDLER_DLL compiler constant. (#43393) 2020-10-14 17:05:55 +02:00
Stephen ToubandCarlos Sanchez d3beb6014a Implement ZLibStream and fix SocketsHttpHandler deflate support (#42717)
* Implement ZLibStream and fix SocketsHttpHandler deflate support

- Implements ZLibStream, exposes it in the ref, and add tests
- Fixes SocketsHttpHandler to use ZLibStream instead of DeflateStream

* Add comment about deflate content encoding

* Apply suggestions from code review

Co-authored-by: Carlos Sanchez <[email protected]>

* Fix netfx build

Co-authored-by: Carlos Sanchez <[email protected]>
2020-10-09 06:12:47 -04:00
Geoff KizerandGeoffrey Kizer fdc6472bd1 add System.Net.Quic assembly and use it in HttpClient (#43076)
* add System.Net.Quic assembly and use it in HttpClient

* fix build issue

* remove old quic code from shared directory

* fix Common.Tests project

* fix WinHttp tests

* fix typo

Co-authored-by: Geoffrey Kizer <[email protected]>
2020-10-06 19:01:33 -07:00
Stephen Toub 3b6600cbef Add IDE warnings to code analysis ruleset (#42566)
- Add all IDEXXXX warnings to ruleset, but as hidden for now
- Enable IDE0073: file header mismatch
2020-09-23 22:26:31 -04:00
Stephen Toub e4034f8d85 Fix several BeginXx nullable annotations (#42442)
AsyncCallback and object state parameters in APM BeginXx methods should always be nullable.  Several in annotated libraries were annotated incorrectly.
2020-09-19 06:51:20 -04:00
Viktor Hofer 2182936365 Add transitive CompilerServices.Unsafe dependency (#41616)
* Add transitive CompilerServices.Unsafe dependency

for System.Memory and System.Threading.Tasks.Extensions package
references. Adding the dependency as a P2P to prefer the live asset
over the prebuilt.
2020-09-07 22:18:28 +02:00
Marie Píchová ba7c518a49 Renamed EventSources "Microsoft-"->"Private.InternalDiagnostics.". 2020-08-17 13:10:32 +02:00
Alexander KöplingerandSteve Pfister c6eac1f2d5 Cleanup old corefx/coreclr GitHub issue links (#40286)
Replace them with the current URL after the redirect.

Similar to https://github.com/dotnet/runtime/pull/2063.

Co-authored-by: Steve Pfister <[email protected]>
2020-08-13 23:13:51 +02:00
Jan Jahoda 4a436e3313 Configure ping in HTTP2 (#40257) 2020-08-13 08:51:29 +02:00
Tomas Weinfurt ff01831094 make ssl tests more portable (#40303)
* make ssl tests more portable

* feedback from review

* fix build

* fix http broken by one previous commits

* feedback from review

* fix tests with old ssl versions.S

* more ssl fixes
2020-08-09 18:46:16 -07:00
Stephen Toub aa5fdab965 Update Microsoft.CodeAnalysis.NetAnalyzers to 3.3.0-beta3.20407.4 (#40560) 2020-08-09 05:32:44 -04:00
Tomas Weinfurt 664d9f8661 cleanup schannel pal (#39755)
* cleanup schannel pal

* fix netfx
2020-08-04 10:28:04 -07:00
Marie Píchová 3218c12807 HTTP agnostic loopback server. (#40144) 2020-08-03 13:11:52 +02:00
Anirudh Agnihotry 621ed57461 Correcting Mismatch between ref and src (#39741)
* minor formatting

* ref changes
2020-07-30 14:52:46 -07:00
Marie Píchová 7a6ca80bcd Expect 100 Continue Hang (#38774)
Inside sendRequestContentTask recognizes that it's invoked from a timer thread and if request content fails, unblocks SendAsyncCore and eventually propagates the exception from the content to the outside.
Fixes the issue for H2 as well.

Fixes #36717
2020-07-28 16:58:43 +02:00
Viktor Hofer 809a06f451 Remove depprojs in favor of PackageReferences (#35606)
- Remove depprojs which currently binplace external references into the RefPath folders in favor of PackageReference and PackageDownload items.
- Build all configurations by default when building an individual project (either on the CLI or inside VS) same as with the official SDK. This enables .NETFramework Test Explorer support.
- Centrally define libraries that compose the shared framework instead of in each Directory.Build.props file to be able to build the targeting pack first and consume it in the OOB libraries.
- Use ProjectReferences to reference OOB projects. Compile against the reference assembly but use the implementation assembly app-local during runtime.
- Remove OOBs from the testhost and remove the testhost folder for .NETFramework as it isn't required anymore.
- Only binplace for $(NetCoreAppCurrent) to compose a) the targeting pack, b) the runtime pack, c) the testhost, d) a full closure for the shims.
- Use Targeting Packs for OOB projects (with their implicit assembly references) but still explicitly define granular references for .NETCoreApp configurations (DisableImplicitAssemblyReferences switch). Use the implicit targeting pack references in some Microsoft.Extensions.* cases.
- Remove placeholder configurations as they aren't needed anymore with explicit P2Ps vs Targeting Pack references.
- Remove implicit assembly references (ie for .NETFramework, mscorlib)
- Remove AssemblySearchPath hacks that were introduced with b7c4cb7 as the targeting pack is now used by default.
- Reduce unnecessary .NETFramework configurations that were added to run tests in favor of the already existing ref&src configurations.
- Stop hardcoding the paths for wasm assemblies and use the returned TargetPath of the ProjectReferences.
- Addressed formatting (ItemGroups, References at the bottom of the project file, ordering of references, use LibrariesProjectRoot instead of a relative path, unnecessary AssemblyName and RootNamespace properties which are identical to the project name, ordering of tfms)
- Revert "fix clean (#33758)"
2020-07-23 17:20:26 +02:00
5c274f699d Suppress credscan false positives (#38026)
* Suppress initial cred issues

* Another bunch of supresses

* Clean up

* Another bunch of supresses

* Revert to suppression messages

* Clean up

* Apply suggestions from code review

Co-authored-by: Jeremy Barton <[email protected]>

* Revert passwords literals

* Fix suppression justification comment

Co-authored-by: Jan Jahoda <[email protected]>
Co-authored-by: Jeremy Barton <[email protected]>
2020-07-23 11:59:00 +02:00
Adam SitnikandViktor Hofer 52d4d8c057 mark Windows-specific APIs as such (#39265)
* move all OSPlatformAttributes to a single file so they can be easily referenced in < .NET 5 libraries

* Adds System.Runtime.Versioning*Platform* annotation attributes to < .NET 5 builds

* introduce MinimiumSupportedWindowsPlatform

* introduce IsWindowsSpecific setting that adds MinimumOSPlatform attribute for Windows Specific libraries

* mark all Windows-specific libraries as such

* annotate Windows-specific System.Console methods and properites

* annotate Windows-specific DpapiProtectedConfigurationProvider type

* annotate throwing Windows-specific APIs from System.Diagnostics.Process namespace

* annotate throwing Windows-specific APIs from System.IO.MemoryMappedFiles namespace

* annotate Windows-specific APIs from System.IO.Pipes namespace

* the new attributes should support enums

* annotate Windows-specific APIs from HttpListenerTimeoutManager class

* annotate Windows-specific APIs from System.Net.Sockets namespace

* annotate Windows-specific APIs from System.Runtime.InteropServices namespace

* annotate Windows-specific APIs from System.Security.Cryptography.Csp namespace

* annotate Windows-specific APIs from System.Security.Cryptography.X509Certificates namespace

* annotate Windows-specific APIs from System.Threading namespace

* address code review feedback: dont introduce new constants, reuse existing SYSTEM_PRIVATE_CORELIB

* code review: import the namespace, simplify the attribute name

* add missing Socket.DuplicateAndClose and Socket(SocketInformation)

* fix the test name (it does not throw)

* add missing DriveInfo.set_VolumeLabel

* add System.IO.FileSystem File Encrypt and Descrypt methods

* simplify the < .NET 5 check

* enable nullable in explicit way as it's not enabled in all the projects where this file is included

* include platform attributes in projects that ask for it in explicit way

* set IncludePlatformAttributes to true for projects that include files from other projects

* use suggestions from Viktor and Santi

Co-authored-by: Viktor Hofer <[email protected]>
2020-07-17 15:11:50 +02:00
Jose Perez RodriguezandEric StJohn b7c4cb71fe Add NetFramework Configurations to OOB packages (#39099)
* Porting new netfx configurations for packages

* Add Netfx configurations to Microsoft.Extensions and missing System packages

* Making sure net461 configurations build against targeting pack assembly versions

* Undo changes to add netfx configurations on reference projects that don't ship in their package

* Fix issue with M.E.FP.P package by removing NetStandard.Library metapackage dependency

* Fix issues with depending on higher version than the one available in net461

* Disable UTF8String verifyClosure on package

* Undo changes to Microsoft.XmlSerializer.Generator

* Update src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Microsoft.Extensions.FileProviders.Physical.csproj

Co-authored-by: Eric StJohn <[email protected]>

Co-authored-by: Eric StJohn <[email protected]>
2020-07-14 21:59:55 -07:00