Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@@ -558,6 +558,10 @@ public class Tests : TestsBase, ITest2
runtime_invoke_hybrid_exceptions();
return 0;
}
if (args.Length > 0 && args [0] == "new_thread_hybrid_exception") {
new_thread_hybrid_exception();
return 0;
}
assembly_load ();
breakpoints ();
single_stepping ();
@@ -2222,12 +2226,27 @@ public class Tests : TestsBase, ITest2
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void runtime_invoke_hybrid_exceptions () {
Type rtType = Type.GetType("RuntimeInvokeWithThrowClass");
ConstructorInfo rtConstructor = rtType.GetConstructor(Type.EmptyTypes);
object rtObject = rtConstructor.Invoke(new object[] { });
MethodInfo rtMethod = rtType.GetMethod("RuntimeInvokeThrowMethod");
rtMethod.Invoke(rtObject, new object[] { });
ConstructorInfo rtConstructor = rtType.GetConstructor(Type.EmptyTypes);
object rtObject = rtConstructor.Invoke(new object[] { });
MethodInfo rtMethod = rtType.GetMethod("RuntimeInvokeThrowMethod");
rtMethod.Invoke(rtObject, new object[] { });
}
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void new_thread_hybrid_exception() {
try
{
Thread thread = new Thread(new_thread_hybrid_exception2);
thread.Start();
}
catch (Exception sockEx)
{
}
}
public static void new_thread_hybrid_exception2()
{
throw new Exception("Error");
}
}
public class SentinelClass : MarshalByRefObject {

View File

@@ -1 +1 @@
52da50a45dbfc7510ab393f4a443ee0caae46b7b
05d112e3f88c7618dfea5f2e0d291812b01105d6

View File

@@ -218,9 +218,13 @@ namespace Mono.Options
int start = 0, end;
do {
end = GetLineEnd (start, width, self);
char c = self [end-1];
// endCorrection is 1 if the line end is '\n', and might be 2 if the line end is '\r\n'.
int endCorrection = 1;
if (end >= 2 && self.Substring (end - 2, 2).Equals ("\r\n"))
endCorrection = 2;
char c = self [end - endCorrection];
if (char.IsWhiteSpace (c))
--end;
end -= endCorrection;
bool needContinuation = end != self.Length && !IsEolChar (c);
string continuation = "";
if (needContinuation) {
@@ -231,7 +235,7 @@ namespace Mono.Options
yield return line;
start = end;
if (char.IsWhiteSpace (c))
++start;
start += endCorrection;
width = GetNextWidth (ewidths, width, ref hw);
} while (start < self.Length);
}
@@ -262,6 +266,8 @@ namespace Mono.Options
int end = System.Math.Min (start + length, description.Length);
int sep = -1;
for (int i = start; i < end; ++i) {
if (i + 2 <= description.Length && description.Substring (i, 2).Equals ("\r\n"))
return i+2;
if (description [i] == '\n')
return i+1;
if (IsEolChar (description [i]))

View File

@@ -497,6 +497,25 @@ namespace MonoTests.Mono.Options
Assert.AreEqual (expected.ToString (), actual.ToString ());
}
[Test]
public void NewLines ()
{
var p = new OptionSet () {
"What is interesting about this is that we are going to use a newli\r\nne that is windows style"
};
StringWriter expected = new StringWriter ();
expected.NewLine = "\r\n";
expected.WriteLine ("What is interesting about this is that we are going to use a newli");
expected.WriteLine ("ne that is windows style");
StringWriter actual = new StringWriter ();
actual.NewLine = "\r\n";
p.WriteOptionDescriptions (actual);
Assert.AreEqual (expected.ToString (), actual.ToString ());
}
[Test]
public void OptionBundling ()
{

View File

@@ -9,6 +9,7 @@ Mono.Unix/UnixPathTest.cs
Mono.Unix/UnixSignalTest.cs
Mono.Unix/UnixUserTest.cs
Mono.Unix.Android/TestHelper.cs
Mono.Unix.Native/MemfdTest.cs
Mono.Unix.Native/OFDLockTest.cs
Mono.Unix.Native/RealTimeSignumTests.cs
Mono.Unix.Native/SocketTest.cs

View File

@@ -341,6 +341,38 @@ namespace Mono.Unix.Native {
return fopen_mode;
}
[DllImport (LIB, EntryPoint="Mono_Posix_FromMremapFlags")]
private static extern int FromMremapFlags (MremapFlags value, out UInt64 rval);
public static bool TryFromMremapFlags (MremapFlags value, out UInt64 rval)
{
return FromMremapFlags (value, out rval) == 0;
}
public static UInt64 FromMremapFlags (MremapFlags value)
{
UInt64 rval;
if (FromMremapFlags (value, out rval) == -1)
ThrowArgumentException (value);
return rval;
}
[DllImport (LIB, EntryPoint="Mono_Posix_ToMremapFlags")]
private static extern int ToMremapFlags (UInt64 value, out MremapFlags rval);
public static bool TryToMremapFlags (UInt64 value, out MremapFlags rval)
{
return ToMremapFlags (value, out rval) == 0;
}
public static MremapFlags ToMremapFlags (UInt64 value)
{
MremapFlags rval;
if (ToMremapFlags (value, out rval) == -1)
ThrowArgumentException (value);
return rval;
}
[DllImport (LIB, EntryPoint="Mono_Posix_FromStat")]
private static extern int FromStat (ref Stat source, IntPtr destination);

View File

@@ -1,5 +1,5 @@
/*
* This file was automatically generated by create-native-map from ./../../class/lib/net_4_x/Mono.Posix.dll.
* This file was automatically generated by create-native-map from ./../../class/lib/net_4_x-linux/Mono.Posix.dll.
*
* DO NOT MODIFY.
*/
@@ -438,6 +438,38 @@ namespace Mono.Unix.Native {
return rval;
}
[DllImport (LIB, EntryPoint="Mono_Posix_FromMemfdFlags")]
private static extern int FromMemfdFlags (MemfdFlags value, out UInt32 rval);
public static bool TryFromMemfdFlags (MemfdFlags value, out UInt32 rval)
{
return FromMemfdFlags (value, out rval) == 0;
}
public static UInt32 FromMemfdFlags (MemfdFlags value)
{
UInt32 rval;
if (FromMemfdFlags (value, out rval) == -1)
ThrowArgumentException (value);
return rval;
}
[DllImport (LIB, EntryPoint="Mono_Posix_ToMemfdFlags")]
private static extern int ToMemfdFlags (UInt32 value, out MemfdFlags rval);
public static bool TryToMemfdFlags (UInt32 value, out MemfdFlags rval)
{
return ToMemfdFlags (value, out rval) == 0;
}
public static MemfdFlags ToMemfdFlags (UInt32 value)
{
MemfdFlags rval;
if (ToMemfdFlags (value, out rval) == -1)
ThrowArgumentException (value);
return rval;
}
[DllImport (LIB, EntryPoint="Mono_Posix_FromMessageFlags")]
private static extern int FromMessageFlags (MessageFlags value, out Int32 rval);
@@ -598,38 +630,6 @@ namespace Mono.Unix.Native {
return rval;
}
[DllImport (LIB, EntryPoint="Mono_Posix_FromMremapFlags")]
private static extern int FromMremapFlags (MremapFlags value, out UInt64 rval);
public static bool TryFromMremapFlags (MremapFlags value, out UInt64 rval)
{
return FromMremapFlags (value, out rval) == 0;
}
public static UInt64 FromMremapFlags (MremapFlags value)
{
UInt64 rval;
if (FromMremapFlags (value, out rval) == -1)
ThrowArgumentException (value);
return rval;
}
[DllImport (LIB, EntryPoint="Mono_Posix_ToMremapFlags")]
private static extern int ToMremapFlags (UInt64 value, out MremapFlags rval);
public static bool TryToMremapFlags (UInt64 value, out MremapFlags rval)
{
return ToMremapFlags (value, out rval) == 0;
}
public static MremapFlags ToMremapFlags (UInt64 value)
{
MremapFlags rval;
if (ToMremapFlags (value, out rval) == -1)
ThrowArgumentException (value);
return rval;
}
[DllImport (LIB, EntryPoint="Mono_Posix_FromMsyncFlags")]
private static extern int FromMsyncFlags (MsyncFlags value, out Int32 rval);
@@ -838,6 +838,38 @@ namespace Mono.Unix.Native {
return rval;
}
[DllImport (LIB, EntryPoint="Mono_Posix_FromSealType")]
private static extern int FromSealType (SealType value, out Int32 rval);
public static bool TryFromSealType (SealType value, out Int32 rval)
{
return FromSealType (value, out rval) == 0;
}
public static Int32 FromSealType (SealType value)
{
Int32 rval;
if (FromSealType (value, out rval) == -1)
ThrowArgumentException (value);
return rval;
}
[DllImport (LIB, EntryPoint="Mono_Posix_ToSealType")]
private static extern int ToSealType (Int32 value, out SealType rval);
public static bool TryToSealType (Int32 value, out SealType rval)
{
return ToSealType (value, out rval) == 0;
}
public static SealType ToSealType (Int32 value)
{
SealType rval;
if (ToSealType (value, out rval) == -1)
ThrowArgumentException (value);
return rval;
}
[DllImport (LIB, EntryPoint="Mono_Posix_FromSeekFlags")]
private static extern int FromSeekFlags (SeekFlags value, out Int16 rval);

View File

@@ -1 +1 @@
c9eb750d22227382cc4989053d328c0e7fc0bc79
c518961806361767322f0b757271f1146519fa75

View File

@@ -0,0 +1,98 @@
//
// Tests for memfd_create and file sealing
//
// Authors:
// Steffen Kiess (kiess@ki4.de)
//
// Copyright (C) 2019 Steffen Kiess
//
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using Mono.Unix;
using Mono.Unix.Native;
using NUnit.Framework;
namespace MonoTests.Mono.Unix.Native
{
[TestFixture, Category ("NotDotNet"), Category ("NotOnWindows"), Category ("NotOnMac")]
public class MemfdTest {
[Test]
public unsafe void TestMemfd ()
{
int fd;
try {
fd = Syscall.memfd_create ("mono-test", 0);
} catch (EntryPointNotFoundException) {
Assert.Ignore ("memfd_create() not available");
return;
}
if (fd < 0 && Stdlib.GetLastError () == Errno.ENOSYS)
// Might happen on a new libc + old kernel
Assert.Ignore ("memfd_create() returns ENOSYS");
if (fd < 0)
UnixMarshal.ThrowExceptionForLastError ();
byte b = 42;
if (Syscall.write (fd, &b, 1) < 0)
UnixMarshal.ThrowExceptionForLastError ();
// Should fail with EPERM because MFD_ALLOW_SEALING was not used
var res = Syscall.fcntl(fd, FcntlCommand.F_ADD_SEALS, SealType.F_SEAL_WRITE);
Assert.AreEqual (-1, res);
Assert.AreEqual (Errno.EPERM, Stdlib.GetLastError ());
//Stdlib.system ("ls -l /proc/$PPID/fd/");
if (Syscall.close (fd) < 0)
UnixMarshal.ThrowExceptionForLastError ();
// Call memfd_create with MFD_ALLOW_SEALING
fd = Syscall.memfd_create ("mono-test", MemfdFlags.MFD_CLOEXEC | MemfdFlags.MFD_ALLOW_SEALING);
if (fd < 0)
UnixMarshal.ThrowExceptionForLastError ();
if (Syscall.write (fd, &b, 1) < 0)
UnixMarshal.ThrowExceptionForLastError ();
res = Syscall.fcntl(fd, FcntlCommand.F_GET_SEALS);
if (res < 0)
UnixMarshal.ThrowExceptionForLastError ();
// Need to convert the result to SealType
SealType sealType = NativeConvert.ToSealType (res);
Assert.AreEqual ((SealType)0, sealType);
if (Syscall.fcntl(fd, FcntlCommand.F_ADD_SEALS, SealType.F_SEAL_WRITE) < 0)
UnixMarshal.ThrowExceptionForLastError ();
// Should fail with EPERM because the file was sealed for writing
var lres = Syscall.write (fd, &b, 1);
Assert.AreEqual (-1, lres);
Assert.AreEqual (Errno.EPERM, Stdlib.GetLastError ());
res = Syscall.fcntl(fd, FcntlCommand.F_GET_SEALS);
if (res < 0)
UnixMarshal.ThrowExceptionForLastError ();
// Need to convert the result to SealType
sealType = NativeConvert.ToSealType (res);
Assert.AreEqual (SealType.F_SEAL_WRITE, sealType);
//Stdlib.system ("ls -l /proc/$PPID/fd/");
if (Syscall.close (fd) < 0)
UnixMarshal.ThrowExceptionForLastError ();
}
}
}
// vim: noexpandtab
// Local Variables:
// tab-width: 4
// c-basic-offset: 4
// indent-tabs-mode: t
// End:

View File

@@ -86,8 +86,8 @@ namespace Mono.Security {
Buffer.BlockCopy (data, (2 + nLenLength), m_aValue, 0, nLength);
if ((m_nTag & 0x20) == 0x20) {
int nStart = (2 + nLenLength);
Decode (data, ref nStart, data.Length);
int nStart = 0;
Decode (m_aValue, ref nStart, m_aValue.Length);
}
}
@@ -312,7 +312,7 @@ namespace Mono.Security {
public override string ToString()
{
StringBuilder hexLine = new StringBuilder ();
// Add tag
hexLine.AppendFormat ("Tag: {0} {1}", m_nTag.ToString ("X2"), Environment.NewLine);

View File

@@ -3,6 +3,8 @@
// See the LICENSE file in the project root for more information.
using System;
using System.Resources;
using System.Reflection;
// needed for ../referencesource/System.Data/System/Data/CodeGen/datacache.cs
internal static partial class Res
@@ -41,5 +43,13 @@ internal static partial class Res
internal static partial class SR
{
public static string GetResourceString(string resourceKey, string defaultString) => defaultString;
public static string GetResourceString(string resourceKey, string defaultString) {
Type fieldType = typeof(SR);
FieldInfo field = fieldType.GetField(resourceKey);
if (field != null) {
return field.GetValue(null).ToString();
}
return defaultString;
}
}

View File

@@ -1,148 +0,0 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
using System.Net.Security;
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
using System.Threading.Tasks;
namespace System.Net.Http
{
public partial class HttpClientHandler : HttpMessageHandler
{
HttpMessageHandler wasmHandler;
public HttpClientHandler () : this (HttpClient.CreateDefaultHandler ()) { }
HttpClientHandler (HttpMessageHandler wasmHandler)
{
this.wasmHandler = wasmHandler;
}
protected override void Dispose (bool disposing)
{
if (disposing) {
if (wasmHandler != null) {
wasmHandler.Dispose ();
wasmHandler = null;
}
}
base.Dispose (disposing);
}
const string EXCEPTION_MESSAGE = "System.Net.Http.HttpClientHandler is not supported on the current platform.";
public virtual bool SupportsAutomaticDecompression => false;
public virtual bool SupportsProxy => false;
public virtual bool SupportsRedirectConfiguration => false;
public bool UseCookies {
get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public CookieContainer CookieContainer {
get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public ClientCertificateOption ClientCertificateOptions {
get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public X509CertificateCollection ClientCertificates {
get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public Func<HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors, bool> ServerCertificateCustomValidationCallback {
get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public bool CheckCertificateRevocationList {
get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public SslProtocols SslProtocols {
get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public DecompressionMethods AutomaticDecompression {
get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public bool UseProxy {
get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public IWebProxy Proxy {
get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public ICredentials DefaultProxyCredentials {
get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public bool PreAuthenticate {
get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public bool UseDefaultCredentials {
get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public ICredentials Credentials {
get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public bool AllowAutoRedirect {
get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public int MaxAutomaticRedirections {
get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public int MaxConnectionsPerServer {
get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public int MaxResponseHeadersLength {
get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public long MaxRequestContentBufferSize {
get => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
set => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
}
public IDictionary<string, object> Properties => throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
protected internal override Task<HttpResponseMessage> SendAsync (HttpRequestMessage request, CancellationToken cancellationToken)
{
if (wasmHandler == null)
throw new PlatformNotSupportedException (EXCEPTION_MESSAGE);
return wasmHandler.SendAsync (request, cancellationToken);
}
}
}

View File

@@ -37,6 +37,10 @@ LIB_MCS_FLAGS += -r:$(topdir)/../external/binary-reference-assemblies/build/mono
LIB_MCS_FLAGS += -d:XAMARIN_MODERN
endif
ifeq (wasm,$(PROFILE))
API_BIN_REFS := WebAssembly.Net.Http
endif
TEST_LIB_REFS = System System.Core
TEST_MCS_FLAGS =

View File

@@ -1,54 +1,7 @@
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
namespace System.Net.Http
{
public partial class HttpClient
{
#pragma warning disable 649
private static Func<HttpMessageHandler> GetHttpMessageHandler;
#pragma warning restore 649
internal static HttpMessageHandler CreateDefaultHandler()
{
if (GetHttpMessageHandler == null)
{
Type type = Type.GetType("WebAssembly.Net.Http.HttpClient.WasmHttpMessageHandler, WebAssembly.Net.Http");
if (type == null)
return GetFallback ("Invalid WebAssembly Module? Cannot find WebAssembly.Net.Http.HttpClient.WasmHttpMessageHandler");
MethodInfo method = type.GetMethod("GetHttpMessageHandler", BindingFlags.Static | BindingFlags.NonPublic);
if (method == null)
return GetFallback ("Your WebAssembly version does not support obtaining of the custom HttpClientHandler");
object ret = method.Invoke(null, null);
if (ret == null)
return GetFallback ("WebAssembly returned no custom HttpClientHandler");
var handler = ret as HttpMessageHandler;
if (handler == null)
return GetFallback ($"{ret?.GetType()} is not a valid HttpMessageHandler");
return handler;
}
else
{
var handler = GetHttpMessageHandler();
if (handler == null)
return GetFallback($"Custom HttpMessageHandler is not valid");
return handler;
}
}
static HttpMessageHandler GetFallback(string message)
{
//Console.WriteLine(message + ". Defaulting to System.Net.Http.HttpClientHandler");
return new HttpClientHandler();
}
}
public partial class HttpClient
{
static HttpMessageHandler CreateDefaultHandler () => new WebAssembly.Net.Http.HttpClient.WasmHttpMessageHandler ();
}
}

View File

@@ -0,0 +1,147 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
using System.Net.Security;
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
using System.Threading.Tasks;
namespace System.Net.Http
{
public class HttpClientHandler : HttpMessageHandler
{
WebAssembly.Net.Http.HttpClient.WasmHttpMessageHandler wasmHandler;
public HttpClientHandler ()
{
wasmHandler = new WebAssembly.Net.Http.HttpClient.WasmHttpMessageHandler ();
}
protected override void Dispose (bool disposing)
{
if (disposing) {
if (wasmHandler != null) {
wasmHandler.Dispose ();
wasmHandler = null;
}
}
base.Dispose (disposing);
}
public virtual bool SupportsAutomaticDecompression => false;
public virtual bool SupportsProxy => false;
public virtual bool SupportsRedirectConfiguration => false;
public bool UseCookies {
get => throw new PlatformNotSupportedException ("Property UseCookies is not supported.");
set => throw new PlatformNotSupportedException ("Property UseCookies is not supported.");
}
public CookieContainer CookieContainer {
get => throw new PlatformNotSupportedException ("Property CookieContainer is not supported.");
set => throw new PlatformNotSupportedException ("Property CookieContainer is not supported.");
}
public ClientCertificateOption ClientCertificateOptions {
get => throw new PlatformNotSupportedException ("Property ClientCertificateOptions is not supported.");
set => throw new PlatformNotSupportedException ("Property ClientCertificateOptions is not supported.");
}
public X509CertificateCollection ClientCertificates {
get => throw new PlatformNotSupportedException ("Property ClientCertificates is not supported.");
set => throw new PlatformNotSupportedException ("Property ClientCertificates is not supported.");
}
public Func<HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors, bool> ServerCertificateCustomValidationCallback {
get => throw new PlatformNotSupportedException ("Property ServerCertificateCustomValidationCallback is not supported.");
set => throw new PlatformNotSupportedException ("Property ServerCertificateCustomValidationCallback is not supported.");
}
public bool CheckCertificateRevocationList {
get => throw new PlatformNotSupportedException ("Property CheckCertificateRevocationList is not supported.");
set => throw new PlatformNotSupportedException ("Property CheckCertificateRevocationList is not supported.");
}
public SslProtocols SslProtocols {
get => throw new PlatformNotSupportedException ("Property SslProtocols is not supported.");
set => throw new PlatformNotSupportedException ("Property SslProtocols is not supported.");
}
public DecompressionMethods AutomaticDecompression {
get => throw new PlatformNotSupportedException ("Property AutomaticDecompression is not supported.");
set => throw new PlatformNotSupportedException ("Property AutomaticDecompression is not supported.");
}
public bool UseProxy {
get => throw new PlatformNotSupportedException ("Property UseProxy is not supported.");
set => throw new PlatformNotSupportedException ("Property UseProxy is not supported.");
}
public IWebProxy Proxy {
get => throw new PlatformNotSupportedException ("Property Proxy is not supported.");
set => throw new PlatformNotSupportedException ("Property Proxy is not supported.");
}
public ICredentials DefaultProxyCredentials {
get => throw new PlatformNotSupportedException ("Property DefaultProxyCredentials is not supported.");
set => throw new PlatformNotSupportedException ("Property DefaultProxyCredentials is not supported.");
}
public bool PreAuthenticate {
get => throw new PlatformNotSupportedException ("Property PreAuthenticate is not supported.");
set => throw new PlatformNotSupportedException ("Property PreAuthenticate is not supported.");
}
public bool UseDefaultCredentials {
get => throw new PlatformNotSupportedException ("Property UseDefaultCredentials is not supported.");
set => throw new PlatformNotSupportedException ("Property UseDefaultCredentials is not supported.");
}
public ICredentials Credentials {
get => throw new PlatformNotSupportedException ("Property Credentials is not supported.");
set => throw new PlatformNotSupportedException ("Property Credentials is not supported.");
}
public bool AllowAutoRedirect {
get => throw new PlatformNotSupportedException ("Property AllowAutoRedirect is not supported.");
set => throw new PlatformNotSupportedException ("Property AllowAutoRedirect is not supported.");
}
public int MaxAutomaticRedirections {
get => throw new PlatformNotSupportedException ("Property MaxAutomaticRedirections is not supported.");
set => throw new PlatformNotSupportedException ("Property MaxAutomaticRedirections is not supported.");
}
public int MaxConnectionsPerServer {
get => throw new PlatformNotSupportedException ("Property MaxConnectionsPerServer is not supported.");
set => throw new PlatformNotSupportedException ("Property MaxConnectionsPerServer is not supported.");
}
public int MaxResponseHeadersLength {
get => throw new PlatformNotSupportedException ("Property MaxResponseHeadersLength is not supported.");
set => throw new PlatformNotSupportedException ("Property MaxResponseHeadersLength is not supported.");
}
public long MaxRequestContentBufferSize {
get => throw new PlatformNotSupportedException ("Property MaxRequestContentBufferSize is not supported.");
set => throw new PlatformNotSupportedException ("Property MaxRequestContentBufferSize is not supported.");
}
public IDictionary<string, object> Properties => throw new PlatformNotSupportedException ("Property Properties is not supported.");
public static Func<HttpRequestMessage, X509Certificate2, X509Chain, SslPolicyErrors, bool> DangerousAcceptAnyServerCertificateValidator { get; } = delegate { return true; };
protected internal override Task<HttpResponseMessage> SendAsync (HttpRequestMessage request, CancellationToken cancellationToken)
{
if (wasmHandler == null)
throw new ObjectDisposedException (GetType().ToString());
return wasmHandler.SendAsync (request, cancellationToken);
}
}
}

View File

@@ -1,6 +0,0 @@
HttpClient.DefaultHandler.cs
HttpClientHandler.cs
HttpClientHandler.DefaultHandler.cs
HttpClientHandler.SocketsHandler.cs
corefx/SocketsHttpHandler.Mono.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/*.cs

View File

@@ -1,3 +1,34 @@
#include socketshandler.sources
HttpClientHandler.wasm.cs
Assembly/AssemblyInfo.cs
corefx/NetEventSource.Http.cs
System.Net.Http/HttpClientHandler.wasm.cs
System.Net.Http/HttpClient.wasm.cs
HttpRequestMessage.Mono.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/Headers/*.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/ByteArrayContent.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/ByteArrayHelpers.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/ClientCertificateOption.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/DelegatingHandler.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/FormUrlEncodedContent.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpClient.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpCompletionOption.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpContent.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpMessageHandler.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpMessageInvoker.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpMethod.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpParseResult.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpRequestException.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpRequestMessage.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpResponseMessage.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpRuleParser.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/HttpUtilities.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/MessageProcessingHandler.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/MultipartContent.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/MultipartFormDataContent.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/ReadOnlyMemoryContent.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/StreamContent.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/StreamToStreamCopy.cs
../../../external/corefx/src/System.Net.Http/src/System/Net/Http/StringContent.cs

View File

@@ -9,4 +9,7 @@ partial class SR
public const string SynchronizedCollectionWrongType1 = "A value of type '{0}' cannot be added to the generic collection, because the collection has been parameterized with a different type.";
public const string SynchronizedCollectionWrongTypeNull = "A null value cannot be added to the generic collection, because the collection has been parameterized with a value type.";
public const string ValueMustBeInRange = "The value of this argument must fall within the range {0} to {1}.";
public const string XmlLangAttributeMissing = "Required xml:lang attribute value is missing.";
public const string InvalidXmlQualifiedName = "Expected XML qualified name, found '{0}'";
public const string UnboundPrefixInQName = "Unbound prefix used in qualified name '{0}'.";
}

View File

@@ -40,8 +40,9 @@ namespace System.ServiceModel.Channels
public static MessageFault CreateFault (Message message, int maxBufferSize)
{
try {
if (message.Version.Envelope == EnvelopeVersion.Soap11)
return CreateFault11 (message, maxBufferSize);
if (message.Version.Envelope == EnvelopeVersion.Soap11) {
return CreateFault11 (message, maxBufferSize);
}
else // common to None and SOAP12
return CreateFault12 (message, maxBufferSize);
} catch (XmlException ex) {
@@ -55,14 +56,14 @@ namespace System.ServiceModel.Channels
FaultReason fr = null;
string actor = null;
XmlDictionaryReader r = message.GetReaderAtBodyContents ();
r.ReadStartElement ("Fault", message.Version.Envelope.Namespace);
fc = ReadFaultCode11 (r, maxBufferSize);
r.MoveToContent ();
while (r.NodeType != XmlNodeType.EndElement) {
switch (r.LocalName) {
case "faultcode":
fc = ReadFaultCode11 (r);
break;
switch (r.LocalName) {
case "faultstring":
fr = new FaultReason (r.ReadElementContentAsString());
break;
@@ -128,26 +129,27 @@ namespace System.ServiceModel.Channels
return new SimpleMessageFault (fc, fr, false, null, null, null, node);
}
static FaultCode ReadFaultCode11 (XmlDictionaryReader r)
// In reference source for soap 1.1, the fault code value is not strictly enforced as per the
// Namespaces in XML spec.
//
// Additionally, the fault sub code is not looked for:
//
// See: https://referencesource.microsoft.com/#System.ServiceModel/System/ServiceModel/Channels/MessageFault.cs,f23a5298fd999b2d
//
static FaultCode ReadFaultCode11 (XmlDictionaryReader reader, int maxBufferSize)
{
FaultCode subcode = null;
XmlQualifiedName value = XmlQualifiedName.Empty;
FaultCode code;
string ns;
string name;
if (r.IsEmptyElement)
throw new ArgumentException ("Fault Code is mandatory in SOAP fault message.");
reader.ReadStartElement ("faultcode", "");
XmlUtil.ReadContentAsQName (reader, out name, out ns);
code = new FaultCode (name, ns);
r.ReadStartElement ("faultcode");
r.MoveToContent ();
while (r.NodeType != XmlNodeType.EndElement) {
if (r.NodeType == XmlNodeType.Element)
subcode = ReadFaultCode11 (r);
else
value = (XmlQualifiedName) r.ReadContentAs (typeof (XmlQualifiedName), r as IXmlNamespaceResolver);
r.MoveToContent ();
}
r.ReadEndElement ();
return new FaultCode (value.Name, value.Namespace, subcode);
reader.ReadEndElement ();
return code;
}
static FaultCode ReadFaultCode12 (XmlDictionaryReader r, string ns)

View File

@@ -912,4 +912,5 @@ System.ServiceModel.Configuration/HttpBindingBaseElement.cs
System.ServiceModel.Configuration/BasicHttpsBindingElement.cs
System.ServiceModel.Configuration/BasicHttpsSecurityElement.cs
System.ServiceModel.Configuration/BasicHttpsBindingCollectionElement.cs
../referencesource/System.ServiceModel/System/ServiceModel/XmlUtil.cs

Some files were not shown because too many files have changed in this diff Show More