();
/**
* A dispatcher for incoming requests event;
@@ -279,12 +281,21 @@ public class StunStack
StunServerTransaction sTran =
serverTransactions.get(tid);
- if(sTran == null || sTran.isReransmitting())
+ if(sTran == null)
+ {
+ throw new StunException(StunException.TRANSACTION_DOES_NOT_EXIST,
+ "The transaction specified in the response "
+ + "(tid="+ tid.toString() +") "
+ + "object does not exist.");
+ }
+ else if( sTran.isReransmitting())
{
throw new StunException(StunException.TRANSACTION_DOES_NOT_EXIST,
"The transaction specified in the response "
- + "object does not exist or has already "
- + "transmitted a response.");
+ + "(tid="+ tid.toString() +") "
+ + "has already seen a previous response. "
+ + "Response was:\n"
+ + sTran.getResponse());
}
else
{
diff --git a/src/org/ice4j/stack/TransactionID.java b/src/org/ice4j/stack/TransactionID.java
index 643a7e5..e4a25cc 100644
--- a/src/org/ice4j/stack/TransactionID.java
+++ b/src/org/ice4j/stack/TransactionID.java
@@ -143,24 +143,36 @@ public class TransactionID
/**
* Returns a string representation of the ID
+ *
* @return a hex string representing the id
*/
public String toString()
+ {
+ return TransactionID.toString(transactionID);
+ }
+
+ /**
+ * Returns a string representation of the ID
+ *
+ * @param transactionID the transaction ID to convert into String.
+ *
+ * @return a hex string representing the id
+ */
+ public static String toString(byte[] transactionID)
{
StringBuffer idStr = new StringBuffer();
+ idStr.append("0x");
for(int i = 0; i < transactionID.length; i++)
{
- idStr.append("0x");
+
if((transactionID[i]&0xFF) <= 15)
{
idStr.append("0");
}
- idStr.append(Integer.toHexString(transactionID[i]&0xff).toUpperCase());
-
- if(i < transactionID.length)
- idStr.append(" ");
+ idStr.append(Integer.toHexString(transactionID[i]&0xff)
+ .toUpperCase());
}
return idStr.toString();
diff --git a/test/org/ice4j/attribute/NonceAttributeTest.java b/test/org/ice4j/attribute/NonceAttributeTest.java
index 8c6385b..c36c17c 100644
--- a/test/org/ice4j/attribute/NonceAttributeTest.java
+++ b/test/org/ice4j/attribute/NonceAttributeTest.java
@@ -1,8 +1,8 @@
/*
- * Ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
+ * ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
+ * Maintained by the SIP Communicator community (http://sip-communicator.org).
*
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
+ * Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@@ -15,7 +15,7 @@ import org.ice4j.attribute.*;
/**
* Tests the nonce attribute class.
- * Organization Network Research Team, Louis Pasteur University
+ *
* @author Emil Ivov
* @author Sebastien Vincent
*/
diff --git a/test/org/ice4j/attribute/RealmAttributeTest.java b/test/org/ice4j/attribute/RealmAttributeTest.java
index f9b4a77..b95e233 100644
--- a/test/org/ice4j/attribute/RealmAttributeTest.java
+++ b/test/org/ice4j/attribute/RealmAttributeTest.java
@@ -1,8 +1,8 @@
/*
- * Ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
+ * ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
+ * Maintained by the SIP Communicator community (http://sip-communicator.org).
*
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
+ * Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@@ -15,7 +15,7 @@ import org.ice4j.attribute.*;
/**
* Tests the realm attribute class.
- * Organization Network Research Team, Louis Pasteur University
+ *
* @author Emil Ivov
* @author Sebastien Vincent
*/
diff --git a/test/org/ice4j/attribute/UsernameAttributeTest.java b/test/org/ice4j/attribute/UsernameAttributeTest.java
index 97ea6db..3960141 100644
--- a/test/org/ice4j/attribute/UsernameAttributeTest.java
+++ b/test/org/ice4j/attribute/UsernameAttributeTest.java
@@ -1,8 +1,8 @@
/*
- * Ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
+ * ice4j, the OpenSource Java Solution for NAT and Firewall Traversal.
+ * Maintained by the SIP Communicator community (http://sip-communicator.org).
*
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
+ * Distributable under LGPL license. See terms of license at gnu.org.
*/
package org.ice4j.attribute;
@@ -11,11 +11,10 @@ import junit.framework.*;
import java.util.*;
import org.ice4j.*;
-import org.ice4j.attribute.*;
/**
* Tests the username attribute class.
- * Organization Network Research Team, Louis Pasteur University
+ *
* @author Emil Ivov
* @author Sebastien Vincent
*/
diff --git a/test/test/Ice.java b/test/test/Ice.java
index 53e6a3d..ef555e9 100644
--- a/test/test/Ice.java
+++ b/test/test/Ice.java
@@ -41,6 +41,11 @@ public class Ice
long endTime = System.currentTimeMillis();
transferRemoteCandidates(localAgent, remotePeer);
+ localAgent.setRemoteUserName(remotePeer.getUserName());
+ localAgent.setRemotePassword(remotePeer.getPassword());
+
+ remotePeer.setRemoteUserName(localAgent.getUserName());
+ remotePeer.setRemotePassword(localAgent.getPassword());
System.out.println("Total candidate gathering time: "
+ (endTime - startTime) + "ms");