comparison mod_pubsub_hub/mod_pubsub_hub.lua @ 767:e5667f1da6bf

mod_pubsub_hub: Enforce minimal lease time
author Kim Alvefur <zash@zash.se>
date Thu, 02 Aug 2012 00:28:33 +0200
parents 1184fe8ebb21
children e781e63a49f4
comparison
equal deleted inserted replaced
766:1184fe8ebb21 767:e5667f1da6bf
48 48
49 -- http://pubsubhubbub.googlecode.com/svn/trunk/pubsubhubbub-core-0.3.html#anchor5 49 -- http://pubsubhubbub.googlecode.com/svn/trunk/pubsubhubbub-core-0.3.html#anchor5
50 local callback = body["hub.callback"]; 50 local callback = body["hub.callback"];
51 local mode = body["hub.mode"]; 51 local mode = body["hub.mode"];
52 local topic = body["hub.topic"]; 52 local topic = body["hub.topic"];
53 local lease_seconds = m_min(tonumber(body["hub.lease_seconds"]) or default_lease, max_lease); 53 local lease_seconds = m_max(min_lease, m_min(tonumber(body["hub.lease_seconds"]) or default_lease, max_lease));
54 local secret = body["hub.secret"]; 54 local secret = body["hub.secret"];
55 local verify_token = body["hub.verify_token"]; 55 local verify_token = body["hub.verify_token"];
56 56
57 module:log("debug", "topic is "..(type(topic)=="string" and "%q" or "%s"), topic); 57 module:log("debug", "topic is "..(type(topic)=="string" and "%q" or "%s"), topic);
58 58