Commit 1bab6601 authored by Alex Wenckus's avatar Alex Wenckus Committed by alex

Fixed issue where specifying a hold value of zero would be ignored, Wildfire...

Fixed issue where specifying a hold value of zero would be ignored, Wildfire would act as if it had recieved a hold value of 1 from the client.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@6501 b35dd754-fafc-0310-a699-88a17e54d16e
parent 4d7a47ca
......@@ -106,7 +106,9 @@ public class HttpSession extends ClientSession {
}
connection.setSession(this);
if (pendingElements.size() > 0) {
// We aren't supposed to hold connections open or we already have some packets waiting
// to be sent to the client.
if (hold <= 0 || pendingElements.size() > 0) {
String deliverable = createDeliverable(pendingElements);
try {
fireConnectionOpened(connection);
......@@ -121,7 +123,7 @@ public class HttpSession extends ClientSession {
else {
// With this connection we need to check if we will have too many connections open,
// closing any extras.
while (hold > 0 && connectionQueue.size() >= hold) {
while (connectionQueue.size() >= hold) {
HttpConnection toClose = connectionQueue.remove();
toClose.close();
fireConnectionClosed(toClose);
......@@ -157,7 +159,7 @@ public class HttpSession extends ClientSession {
private void checkPollingInterval() throws HttpBindException {
long time = System.currentTimeMillis();
if(lastPoll > 0 && ((time - lastPoll) / 1000) < maxPollingInterval) {
if(((time - lastPoll) / 1000) < maxPollingInterval) {
throw new HttpBindException("Too frequent polling minimum interval is "
+ maxPollingInterval + ", current interval " + ((lastPoll - time) / 1000),
true, 403);
......
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