qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1661079 - /qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java
Date Fri, 20 Feb 2015 09:24:10 GMT
Author: rgodfrey
Date: Fri Feb 20 09:24:10 2015
New Revision: 1661079

URL: http://svn.apache.org/r1661079
Log:
QPID-6401 : move authroize check inside try-catch

Modified:
    qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java?rev=1661079&r1=1661078&r2=1661079&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQProtocolEngine.java
Fri Feb 20 09:24:10 2015
@@ -1564,10 +1564,10 @@ public class AMQProtocolEngine implement
             else
             {
                 setVirtualHost(virtualHost);
-
-                if(virtualHost.authoriseCreateConnection(this))
+                try
                 {
-                    try
+
+                    if(virtualHost.authoriseCreateConnection(this))
                     {
                         if (getContextKey() == null)
                         {
@@ -1579,15 +1579,16 @@ public class AMQProtocolEngine implement
 
                         writeFrame(responseBody.generateFrame(0));
                         _state = ConnectionState.OPEN;
+
                     }
-                    catch (AccessControlException e)
+                    else
                     {
-                        closeConnection(AMQConstant.ACCESS_REFUSED, e.getMessage(), 0);
+                        closeConnection(AMQConstant.ACCESS_REFUSED, "Connection refused",0);
                     }
                 }
-                else
+                catch (AccessControlException e)
                 {
-                    closeConnection(AMQConstant.ACCESS_REFUSED, "Connection refused",0);
+                    closeConnection(AMQConstant.ACCESS_REFUSED, e.getMessage(), 0);
                 }
             }
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message