Comparison

plugins/mod_net_multiplex.lua @ 10466:276f62d14437

mod_net_multiplex: Tweak debug logging for ALPN case
author Kim Alvefur <zash@zash.se>
date Fri, 29 Nov 2019 23:41:41 +0100
parent 10465:09697a673015
child 10475:fa0cad7c89e3
comparison
equal deleted inserted replaced
10465:09697a673015 10466:276f62d14437
46 46
47 function listener.onconnect(conn) 47 function listener.onconnect(conn)
48 local sock = conn:socket(); 48 local sock = conn:socket();
49 if sock.getalpn then 49 if sock.getalpn then
50 local selected_proto = sock:getalpn(); 50 local selected_proto = sock:getalpn();
51 module:log("debug", "ALPN selected is %s", selected_proto);
52 local service = service_by_protocol[selected_proto]; 51 local service = service_by_protocol[selected_proto];
53 if service then 52 if service then
54 module:log("debug", "Routing incoming connection to %s", service.name); 53 module:log("debug", "Routing incoming connection to %s based on ALPN %q", service.name, selected_proto);
55 local next_listener = service.listener; 54 local next_listener = service.listener;
56 conn:setlistener(next_listener); 55 conn:setlistener(next_listener);
57 local onconnect = next_listener.onconnect; 56 local onconnect = next_listener.onconnect;
58 if onconnect then return onconnect(conn) end 57 if onconnect then return onconnect(conn) end
59 end 58 end