SMACK-419 PacketWriter: Only flush if queue is empty

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_3_0@13567 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Florian Schmaus 2013-03-18 19:58:14 +00:00 committed by flow
parent 2eb13f48d2
commit 6dcf8e0123
1 changed files with 5 additions and 3 deletions

View File

@ -193,9 +193,11 @@ class PacketWriter {
if (packet != null) {
synchronized (writer) {
writer.write(packet.toXML());
writer.flush();
// Keep track of the last time a stanza was sent to the server
lastActive = System.currentTimeMillis();
if (queue.isEmpty()) {
writer.flush();
// Keep track of the last time a stanza was sent to the server
lastActive = System.currentTimeMillis();
}
}
}
}