comparison common-session.c @ 896:a1a97e98b0c1

Read (and enqueue) packets from interactive input even when we're waiting for a key exchange. This should hopefully fix the situation where "~." doesn't work to terminate a client session when a laptop wakes up. The client will be stuck waiting for a key exchange on a dead connection, so won't have read the escape character
author Matt Johnston <matt@ucc.asn.au>
date Mon, 17 Feb 2014 21:41:06 +0800
parents e78f5ce6e7bb
children bae0b34bc059 b8208506322e
comparison
equal deleted inserted replaced
895:5608a5a61c2a 896:a1a97e98b0c1
151 151
152 /* We get woken up when signal handlers write to this pipe. 152 /* We get woken up when signal handlers write to this pipe.
153 SIGCHLD in svr-chansession is the only one currently. */ 153 SIGCHLD in svr-chansession is the only one currently. */
154 FD_SET(ses.signal_pipe[0], &readfd); 154 FD_SET(ses.signal_pipe[0], &readfd);
155 155
156 /* set up for channels which require reading/writing */ 156 /* set up for channels which can be read/written */
157 if (ses.dataallowed) { 157 setchannelfds(&readfd, &writefd);
158 setchannelfds(&readfd, &writefd); 158
159 }
160 val = select(ses.maxfd+1, &readfd, &writefd, NULL, &timeout); 159 val = select(ses.maxfd+1, &readfd, &writefd, NULL, &timeout);
161 160
162 if (exitflag) { 161 if (exitflag) {
163 dropbear_exit("Terminated by signal"); 162 dropbear_exit("Terminated by signal");
164 } 163 }
215 were being held up during a KEX */ 214 were being held up during a KEX */
216 maybe_flush_reply_queue(); 215 maybe_flush_reply_queue();
217 216
218 /* process pipes etc for the channels, ses.dataallowed == 0 217 /* process pipes etc for the channels, ses.dataallowed == 0
219 * during rekeying ) */ 218 * during rekeying ) */
220 if (ses.dataallowed) { 219 channelio(&readfd, &writefd);
221 channelio(&readfd, &writefd);
222 }
223 220
224 if (loophandler) { 221 if (loophandler) {
225 loophandler(); 222 loophandler();
226 } 223 }
227 224