Pārlūkot izejas kodu

2009-07-31 Atsushi Enomoto <[email protected]>

	* ChannelDispatcher.cs : raise error on multiple endpoint match
	  (documented at EndpointDispatcher.FilterPriority).


svn path=/trunk/mcs/; revision=139194
Atsushi Eno 16 gadi atpakaļ
vecāks
revīzija
4bd222cfb5

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

@@ -1,3 +1,8 @@
+2009-07-31  Atsushi Enomoto  <[email protected]>
+
+	* ChannelDispatcher.cs : raise error on multiple endpoint match
+	  (documented at EndpointDispatcher.FilterPriority).
+
 2009-07-28  Atsushi Enomoto  <[email protected]>
 
 	* ChannelDispatcher.cs : move Open() inside acceptor lock, so that

+ 5 - 2
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChannelDispatcher.cs

@@ -560,8 +560,11 @@ namespace System.ServiceModel.Dispatcher
 				EndpointDispatcher candidate = null;
 				for (int i = 0; i < owner.Endpoints.Count; i++) {
 					if (owner.IsMessageMatchesEndpointDispatcher (message, owner.Endpoints [i])) {
-						candidate = owner.Endpoints [i];
-						break;
+						var newdis = owner.Endpoints [i];
+						if (candidate == null || candidate.FilterPriority < newdis.FilterPriority)
+							candidate = newdis;
+						else if (candidate.FilterPriority == newdis.FilterPriority)
+							throw new MultipleFilterMatchesException ();
 					}
 				}
 				if (candidate == null)