Imported Upstream version 4.2.1.60
Former-commit-id: 05052d1d7a3a94b0d9ee70461d62b6591e5ab5bc
This commit is contained in:
parent
ea5caba957
commit
bdd40f83c0
@ -84,8 +84,8 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
|
||||
$(top_srcdir)/configure $(am__configure_deps) \
|
||||
$(srcdir)/config.h.in mkinstalldirs \
|
||||
$(srcdir)/mono-uninstalled.pc.in COPYING.LIB ChangeLog NEWS \
|
||||
compile config.guess config.rpath config.sub install-sh \
|
||||
missing ltmain.sh
|
||||
compile config.guess config.rpath config.sub depcomp \
|
||||
install-sh missing ltmain.sh
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/iconv.m4 \
|
||||
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
|
||||
|
@ -183,11 +183,11 @@ Restrict the compiler to use only the features available in C# 3.0
|
||||
Restrict the compiler to use only the features available in C# 4.0
|
||||
specification.
|
||||
.TP
|
||||
.I "future"
|
||||
.I "experimental"
|
||||
Enables unstable features from upcoming versions of the language.
|
||||
.PP
|
||||
Notice that this flag only restricts the language features available to
|
||||
the programmer. A version of produced assemblies can be controled using
|
||||
the programmer. A version of produced assemblies can be controlled using
|
||||
.I SDK
|
||||
option.
|
||||
.ne
|
||||
|
@ -276,6 +276,14 @@ namespace System.Net.Http
|
||||
var headers = wr.Headers;
|
||||
foreach (var header in request.Headers) {
|
||||
var values = header.Value;
|
||||
if (header.Key == "Host") {
|
||||
//
|
||||
// Host must be explicitly set for HttpWebRequest
|
||||
//
|
||||
wr.Host = request.Headers.Host;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (header.Key == "Transfer-Encoding") {
|
||||
// Chunked Transfer-Encoding is never set for HttpWebRequest. It's detected
|
||||
// from ContentLength by HttpWebRequest
|
||||
|
@ -606,6 +606,39 @@ namespace MonoTests.System.Net.Http
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Send_Complete_CustomHeaders_Host ()
|
||||
{
|
||||
bool? failed = null;
|
||||
var listener = CreateListener (l => {
|
||||
var request = l.Request;
|
||||
|
||||
try {
|
||||
Assert.AreEqual ("customhost", request.Headers["Host"], "#1");
|
||||
failed = false;
|
||||
} catch {
|
||||
failed = true;
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
var client = new HttpClient ();
|
||||
|
||||
client.DefaultRequestHeaders.Add("Host", "customhost");
|
||||
|
||||
var request = new HttpRequestMessage (HttpMethod.Get, LocalServer);
|
||||
|
||||
var response = client.SendAsync (request, HttpCompletionOption.ResponseHeadersRead).Result;
|
||||
|
||||
Assert.AreEqual ("", response.Content.ReadAsStringAsync ().Result, "#100");
|
||||
Assert.AreEqual (HttpStatusCode.OK, response.StatusCode, "#101");
|
||||
Assert.AreEqual (false, failed, "#102");
|
||||
} finally {
|
||||
listener.Abort ();
|
||||
listener.Close ();
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Send_Transfer_Encoding_Chunked ()
|
||||
{
|
||||
|
@ -1 +1 @@
|
||||
f8c2f4cb750d69cbda8d81e1312338786dae656f
|
||||
fbc2bff995e010b1e2e97373f5bd7a86db9b7aba
|
@ -60,6 +60,7 @@ namespace System
|
||||
private object m_target;
|
||||
private IntPtr method;
|
||||
private IntPtr delegate_trampoline;
|
||||
private IntPtr rgctx;
|
||||
private IntPtr method_code;
|
||||
private MethodInfo method_info;
|
||||
|
||||
@ -68,6 +69,8 @@ namespace System
|
||||
private MethodInfo original_method_info;
|
||||
|
||||
private DelegateData data;
|
||||
|
||||
private bool method_is_virtual;
|
||||
#pragma warning restore 169, 414, 649
|
||||
#endregion
|
||||
|
||||
@ -103,13 +106,19 @@ namespace System
|
||||
return method_info;
|
||||
} else {
|
||||
if (method != IntPtr.Zero) {
|
||||
method_info = (MethodInfo)MethodBase.GetMethodFromHandleNoGenericCheck (new RuntimeMethodHandle (method));
|
||||
if (!method_is_virtual)
|
||||
method_info = (MethodInfo)MethodBase.GetMethodFromHandleNoGenericCheck (new RuntimeMethodHandle (method));
|
||||
else
|
||||
method_info = GetVirtualMethod_internal ();
|
||||
}
|
||||
return method_info;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImplAttribute (MethodImplOptions.InternalCall)]
|
||||
extern MethodInfo GetVirtualMethod_internal ();
|
||||
|
||||
public object Target {
|
||||
get {
|
||||
return m_target;
|
||||
@ -467,13 +476,15 @@ namespace System
|
||||
return MemberwiseClone ();
|
||||
}
|
||||
|
||||
internal bool Compare (Delegate d)
|
||||
public override bool Equals (object obj)
|
||||
{
|
||||
Delegate d = obj as Delegate;
|
||||
|
||||
if (d == null)
|
||||
return false;
|
||||
|
||||
|
||||
// Do not compare method_ptr, since it can point to a trampoline
|
||||
if (d.m_target == m_target && d.method == method) {
|
||||
if (d.m_target == m_target && d.Method == Method) {
|
||||
if (d.data != null || data != null) {
|
||||
/* Uncommon case */
|
||||
if (d.data != null && data != null)
|
||||
@ -492,14 +503,10 @@ namespace System
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool Equals (object obj)
|
||||
{
|
||||
return Compare (obj as Delegate);
|
||||
}
|
||||
|
||||
public override int GetHashCode ()
|
||||
{
|
||||
return method.GetHashCode () ^ (m_target != null ? m_target.GetHashCode () : 0);
|
||||
/* same implementation as CoreCLR */
|
||||
return GetType ().GetHashCode ();
|
||||
}
|
||||
|
||||
protected virtual MethodInfo GetMethodImpl ()
|
||||
|
@ -57,7 +57,7 @@ namespace System {
|
||||
* of icalls, do not require an increment.
|
||||
*/
|
||||
#pragma warning disable 169
|
||||
private const int mono_corlib_version = 135;
|
||||
private const int mono_corlib_version = 138;
|
||||
#pragma warning restore 169
|
||||
|
||||
[ComVisible (true)]
|
||||
|
@ -361,14 +361,20 @@ namespace MonoTests.System.Reflection
|
||||
|
||||
IList<LocalVariableInfo> locals = mb.LocalVariables;
|
||||
|
||||
// This might break with different compilers etc.
|
||||
Assert.AreEqual (2, locals.Count, "#3");
|
||||
bool foundPinnedBytePointer = false;
|
||||
unsafe {
|
||||
foreach (LocalVariableInfo lvi in locals) {
|
||||
if (lvi.LocalType == typeof (byte[]))
|
||||
// This is optimized out by CSC in .NET 4.6
|
||||
Assert.IsFalse (lvi.IsPinned, "#3-1");
|
||||
|
||||
Assert.IsTrue ((locals [0].LocalType == typeof (byte[])) || (locals [1].LocalType == typeof (byte[])), "#4");
|
||||
if (locals [0].LocalType == typeof (byte[]))
|
||||
Assert.AreEqual (false, locals [0].IsPinned, "#5");
|
||||
else
|
||||
Assert.AreEqual (false, locals [1].IsPinned, "#6");
|
||||
if (/* mcs */ lvi.LocalType == typeof (byte*) || /* csc */ lvi.LocalType == typeof (byte).MakeByRefType ()) {
|
||||
foundPinnedBytePointer = true;
|
||||
Assert.IsTrue (lvi.IsPinned, "#3-2");
|
||||
}
|
||||
}
|
||||
}
|
||||
Assert.IsTrue (foundPinnedBytePointer, "#4");
|
||||
}
|
||||
|
||||
public int return_parameter_test ()
|
||||
@ -804,21 +810,44 @@ namespace MonoTests.System.Reflection
|
||||
var type = typeof (GenericClass<>).GetMethod("Method").GetMethodBody().LocalVariables[0].LocalType;
|
||||
Assert.AreEqual (typeofT, type);
|
||||
Assert.AreEqual (typeof (GenericClass<>), type.DeclaringType);
|
||||
|
||||
bool foundTypeOfK = false;
|
||||
bool foundExpectedType = false;
|
||||
|
||||
MethodBody mb = typeof (GenericClass<>).GetMethod("Method2").GetMethodBody();
|
||||
foreach (LocalVariableInfo lvi in mb.LocalVariables) {
|
||||
if (lvi.LocalType == typeofK) {
|
||||
foundTypeOfK = true;
|
||||
Assert.AreEqual (typeof (GenericClass<>), lvi.LocalType.DeclaringType, "#1-1");
|
||||
} else if (lvi.LocalType == typeofT) {
|
||||
foundExpectedType = true;
|
||||
Assert.AreEqual (typeof (GenericClass<>), lvi.LocalType.DeclaringType, "#1-2");
|
||||
}
|
||||
}
|
||||
|
||||
type = typeof (GenericClass<>).GetMethod("Method2").GetMethodBody().LocalVariables[0].LocalType;
|
||||
Assert.AreEqual (typeofT, type);
|
||||
Assert.AreEqual (typeof (GenericClass<>), type.DeclaringType);
|
||||
|
||||
type = typeof (GenericClass<>).GetMethod("Method2").GetMethodBody().LocalVariables[1].LocalType;
|
||||
Assert.AreEqual (typeofK, type);
|
||||
Assert.AreEqual (typeof (GenericClass<>), type.DeclaringType);
|
||||
|
||||
type = typeof (GenericClass<int>).GetMethod("Method2").GetMethodBody().LocalVariables[0].LocalType;
|
||||
Assert.AreEqual (typeof (int), type);
|
||||
|
||||
type = typeof (GenericClass<int>).GetMethod("Method2").GetMethodBody().LocalVariables[1].LocalType;
|
||||
Assert.AreEqual (typeofK, type);
|
||||
Assert.AreEqual (typeof (GenericClass<>), type.DeclaringType);
|
||||
Assert.IsTrue (foundTypeOfK, "#1-3");
|
||||
if (mb.LocalVariables.Count < 2)
|
||||
Assert.Ignore ("Code built in release mode - 'T var0' optmized out");
|
||||
else
|
||||
Assert.IsTrue (foundExpectedType, "#1-4");
|
||||
|
||||
foundTypeOfK = false;
|
||||
foundExpectedType = false;
|
||||
mb = typeof (GenericClass<int>).GetMethod("Method2").GetMethodBody();
|
||||
foreach (LocalVariableInfo lvi in mb.LocalVariables) {
|
||||
if (lvi.LocalType == typeofK) {
|
||||
foundTypeOfK = true;
|
||||
Assert.AreEqual (typeof (GenericClass<>), lvi.LocalType.DeclaringType, "#2-1");
|
||||
} else if (lvi.LocalType == typeof (int)) {
|
||||
foundExpectedType = true;
|
||||
}
|
||||
}
|
||||
|
||||
Assert.IsTrue (foundTypeOfK, "#2-3");
|
||||
if (mb.LocalVariables.Count < 2)
|
||||
Assert.Ignore ("Code built in release mode - 'int var0' optmized out");
|
||||
else
|
||||
Assert.IsTrue (foundExpectedType, "#2-4");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
0240ebb4d2659b40f56c66a63819f414a5d9df62
|
||||
1fdb613e86f18f2b9886f4967a0bdc43f79fef7e
|
@ -1 +1 @@
|
||||
cb7dc0666856e54db03e68c589fc978dd269c5f3
|
||||
70d97fe10dc6037275080996eac59af0d68e1561
|
@ -1 +1 @@
|
||||
b341b2406947158e34dcfde3e0e842d2f8f45366
|
||||
06bd1619ad328b5c34a59a366c095894e50efd56
|
@ -1 +1 @@
|
||||
e69df203c4e52e18dafc6255ea6247008eecfadb
|
||||
5b9fdc62b8f41a0b32a323e04f253e4de34cd483
|
@ -1 +1 @@
|
||||
cfddc735dcaad9c8ee6f62802c7b870328e6d9e7
|
||||
a6fc9a5ca70542579710af7ccfbd377501d45c30
|
15
mcs/errors/cs0023-26.cs
Normal file
15
mcs/errors/cs0023-26.cs
Normal file
@ -0,0 +1,15 @@
|
||||
// CS0023: The `?' operator cannot be applied to operand of type `method group'
|
||||
// Line: 14
|
||||
|
||||
class X
|
||||
{
|
||||
void Test ()
|
||||
{
|
||||
}
|
||||
|
||||
public static void Main ()
|
||||
{
|
||||
X x = null;
|
||||
System.Action n = x?.Test;
|
||||
}
|
||||
}
|
@ -189,7 +189,7 @@ namespace Mono.CSharp
|
||||
|
||||
TryWithCatchScope = 1 << 15,
|
||||
|
||||
ConditionalAccessReceiver = 1 << 16,
|
||||
DontSetConditionalAccessReceiver = 1 << 16,
|
||||
|
||||
///
|
||||
/// Indicates the current context is in probing mode, no errors are reported.
|
||||
|
@ -457,7 +457,6 @@ namespace Mono.CSharp {
|
||||
//
|
||||
public abstract class DelegateCreation : Expression, OverloadResolver.IErrorHandler
|
||||
{
|
||||
bool conditional_access_receiver;
|
||||
protected MethodSpec constructor_method;
|
||||
protected MethodGroupExpr method_group;
|
||||
|
||||
@ -520,25 +519,25 @@ namespace Mono.CSharp {
|
||||
return e.CreateExpressionTree (ec);
|
||||
}
|
||||
|
||||
void ResolveConditionalAccessReceiver (ResolveContext rc)
|
||||
{
|
||||
// LAMESPEC: Not sure why this is explicitly disalloed with very odd error message
|
||||
if (!rc.HasSet (ResolveContext.Options.DontSetConditionalAccessReceiver) && method_group.HasConditionalAccess ()) {
|
||||
Error_OperatorCannotBeApplied (rc, loc, "?", method_group.Type);
|
||||
}
|
||||
}
|
||||
|
||||
protected override Expression DoResolve (ResolveContext ec)
|
||||
{
|
||||
constructor_method = Delegate.GetConstructor (type);
|
||||
|
||||
var invoke_method = Delegate.GetInvokeMethod (type);
|
||||
|
||||
if (!ec.HasSet (ResolveContext.Options.ConditionalAccessReceiver)) {
|
||||
if (method_group.HasConditionalAccess ()) {
|
||||
conditional_access_receiver = true;
|
||||
ec.Set (ResolveContext.Options.ConditionalAccessReceiver);
|
||||
}
|
||||
}
|
||||
ResolveConditionalAccessReceiver (ec);
|
||||
|
||||
Arguments arguments = CreateDelegateMethodArguments (ec, invoke_method.Parameters, invoke_method.Parameters.Types, loc);
|
||||
method_group = method_group.OverloadResolve (ec, ref arguments, this, OverloadResolver.Restrictions.CovariantDelegate);
|
||||
|
||||
if (conditional_access_receiver)
|
||||
ec.With (ResolveContext.Options.ConditionalAccessReceiver, false);
|
||||
|
||||
if (method_group == null)
|
||||
return null;
|
||||
|
||||
@ -594,9 +593,6 @@ namespace Mono.CSharp {
|
||||
|
||||
public override void Emit (EmitContext ec)
|
||||
{
|
||||
if (conditional_access_receiver)
|
||||
ec.ConditionalAccess = new ConditionalAccessContext (type, ec.DefineLabel ());
|
||||
|
||||
if (method_group.InstanceExpression == null) {
|
||||
ec.EmitNull ();
|
||||
} else {
|
||||
@ -615,20 +611,12 @@ namespace Mono.CSharp {
|
||||
}
|
||||
|
||||
ec.Emit (OpCodes.Newobj, constructor_method);
|
||||
|
||||
if (conditional_access_receiver)
|
||||
ec.CloseConditionalAccess (null);
|
||||
}
|
||||
|
||||
public override void FlowAnalysis (FlowAnalysisContext fc)
|
||||
{
|
||||
var da = conditional_access_receiver ? fc.BranchDefiniteAssignment () : null;
|
||||
|
||||
base.FlowAnalysis (fc);
|
||||
method_group.FlowAnalysis (fc);
|
||||
|
||||
if (conditional_access_receiver)
|
||||
fc.DefiniteAssignment = da;
|
||||
}
|
||||
|
||||
void Error_ConversionFailed (ResolveContext ec, MethodSpec method, Expression return_type)
|
||||
|
@ -1 +1 @@
|
||||
38d317979f9db73620faf65c9a701a808c9b17ef
|
||||
4225b585eea7227c7a3a236f80f3f28a3dd9919b
|
@ -1 +1 @@
|
||||
c4b5db38d37bc3d4db203452efe5a88099ddf0da
|
||||
acdcf32485d622ab24dcb505dba5e58729d82483
|
@ -1561,7 +1561,7 @@ namespace Mono.CSharp {
|
||||
" -help Lists all compiler options (short: -?)\n" +
|
||||
" -keycontainer:NAME The key pair container used to sign the output assembly\n" +
|
||||
" -keyfile:FILE The key file used to strongname the ouput assembly\n" +
|
||||
" -langversion:TEXT Specifies language version: ISO-1, ISO-2, 3, 4, 5, Default or Future\n" +
|
||||
" -langversion:TEXT Specifies language version: ISO-1, ISO-2, 3, 4, 5, Default or Experimental\n" +
|
||||
" -lib:PATH1[,PATHn] Specifies the location of referenced assemblies\n" +
|
||||
" -main:CLASS Specifies the class with the Main method (short: -m)\n" +
|
||||
" -noconfig Disables implicitly referenced assemblies\n" +
|
||||
|
@ -1,14 +0,0 @@
|
||||
using System;
|
||||
|
||||
public class D
|
||||
{
|
||||
void Foo ()
|
||||
{
|
||||
}
|
||||
|
||||
public static void Main()
|
||||
{
|
||||
D d = null;
|
||||
Action a = d?.Foo;
|
||||
}
|
||||
}
|
@ -1 +1 @@
|
||||
fae778dd6cbda23f819c138a80c2bb28d051aac3
|
||||
4a970c00528488693bba23a5f9eda9b860437527
|
@ -733,7 +733,7 @@ int _wapi_setsockopt(guint32 fd, int level, int optname,
|
||||
socklen_t type_len = sizeof (type);
|
||||
|
||||
if (!getsockopt (fd, level, SO_TYPE, &type, &type_len)) {
|
||||
if (type == SOCK_DGRAM)
|
||||
if (type == SOCK_DGRAM || type == SOCK_STREAM)
|
||||
setsockopt (fd, level, SO_REUSEPORT, tmp_val, optlen);
|
||||
}
|
||||
}
|
||||
|
@ -79,7 +79,7 @@
|
||||
* Changes which are already detected at runtime, like the addition
|
||||
* of icalls, do not require an increment.
|
||||
*/
|
||||
#define MONO_CORLIB_VERSION 135
|
||||
#define MONO_CORLIB_VERSION 138
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -1 +1 @@
|
||||
7d7b7588e7dae77ee43323197a1e31c9ad6c5adb
|
||||
20306b572ddc8e866c948eb5b022acbe9c68f920
|
@ -152,6 +152,7 @@ ICALL(DECIMAL_13, "ToSingle", mono_decimal_to_float)
|
||||
ICALL_TYPE(DELEGATE, "System.Delegate", DELEGATE_1)
|
||||
ICALL(DELEGATE_1, "AllocDelegateLike_internal", ves_icall_System_Delegate_AllocDelegateLike_internal)
|
||||
ICALL(DELEGATE_2, "CreateDelegate_internal", ves_icall_System_Delegate_CreateDelegate_internal)
|
||||
ICALL(DELEGATE_3, "GetVirtualMethod_internal", ves_icall_System_Delegate_GetVirtualMethod_internal)
|
||||
|
||||
ICALL_TYPE(DEBUGR, "System.Diagnostics.Debugger", DEBUGR_1)
|
||||
ICALL(DEBUGR_1, "IsAttached_internal", ves_icall_System_Diagnostics_Debugger_IsAttached_internal)
|
||||
|
@ -1 +1 @@
|
||||
675ead03dec528ee6fee4a68520415fdec68cf9f
|
||||
6ebd10e41823c4ad8b8b55803384746f3d58e7ce
|
@ -778,6 +778,7 @@ struct _MonoDelegate {
|
||||
MonoObject *target;
|
||||
MonoMethod *method;
|
||||
gpointer delegate_trampoline;
|
||||
gpointer rgctx;
|
||||
/*
|
||||
* If non-NULL, this points to a memory location which stores the address of
|
||||
* the compiled code of the method, or NULL if it is not yet compiled.
|
||||
@ -786,6 +787,7 @@ struct _MonoDelegate {
|
||||
MonoReflectionMethod *method_info;
|
||||
MonoReflectionMethod *original_method_info;
|
||||
MonoObject *data;
|
||||
MonoBoolean method_is_virtual;
|
||||
};
|
||||
|
||||
typedef struct _MonoMulticastDelegate MonoMulticastDelegate;
|
||||
|
@ -71,6 +71,7 @@ DECL_OFFSET(MonoDelegate, method_ptr)
|
||||
DECL_OFFSET(MonoDelegate, invoke_impl)
|
||||
DECL_OFFSET(MonoDelegate, method)
|
||||
DECL_OFFSET(MonoDelegate, method_code)
|
||||
DECL_OFFSET(MonoDelegate, method_is_virtual)
|
||||
|
||||
DECL_OFFSET(MonoInternalThread, tid)
|
||||
DECL_OFFSET(MonoInternalThread, small_id)
|
||||
|
@ -1,24 +1,5 @@
|
||||
|
||||
#if defined(HAVE_POLL)
|
||||
|
||||
#if defined(HAVE_POLL_H)
|
||||
#include <poll.h>
|
||||
#elif defined(HAVE_SYS_POLL_H)
|
||||
#include <sys/poll.h>
|
||||
#endif
|
||||
|
||||
typedef struct pollfd mono_pollfd;
|
||||
|
||||
#elif defined(HOST_WIN32)
|
||||
|
||||
#include "mswsock.h"
|
||||
|
||||
typedef WSAPOLLFD mono_pollfd;
|
||||
|
||||
#else
|
||||
/* poll is not defined */
|
||||
#error
|
||||
#endif
|
||||
#include "utils/mono-poll.h"
|
||||
|
||||
static mono_pollfd *poll_fds;
|
||||
static guint poll_fds_capacity;
|
||||
@ -42,7 +23,7 @@ poll_init (gint wakeup_pipe_fd)
|
||||
|
||||
poll_fds = g_new0 (mono_pollfd, poll_fds_capacity);
|
||||
|
||||
POLL_INIT_FD (&poll_fds [0], wakeup_pipe_fd, POLLIN);
|
||||
POLL_INIT_FD (&poll_fds [0], wakeup_pipe_fd, MONO_POLLIN);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -66,9 +47,9 @@ poll_register_fd (gint fd, gint events, gboolean is_new)
|
||||
|
||||
poll_event = 0;
|
||||
if (events & EVENT_IN)
|
||||
poll_event |= POLLIN;
|
||||
poll_event |= MONO_POLLIN;
|
||||
if (events & EVENT_OUT)
|
||||
poll_event |= POLLOUT;
|
||||
poll_event |= MONO_POLLOUT;
|
||||
|
||||
for (i = 0; i < poll_fds_size; ++i) {
|
||||
if (poll_fds [i].fd == fd) {
|
||||
@ -128,6 +109,36 @@ poll_remove_fd (gint fd)
|
||||
poll_fds_size -= 1;
|
||||
}
|
||||
|
||||
static inline gint
|
||||
poll_mark_bad_fds (mono_pollfd *poll_fds, gint poll_fds_size)
|
||||
{
|
||||
gint i, ready = 0;
|
||||
|
||||
for (i = 0; i < poll_fds_size; i++) {
|
||||
if (poll_fds [i].fd == -1)
|
||||
continue;
|
||||
|
||||
switch (mono_poll (&poll_fds [i], 1, 0)) {
|
||||
case 1:
|
||||
ready++;
|
||||
break;
|
||||
case -1:
|
||||
#if !defined(HOST_WIN32)
|
||||
if (errno == EBADF)
|
||||
#else
|
||||
if (WSAGetLastError () == WSAEBADF)
|
||||
#endif
|
||||
{
|
||||
poll_fds [i].revents |= MONO_POLLNVAL;
|
||||
ready++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return ready;
|
||||
}
|
||||
|
||||
static gint
|
||||
poll_event_wait (void (*callback) (gint fd, gint events, gpointer user_data), gpointer user_data)
|
||||
{
|
||||
@ -138,13 +149,7 @@ poll_event_wait (void (*callback) (gint fd, gint events, gpointer user_data), gp
|
||||
|
||||
mono_gc_set_skip_thread (TRUE);
|
||||
|
||||
#if !defined(HOST_WIN32)
|
||||
ready = poll (poll_fds, poll_fds_size, -1);
|
||||
#else
|
||||
ready = WSAPoll(poll_fds, poll_fds_size, -1);
|
||||
if (ready == SOCKET_ERROR)
|
||||
ready = -1;
|
||||
#endif
|
||||
ready = mono_poll (poll_fds, poll_fds_size, -1);
|
||||
|
||||
mono_gc_set_skip_thread (FALSE);
|
||||
|
||||
@ -178,6 +183,15 @@ poll_event_wait (void (*callback) (gint fd, gint events, gpointer user_data), gp
|
||||
ready = 0;
|
||||
break;
|
||||
}
|
||||
#if !defined(HOST_WIN32)
|
||||
case EBADF:
|
||||
#else
|
||||
case WSAEBADF:
|
||||
#endif
|
||||
{
|
||||
ready = poll_mark_bad_fds (poll_fds, poll_fds_size);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
#if !defined(HOST_WIN32)
|
||||
g_error ("poll_event_wait: mono_poll () failed, error (%d) %s", errno, g_strerror (errno));
|
||||
@ -200,10 +214,12 @@ poll_event_wait (void (*callback) (gint fd, gint events, gpointer user_data), gp
|
||||
continue;
|
||||
|
||||
fd = poll_fds [i].fd;
|
||||
if (poll_fds [i].revents & (POLLIN | POLLERR | POLLHUP | POLLNVAL))
|
||||
if (poll_fds [i].revents & (MONO_POLLIN | MONO_POLLERR | MONO_POLLHUP | MONO_POLLNVAL))
|
||||
events |= EVENT_IN;
|
||||
if (poll_fds [i].revents & (POLLOUT | POLLERR | POLLHUP | POLLNVAL))
|
||||
if (poll_fds [i].revents & (MONO_POLLOUT | MONO_POLLERR | MONO_POLLHUP | MONO_POLLNVAL))
|
||||
events |= EVENT_OUT;
|
||||
if (poll_fds [i].revents & (MONO_POLLERR | MONO_POLLHUP | MONO_POLLNVAL))
|
||||
events |= EVENT_ERR;
|
||||
|
||||
callback (fd, events, user_data);
|
||||
|
||||
|
@ -40,6 +40,7 @@ typedef struct {
|
||||
enum {
|
||||
EVENT_IN = 1 << 0,
|
||||
EVENT_OUT = 1 << 1,
|
||||
EVENT_ERR = 1 << 2,
|
||||
} ThreadPoolIOEvent;
|
||||
|
||||
#include "threadpool-ms-io-epoll.c"
|
||||
@ -289,12 +290,13 @@ wait_callback (gint fd, gint events, gpointer user_data)
|
||||
MonoGHashTable *states;
|
||||
MonoMList *list = NULL;
|
||||
gpointer k;
|
||||
gboolean remove_fd = FALSE;
|
||||
|
||||
g_assert (user_data);
|
||||
states = user_data;
|
||||
|
||||
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_THREADPOOL, "io threadpool: cal fd %3d, events = %2s | %2s",
|
||||
fd, (events & EVENT_IN) ? "RD" : "..", (events & EVENT_OUT) ? "WR" : "..");
|
||||
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_THREADPOOL, "io threadpool: cal fd %3d, events = %2s | %2s | %3s",
|
||||
fd, (events & EVENT_IN) ? "RD" : "..", (events & EVENT_OUT) ? "WR" : "..", (events & EVENT_ERR) ? "ERR" : "...");
|
||||
|
||||
if (!mono_g_hash_table_lookup_extended (states, GINT_TO_POINTER (fd), &k, (gpointer*) &list))
|
||||
g_error ("wait_callback: fd %d not found in states table", fd);
|
||||
@ -310,14 +312,23 @@ wait_callback (gint fd, gint events, gpointer user_data)
|
||||
mono_threadpool_ms_enqueue_work_item (((MonoObject*) sockares)->vtable->domain, (MonoObject*) sockares);
|
||||
}
|
||||
|
||||
mono_g_hash_table_replace (states, GINT_TO_POINTER (fd), list);
|
||||
remove_fd = (events & EVENT_ERR) == EVENT_ERR;
|
||||
if (!remove_fd) {
|
||||
mono_g_hash_table_replace (states, GINT_TO_POINTER (fd), list);
|
||||
|
||||
events = get_events (list);
|
||||
events = get_events (list);
|
||||
|
||||
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_THREADPOOL, "io threadpool: res fd %3d, events = %2s | %2s",
|
||||
fd, (events & EVENT_IN) ? "RD" : "..", (events & EVENT_OUT) ? "WR" : "..");
|
||||
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_THREADPOOL, "io threadpool: res fd %3d, events = %2s | %2s | %2s",
|
||||
fd, (events & EVENT_IN) ? "RD" : "..", (events & EVENT_OUT) ? "WR" : "..", (events & EVENT_ERR) ? "ERR" : "...");
|
||||
|
||||
threadpool_io->backend.register_fd (fd, events, FALSE);
|
||||
threadpool_io->backend.register_fd (fd, events, FALSE);
|
||||
} else {
|
||||
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_THREADPOOL, "io threadpool: err fd %d", fd);
|
||||
|
||||
mono_g_hash_table_remove (states, GINT_TO_POINTER (fd));
|
||||
|
||||
threadpool_io->backend.remove_fd (fd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -367,8 +378,8 @@ selector_thread (gpointer data)
|
||||
|
||||
events = get_events (list);
|
||||
|
||||
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_THREADPOOL, "io threadpool: %3s fd %3d, events = %2s | %2s",
|
||||
exists ? "mod" : "add", fd, (events & EVENT_IN) ? "RD" : "..", (events & EVENT_OUT) ? "WR" : "..");
|
||||
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_THREADPOOL, "io threadpool: %3s fd %3d, events = %2s | %2s | %2s",
|
||||
exists ? "mod" : "add", fd, (events & EVENT_IN) ? "RD" : "..", (events & EVENT_OUT) ? "WR" : "..", (events & EVENT_ERR) ? "ERR" : "...");
|
||||
|
||||
threadpool_io->backend.register_fd (fd, events, !exists);
|
||||
|
||||
|
@ -749,7 +749,7 @@ EXTRA_DIST = TestDriver.cs \
|
||||
Makefile.am.in
|
||||
|
||||
version.h: Makefile
|
||||
echo "#define FULL_VERSION \"Stable 4.2.1.36/dbd6429\"" > version.h
|
||||
echo "#define FULL_VERSION \"Stable 4.2.1.60/804ddbc\"" > version.h
|
||||
|
||||
# Utility target for patching libtool to speed up linking
|
||||
patch-libtool:
|
||||
|
@ -749,7 +749,7 @@ EXTRA_DIST = TestDriver.cs \
|
||||
Makefile.am.in
|
||||
|
||||
version.h: Makefile
|
||||
echo "#define FULL_VERSION \"Stable 4.2.1.36/dbd6429\"" > version.h
|
||||
echo "#define FULL_VERSION \"Stable 4.2.1.60/804ddbc\"" > version.h
|
||||
|
||||
# Utility target for patching libtool to speed up linking
|
||||
patch-libtool:
|
||||
|
@ -1 +1 @@
|
||||
c65a3a960c9fab0078aaf2bc05b202ec039553a6
|
||||
080f9cc654f5abb2d7030948dfd47427b8979777
|
@ -1 +1 @@
|
||||
55b292ac8dd94a1c3eeb3d05962d2d9a30b1808f
|
||||
0458c47551638425b42b9b304999eab0ae33938f
|
@ -1 +1 @@
|
||||
8901046041bb65808a7d99cb9b185596c7be01c5
|
||||
24b171b7d02edaa3d317cb6d27de214a3e476267
|
@ -1 +1 @@
|
||||
8b14d1f670c108df89e59f0ab80f793a259597e1
|
||||
b4605733bb4bb4fa16d13db526cb439680307bba
|
@ -1 +1 @@
|
||||
1cbbf289bd0e3394b2850dfd3d558327f35ec6cc
|
||||
7c01d8b67d92f0bebbdeff1c929e982a99b7d3bb
|
@ -1 +1 @@
|
||||
#define FULL_VERSION "Stable 4.2.1.36/dbd6429"
|
||||
#define FULL_VERSION "Stable 4.2.1.60/804ddbc"
|
||||
|
@ -1 +1 @@
|
||||
549a7cf0c9085eb4b819e7233c09a5a5fedb2835
|
||||
dfcf6b34bb42b054c3aad0c16e51798401f02028
|
@ -25,6 +25,7 @@
|
||||
load/unload/name for assemblies
|
||||
removed TYPE_LOAD_ERR flag (profiler never generated it, now removed from the format itself)
|
||||
added TYPE_GC_HANDLE_{CREATED,DESTROYED}_BT
|
||||
TYPE_JIT events are no longer guaranteed to have code start/size info (can be zero)
|
||||
*/
|
||||
|
||||
enum {
|
||||
|
@ -181,6 +181,7 @@ BASE_TEST_CS_SRC= \
|
||||
delegate9.cs \
|
||||
delegate10.cs \
|
||||
delegate11.cs \
|
||||
delegate12.cs \
|
||||
remoting1.cs \
|
||||
remoting2.cs \
|
||||
remoting3.cs \
|
||||
|
@ -600,6 +600,7 @@ BASE_TEST_CS_SRC = \
|
||||
delegate9.cs \
|
||||
delegate10.cs \
|
||||
delegate11.cs \
|
||||
delegate12.cs \
|
||||
remoting1.cs \
|
||||
remoting2.cs \
|
||||
remoting3.cs \
|
||||
|
73
mono/tests/delegate12.cs
Normal file
73
mono/tests/delegate12.cs
Normal file
@ -0,0 +1,73 @@
|
||||
using System;
|
||||
|
||||
class MainClass
|
||||
{
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
DerivedClass o = new DerivedClass();
|
||||
|
||||
Func<string> del1 = GetDel1 (o);
|
||||
Func<string> del2 = GetDel2 (o);
|
||||
|
||||
|
||||
Console.WriteLine("Action\n======\nReflected type: {0}\nDeclaring type: {1}\nAttributes: {2}\nResult: {3}",
|
||||
del1.Method.ReflectedType, del1.Method.DeclaringType, del1.Method.Attributes, del1 ());
|
||||
|
||||
Console.WriteLine ();
|
||||
|
||||
Console.WriteLine("Delegate\n========\nReflected type: {0}\nDeclaring type: {1}\nAttributes: {2}\nResult: {3}",
|
||||
del2.Method.ReflectedType, del2.Method.DeclaringType, del2.Method.Attributes, del2 ());
|
||||
|
||||
if (del1.Method.ReflectedType != typeof (DerivedClass))
|
||||
return 10;
|
||||
if (del1.Method.DeclaringType != typeof (DerivedClass))
|
||||
return 11;
|
||||
if (del1 () != "Derived method")
|
||||
return 12;
|
||||
|
||||
if (del2.Method.ReflectedType != typeof (DerivedClass))
|
||||
return 20;
|
||||
if (del2.Method.DeclaringType != typeof (DerivedClass))
|
||||
return 21;
|
||||
if (del2 () != "Derived method")
|
||||
return 22;
|
||||
|
||||
if (!del1.Equals (del2))
|
||||
return 30;
|
||||
if (!del2.Equals (del1))
|
||||
return 31;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Func<string> GetDel1 (DerivedClass o)
|
||||
{
|
||||
return o.GetMethod();
|
||||
}
|
||||
|
||||
static Func<string> GetDel2 (DerivedClass o)
|
||||
{
|
||||
return (Func<string>) Delegate.CreateDelegate(typeof(Func<string>), o, o.GetMethod().Method);
|
||||
}
|
||||
}
|
||||
|
||||
class BaseClass
|
||||
{
|
||||
public Func<string> GetMethod()
|
||||
{
|
||||
return MyMethod;
|
||||
}
|
||||
|
||||
public virtual string MyMethod()
|
||||
{
|
||||
return "Base method";
|
||||
}
|
||||
}
|
||||
|
||||
class DerivedClass : BaseClass
|
||||
{
|
||||
public override string MyMethod()
|
||||
{
|
||||
return "Derived method";
|
||||
}
|
||||
}
|
@ -97,9 +97,8 @@ mono_network_get_data (char* name, MonoNetworkData data, MonoNetworkError *error
|
||||
|
||||
char *ptr;
|
||||
buf [sizeof (buf) - 1] = 0;
|
||||
/* FIXME: This might potentially cause a buffer overflow for cname. */
|
||||
if ((ptr = strchr (buf, ':')) == NULL ||
|
||||
(*ptr++ = 0, sscanf (buf, "%s", cname) != 1))
|
||||
(*ptr++ = 0, sscanf (buf, "%250s", cname) != 1))
|
||||
goto out;
|
||||
|
||||
if (strcmp (name, cname) != 0) continue;
|
||||
|
@ -422,7 +422,7 @@ mono_threads_unregister_current_thread (MonoThreadInfo *info)
|
||||
MonoThreadInfo*
|
||||
mono_thread_info_current_unchecked (void)
|
||||
{
|
||||
return thread_info_key ? (MonoThreadInfo*)mono_native_tls_get_value (thread_info_key) : NULL;
|
||||
return mono_threads_inited ? (MonoThreadInfo*)mono_native_tls_get_value (thread_info_key) : NULL;
|
||||
}
|
||||
|
||||
|
||||
@ -579,8 +579,6 @@ mono_threads_init (MonoThreadInfoCallbacks *callbacks, size_t info_size)
|
||||
res = mono_native_tls_alloc (&thread_exited_key, (void *) thread_exited_dtor);
|
||||
#endif
|
||||
|
||||
g_assert (thread_info_key);
|
||||
|
||||
g_assert (res);
|
||||
|
||||
#ifndef HAVE_KW_THREAD
|
||||
|
BIN
po/mcs/de.gmo
BIN
po/mcs/de.gmo
Binary file not shown.
@ -1 +1 @@
|
||||
f131d269bff942dba1b5d8de0cb40c8be0f08b12
|
||||
b75dfdb860929f1f54efefc462287a9efaa4d642
|
BIN
po/mcs/es.gmo
BIN
po/mcs/es.gmo
Binary file not shown.
@ -1 +1 @@
|
||||
e95a38693d93dba730e8a8aedea4702be73483d4
|
||||
1c98958bcd4cb878860930dc7f4aae05a6f4e48e
|
BIN
po/mcs/ja.gmo
BIN
po/mcs/ja.gmo
Binary file not shown.
@ -1 +1 @@
|
||||
9b90d6522bbeebffd1042749a032a29d5d81265d
|
||||
c4ca0fdff467e7a69c3da9737d49025f96868a34
|
344
po/mcs/mcs.pot
344
po/mcs/mcs.pot
File diff suppressed because it is too large
Load Diff
BIN
po/mcs/pt_BR.gmo
BIN
po/mcs/pt_BR.gmo
Binary file not shown.
@ -1 +1 @@
|
||||
041a3348d42766d063aa488a09698ad0f3029a26
|
||||
0e40af127109b02fbd5bb5af7859cc05846654b9
|
@ -1170,6 +1170,7 @@ namespace Mono.Tools.LocaleBuilder
|
||||
// .net has incorrect separators for some countries and we want to be compatible
|
||||
switch (ci.Name) {
|
||||
case "es-ES":
|
||||
case "es":
|
||||
// es-ES does not have group separator but .net has '.'
|
||||
value = ".";
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user