diff svr-session.c @ 1495:0c16b4ccbd54

make signal flags volatile, simplify handling
author Matt Johnston <matt@ucc.asn.au>
date Wed, 14 Feb 2018 23:06:01 +0800
parents e8f67918fdc9
children 5916af64acd4 d1a8a05216ff
line wrap: on
line diff
--- a/svr-session.c	Wed Feb 14 00:24:44 2018 +0800
+++ b/svr-session.c	Wed Feb 14 23:06:01 2018 +0800
@@ -124,7 +124,7 @@
 	ses.isserver = 1;
 
 	/* We're ready to go now */
-	sessinitdone = 1;
+	ses.init_done = 1;
 
 	/* exchange identification, version etc */
 	send_session_identification();
@@ -136,7 +136,7 @@
 
 	/* Run the main for loop. NULL is for the dispatcher - only the client
 	 * code makes use of it */
-	session_loop(NULL);
+	session_loop(svr_chansess_checksignal);
 
 	/* Not reached */
 
@@ -152,7 +152,7 @@
 	vsnprintf(exitmsg, sizeof(exitmsg), format, param);
 
 	/* Add the prefix depending on session/auth state */
-	if (!sessinitdone) {
+	if (!ses.init_done) {
 		/* before session init */
 		snprintf(fullmsg, sizeof(fullmsg), "Early exit: %s", exitmsg);
 	} else if (ses.authstate.authdone) {