Changeset

2185:2cbd7876ba14

mod_s2s_auth_dane: Move pausing code to a function
author Kim Alvefur <zash@zash.se>
date Sat, 28 May 2016 16:55:43 +0200
parents 2184:7155ed1fb540
children 2186:a100f4a720cb
files mod_s2s_auth_dane/mod_s2s_auth_dane.lua
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_s2s_auth_dane/mod_s2s_auth_dane.lua	Sat May 28 13:34:43 2016 +0200
+++ b/mod_s2s_auth_dane/mod_s2s_auth_dane.lua	Sat May 28 16:55:43 2016 +0200
@@ -198,6 +198,11 @@
 	end
 end
 
+local function pause(host_session)
+	host_session.log("debug", "Pausing connection until DANE lookup is completed");
+	host_session.conn:pause()
+end
+
 local function resume(host_session)
 	host_session.log("debug", "DANE lookup completed, resuming connection");
 	host_session.conn:resume()
@@ -213,8 +218,7 @@
 			return; -- Already done DANE lookup
 		end
 		if dane_lookup(host_session, resume) then
-			host_session.log("debug", "Pausing connection until DANE lookup is completed");
-			host_session.conn:pause()
+			pause(host_session);
 		end
 	end