activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1377653 - /activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.scala
Date Mon, 27 Aug 2012 12:26:37 GMT
Author: chirino
Date: Mon Aug 27 12:26:37 2012
New Revision: 1377653

URL: http://svn.apache.org/viewvc?rev=1377653&view=rev
Log:
Fixes NPE identified in APLO-177.

Modified:
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.scala

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.scala?rev=1377653&r1=1377652&r2=1377653&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.scala
Mon Aug 27 12:26:37 2012
@@ -93,11 +93,12 @@ class StompUdpProtocol extends UdpProtoc
       var headers = frame.headers
       val login = get(headers, LOGIN)
       val passcode = get(headers, PASSCODE)
+      val sc = new SecurityContext
+      sc.connector_id = connection.connector.id
+      sc.local_address = connection.transport.getLocalAddress
+      sc.session_id = session_id
       if( login.isDefined || passcode.isDefined ) {
         val sc = new SecurityContext
-        sc.connector_id = connection.connector.id
-        sc.local_address = connection.transport.getLocalAddress
-        sc.session_id = session_id
         for( value <- login ) {
           sc.user = value.toString
           headers = headers.filterNot( _._1 == LOGIN)
@@ -108,7 +109,7 @@ class StompUdpProtocol extends UdpProtoc
         }
         (sc, frame.copy(headers=headers))
       } else {
-        (null, frame)
+        (sc, frame)
       }
     }
 



Mime
View raw message