Commit a2347a34 authored by Alex Wenckus's avatar Alex Wenckus Committed by alex

Small fixes

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/branches@5834 b35dd754-fafc-0310-a699-88a17e54d16e
parent 03c05a79
......@@ -148,28 +148,8 @@ public class HttpSession extends ClientSession {
public String getAvailableStreamFeatures() {
StringBuilder sb = new StringBuilder(200);
// Include Stream Compression Mechanism
if (conn.getCompressionPolicy() != Connection.CompressionPolicy.disabled &&
!conn.isCompressed()) {
sb.append(
"<compression xmlns=\"http://jabber.org/features/compress\">" +
"<method>zlib</method></compression>");
}
if (getAuthToken() == null) {
// Advertise that the server supports Non-SASL Authentication
sb.append("<auth xmlns=\"http://jabber.org/features/iq-auth\"/>");
// Advertise that the server supports In-Band Registration
if (XMPPServer.getInstance().getIQRegisterHandler().isInbandRegEnabled()) {
sb.append("<register xmlns=\"http://jabber.org/features/iq-register\"/>");
}
}
else {
// If the session has been authenticated then offer resource binding
// and session establishment
sb.append("<bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\"/>");
sb.append("<session xmlns=\"urn:ietf:params:xml:ns:xmpp-session\"/>");
for(Element element : getAvailableStreamFeaturesElements()) {
sb.append(element.asXML());
}
return sb.toString();
}
......
......@@ -134,6 +134,7 @@ public class HttpSessionManager {
public void sessionClosed(HttpSession session) {
sessionMap.remove(session.getStreamID().getID());
sessionManager.removeSession(session);
timer.stop(session);
}
});
......@@ -186,6 +187,7 @@ public class HttpSessionManager {
for (Element packet : elements) {
try {
router.route(packet);
session.incrementClientPacketCount();
}
catch (UnsupportedEncodingException e) {
throw new HttpBindException("Bad auth request, unknown encoding", true, 400);
......
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