David Shulman [Tue, 19 Mar 2019 23:59:28 +0000 (16:59 -0700)]
Fix X509Chain build error reporting on Windows (dotnet/corefx#36150)
This issue started out with a difference in behavior between .NET Core 2.0
and .NET Core 2.1. An HTTP request to a TLS website worked in 2.0 and failed
in 2.1. The website used a certificate that chained to an untrusted root. But
the certificate itself was placed in the Windows Local Machine/TrustedPeople cert
store.
It was first thought this was a difference between how WinHttpHandler (WinHTTP)
and SocketsHttpHandler worked. But it turned out to be a problem with SslStream.
The problem can also be observed on current .NET Core 3.0 (master) switching between
WinHttpHandler (disable SocketsHttpHandler via AppContext) and the default
SocketsHttpHandler.
In both cases, the X509Chain built has an error in its X509ChainStatus array. The
single error is 'PartialChain'. The X509Chain.Build() method will try to build a chain
using the applicable policies set into the X509Chain before building. This includes
implied operating system policy such as trusting certificates that are in the
TrustedPeople cert store. X509Chain.Build() returns a boolean indicating if the
chain was successfully built. There might still be entries in the X509ChainStatus
array indicating "soft failures" that were ignored based on policy.
We have some duplicative/similar code in WinHttpHandler and SslStream for building
an X509Chain object. The WinHttpHandler code and the Unix version of SslStream were
both correctly using the bool return value of X509Chain.Build() in determining whether
or not to return a final SslPolicyErrors.RemoteCertificateChainErrors. But the Windows
version of SslStream was not using that boolean. Instead, it was actually checking the
X509ChainStatus array.
This PR fixes the logic to be consistent and only check the result of X509Chain.Build().
I tested this change with CI tests as well as putting the certificate into the TrustedPeople
cert store (and also removing it).
Fixes dotnet/corefx#29563
Commit migrated from https://github.com/dotnet/corefx/commit/
9cc9e050df3b262d6e9d227d484c6cf0c4ccfbd2
Levi Broderick [Tue, 19 Mar 2019 23:18:48 +0000 (16:18 -0700)]
Add BoundedMemory tests for String ctor (dotnet/corefx#36162)
Use the new BoundedMemory feature to put additional correctness checks around the pointer-based String ctors
Commit migrated from https://github.com/dotnet/corefx/commit/
5cf8f3b1785b44fcf72492847f12fd894d0da74b
Stephen Toub [Tue, 19 Mar 2019 20:32:51 +0000 (16:32 -0400)]
Make PipeReader/Writer.AsStream().Dispose complete the reader/writer (dotnet/corefx#36160)
Commit migrated from https://github.com/dotnet/corefx/commit/
4edea1b6b817a3b7e9116e8cc20ccab55f7d7c9a
Santiago Fernandez Madero [Tue, 19 Mar 2019 19:27:27 +0000 (12:27 -0700)]
Fix wrong error condition on Xunit depproj (dotnet/corefx#36158)
* Fix wrong error condition
* Fix typo
Commit migrated from https://github.com/dotnet/corefx/commit/
cfa7e15abf06d73dd31e5343f516a16f6ee79998
Stephen Toub [Tue, 19 Mar 2019 19:12:17 +0000 (15:12 -0400)]
Change Process.MaxWorkingSet to prefer cgroup data (dotnet/corefx#35645)
Commit migrated from https://github.com/dotnet/corefx/commit/
dbcb7528847402325dabe40b9f447534d8a0617d
Hugh Bellamy [Tue, 19 Mar 2019 17:41:44 +0000 (18:41 +0100)]
Cleanup and enhance DateTimeFormatInfo tests (dotnet/corefx#35944)
* Cleanup and enhance DateTimeFormatInfo tests
* Combine tests into single file
- Makes sense for these short tests
- No cleanups or test additions performed
* Remove net46 tests
* Update DateTimeFormatInfoAbbreviatedDayNames.cs
Commit migrated from https://github.com/dotnet/corefx/commit/
f41206d387f9793fcb64c37d509128f6c016231a
Afsaneh Rafighi [Tue, 19 Mar 2019 17:02:10 +0000 (10:02 -0700)]
Merge pull request dotnet/corefx#34999 from Wraith2/sqlperf-guidread
SqlClient remove primitive boxing in SqlDataReader.GetFieldValue
Commit migrated from https://github.com/dotnet/corefx/commit/
5430d51761676bd3e6f59641e2e9931ec5966e96
Tomas Weinfurt [Tue, 19 Mar 2019 14:24:36 +0000 (07:24 -0700)]
improve parsing of Digest authentication header (dotnet/corefx#36134)
* improve parsing if Digest authentication
* Remove unnecessary blank line
Commit migrated from https://github.com/dotnet/corefx/commit/
5298673f77c7e3d40b95286af713c9af933ba66a
Santiago Fernandez Madero [Tue, 19 Mar 2019 02:31:07 +0000 (19:31 -0700)]
Fix netfx test runs (dotnet/corefx#36082)
* Fix netfx test SDK tfm for new package version
* Add validation that we actually found assets in package to catch this early
* PR Feedback
Commit migrated from https://github.com/dotnet/corefx/commit/
6e9561fb169b372ac0ecc5f85655f4d8800d1238
Ahson Khan [Tue, 19 Mar 2019 01:28:38 +0000 (18:28 -0700)]
Update CurrentDepth semantics to match current token depth, not reader state (dotnet/corefx#36116)
* Update CurrentDepth semantics to match current token depth, not reader
state
* Remove use of CurrentDepth from exception message and add tests.
* Use bitstack.CurrentDepth and update exception message.
Commit migrated from https://github.com/dotnet/corefx/commit/
44f54db21b45fb1b8aa4490833e2d64700801849
Wraith2 [Mon, 18 Mar 2019 23:15:46 +0000 (23:15 +0000)]
fix KatmaiNewDateTimeType logic inversion
Commit migrated from https://github.com/dotnet/corefx/commit/
c9d2331e8a28fb6d69c2b61d032506a727875cd5
Levi Broderick [Mon, 18 Mar 2019 22:05:05 +0000 (15:05 -0700)]
Add ref APIs and unit tests for System.Text.Unicode.Utf8 (dotnet/corefx#34538)
Also provides the implementation of BoundedMemory for checking for buffer overruns during unit testing
Commit migrated from https://github.com/dotnet/corefx/commit/
cd3936e55ad3a1624d4cd81d443554b72445b444
Ahson Khan [Mon, 18 Mar 2019 21:51:33 +0000 (14:51 -0700)]
Utf8JsonReader should be consistent when dealing with more than one JSON payload. (dotnet/corefx#36114)
* Utf8JsonReader should be consistent when dealing with more than one JSON
payload.
* Resolve PR feedback - update tests (Assert.Equals, move out of loop,
AssertThrows)
* Remove unnecessary assert since AssertThrows validates that anyway.
Commit migrated from https://github.com/dotnet/corefx/commit/
969270f5b9aa921b9ec956be87600d1f2e915403
Ahson Khan [Mon, 18 Mar 2019 20:35:15 +0000 (13:35 -0700)]
Disable BuildInvalidSignatureTwice in X509Certificates.Tests on Windows (dotnet/corefx#36127)
Commit migrated from https://github.com/dotnet/corefx/commit/
10c79df595b485f0998dded035f6f35e6279e50d
Stephen Toub [Mon, 18 Mar 2019 13:21:33 +0000 (09:21 -0400)]
Unlock SslStream for writes after failed write (dotnet/corefx#36106)
Commit migrated from https://github.com/dotnet/corefx/commit/
6123d3916f1a78de36a49e52f73ab7129c4cfa95
Ahson Khan [Mon, 18 Mar 2019 06:28:31 +0000 (23:28 -0700)]
Reduce test string size for TextEquals and mover overflow test to (dotnet/corefx#36115)
outerloop.
Commit migrated from https://github.com/dotnet/corefx/commit/
e373334e99f50b9981d3dab76e7449a31df73e99
Ahson Khan [Mon, 18 Mar 2019 05:23:24 +0000 (22:23 -0700)]
Default Ut8fJsonReader.Read should return false. (dotnet/corefx#36112)
* Default Ut8fJsonReader.Read should return false.
* Address PR feedback.
Commit migrated from https://github.com/dotnet/corefx/commit/
e929f9bb99649279d4aab06d300a8beef33411fa
David Shulman [Mon, 18 Mar 2019 00:13:31 +0000 (17:13 -0700)]
Fix WebSocketHttpListenerDuplexStream error handling (dotnet/corefx#36110)
An unobserved websocket task exception was happening when attempting to read/write on
non-existent connections. This code originally came from .NET Framework. It is specific
to Windows only and uses HttpListener as the server for the WebSocket. I was able to
reproduce the problem on .NET Framework as well.
The problem was due to the logic in WebSocketHttpListenerDuplexStream where it was always
creating a TaskCompletionSource and doing a TrySetException even if the error occured on
a synchronous codepath. The ReadAsyncFast (and WriteAsyncFast) methods are always calling
a callback to finish the operation and thus always setting an exception into the task. But
the task was never awaited because the exception was also rethrown from the ReadAsyncFast
method and skips the await.
The fix is to change the logic slightly so that ReadAsyncFast won't rethrow the exception.
It doesn't need to since the exception is already stored in the task. So, awaiting that task
will be fast since it is already completed (faulted with the exception).
In addition to the CI tests, I also verified the fix with the original repro from the issue.
Fixes dotnet/corefx#29005
Commit migrated from https://github.com/dotnet/corefx/commit/
3633ea2c6bf9d52029681efeedd84fd7a06eb6ba
Nikita Potapenko [Sun, 17 Mar 2019 22:43:21 +0000 (00:43 +0200)]
Fix typo (dotnet/corefx#36107)
.Net -> .NET
Commit migrated from https://github.com/dotnet/corefx/commit/
d29ae79fb13b4df9078400ac49b460e011f96404
Layomi Akinrinade [Sun, 17 Mar 2019 20:20:45 +0000 (16:20 -0400)]
Add (Try)GetDateTime(Offset) to JsonElement
Commit migrated from https://github.com/dotnet/corefx/commit/
a5d58ccf75741365c9a0f82c5387a9ae2ec99e16
Stephen Toub [Sun, 17 Mar 2019 09:40:21 +0000 (05:40 -0400)]
Add SslStream test to validate synchronous invocation on underlying Stream (dotnet/corefx#36097)
* Change SslStreamStreamToStreamTest_Sync to actually be synchronous
* Add SslStream test to validate synchronous invocation on underlying Stream
SslStream doesn't introduce its own asynchrony. The only reason an asynchronous operation on SslStream should complete asynchronously is because of an asynchronous call made on its underlying stream completes asynchronously. This adds tests to validate that, e.g. the tests would fail if we started using Task.Run in the SslStream implementation to invoke operations on the underlying stream.
Commit migrated from https://github.com/dotnet/corefx/commit/
5f4e3ce4ec775a960cb379a0edef33406b37befe
Stephen Toub [Sun, 17 Mar 2019 05:49:36 +0000 (01:49 -0400)]
Fix casing of SslStream.Implementation.cs file name (dotnet/corefx#36099)
Commit migrated from https://github.com/dotnet/corefx/commit/
4758e570d40c917c29de47945fd56b5dae350ad4
Stephen Toub [Sun, 17 Mar 2019 02:01:52 +0000 (22:01 -0400)]
Make ReallyLargeLookupUTF8 test outer loop
It allocates a huge amount of memory currently.
Commit migrated from https://github.com/dotnet/corefx/commit/
0d2cbec33968872aa736d033696f618fb0c3b3de
Stephen Toub [Sun, 17 Mar 2019 01:03:18 +0000 (21:03 -0400)]
Disable System.Text.Json outerloop tests failing in CI (dotnet/corefx#36096)
Commit migrated from https://github.com/dotnet/corefx/commit/
fd0abd12c89e8d90fdec1e5233ae89a0b7aceaee
Tim Seaward [Sun, 17 Mar 2019 00:05:58 +0000 (00:05 +0000)]
Flatten SslStream by removing SslStreamInternal SslState (dotnet/corefx#35109)
* Still moving sslState
* Initial SslState removed, should build
* Fix tests
* Moved first methods from SslStreamInternal
* moved a few more messages
* Moved more SslStreamInternal into SslStream
* Move half of SslStreamInternal into SslStream now
* Almost all moved other than shutdown
* Removed SslStreamInternal completely
* Final cleanup
* Clean Fakes
* Formatting
* Remove useless properties, remove dispose internal
* Remove HandshakeComplete and IsShutdown, removed methods from the fakes that match
* Added comment on Fake around removing build warnings
Commit migrated from https://github.com/dotnet/corefx/commit/
5f2d585b6709aa8034da0683eb6367a448faf5e4
Caesar Chen [Sat, 16 Mar 2019 19:56:39 +0000 (12:56 -0700)]
Http trailer support for HTTP/1.x (dotnet/corefx#35337)
* http trailer for http/1.1
* address feedback
* address feedback
* pr feedback
* stop blocking context
* fix framework test failiure
* address feedback
* seperate tests
* address some feedback
* more feedback from review
* correct ReadAsync
* feedback from review
* handle short ReadAsync()
* more feedback
Commit migrated from https://github.com/dotnet/corefx/commit/
ac9c746c44a5c0decf551fe33fb2acbdc895d021
Stephen Toub [Sat, 16 Mar 2019 19:54:15 +0000 (15:54 -0400)]
Add SslStream test for "unlocking" after failure (dotnet/corefx#36094)
* Add SslStream test for "unlocking" after failure
* Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/
6a26d45c3a0f3571f57637c2a995fb40336378f5
David Shulman [Sat, 16 Mar 2019 01:21:24 +0000 (18:21 -0700)]
Fix and re-enable some HttpListener authentication tests (dotnet/corefx#36084)
The Negotiate and NTLM HttpListener tests were disabled due to a behavior of running them
on loopback using an HttpClient with WinHttpHandler. But now the default handler for HttpClient
is SocketsHttpHandler. And it doesn't have this problem with loopback authentication.
Closes dotnet/corefx#20604
Commit migrated from https://github.com/dotnet/corefx/commit/
decd797ca84aca0f4b8ca4b6e5f9c7b818bd2967
Liudmila Molkova [Fri, 15 Mar 2019 22:43:24 +0000 (15:43 -0700)]
Inject W3C headers in netfx HTTP diagnostics hook (dotnet/corefx#35880)
* Inject W3C headers in Http Desktop hook
* do not inject headers if they were injected before
* check that w3c headers are empty when format is Hierarchical
* review comments
Commit migrated from https://github.com/dotnet/corefx/commit/
dee28e27e55251bb01680949105d18f5d6876bc3
Afsaneh Rafighi [Fri, 15 Mar 2019 22:20:16 +0000 (15:20 -0700)]
Merge pull request dotnet/corefx#35344 from Wraith2/sqlfix-tweaks1
SqlClient minor fix and changes
Commit migrated from https://github.com/dotnet/corefx/commit/
9fef9c9e85a60d1491b9f0f953bd02ea1ddeb024
Stephen Toub [Fri, 15 Mar 2019 19:59:31 +0000 (15:59 -0400)]
Fix SslStreamStreamToStreamTest to exercise correct overloads (dotnet/corefx#36065)
The SslStreamStreamToStreamTest is set up as a base class from which three test classes derive, one for each of Async, Begin/End, and Sync. But the base class isn't actually deferring to the derived types to customize most of the functionality being executed, namely read/write methods. This PR fixes that, so that the base class properly exercises the relevant methods, customized to the base type.
Commit migrated from https://github.com/dotnet/corefx/commit/
6a9fe42b8d236f9cb0e5cdede2f06dc7537dc933
Stephen Toub [Fri, 15 Mar 2019 18:30:25 +0000 (14:30 -0400)]
Add test for using SslStream for concurrent read/writes (dotnet/corefx#36064)
Commit migrated from https://github.com/dotnet/corefx/commit/
66ddc3e0da1af94c52bd7c78f27d18ea008bea74
Ahson Khan [Fri, 15 Mar 2019 05:38:46 +0000 (22:38 -0700)]
Add TextEquals helper methods to Utf8JsonReader (dotnet/corefx#35979)
* Add initial impl of ValueEquals with basic tests.
* Rename to TextEquals based on API review feedback.
* Move to separate test file, increase coverage, and fill in missing impl
details.
* Add xml comments and more test cases.
* Re-enable all the tests.
* Update tests to be netstandard compliant.
* Rename some existing tests to be clearer.
* Address PR feedback.
* Return early if we know unescaping won't produce a match.
* More eagerly check the lengths to return mismatch sooner.
* Add tests to improve code coverage and re-write to avoid unreachable
code.
* Fix resource string merge issue.
* Fix test build failures on netstandard (missing implicit string->span
cast)
Commit migrated from https://github.com/dotnet/corefx/commit/
b8bc4ff80c5f7baa681e8a569d367356957ba78a
David Shulman [Fri, 15 Mar 2019 01:47:50 +0000 (18:47 -0700)]
Add test for HttpWebRequest default proxy credentials (dotnet/corefx#36061)
It's easier to simulate default system proxy settings on Linux since it uses environment
variables. Add a test to verify that the proxy credentials are passed from
WebRequest.DefaultWebProxy.Credentials to the system proxy.
Follow-up to PR dotnet/corefx#36059
Commit migrated from https://github.com/dotnet/corefx/commit/
2e006bb1a471d2b75d1bbae282241d15da388899
Stephen Toub [Fri, 15 Mar 2019 01:46:39 +0000 (21:46 -0400)]
Fix CryptoStream.Dispose to only transform final block when writing (dotnet/corefx#36048)
* Fix CryptoStream.Dispose to only transform final block when writing
When reading, the final transform isn't required, and using it can result in exceptions when the stream is only partially read.
* Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/
f99562f10e72edb5b8d8fb264eb7b2436ad2df01
David Shulman [Thu, 14 Mar 2019 23:32:38 +0000 (16:32 -0700)]
Fix HttpWebRequest to use WebRequest.DefaultWebProxy credentials (dotnet/corefx#36059)
If the HttpWebRequest is using the default system proxy, we need to pass any proxy
credentials that the developer might have set via the WebRequest.DefaultWebProxy.Credentials
property. This matches .NET Framework behavior.
I tested this manually using Fiddler as the authenticating proxy.
Fixes dotnet/corefx#36058
Commit migrated from https://github.com/dotnet/corefx/commit/
d6a30736858f91b297fdd3ed4e3d1dfde67bdbdb
Marco Rossignoli [Thu, 14 Mar 2019 21:19:27 +0000 (22:19 +0100)]
Improve test logging: add process name to log (dotnet/corefx#35996)
* add process name to log
* updates
* update
Commit migrated from https://github.com/dotnet/corefx/commit/
88548f58fbd9a5c421395b0f6a4a1eed4be4f155
Stephen Toub [Thu, 14 Mar 2019 20:46:48 +0000 (16:46 -0400)]
Avoid three expensive allocations in UriHelper (dotnet/corefx#36056)
In this repro:
```C#
using System;
using System.Diagnostics;
using System.Text;
class Program
{
static void Main()
{
string input = $"param1={GenerateUrlEncoded(40)}¶m2={GenerateUrlEncoded(220)}";
Console.WriteLine("Input length: " + input.Length);
var sw = Stopwatch.StartNew();
string result = Uri.UnescapeDataString(input);
Console.WriteLine("Result length: " + result.Length);
Console.WriteLine(sw.Elapsed);
}
private static string GenerateUrlEncoded(int rowsCount)
{
var sb = new StringBuilder();
for (int i = 0x100; i < 0x999; i++)
{
sb.Append((char)i);
if (i % 10 == 0) sb.Append('<');
if (i % 20 == 0) sb.Append('>');
if (i % 15 == 0) sb.Append('\"');
}
string escaped = Uri.EscapeDataString(sb.ToString());
sb.Clear();
for (int i = 0; i < rowsCount; i++)
{
sb.AppendLine(escaped);
}
return sb.ToString();
}
}
```
on my machine it ends up allocating ~630GB of memory and takes ~14 seconds.
Almost all of that ~14 seconds is spent in gc_heap::allocate_large, and most of that inside memset_repmovs. This ends up being due to some large allocations being done in a tight loop.
This PR contains three simple fixes that address the majority of the problem. There's still more that can be done here, but this is the lowest of the low-hanging fruit and makes the biggest impact:
1. In UnescapeString, the previous code was allocating a new char[bytes.Length] for each iteration. Stop doing that. Instead, just reuse the same array over and over and only grow it if it's smaller than is needed.
2. In MatchUTF8Sequence, the previous code was allocating a byte[] for each character or surrogate pair. Stop doing that. Instead, just use a reusable four-byte segment of stack.
3. In UnescapeString, the previous code was allocating a new UTF8Encoding for each iteration of the loop. Stop doing that. The object is thread-safe and can be used for all requests, so we just make it a static.
These changes drop that ~630GB to ~22MB and that ~14s to ~0.05s.
Subsequently, there's more memory-related changes that could be done in this code, e.g. using pooling, addressing some of the other allocation, but I've left that for the future.
Commit migrated from https://github.com/dotnet/corefx/commit/
5e84d5b782fd56c7c6772f199719d208b299b605
Wraith2 [Thu, 14 Mar 2019 19:48:55 +0000 (19:48 +0000)]
address formatting feedback
Commit migrated from https://github.com/dotnet/corefx/commit/
de24817089ee09fcc35b1cfa5829ce5903fd2e72
Wraith2 [Thu, 14 Mar 2019 19:48:25 +0000 (19:48 +0000)]
Merge remote-tracking branch 'dotnet/master' into sqlperf-guidread
Commit migrated from https://github.com/dotnet/corefx/commit/
a08768dc5aeb0056b38575a4b41abd604b62aa34
Marco Rossignoli [Thu, 14 Mar 2019 17:39:24 +0000 (18:39 +0100)]
Optimize recursion of System.Net.Http.HttpRuleParser.GetExpressionLength (dotnet/corefx#35959)
Optimize recursion of System.Net.Http.HttpRuleParser.GetExpressionLength
Commit migrated from https://github.com/dotnet/corefx/commit/
4636de3b8595ad10eaebf00cbeed715684e7fd1b
Laura Walker [Thu, 14 Mar 2019 17:14:58 +0000 (17:14 +0000)]
Fix single character typo. (dotnet/corefx#36047)
Commit migrated from https://github.com/dotnet/corefx/commit/
bbf559f23a072a8355ba59bff9f8aad56dbfc67d
John Salem [Thu, 14 Mar 2019 17:02:53 +0000 (10:02 -0700)]
Make StackTrace Symbol Caching Aware of Collectible Types (Phase 2) (dotnet/corefx#35827)
* Update GetSourceLineInfo to consume an assembly:
* Use Assembly as cache key for MetadataReader
* Dynamic and regular assemblies now have the same cache key
* Prevents stale cache entries in the case where a PEFile is unloaded
and replaced by a new one in the same location
dotnet/coreclrdotnet/corefx#20179
* Remove redundant overload of GetSourceLineInfo
* update comments to reflect new behavior
* Change TryGetReader to use ConditionalWeakTable's atomic Add with callback method.
* cleaning up var names based on feedback
Commit migrated from https://github.com/dotnet/corefx/commit/
6f00e97f85650768f87743df769206bfc4119fbc
Michelle McDaniel [Tue, 12 Mar 2019 21:45:41 +0000 (14:45 -0700)]
Rename optimzation package version
Commit migrated from https://github.com/dotnet/corefx/commit/
a42be17c8be34eaf2711dfb09e6196bea68368d3
Michelle McDaniel [Tue, 12 Mar 2019 20:45:26 +0000 (13:45 -0700)]
Remove the workaround to put the IBC files in the right directory
Commit migrated from https://github.com/dotnet/corefx/commit/
6a942229bd09f5c34fbf9a3b7cd03bc032a626b5
Michal Strehovský [Thu, 14 Mar 2019 16:26:11 +0000 (17:26 +0100)]
Enable default interfaces unconditionally (dotnet/corefx#36012)
Corresponds to dotnet/coreclrdotnet/corefx#23225.
Commit migrated from https://github.com/dotnet/corefx/commit/
5fb12949b1487e34657ba9f4e2e12f31f8305295
Krzysztof Wicher [Thu, 14 Mar 2019 16:22:56 +0000 (09:22 -0700)]
Fix: System.IO.Ports runtime package signing (dotnet/corefx#36022)
* temporarily disable publishing
* temporarily disable another publish step
* Move signing to publish step
* re-enable publish steps
Commit migrated from https://github.com/dotnet/corefx/commit/
231bcfc265570ae42a412ac6cc5b09c5d47ca042
Afsaneh Rafighi [Thu, 14 Mar 2019 16:14:44 +0000 (09:14 -0700)]
Merge pull request dotnet/corefx#35927 from Wraith2/sqlperf-streamwrite
SqlClient rent stream parameter buffers
Commit migrated from https://github.com/dotnet/corefx/commit/
397b8cff410b94c74e8c1fc3ddf9c2d44c7e98f8
Eric StJohn [Thu, 14 Mar 2019 13:59:26 +0000 (06:59 -0700)]
Use ILResourceReference (dotnet/corefx#36038)
Commit migrated from https://github.com/dotnet/corefx/commit/
85e4afd0097364b2675c94d11888906f6651b93b
Filip Navara [Thu, 14 Mar 2019 13:51:10 +0000 (14:51 +0100)]
Update ResourceManager tests to account for dotnet/corefx#35114. (dotnet/corefx#35811)
Commit migrated from https://github.com/dotnet/corefx/commit/
8de6f2aefd7e87a45ff47c4949ff251c7c84ac71
David Shulman [Thu, 14 Mar 2019 13:48:55 +0000 (06:48 -0700)]
Disable some proxy tests (dotnet/corefx#36037)
Disable some problematic proxy related tests.
Contributes to issue dotnet/corefx#32809
Commit migrated from https://github.com/dotnet/corefx/commit/
b97e1b696cb9bf6bf288b4fd28481a2026b0dd7a
Stephen Toub [Thu, 14 Mar 2019 13:47:04 +0000 (09:47 -0400)]
Remove remaining usage of Contract.* (dotnet/corefx#36002)
Only remaining use of System.Diagnostics.Contracts in corefx is tests for the library itself, and usage of the [Pure] attribute.
Commit migrated from https://github.com/dotnet/corefx/commit/
940ecee40b64ab93c92f87a7e8909771c013f1a5
Stephen Toub [Thu, 14 Mar 2019 13:01:19 +0000 (09:01 -0400)]
Tweak SslApplicationProtocol (dotnet/corefx#36021)
* Tweak SslApplicationProtocol
- It currently stores a `ReadOnlyMemory<byte>`. That just adds unnecessary expense: we can instead just store the provided `byte[]`.
- The most common values are those exposed statically: Http2 and Http11, but ToString on those results in creating a new string each time. Special-case them.
- Constructing an SslApplicationProtocol with a null string results in an ArgumentNullException being thrown with the wrong parameter name. Fix it.
- Miscellaneous cleanup on the file.
* Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/
af6e226ed530bbe7c8319507f414cbad8e81df24
Eric St. John [Wed, 13 Mar 2019 00:01:37 +0000 (17:01 -0700)]
Fix local zip entry header for large files
When opened for Write ZipArchiveEntry needs to write the local header
information to the archive stream upon the first call to write since the
compressed content comes after that and we write directly to the backing stream
rather than buffering in memory.
By default header information only accommodates 32-bit sizes since this is much
more likely and saves space in archives with lots of files and at the first
write we don’t know how big the entry is going to be.
Once the entry is disposed we know the final length and may find it cannot be
represented in 32-bit fields. It can’t insert the extra bytes it would need
in the header region since it’s already written the compressed data and
streams/files don’t have insertion operations, so instead it sets a bit that
says the entry's size information is in a descriptor at the end of the entry.
The entry was setting the bit that indicated the descriptor existed but didn't
set the version in the header to ZIP64 to indicate wether that descriptor had
64-bit fields. Additionally we were writing the central-directory header for
the file with a version of ZIP64 so our local header and central header didn't
match.
May ZIP implementations were OK with this, but not all. Specifically
WindowsBase.dll's implementation of the System.IO.Packaging APIs has a
ZipArchive that insists the local header version must be ZIP64 to have a
64-bit descriptor. Moreover it also insists that the local-header version must
match the central header version.
To ensure zips created with .NETCore's System.IO.Packaging APIs work with
desktop we should set this version field in the local header.
Commit migrated from https://github.com/dotnet/corefx/commit/
b37b4efe6b58eecb83b81e6c754bd5dbe506bedc
David Shulman [Thu, 14 Mar 2019 03:57:55 +0000 (20:57 -0700)]
Clean up some tests and move to new Azure endpoint (dotnet/corefx#36018)
This PR changes the Azure test endpoint for HTTP/1.1 and WebSocket tests to use
Azure App Service instead of the classic Azure Cloud Service endpoint. This now
matches the HTTP/2.0 endpoint architecture.
We are deprecating the use of Azure Cloud Service endpoints because they are hard
to deploy and maintain. Azure App Service, on the other hand, provides a lot of benefits
including built in production/staging slots, TLS certificate handling and easier
integration with Azure DevOps deployment models.
There are a few downsides to Azure App Service which are known feature limitations.
Since it uses ARR (reverse proxy), it causes websocket connections to be proxied.
This results in some behavior changes for some edge condition tests we have. For example,
when a websocket handshake fails (due to subprotocol mismatch for example), the client
side doesn't see a TCP disconnect. Instead, due to the reverse proxy, we end up getting
an HTTP status code (like 500). Either way, it is a websocket handshake failure. So, I've
updated a few tests to be less brittle for that. I also opened another issue dotnet/corefx#36016 to
track moving a few websocket tests to the loopback websocket server which doesn't yet
have full capability.
I also converted an HTTP statusline test to use the loopback server.
Commit migrated from https://github.com/dotnet/corefx/commit/
689e58ec123d8c730d48d1c35c8f7ecbba6c22cf
Stephen Toub [Thu, 14 Mar 2019 01:09:42 +0000 (21:09 -0400)]
Disable tests failing on WSL (dotnet/corefx#36017)
This is on Windows 10 Version 10.0.17763 Build 17763.
Commit migrated from https://github.com/dotnet/corefx/commit/
cf5c3b0282c07ab13da79f04ee83d39f20bac431
Wraith2 [Thu, 14 Mar 2019 01:03:54 +0000 (01:03 +0000)]
let ArrayPool clear returned arrays
Commit migrated from https://github.com/dotnet/corefx/commit/
0972e60bb1d8fb1ba867e29f7ea7d7a81506af51
Layomi Akinrinade [Thu, 14 Mar 2019 01:02:35 +0000 (21:02 -0400)]
Add (Try)GetDateTime(Offset) to Utf8JsonReader (dotnet/corefx#35903)
Add (Try)GetDateTime(Offset) to Utf8JsonReader
This change partially addresses https://github.com/dotnet/corefx/issues/34690.
These methods parse JSON strings to DateTime(Offset) objects according to format `YYYY-MM-DD[Thh:mm[:ss[.s]][TZD]]`
Commit migrated from https://github.com/dotnet/corefx/commit/
66cf67037568d9818881e1a78d3e7b2aa8b04047
Wraith2 [Wed, 13 Mar 2019 22:41:48 +0000 (22:41 +0000)]
Merge remote-tracking branch 'dotnet/master' into sqlfix-tweaks1
Commit migrated from https://github.com/dotnet/corefx/commit/
f8ec493e9c2d2af88af70473229b319cef2017fd
Tarikul Sabbir [Wed, 13 Mar 2019 22:32:16 +0000 (15:32 -0700)]
Merge pull request dotnet/corefx#36015 from tarikulsabbir/datastream_bugfix
Porting XEvent Delay BugFix from .Net Framework
Commit migrated from https://github.com/dotnet/corefx/commit/
8801ab0b3365f551966ae9caa053434ec07f41bb
Eric StJohn [Wed, 13 Mar 2019 21:57:58 +0000 (14:57 -0700)]
Update Windows.Compatibility package with references to newer WCF versions. (dotnet/corefx#35990)
Commit migrated from https://github.com/dotnet/corefx/commit/
369b90a4604281e723ddbc8f6bf114be6074cb82
Tarikul Sabbir [Wed, 13 Mar 2019 18:40:59 +0000 (11:40 -0700)]
Delete XEvent before method exits.
Commit migrated from https://github.com/dotnet/corefx/commit/
f878d4c086baf2225b4097c03f13f347fc5c54d8
Tarikul Sabbir [Wed, 13 Mar 2019 17:23:40 +0000 (10:23 -0700)]
Formatting change
Commit migrated from https://github.com/dotnet/corefx/commit/
b21616da94e320b643d9dfd9fb3ee248f5752c3c
Tomas Weinfurt [Wed, 13 Mar 2019 16:17:01 +0000 (09:17 -0700)]
small fixes for ping to properly set state in case of failure (dotnet/corefx#33621)
* unix ping fixes
* feedback from review and fixes for failing tests
* feedback from review
* more rework on cleanup logic
* add missing check for disposed object in Async path
* remove freebsd part of this change to make it cleaner
* await for all calls of SendPingAsyncCore()
* make arg checking synchronous and stabilize SendPingAsync_InvalidArgs failing on some platforms
* feedback from review
Commit migrated from https://github.com/dotnet/corefx/commit/
2696d751a7b50bdc3e03bf5089f67aa0bd081b24
Stephen Bonikowsky [Wed, 13 Mar 2019 16:16:22 +0000 (09:16 -0700)]
Updating to latest WCF version.
Commit migrated from https://github.com/dotnet/corefx/commit/
ff42076b3b432205007a562435b08e2aac246f92
Ahson Khan [Wed, 13 Mar 2019 02:26:08 +0000 (19:26 -0700)]
Fix JsonReader bug in multi-segment string processing (dotnet/corefx#35978)
Commit migrated from https://github.com/dotnet/corefx/commit/
118ea047b67221f9c50be03515f04ad52492ee6e
Tarikul Sabbir [Wed, 13 Mar 2019 00:50:02 +0000 (17:50 -0700)]
DataStream Test change
Commit migrated from https://github.com/dotnet/corefx/commit/
d761e61fd8da88f291b39cd0db8bce74fc822e75
Wraith2 [Wed, 13 Mar 2019 00:39:18 +0000 (00:39 +0000)]
make TextDataFeed.DefaultEncoding internal
Commit migrated from https://github.com/dotnet/corefx/commit/
d32a2ee4aea2ffdf3a0ec47081b0a978466a3631
Levi Broderick [Tue, 5 Mar 2019 02:31:41 +0000 (18:31 -0800)]
React to changes through ASCIIEncoding and EncoderNLS
Also create some additional ASCII tests
Commit migrated from https://github.com/dotnet/corefx/commit/
d817d68fc6e2fc78624540aa90a060f4d5bf0eee
Wraith2 [Tue, 12 Mar 2019 23:24:19 +0000 (23:24 +0000)]
address feedback
Commit migrated from https://github.com/dotnet/corefx/commit/
f2417f59441b0dc55ad73deb75ff23672041aa5e
Tarikul Sabbir [Tue, 12 Mar 2019 22:19:17 +0000 (15:19 -0700)]
DataSteam Test change
Commit migrated from https://github.com/dotnet/corefx/commit/
01f138e1008381379861eaec6df8a5b457d1084e
Jan Kotas [Tue, 12 Mar 2019 21:03:55 +0000 (14:03 -0700)]
Pin buffer for NtQuerySystemInformation (dotnet/corefx#35991)
Fixes dotnet/corefx#35987
Commit migrated from https://github.com/dotnet/corefx/commit/
704a9669e69ef5faae55ca438e9850b8aa0e9ec5
Tomas Weinfurt [Tue, 12 Mar 2019 19:16:12 +0000 (12:16 -0700)]
Fix SendWithPingUtilityAsync to catch InvalidOperationException (dotnet/corefx#35992)
* ignore InvalidOperationException from Kill
* ignore InvalidOperationException from Kill
Commit migrated from https://github.com/dotnet/corefx/commit/
0f7a0bd5fb4892c1434e263824d394ab621a1b2a
Stephen Bonikowsky [Tue, 12 Mar 2019 17:15:20 +0000 (10:15 -0700)]
Update Windows.Compatibility package with references to newer WCF versions.
Commit migrated from https://github.com/dotnet/corefx/commit/
4feda8061bfe03429555654c3df2fa5f7438f082
Osman Turan [Tue, 12 Mar 2019 09:57:50 +0000 (12:57 +0300)]
Add unit tests for PEHeaderBuilder factory methods
See: dotnet/corefx#35758
Commit migrated from https://github.com/dotnet/corefx/commit/
07dfb7b7530528a065a2eccb09b6df560e2547c5
Osman Turan [Wed, 6 Mar 2019 11:03:30 +0000 (14:03 +0300)]
Fix ImageCharacteristics of PEHeaderBuilder when initialized by CreateLibraryHeader
Fixes: dotnet/corefx#35758
Commit migrated from https://github.com/dotnet/corefx/commit/
a04be5028544df36b11cabd4081896ba8037b71e
Stephen Toub [Tue, 12 Mar 2019 15:05:04 +0000 (11:05 -0400)]
Include correct error code in WebSocket.ThrowOnInvalidState (dotnet/corefx#35960)
* Include correct error code in WebSocket.ThrowOnInvalidState
* Address PR feedback
* Fix UWP leg
Commit migrated from https://github.com/dotnet/corefx/commit/
ef145001b10660be940aeb9318e0ff7e306f65bc
David Fowler [Tue, 12 Mar 2019 15:02:02 +0000 (08:02 -0700)]
Made some tweaks to the BufferSegmentStack (dotnet/corefx#35980)
- Remove array covariance checks
- Added another test for pooled segments
Commit migrated from https://github.com/dotnet/corefx/commit/
19ec4f3cabcc0796c14f4663c6ee3ab8173ad90d
Stephen Toub [Tue, 12 Mar 2019 14:40:45 +0000 (10:40 -0400)]
Remove stale TODO
We have no plans to address this further.
Commit migrated from https://github.com/dotnet/corefx/commit/
57642c99f187a4611763d1c5b3efb4347d27c1b3
David Fowler [Tue, 12 Mar 2019 02:53:04 +0000 (19:53 -0700)]
Don't allocate a stack (dotnet/corefx#35958)
- Avoid an extra object allocation by using a struct based stack
Commit migrated from https://github.com/dotnet/corefx/commit/
a7098b8893a0ebf53a881d43b333dcda5b2c8716
Calvin Buckley [Tue, 12 Mar 2019 00:23:45 +0000 (21:23 -0300)]
Switch from asserts on POSIX_FADV_* to conversions (dotnet/corefx#35971)
Commit migrated from https://github.com/dotnet/corefx/commit/
fb4afc8dec2fc5bb7885606986387c37227cd350
Marco Rossignoli [Mon, 11 Mar 2019 23:36:40 +0000 (00:36 +0100)]
fix catch (dotnet/corefx#35970)
Commit migrated from https://github.com/dotnet/corefx/commit/
d5c6b10af17a87139c745c78148f942f947e1eb9
Tarikul Sabbir [Mon, 11 Mar 2019 22:39:11 +0000 (15:39 -0700)]
datastream bugfix first commit
Commit migrated from https://github.com/dotnet/corefx/commit/
408dd114ecea7100524d678bfbfcb8abed4fb341
Liudmila Molkova [Mon, 11 Mar 2019 22:15:08 +0000 (15:15 -0700)]
Inject W3C headers in HTTP diagnostics handler (dotnet/corefx#35882)
* Inject W3C headers in corefx Htpp Diagnostics HAndler
* Inject W3C headers if activity format is W3C
* fix style and indentation
* review: fix issue
Commit migrated from https://github.com/dotnet/corefx/commit/
7314001fd1ebfb25b500774d1551170a17c7a209
David Fowler [Mon, 11 Mar 2019 21:35:27 +0000 (14:35 -0700)]
Throw an exception if examined < consumed and reworked lastExamined (dotnet/corefx#35879)
- Store a single absolute position instead of the segment
- Fixed some typos and added tests for null segments
- Added more tests
Commit migrated from https://github.com/dotnet/corefx/commit/
203bc37eddbae8fb14531d305554a662c0428279
Adeel Mujahid [Mon, 11 Mar 2019 19:32:34 +0000 (21:32 +0200)]
Add GNU compiler support to build src/Native (dotnet/corefx#35737)
* Add GNU compiler support to build src/Native
Tested with gcc v5, v6, v7 and v8 on CentOS 7, Ubuntu 18, Debian 8 and
FreeBSD 11.
`corefx/src/Native/build-native.sh x64 checked gcc`
* Remove unnecessary cast
* Sync gen-buildsys-gcc.sh with CoreCLR
Commit migrated from https://github.com/dotnet/corefx/commit/
b3b1777642c80f7a0ba57b32581c33442ceac1d7
Stephen Toub [Mon, 11 Mar 2019 17:32:41 +0000 (13:32 -0400)]
Use TryAddWithoutValidation in WebSocketHandle.ConnectAsyncCore (dotnet/corefx#35954)
Don't validate the headers the developer has explicitly added to ClientWebSocketOptions.RequestHeaders; just pass them through.
Commit migrated from https://github.com/dotnet/corefx/commit/
e433981ea570928efbb1587cc6735c90c1881a58
Stephen Toub [Mon, 11 Mar 2019 17:32:14 +0000 (13:32 -0400)]
Add missing deserialization ctor to ChannelClosedException (dotnet/corefx#35952)
Commit migrated from https://github.com/dotnet/corefx/commit/
9187219ad62356da3d5b820c6b63deba0549f79f
Stephen Toub [Mon, 11 Mar 2019 17:31:04 +0000 (13:31 -0400)]
Fix timezone-related failures in System.Runtime.Tests (dotnet/corefx#35955)
In timezones with a positive offset, several tests were failing due to going below the minimum supported values.
Commit migrated from https://github.com/dotnet/corefx/commit/
8f50086da1ac1f2edd175d0a6cac7c6b596f4f36
Hugh Bellamy [Mon, 11 Mar 2019 15:39:15 +0000 (15:39 +0000)]
Cleanup and enhance misc reflection/attribute tests (dotnet/corefx#35858)
* Cleanup and enhance misc reflection tests
* Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/
2a2d34df7db5d2617d12f55fe5ad8fd208117049
David Fowler [Mon, 11 Mar 2019 14:31:42 +0000 (07:31 -0700)]
Better defaults for the Pipe (dotnet/corefx#35939)
- Use a 4K buffer instead of 2K (4K is a very common buffer size and usually maps to system page size)
- Use a stack for the buffer segment pool and allow pooling more than 16 segments for large writes
Commit migrated from https://github.com/dotnet/corefx/commit/
b49b512a6288edd96d4fbb68bf23a4bd2f831545
Stephen Toub [Mon, 11 Mar 2019 14:17:04 +0000 (10:17 -0400)]
Disable TestCheckChildProcessUserAndGroupIds test (dotnet/corefx#35949)
Sporadically failing in CI
Commit migrated from https://github.com/dotnet/corefx/commit/
6eedd6fd57dc89bba05bbe18ed395e9efae4ada1
Stephen Toub [Mon, 11 Mar 2019 03:19:09 +0000 (23:19 -0400)]
Add await stack guard test (dotnet/corefx#35905)
* Add await stack guard test
* Fix typo
* Skip new test on netfx
Commit migrated from https://github.com/dotnet/corefx/commit/
6d7126e0a329db795930ea17e84369eacb7bae5a
Hugh Bellamy [Sun, 10 Mar 2019 17:41:22 +0000 (17:41 +0000)]
Fix CompositionContract.Equals for null (dotnet/corefx#35132)
* Fix CompositionContract.Equals for null
* Move tests to right folder
Commit migrated from https://github.com/dotnet/corefx/commit/
f52d7e6f69a35042489a192fec08edd318a134aa
Tomas Weinfurt [Sun, 10 Mar 2019 09:56:10 +0000 (01:56 -0800)]
disable SendToRecvFrom_Datagram_UDP aagin. (dotnet/corefx#35920)
Commit migrated from https://github.com/dotnet/corefx/commit/
0dbce2be7aa2fe6d4c82b91e9cab677c6289ace1
Marco Rossignoli [Sun, 10 Mar 2019 09:53:30 +0000 (10:53 +0100)]
disable test on netfx (dotnet/corefx#35921)
Commit migrated from https://github.com/dotnet/corefx/commit/
1f8a77c4a96c476741b2ed35ec4faf7c92e14a8f
David Shulman [Sun, 10 Mar 2019 05:22:44 +0000 (21:22 -0800)]
Fix NetEventSource logging for Windows auth on Linux (dotnet/corefx#35918)
While debugging some Linux enterprise auth (Negotiate/NTLM) scenarios, I discovered that the
logging I added in PR dotnet/corefx#35383 wasn't working. This was due to not passing in a 'null' value
for the context object for NetEventSource.Info. It was using the string object as the
context object and not logging the string data.
As part of fixing that I optimized some code for remembering what auth package (NTLM
or SPNEGO) is used.
Commit migrated from https://github.com/dotnet/corefx/commit/
21db29aeff8acafe080113856545d30246891da6
Marco Rossignoli [Sat, 9 Mar 2019 22:23:32 +0000 (23:23 +0100)]
Bug fix: await SmtpClient.SendMailAsync never ends (dotnet/corefx#35915)
Call InvokeCallback() in case of CompletedSynchronously.
Fixes dotnet/corefx#35738
Commit migrated from https://github.com/dotnet/corefx/commit/
848811c496a7cb9d48ddee2775e982b4b732e8ac
Dan Moseley [Sat, 9 Mar 2019 21:54:04 +0000 (13:54 -0800)]
Remove 2 suffix step 1 (dotnet/corefx#35904)
Commit migrated from https://github.com/dotnet/corefx/commit/
71a2e84b885f4d83697c93d25cebdb85c28a5d74
Wraith2 [Sat, 9 Mar 2019 19:03:31 +0000 (19:03 +0000)]
Merge remote-tracking branch 'dotnet/master' into sqlperf-streamwrite
Commit migrated from https://github.com/dotnet/corefx/commit/
8f3233fc13e4bcabbf2237627994865a02b35c3c