2010-04-28 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Wed, 28 Apr 2010 16:25:01 +0000 (16:25 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Wed, 28 Apr 2010 16:25:01 +0000 (16:25 -0000)
* ChannelDispatcher.cs : add workaround to set ChannelDispatcher
  to IChannelListener. Avoid null ChannelDispatcher in http listener.

* HttpChannelListener.cs, HttpListenerManager.cs :
  Fix NRE issue in olive/samples/wcf/web-http-binding/samplesvc3.exe.

svn path=/trunk/mcs/; revision=156344

mcs/class/System.ServiceModel/System.ServiceModel.Channels/ChangeLog
mcs/class/System.ServiceModel/System.ServiceModel.Channels/HttpChannelListener.cs
mcs/class/System.ServiceModel/System.ServiceModel.Channels/HttpListenerManager.cs
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChangeLog
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChannelDispatcher.cs

index db7b6625f1856eaf04ef9f226cbc695a358ad44c..795def22d504ee8dd1af29368a5102638e8b65c4 100755 (executable)
@@ -1,3 +1,8 @@
+2010-04-28  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * HttpChannelListener.cs, HttpListenerManager.cs :
+         Fix NRE issue in olive/samples/wcf/web-http-binding/samplesvc3.exe.
+
 2010-04-23  Atsushi Enomoto  <atsushi@ximian.com>
 
        * HttpListenerManager.cs : fixed the issue that mex_info is never
index 988d431c508e8402f8023c85f9eca6361bb680ee..9e015dd1ea6c004e1d995f74767dd35c4eff4ac6 100644 (file)
@@ -94,7 +94,12 @@ namespace System.ServiceModel.Channels
                }
        }
 
-       internal abstract class HttpChannelListenerBase<TChannel> : InternalChannelListenerBase<TChannel>
+       internal interface IChannelDispatcherBoundListener
+       {
+               ChannelDispatcher ChannelDispatcher { get; set; }
+       }
+
+       internal abstract class HttpChannelListenerBase<TChannel> : InternalChannelListenerBase<TChannel>, IChannelDispatcherBoundListener
                where TChannel : class, IChannel
        {
                List<TChannel> channels = new List<TChannel> ();
@@ -130,7 +135,7 @@ namespace System.ServiceModel.Channels
                                SecurityTokenManager = new ServiceCredentialsSecurityTokenManager ((ServiceCredentials) context.BindingParameters [typeof (ServiceCredentials)]);
                }
 
-               internal ChannelDispatcher ChannelDispatcher { get; set; }
+               public ChannelDispatcher ChannelDispatcher { get; set; }
 
                public HttpTransportBindingElement Source { get; private set; }
 
index 927ed06c85e1697e8876b41f367e4fa1e8ac04b9..9b430f380900603054b6eca6ff7f450aa30a0a46 100644 (file)
@@ -268,7 +268,7 @@ namespace System.ServiceModel.Channels
                {
                        this.Dispatcher = dispatcher;
                        this.channel_listener = channelListener;
-                       mex_info = Dispatcher.Listener.GetProperty<MetadataPublishingInfo> ();
+                       mex_info = Dispatcher != null ? Dispatcher.Listener.GetProperty<MetadataPublishingInfo> () : null;
                        wsdl_instance = mex_info != null ? mex_info.Instance : null;
                        Source = source;
 
index 820799d28ca4be7050d534007c3f8cb27f65b2bc..ff02acc3da6ff2cd34914ee8ed6ed77939fef026 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-28  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * ChannelDispatcher.cs : add workaround to set ChannelDispatcher
+         to IChannelListener. Avoid null ChannelDispatcher in http listener.
+
 2010-04-20  Atsushi Enomoto  <atsushi@ximian.com>
 
        * OperationInvokerHandler.cs : workaround NRE issue in AsyncCallTest.
index 157c08f6c8e5b26d15cd7fc9ab3022a36ea26eaa..bcb6d075634ea0f2f7a36ae83896d711e0de10ff 100644 (file)
@@ -231,6 +231,9 @@ namespace System.ServiceModel.Dispatcher
                protected internal override void Attach (ServiceHostBase host)
                {
                        this.host = host;
+                       var bl = listener as IChannelDispatcherBoundListener;
+                       if (bl != null)
+                               bl.ChannelDispatcher = this;
                }
 
                public override void CloseInput ()