mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-12-06 19:11:10 +01:00
SMACK-417 If both PacketReader and PacketWriter fail at the same time, connectionClosedonError() is called two times
Refactored notifyConnectionError() and notifyReconnection() from PacketReader to XMPPConnection. Made PacketReader.done and PacketWriter.done volatile. Prevent duplicate connectionClosedonError() calls by making the method synchronzied and protected them with an enter guard: if (packetReader.done && packetWriter.done) return; git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@13566 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
cb44042d3c
commit
26338a2754
5 changed files with 65 additions and 61 deletions
|
|
@ -689,7 +689,7 @@ public class RosterSmackTest extends SmackTestCase {
|
|||
Thread.sleep(200);
|
||||
|
||||
// Break the connection
|
||||
getConnection(0).packetReader.notifyConnectionError(new Exception("Simulated Error"));
|
||||
getConnection(0).notifyConnectionError(new Exception("Simulated Error"));
|
||||
|
||||
Presence presence = roster.getPresence(getBareJID(1));
|
||||
assertFalse("Unavailable presence not found for offline user", presence.isAvailable());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue