# HG changeset patch # User Kim Alvefur # Date 1633040509 -7200 # Node ID 07a72f0a32df47fd2186e7d4bf70948509ea8665 # Parent ae43166fe93169210d65ce3cfc905913999c1e96# Parent 90a474aab2c109f4e66f610b6e7f14e99efff9ac Merge wayward 0.11.10 tag commit diff -r 90a474aab2c1 -r 07a72f0a32df makefile --- a/makefile Tue Aug 03 11:44:31 2021 +0200 +++ b/makefile Fri Oct 01 00:21:49 2021 +0200 @@ -90,12 +90,12 @@ sed 's|certs/|$(INSTALLEDCONFIG)/certs/|' prosody.cfg.lua.dist > $@ prosody.version: - test -f prosody.release && \ - cp prosody.release $@ || \ - test -f .hg_archival.txt && \ - sed -n 's/^node: \(............\).*/\1/p' .hg_archival.txt > $@ || \ - test -f .hg/dirstate && \ - hexdump -n6 -e'6/1 "%02x"' .hg/dirstate > $@ || \ - echo unknown > $@ - - + if [ -f prosody.release ]; then \ + cp prosody.release $@; \ + elif [ -f .hg_archival.txt ]; then \ + sed -n 's/^node: \(............\).*/\1/p' .hg_archival.txt > $@; \ + elif [ -f .hg/dirstate ]; then \ + hexdump -n6 -e'6/1 "%02x"' .hg/dirstate > $@; \ + else \ + echo unknown > $@; \ + fi diff -r 90a474aab2c1 -r 07a72f0a32df net/server_epoll.lua --- a/net/server_epoll.lua Tue Aug 03 11:44:31 2021 +0200 +++ b/net/server_epoll.lua Fri Oct 01 00:21:49 2021 +0200 @@ -58,6 +58,9 @@ -- Maximum and minimum amount of time to sleep waiting for events (adjusted for pending timers) max_wait = 86400; min_wait = 1e-06; + + --- How long to wait after getting the shutdown signal before forcefully tearing down every socket + shutdown_deadline = 5; }}; local cfg = default_config.__index; @@ -122,8 +125,8 @@ end if readd then - for _, timer in pairs(readd) do - timers:insert(timer, timer[1]); + for id, timer in pairs(readd) do + timers:insert(timer, timer[1], id); end peek = timers:peek(); end @@ -743,6 +746,21 @@ if quit then quitting = "quitting"; closeall(); + addtimer(1, function () + if quitting then + closeall(); + return 1; + end + end); + if cfg.shutdown_deadline then + addtimer(cfg.shutdown_deadline, function () + if quitting then + for fd, conn in pairs(fds) do -- luacheck: ignore 213/fd + conn:destroy(); + end + end + end); + end else quitting = nil; end diff -r 90a474aab2c1 -r 07a72f0a32df plugins/mod_c2s.lua --- a/plugins/mod_c2s.lua Tue Aug 03 11:44:31 2021 +0200 +++ b/plugins/mod_c2s.lua Fri Oct 01 00:21:49 2021 +0200 @@ -108,7 +108,10 @@ send(features); else (session.log or log)("warn", "No stream features to offer"); - session:close{ condition = "undefined-condition", text = "No stream features to proceed with" }; + session:close({ + condition = "undefined-condition"; + text = "No stream features to proceed with on "..(session.secure and "" or "in").."secure stream"; + }); end end diff -r 90a474aab2c1 -r 07a72f0a32df prosodyctl --- a/prosodyctl Tue Aug 03 11:44:31 2021 +0200 +++ b/prosodyctl Fri Oct 01 00:21:49 2021 +0200 @@ -203,7 +203,7 @@ if prosody.installed and configmanager.get("*", "prosodyctl_service_warnings") ~= false then show_warning("WARNING: Use of prosodyctl start/stop/restart/reload is not recommended"); show_warning(" if Prosody is managed by an init system - use that directly instead."); - lfs = lfs or require + lfs = lfs or require"lfs"; if lfs.attributes("/etc/systemd") then show_warning(" e.g. systemctl %s prosody", service_command); elseif lfs.attributes("/etc/init.d/prosody") then