Commit 7003da26 authored by Guus der Kinderen's avatar Guus der Kinderen

Preventing NPEs when traffic debugging is enabled.

parent e4f4a9c5
......@@ -695,6 +695,7 @@ public class HttpSession extends LocalClientSession {
throws HttpConnectionClosedException, HttpBindException, IOException
{
final HttpConnection connection = new HttpConnection(rid, isSecure, sslCertificates, context);
connection.setSession(this);
context.setTimeout(getWait() * JiveConstants.SECOND);
context.addListener(new AsyncListener() {
@Override
......@@ -825,7 +826,6 @@ public class HttpSession extends LocalClientSession {
sslCertificates = connection.getPeerCertificates();
connection.setSession(this);
// We aren't supposed to hold connections open or we already have some packets waiting
// to be sent to the client.
if (isPollingSession() || (pendingElements.size() > 0 && connection.getRequestId() == lastRequestID + 1)) {
......
......@@ -199,7 +199,8 @@ public class HttpSessionManager {
String [] versionString = version.split("\\.");
session.setMajorVersion(Integer.parseInt(versionString[0]));
session.setMinorVersion(Integer.parseInt(versionString[1]));
connection.setSession(session);
try {
connection.deliverBody(createSessionCreationResponse(session));
}
......
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