Преглед изворни кода

2009-05-18 Atsushi Enomoto <[email protected]>

	* ErrorProcessingHandler.cs, InputOrReplyRequestProcessor.cs :
	  they also premise request-reply channel and broke duplex channels.


svn path=/trunk/mcs/; revision=134319
Atsushi Eno пре 16 година
родитељ
комит
af538f251c

+ 5 - 0
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChangeLog

@@ -1,3 +1,8 @@
+2009-05-18  Atsushi Enomoto  <[email protected]>
+
+	* ErrorProcessingHandler.cs, InputOrReplyRequestProcessor.cs :
+	  they also premise request-reply channel and broke duplex channels.
+
 2009-05-13  Atsushi Enomoto  <[email protected]>
 
 	* ChannelDispatcher.cs : open channel before using it.

+ 11 - 1
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ErrorProcessingHandler.cs

@@ -8,6 +8,13 @@ namespace System.ServiceModel.Dispatcher
 {
 	internal class ErrorProcessingHandler : BaseRequestProcessorHandler
 	{
+		public ErrorProcessingHandler (IChannel channel)
+		{
+			duplex = channel as IDuplexChannel;
+		}
+
+		IDuplexChannel duplex;
+
 		protected override bool ProcessRequest (MessageProcessingContext mrc)
 		{
 			Exception ex = mrc.ProcessingException;
@@ -24,7 +31,10 @@ namespace System.ServiceModel.Dispatcher
 			if (!fc.TryCreateFaultMessage (ex, out res))
 				throw ex;
 			mrc.ReplyMessage = res;
-			mrc.Reply (true);
+			if (duplex != null)
+				mrc.Reply (duplex, true);
+			else
+				mrc.Reply (true);
 			return false;
 		}		
 	}

+ 1 - 1
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/InputOrReplyRequestProcessor.cs

@@ -27,7 +27,7 @@ namespace System.ServiceModel.Dispatcher
 							AddHandler(new ReplyHandler (replyOrInput));
 
 			//errors
-			ErrorChain.AddHandler (new ErrorProcessingHandler ());
+			ErrorChain.AddHandler (new ErrorProcessingHandler (replyOrInput));
 
 			//finalize
 			FinalizationChain.AddHandler (new FinalizeProcessingHandler ());