Commit 62667aa3 authored by Alex Wenckus's avatar Alex Wenckus Committed by alex

Small refactor

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@6024 b35dd754-fafc-0310-a699-88a17e54d16e
parent 29bb43c3
......@@ -65,6 +65,9 @@ public class HttpSession extends ClientSession {
HttpConnection connection = new HttpConnection(rid, isSecure);
if(rid <= lastRequestID) {
Deliverable deliverable = retrieveDeliverable(rid);
if (deliverable == null) {
throw new HttpBindException("Unexpected RID Error", true, 404);
}
connection.deliverBody(deliverable.getDeliverable());
return connection;
}
......@@ -82,7 +85,7 @@ public class HttpSession extends ClientSession {
return delivered;
}
}
throw new HttpBindException("Unexpected RID Error", true, 404);
return null;
}
private void addConnection(HttpConnection connection, boolean isPoll) throws HttpBindException,
......@@ -104,10 +107,15 @@ public class HttpSession extends ClientSession {
connection.setSession(this);
if (pendingElements.size() > 0) {
String deliverable = createDeliverable(pendingElements);
pendingElements.clear();
fireConnectionOpened(connection);
deliver(connection, deliverable);
fireConnectionClosed(connection);
try {
fireConnectionOpened(connection);
deliver(connection, deliverable);
fireConnectionClosed(connection);
pendingElements.clear();
}
catch (HttpConnectionClosedException he) {
throw he;
}
}
else {
// With this connection we need to check if we will have too many connections open,
......@@ -192,10 +200,6 @@ public class HttpSession extends ClientSession {
return sb.toString();
}
public InetAddress getInetAddress() {
return null;
}
public synchronized void close() {
conn.close();
}
......
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