summaryrefslogtreecommitdiff
path: root/qpid/dotnet/Qpid.Sasl
diff options
context:
space:
mode:
authorTomas Restrepo <tomasr@apache.org>2007-05-13 23:08:40 +0000
committerTomas Restrepo <tomasr@apache.org>2007-05-13 23:08:40 +0000
commitc50149d860f90d40b391d26110b35e101d80c808 (patch)
tree87ab822032524ebe1c20315fe84577d8f8e531e2 /qpid/dotnet/Qpid.Sasl
parente9a6d2e94a849b83b4a49b9d92392c382962d42e (diff)
downloadqpid-python-c50149d860f90d40b391d26110b35e101d80c808.tar.gz
Merged revisions 537673 via svnmerge from
https://svn.apache.org/repos/asf/incubator/qpid/branches/M2 ........ r537673 | tomasr | 2007-05-13 18:03:30 -0500 (Sun, 13 May 2007) | 3 lines * QPID-486 Choose strongest SASL Mechanism first * Remove unnecessary wrapping of AMQExceptions on connection failure ........ git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@537676 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/dotnet/Qpid.Sasl')
-rw-r--r--qpid/dotnet/Qpid.Sasl/DefaultClientFactory.cs27
1 files changed, 11 insertions, 16 deletions
diff --git a/qpid/dotnet/Qpid.Sasl/DefaultClientFactory.cs b/qpid/dotnet/Qpid.Sasl/DefaultClientFactory.cs
index 44df9c7ee2..e6387a1e29 100644
--- a/qpid/dotnet/Qpid.Sasl/DefaultClientFactory.cs
+++ b/qpid/dotnet/Qpid.Sasl/DefaultClientFactory.cs
@@ -74,22 +74,17 @@ namespace Qpid.Sasl
IDictionary props, ISaslCallbackHandler handler
)
{
- foreach ( string mech in mechanisms )
- {
- switch ( mech )
- {
- case PlainSaslClient.Mechanism:
- return new PlainSaslClient(authorizationId, props, handler);
- case CramMD5SaslClient.Mechanism:
- return new CramMD5SaslClient(authorizationId, props, handler);
- case AnonymousSaslClient.Mechanism:
- return new AnonymousSaslClient(authorizationId, props, handler);
- case DigestSaslClient.Mechanism:
- return new DigestSaslClient(authorizationId, serverName, protocol, props, handler);
- case ExternalSaslClient.Mechanism:
- return new ExternalSaslClient(authorizationId, props, handler);
- }
- }
+ IList mechs = mechanisms;
+ if ( mechs.Contains(ExternalSaslClient.Mechanism) )
+ return new ExternalSaslClient(authorizationId, props, handler);
+ if ( mechs.Contains(DigestSaslClient.Mechanism) )
+ return new DigestSaslClient(authorizationId, serverName, protocol, props, handler);
+ if ( mechs.Contains(CramMD5SaslClient.Mechanism) )
+ return new CramMD5SaslClient(authorizationId, props, handler);
+ if ( mechs.Contains(PlainSaslClient.Mechanism) )
+ return new PlainSaslClient(authorizationId, props, handler);
+ if ( mechs.Contains(AnonymousSaslClient.Mechanism) )
+ return new AnonymousSaslClient(authorizationId, props, handler);
// unknown mechanism
return null;
}