Comparison

plugins/mod_s2s.lua @ 11859:14cf34d35c30

mod_s2s: Don't pass unknown hostnames as stats label Labels are supposed to be fixed sets of things, so defined hosts are okay, but not unknown hosts.
author Kim Alvefur <zash@zash.se>
date Thu, 21 Oct 2021 17:51:56 +0200
parent 11775:af9c7f3f4735
child 11867:bb20cfd4884f
comparison
equal deleted inserted replaced
11858:2bcd84123eba 11859:14cf34d35c30
621 session:open_stream(session.from_host, session.to_host); 621 session:open_stream(session.from_host, session.to_host);
622 end 622 end
623 end 623 end
624 624
625 local this_host = session.direction == "outgoing" and session.from_host or session.to_host 625 local this_host = session.direction == "outgoing" and session.from_host or session.to_host
626 if not hosts[this_host] then this_host = ":unknown"; end
626 627
627 if reason then -- nil == no err, initiated by us, false == initiated by remote 628 if reason then -- nil == no err, initiated by us, false == initiated by remote
628 local stream_error; 629 local stream_error;
629 local condition, text, extra 630 local condition, text, extra
630 if type(reason) == "string" then -- assume stream error 631 if type(reason) == "string" then -- assume stream error