# HG changeset patch # User Matthew Wild # Date 1323237257 0 # Node ID bc0a68cae23612c6a77453e1c7f689481d580926 # Parent a01b7207cb37844ff88b57ae2d07ed9b238c854f mod_bosh: Experimental option 'bosh_auto_cork' which witholds any response to a request until all stanzas in it have been processed. diff -r a01b7207cb37 -r bc0a68cae236 plugins/mod_bosh.lua --- a/plugins/mod_bosh.lua Wed Dec 07 05:17:39 2011 +0000 +++ b/plugins/mod_bosh.lua Wed Dec 07 05:54:17 2011 +0000 @@ -35,6 +35,7 @@ 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 @@ 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({ "