comparison common-session.c @ 374:87ae4565679d channel-fix

merge of 'a94c5265558121fe936519b5d9a5eb27f95e9d9d' and 'd348546b80847bc0d42a7b5208bb31a54f1fdfaf'
author Matt Johnston <matt@ucc.asn.au>
date Tue, 05 Dec 2006 13:28:44 +0000
parents 70caa99bfe3a
children a01c0c8e543a
comparison
equal deleted inserted replaced
367:c046b66b76cd 374:87ae4565679d
141 141
142 if (exitflag) { 142 if (exitflag) {
143 dropbear_exit("Terminated by signal"); 143 dropbear_exit("Terminated by signal");
144 } 144 }
145 145
146 if (val < 0) { 146 if (val < 0 && errno != EINTR) {
147 if (errno == EINTR) { 147 dropbear_exit("Error in select");
148 /* This must happen even if we've been interrupted, so that 148 }
149 * changed signal-handler vars can take effect etc */ 149
150 if (loophandler) { 150 if (val <= 0) {
151 loophandler(); 151 /* If we were interrupted or the select timed out, we still
152 } 152 * want to iterate over channels etc for reading, to handle
153 continue; 153 * server processes exiting etc.
154 } else { 154 * We don't want to read/write FDs. */
155 dropbear_exit("Error in select"); 155 FD_ZERO(&writefd);
156 } 156 FD_ZERO(&readfd);
157 } 157 }
158 158
159 /* check for auth timeout, rekeying required etc */ 159 /* check for auth timeout, rekeying required etc */
160 checktimeouts(); 160 checktimeouts();
161
162 if (val == 0) {
163 /* timeout */
164 TRACE(("select timeout"))
165 continue;
166 }
167 161
168 /* process session socket's incoming/outgoing data */ 162 /* process session socket's incoming/outgoing data */
169 if (ses.sock != -1) { 163 if (ses.sock != -1) {
170 if (FD_ISSET(ses.sock, &writefd) && !isempty(&ses.writequeue)) { 164 if (FD_ISSET(ses.sock, &writefd) && !isempty(&ses.writequeue)) {
171 write_packet(); 165 write_packet();