aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2011-12-07 05:54:17 +0000
committerMatthew Wild <mwild1@gmail.com>2011-12-07 05:54:17 +0000
commitb212e28356f112a0d36311fa6909db82d2ab2c15 (patch)
tree2e5ea39fd22bd0a5d4c0c24848bce91d7919f932 /plugins
parent0356027c053b6354e4ffda91ae44f7fc66af8411 (diff)
downloadprosody-b212e28356f112a0d36311fa6909db82d2ab2c15.tar.gz
prosody-b212e28356f112a0d36311fa6909db82d2ab2c15.zip
mod_bosh: Experimental option 'bosh_auto_cork' which witholds any response to a request until all stanzas in it have been processed.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_bosh.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua
index b8759f60..e45ebeb4 100644
--- a/plugins/mod_bosh.lua
+++ b/plugins/mod_bosh.lua
@@ -35,6 +35,7 @@ local BOSH_DEFAULT_POLLING = module:get_option_number("bosh_max_polling", 5);
local BOSH_DEFAULT_REQUESTS = module:get_option_number("bosh_max_requests", 2);
local consider_bosh_secure = module:get_option_boolean("consider_bosh_secure");
+local auto_cork = module:get_option_boolean("bosh_auto_cork", false);
local default_headers = { ["Content-Type"] = "text/xml; charset=utf-8" };
@@ -268,7 +269,7 @@ function stream_callbacks.streamopened(request, attr)
end
--log("debug", "Sending BOSH data: %s", tostring(s));
local oldest_request = r[1];
- if oldest_request then
+ if oldest_request and (not(auto_cork) or waiting_requests[oldest_request]) then
log("debug", "We have an open request, so sending on that");
response.body = t_concat({
"<body xmlns='http://jabber.org/protocol/httpbind' ",