Author: robbie
Date: Sun Nov 4 02:06:45 2012
New Revision: 1405489
URL: http://svn.apache.org/viewvc?rev=1405489&view=rev
Log:
QPID-4419: ensure the broker kills the 0-10 connection immediately for explicit
reason that no sasl mech was chosen, instead of sending an incorrect
ConnectionTune and then killing the connection as side effect of a subsequent
NPE.
Modified:
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ServerDelegate.java
qpid/trunk/qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java
Modified:
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ServerDelegate.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ServerDelegate.java?rev=1405489&r1=1405488&r2=1405489&view=diff
==============================================================================
---
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ServerDelegate.java
(original)
+++
qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ServerDelegate.java
Sun Nov 4 02:06:45 2012
@@ -71,7 +71,8 @@ public class ServerDelegate extends Conn
if (mechanism == null || mechanism.length() == 0)
{
- tuneAuthorizedConnection(conn);
+ conn.connectionClose(ConnectionCloseCode.CONNECTION_FORCED,
+ "No Sasl mechanism was specified");
return;
}
@@ -82,7 +83,7 @@ public class ServerDelegate extends Conn
if (ss == null)
{
conn.connectionClose(ConnectionCloseCode.CONNECTION_FORCED,
- "null SASL mechanism: " + mechanism);
+ "No SaslServer could be created for mechanism: " +
mechanism);
return;
}
conn.setSaslServer(ss);
Modified:
qpid/trunk/qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java?rev=1405489&r1=1405488&r2=1405489&view=diff
==============================================================================
---
qpid/trunk/qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java
(original)
+++
qpid/trunk/qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java
Sun Nov 4 02:06:45 2012
@@ -155,6 +155,7 @@ public class ConnectionTest extends Qpid
{
final Connection conn = new Connection();
conn.setConnectionDelegate(new ClientDelegate(new
ConnectionSettings()));
+
conn.addConnectionListener(new ConnectionListener()
{
public void opened(Connection conn) {}
@@ -225,6 +226,12 @@ public class ConnectionTest extends Qpid
ssn.setSessionListener(ConnectionTest.this);
return ssn;
}
+
+ @Override
+ public void connectionStartOk(Connection conn, ConnectionStartOk
ok)
+ {
+ tuneAuthorizedConnection(conn);
+ }
};
try
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]