Comparison

plugins/mod_proxy65.lua @ 2244:730038d3e9e3

mod_proxy65: Update listener callback names for new server API
author sjoerd.simons@collabora.co.uk
date Fri, 27 Nov 2009 16:51:05 +0000
parent 2138:8bb1a2d82896
child 2249:6e0c861dc61f
comparison
equal deleted inserted replaced
2243:bd17dd75b4a5 2244:730038d3e9e3
29 local proxy_address = config_get(host, "core", "proxy65_address") or (proxy_interface ~= "*" and proxy_interface) or host; 29 local proxy_address = config_get(host, "core", "proxy65_address") or (proxy_interface ~= "*" and proxy_interface) or host;
30 local proxy_acl = config_get(host, "core", "proxy65_acl"); 30 local proxy_acl = config_get(host, "core", "proxy65_acl");
31 31
32 local connlistener = { default_port = proxy_port, default_interface = proxy_interface, default_mode = "*a" }; 32 local connlistener = { default_port = proxy_port, default_interface = proxy_interface, default_mode = "*a" };
33 33
34 function connlistener.listener(conn, data) 34 function connlistener.onincoming(conn, data)
35 local session = sessions[conn] or {}; 35 local session = sessions[conn] or {};
36 36
37 if session.setup == nil and data ~= nil and data:sub(1):byte() == 0x05 and data:len() > 2 then 37 if session.setup == nil and data ~= nil and data:sub(1):byte() == 0x05 and data:len() > 2 then
38 local nmethods = data:sub(2):byte(); 38 local nmethods = data:sub(2):byte();
39 local methods = data:sub(3); 39 local methods = data:sub(3);
92 conn.close(); 92 conn.close();
93 end 93 end
94 end 94 end
95 end 95 end
96 96
97 function connlistener.disconnect(conn, err) 97 function connlistener.ondisconnect(conn, err)
98 local session = sessions[conn]; 98 local session = sessions[conn];
99 if session then 99 if session then
100 if session.sha and transfers[session.sha] then 100 if session.sha and transfers[session.sha] then
101 local initiator, target = transfers[session.sha].initiator, transfers[session.sha].target; 101 local initiator, target = transfers[session.sha].initiator, transfers[session.sha].target;
102 if initiator == conn and target ~= nil then 102 if initiator == conn and target ~= nil then