Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
backport every fixes from trunk, except for ServiceContractGeneratorT…
…est which

 fails to compile on 2.6 branch.

svn path=/branches/mono-2-6/mcs/; revision=150914
  • Loading branch information
atsushieno committed Feb 5, 2010
1 parent f6aa979 commit 5e148d2
Show file tree
Hide file tree
Showing 69 changed files with 1,207 additions and 443 deletions.
52 changes: 52 additions & 0 deletions mcs/class/System.ServiceModel/ChangeLog
@@ -1,3 +1,55 @@
2010-02-05 Astushi Enomoto <atsushi@ximian.com>

* Dummy_2_1.cs : remove AuthenticationSchemes. It blocks MT support.

2010-02-04 Astushi Enomoto <atsushi@ximian.com>

* Dummy.cs, net_2_1_raw_System.ServiceModel.dll.sources : add some
classes out of dummy, for monotouch (hidden in 2.1 profile).

2010-02-04 Astushi Enomoto <atsushi@ximian.com>

* HTTP_listener_notes.txt: Fixed some wrong description, simplified
some, and updated some.

2010-02-04 Astushi Enomoto <atsushi@ximian.com>

* HTTP_listener_notes.txt: some notes updated.

2010-02-03 Astushi Enomoto <atsushi@ximian.com>

* HTTP_listener_notes.txt: I couldn't help but write about it to
not keep myself confused by this complicated stuff.

2010-01-20 Astushi Enomoto <atsushi@ximian.com>

* System.ServiceModel_test.dll.sources: move back some FeatureBased
tests.

2010-01-18 Astushi Enomoto <atsushi@ximian.com>

* System.ServiceModel.dll.sources : added new security version types.

2010-01-15 Astushi Enomoto <atsushi@ximian.com>

* System.ServiceModel.dll.sources: add SL config loader here
for easy debugging under 2.0 profile.

2010-01-13 Astushi Enomoto <atsushi@ximian.com>

* net_2_1_raw_System.ServiceModel.dll.sources :
add EndpointAddressBuilder.cs.

2010-01-13 Astushi Enomoto <atsushi@ximian.com>

* net_2_1_raw_System.ServiceModel.dll.sources :
add FaultContractInfo.cs.

2010-01-13 Astushi Enomoto <atsushi@ximian.com>

* net_2_1_raw_System.ServiceModel.dll.sources :
add HttpCookieContainerBindingElement.cs.

2010-01-07 Astushi Enomoto <atsushi@ximian.com>

* System.ServiceModel_test.dll.sources : ended up to remove
Expand Down
6 changes: 0 additions & 6 deletions mcs/class/System.ServiceModel/Dummy_2_1.cs
Expand Up @@ -22,8 +22,6 @@ public interface IPolicyExportExtension {}
public interface IPolicyImportExtension {}
public interface IWsdlExportExtension {}
public interface IWsdlImportExtension {}
public interface IEndpointBehavior {}
public interface IOperationBehavior {}
public interface IContractBehavior {}
}
namespace System.ServiceModel.Dispatcher
Expand All @@ -33,10 +31,6 @@ namespace System.ServiceModel.Security
{
class Dummy {}
}
namespace System.Net
{
public enum AuthenticationSchemes {Anonymous}
}
namespace System.Net.Security
{
public enum ProtectionLevel {None}
Expand Down
@@ -1,9 +1,11 @@
//
// System.ServiceModel.AddressHeader.cs
//
// Author: Duncan Mak (duncan@novell.com)
// Authors:
// Duncan Mak (duncan@novell.com)
// Atsushi Enomoto (atsushi@ximian.com)
//
// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
// Copyright (C) 2005,2010 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
Expand All @@ -26,9 +28,11 @@
//

using System;
using System.IO;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Xml;
using System.Xml.Schema;

namespace System.ServiceModel.Channels
{
Expand Down Expand Up @@ -69,10 +73,14 @@ public override bool Equals (object obj)
return o.Name == this.Name && o.Namespace == this.Namespace;
}

[MonoTODO]
public virtual XmlDictionaryReader GetAddressHeaderReader ()
{
throw new NotImplementedException ();
var sw = new StringWriter ();
var s = new XmlWriterSettings () { OmitXmlDeclaration = true };
var xw = XmlDictionaryWriter.CreateDictionaryWriter (XmlWriter.Create (sw, s));
WriteAddressHeader (xw);
xw.Close ();
return XmlDictionaryReader.CreateDictionaryReader (XmlReader.Create (new StringReader (sw.ToString ())));
}

public override int GetHashCode ()
Expand All @@ -87,7 +95,7 @@ public T GetValue<T> ()

public T GetValue<T> (XmlObjectSerializer formatter)
{
throw new NotImplementedException ();
return (T) formatter.ReadObject (GetAddressHeaderReader ());
}

protected abstract void OnWriteAddressHeaderContents (XmlDictionaryWriter writer);
Expand Down Expand Up @@ -151,12 +159,8 @@ internal DefaultAddressHeader (string name, string ns, object value)

internal DefaultAddressHeader (string name, string ns, object value, XmlObjectSerializer formatter)
{
if (formatter == null) {
if (value == null)
formatter = new NetDataContractSerializer ();
else
formatter = new DataContractSerializer (value.GetType ());
}
if (formatter == null)
formatter = value != null ? new DataContractSerializer (value.GetType ()) : null;
this.name = name;
this.ns = ns;
this.formatter = formatter;
Expand All @@ -173,7 +177,10 @@ internal DefaultAddressHeader (string name, string ns, object value, XmlObjectSe

protected override void OnWriteAddressHeaderContents (XmlDictionaryWriter writer)
{
this.formatter.WriteObject (writer, value);
if (value == null)
writer.WriteAttributeString ("i", "nil", "http://www.w3.org/2001/XMLSchema-instance", "true");
else
this.formatter.WriteObject (writer, value);
}
}

Expand Down
Expand Up @@ -150,15 +150,13 @@ public override bool WaitForRequest (TimeSpan timeout)

public override bool WaitForRequest (TimeSpan timeout)
{
Console.WriteLine ("Enter AspNetReplyChannel.WaitForRequest");
if (wait != null)
throw new InvalidOperationException ("Another wait operation is in progress");
try {
wait = new AutoResetEvent (false);
listener.ListenerManager.GetHttpContextAsync (timeout, HttpContextAcquired);
if (wait != null) // in case callback is done before WaitOne() here.
return wait.WaitOne (timeout, false);
Console.WriteLine ("Exit AspNetReplyChannel.WaitForRequest");
return waiting.Count > 0;
} finally {
wait = null;
Expand All @@ -167,7 +165,6 @@ public override bool WaitForRequest (TimeSpan timeout)

void HttpContextAcquired (HttpContextInfo ctx)
{
Console.WriteLine ("Enter HttpContextAcquired: {0}", ctx != null ? ctx.RequestUrl : null);
if (wait == null)
throw new InvalidOperationException ("WaitForRequest operation has not started");
var sctx = (AspNetHttpContextInfo) ctx;
Expand All @@ -176,7 +173,6 @@ void HttpContextAcquired (HttpContextInfo ctx)
var wait_ = wait;
wait = null;
wait_.Set ();
Console.WriteLine ("Exit HttpContextAcquired: {0}", ctx != null ? ctx.RequestUrl : null);
}
}
}
108 changes: 108 additions & 0 deletions mcs/class/System.ServiceModel/System.ServiceModel.Channels/ChangeLog
@@ -1,3 +1,111 @@
2010-02-05 Atsushi Enomoto <atsushi@ximian.com>

* HttpRequestChannel.cs, HttpTransportBindingElement.cs :
enable authentication schemes on monotouch.

2010-02-04 Atsushi Enomoto <atsushi@ximian.com>

* SvcHttpHandler.cs : a wait handle could be used for more than one
requests and hence it sometimes blocked one reply channel. Now
it creates a wait handle for each ASP.NET request so that such
multiple use should not occur. This should fix blocking on
concurrent requests (it indeed fixes as long as I can see).

2010-02-04 Atsushi Enomoto <atsushi@ximian.com>

* AspNetReplyChannel.cs : remove garbage output.

2010-02-04 Atsushi Enomoto <atsushi@ximian.com>

* SvcHttpHandler.cs : Use lock when it tries to create the service
host.

2010-02-02 Atsushi Enomoto <atsushi@ximian.com>

* SvcHttpHandlerFactory.cs : lock when it tries to acquire
HttpHandler.

2010-02-02 Atsushi Enomoto <atsushi@ximian.com>

* HttpListenerManager.cs : add another workaround for blocking
concurrent calls.

2010-02-02 Atsushi Enomoto <atsushi@ximian.com>

* HttpListenerManager.cs : small refactoring.

2010-01-22 Atsushi Enomoto <atsushi@ximian.com>

* TcpDuplexSessionChannel.cs : added a workaround receiver delay
that somehow makes callback client to not cause infinite loop.

2010-01-22 Atsushi Enomoto <atsushi@ximian.com>

* TcpDuplexSessionChannel.cs, PeerDuplexChannel.cs,
DuplexChannelBase.cs : Receive() should rather use TryReceive().
It should not be in reverse order.

2010-01-22 Atsushi Enomoto <atsushi@ximian.com>

* HttpReplyChannel.cs, HttpListenerManager.cs :
Implement async cancellation in the expected manner (though with
some hack). This mostly removed nunit blockers.

2010-01-22 Atsushi Enomoto <atsushi@ximian.com>

* CommunicationObject.cs : fix wrong status changes.

2010-01-20 Atsushi Enomoto <atsushi@ximian.com>

* AddressHeader.cs : XmlSchema.InstanceNamespace didn't exist in 2.1 :(

2010-01-20 Atsushi Enomoto <atsushi@ximian.com>

* AddressHeader.cs : implement remaining bits.
Eliminate dependency on NetDataContractSerializer.

2010-01-20 Atsushi Enomoto <atsushi@ximian.com>

* CommunicationObject.cs : in Fault(), do similar work as previous
change does.

2010-01-19 Atsushi Enomoto <atsushi@ximian.com>

* CommunicationObject.cs : when process state changes, lock the
object to make sure the state transition is valid.
Change OnClosed/OnClosing to do the way OnOpened/OnOpening does.

2010-01-13 Atsushi Enomoto <atsushi@ximian.com>

* MessageHeaders.cs : implement SetAction().

2010-01-13 Atsushi Enomoto <atsushi@ximian.com>

* ChannelFactoryBase.cs : fix build.

2010-01-13 Atsushi Enomoto <atsushi@ximian.com>

* ChannelBase.cs : cosmetic API fix for SL3.

2010-01-13 Atsushi Enomoto <atsushi@ximian.com>

* ChannelFactoryBase.cs :
implement On{Begin/End}Close() on the generic type.

2010-01-13 Atsushi Enomoto <atsushi@ximian.com>

* HttpChannelFactory.cs, TcpChannelFactory.cs,
ChannelFactoryBase.cs, NamedPipeChannelFactory.cs
PeerChannelFactory.cs, HttpRequestChannel.cs:
fix ChannelFactoryBase API; move On(Begin/End)Open() to internal
type and made required changes.

2010-01-13 Atsushi Enomoto <atsushi@ximian.com>

* HttpCookieContainerBindingElement.cs : new.
* IHttpCookieContainer.cs : fix type name.
* HttpRequestChannel.cs, HttpChannelFactory.cs : support above.

2010-01-07 Atsushi Enomoto <atsushi@ximian.com>

* TcpBinaryFrameManager.cs : treat EOF as interrupted stream too (it
Expand Down
Expand Up @@ -69,10 +69,12 @@ protected ChannelBase (ChannelManagerBase manager)
return null;
}

#if !NET_2_1
protected override void OnClosed ()
{
base.OnClosed ();
}
#endif

TimeSpan IDefaultCommunicationTimeouts.CloseTimeout {
get { return DefaultCloseTimeout; }
Expand Down
Expand Up @@ -38,10 +38,31 @@ internal abstract class TransportChannelFactoryBase<TChannel> : ChannelFactoryBa
{
protected TransportChannelFactoryBase (TransportBindingElement source, BindingContext ctx)
{
Source = source;
Transport = source;
}

public TransportBindingElement Source { get; private set; }
public TransportBindingElement Transport { get; private set; }

Action<TimeSpan> open_delegate;

protected override IAsyncResult OnBeginOpen (TimeSpan timeout,
AsyncCallback callback, object state)
{
if (open_delegate == null)
open_delegate = new Action<TimeSpan> (OnOpen);
return open_delegate.BeginInvoke (timeout, callback, state);
}

protected override void OnEndOpen (IAsyncResult result)
{
if (open_delegate == null)
throw new InvalidOperationException ("Async open operation has not started");
open_delegate.EndInvoke (result);
}

protected override void OnOpen (TimeSpan timeout)
{
}
}

public abstract class ChannelFactoryBase<TChannel>
Expand Down Expand Up @@ -97,6 +118,19 @@ protected override void OnClose (TimeSpan timeout)
base.OnClose (timeout - (DateTime.Now - start));
}

protected override IAsyncResult OnBeginClose (TimeSpan timeout, AsyncCallback callback, object state)
{
// base impl. will call this.OnClose()
// FIXME: use async BeginClose/EndClose on the channels.
return base.OnBeginClose (timeout, callback, state);
}

protected override void OnEndClose (IAsyncResult result)
{
// base impl. will call this.OnClose()
base.OnEndClose (result);
}

protected void ValidateCreateChannel ()
{
ThrowIfDisposedOrNotOpen ();
Expand Down Expand Up @@ -150,28 +184,6 @@ protected override void OnAbort ()
// what should we do here?
}

Action<TimeSpan> open_delegate;

protected override IAsyncResult OnBeginOpen (TimeSpan timeout,
AsyncCallback callback, object state)
{
if (open_delegate == null)
open_delegate = new Action<TimeSpan> (OnOpen);
return open_delegate.BeginInvoke (timeout, callback, state);
}

protected override void OnEndOpen (IAsyncResult result)
{
if (open_delegate == null)
throw new InvalidOperationException ("Async open operation has not started");
open_delegate.EndInvoke (result);
}

protected override void OnOpen (TimeSpan timeout)
{
// what should we do here?
}

Action<TimeSpan> close_delegate;

protected override IAsyncResult OnBeginClose (TimeSpan timeout, AsyncCallback callback, object state)
Expand Down

0 comments on commit 5e148d2

Please sign in to comment.