mod_admin_telnet: Add server:memory() command to view details of Prosody's memory...
[prosody.git] / plugins / mod_bosh.lua
index 184da321bfaf9fe9f729ed15963ccdb33fb7872a..b88cd9691ad71bb74733505a4d7e20e8dc87adfe 100644 (file)
@@ -36,7 +36,7 @@ local bosh_max_wait = module:get_option_number("bosh_max_wait", 120);
 
 local consider_bosh_secure = module:get_option_boolean("consider_bosh_secure");
 
-local default_headers = { ["Content-Type"] = "text/xml; charset=utf-8", ["Connection"] = "keep-alive" };
+local default_headers = { ["Content-Type"] = "text/xml; charset=utf-8" };
 
 local cross_domain = module:get_option("cross_domain_bosh", false);
 if cross_domain then
@@ -284,6 +284,7 @@ function stream_callbacks.streamopened(context, attr)
                                        sid = sid;
                                };
                                if creating_session then
+                                       creating_session = nil;
                                        body_attr.inactivity = tostring(BOSH_DEFAULT_INACTIVITY);
                                        body_attr.polling = tostring(BOSH_DEFAULT_POLLING);
                                        body_attr.requests = tostring(BOSH_DEFAULT_REQUESTS);
@@ -291,7 +292,8 @@ function stream_callbacks.streamopened(context, attr)
                                        body_attr.hold = tostring(session.bosh_hold);
                                        body_attr.authid = sid;
                                        body_attr.secure = "true";
-                                       body_attr.ver  = '1.6'; from = session.host;
+                                       body_attr.ver  = '1.6';
+                                       body_attr.from = session.host;
                                        body_attr["xmlns:xmpp"] = "urn:xmpp:xbosh";
                                        body_attr["xmpp:version"] = "1.0";
                                end
@@ -320,7 +322,7 @@ function stream_callbacks.streamopened(context, attr)
                        session.log("warn", "rid too large (means a request was lost). Last rid: %d New rid: %s", session.rid, attr.rid);
                elseif diff <= 0 then
                        -- Repeated, ignore
-                       session.log("debug", "rid repeated (on request %s), ignoring: %s (diff %d)", request.id, session.rid, diff);
+                       session.log("debug", "rid repeated, ignoring: %s (diff %d)", session.rid, diff);
                        context.notopen = nil;
                        context.ignore = true;
                        context.sid = sid;