Commit 0462a3bb authored by Tom Evans's avatar Tom Evans Committed by tevans

OF-573: Fix BOSH delivery timing/synchronization issue

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13373 b35dd754-fafc-0310-a699-88a17e54d16e
parent 4b8c2317
...@@ -807,9 +807,11 @@ public class HttpSession extends LocalClientSession { ...@@ -807,9 +807,11 @@ public class HttpSession extends LocalClientSession {
// We aren't supposed to hold connections open or we already have some packets waiting // We aren't supposed to hold connections open or we already have some packets waiting
// to be sent to the client. // to be sent to the client.
if (isPollingSession() || (pendingElements.size() > 0 && connection.getRequestId() == lastRequestID + 1)) { if (isPollingSession() || (pendingElements.size() > 0 && connection.getRequestId() == lastRequestID + 1)) {
deliver(connection, pendingElements); synchronized(pendingElements) {
lastRequestID = connection.getRequestId(); deliver(connection, pendingElements);
pendingElements.clear(); lastRequestID = connection.getRequestId();
pendingElements.clear();
}
connectionQueue.add(connection); connectionQueue.add(connection);
Collections.sort(connectionQueue, connectionComparator); Collections.sort(connectionQueue, connectionComparator);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment