comparison 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
comparison
equal deleted inserted replaced
1494:da095983a60b 1495:0c16b4ccbd54
122 ses.packettypes = svr_packettypes; 122 ses.packettypes = svr_packettypes;
123 123
124 ses.isserver = 1; 124 ses.isserver = 1;
125 125
126 /* We're ready to go now */ 126 /* We're ready to go now */
127 sessinitdone = 1; 127 ses.init_done = 1;
128 128
129 /* exchange identification, version etc */ 129 /* exchange identification, version etc */
130 send_session_identification(); 130 send_session_identification();
131 131
132 kexfirstinitialise(); /* initialise the kex state */ 132 kexfirstinitialise(); /* initialise the kex state */
134 /* start off with key exchange */ 134 /* start off with key exchange */
135 send_msg_kexinit(); 135 send_msg_kexinit();
136 136
137 /* Run the main for loop. NULL is for the dispatcher - only the client 137 /* Run the main for loop. NULL is for the dispatcher - only the client
138 * code makes use of it */ 138 * code makes use of it */
139 session_loop(NULL); 139 session_loop(svr_chansess_checksignal);
140 140
141 /* Not reached */ 141 /* Not reached */
142 142
143 } 143 }
144 144
150 150
151 /* Render the formatted exit message */ 151 /* Render the formatted exit message */
152 vsnprintf(exitmsg, sizeof(exitmsg), format, param); 152 vsnprintf(exitmsg, sizeof(exitmsg), format, param);
153 153
154 /* Add the prefix depending on session/auth state */ 154 /* Add the prefix depending on session/auth state */
155 if (!sessinitdone) { 155 if (!ses.init_done) {
156 /* before session init */ 156 /* before session init */
157 snprintf(fullmsg, sizeof(fullmsg), "Early exit: %s", exitmsg); 157 snprintf(fullmsg, sizeof(fullmsg), "Early exit: %s", exitmsg);
158 } else if (ses.authstate.authdone) { 158 } else if (ses.authstate.authdone) {
159 /* user has authenticated */ 159 /* user has authenticated */
160 snprintf(fullmsg, sizeof(fullmsg), 160 snprintf(fullmsg, sizeof(fullmsg),