qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1586780 - /qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Connection_1_0.java
Date Fri, 11 Apr 2014 21:24:55 GMT
Author: rgodfrey
Date: Fri Apr 11 21:24:55 2014
New Revision: 1586780

URL: http://svn.apache.org/r1586780
Log:
QPID-5673 : [Java Broker] Check the virtual host has been found before attempting to register
the connection with the virtual host

Modified:
    qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Connection_1_0.java

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Connection_1_0.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Connection_1_0.java?rev=1586780&r1=1586779&r2=1586780&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Connection_1_0.java
(original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Connection_1_0.java
Fri Apr 11 21:24:55 2014
@@ -134,7 +134,6 @@ public class Connection_1_0 implements C
             host = _broker.getDefaultVirtualHost();
         }
         _vhost = _broker.getVirtualHostRegistry().getVirtualHost(host);
-        _vhost.getConnectionRegistry().registerConnection(this);
 
         if(_vhost == null)
         {
@@ -143,11 +142,14 @@ public class Connection_1_0 implements C
             err.setDescription("Unknown hostname " + _conn.getLocalHostname());
             _conn.close(err);
         }
-        Subject authSubject = _subjectCreator.createSubjectWithGroups(_conn.getUser());
-        _subject.getPrincipals().addAll(authSubject.getPrincipals());
-        _subject.getPublicCredentials().addAll(authSubject.getPublicCredentials());
-        _subject.getPrivateCredentials().addAll(authSubject.getPrivateCredentials());
-
+        else
+        {
+            _vhost.getConnectionRegistry().registerConnection(this);
+            Subject authSubject = _subjectCreator.createSubjectWithGroups(_conn.getUser());
+            _subject.getPrincipals().addAll(authSubject.getPrincipals());
+            _subject.getPublicCredentials().addAll(authSubject.getPublicCredentials());
+            _subject.getPrivateCredentials().addAll(authSubject.getPrivateCredentials());
+        }
     }
 
     public void remoteSessionCreation(SessionEndpoint endpoint)
@@ -218,7 +220,10 @@ public class Connection_1_0 implements C
         {
             _closeTasks.clear();
         }
-        _vhost.getConnectionRegistry().deregisterConnection(this);
+        if(_vhost != null)
+        {
+            _vhost.getConnectionRegistry().deregisterConnection(this);
+        }
 
 
     }



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


Mime
View raw message