mirror of
https://github.com/clearml/dropbear
synced 2025-03-09 13:30:45 +00:00
merge of 'a94c5265558121fe936519b5d9a5eb27f95e9d9d'
and 'd348546b80847bc0d42a7b5208bb31a54f1fdfaf' --HG-- branch : channel-fix extra : convert_revision : a144a771379fa1f0204f81ac3182d045f884be19
This commit is contained in:
commit
235ac72a06
@ -143,28 +143,22 @@ void session_loop(void(*loophandler)()) {
|
|||||||
dropbear_exit("Terminated by signal");
|
dropbear_exit("Terminated by signal");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (val < 0) {
|
if (val < 0 && errno != EINTR) {
|
||||||
if (errno == EINTR) {
|
|
||||||
/* This must happen even if we've been interrupted, so that
|
|
||||||
* changed signal-handler vars can take effect etc */
|
|
||||||
if (loophandler) {
|
|
||||||
loophandler();
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
dropbear_exit("Error in select");
|
dropbear_exit("Error in select");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (val <= 0) {
|
||||||
|
/* If we were interrupted or the select timed out, we still
|
||||||
|
* want to iterate over channels etc for reading, to handle
|
||||||
|
* server processes exiting etc.
|
||||||
|
* We don't want to read/write FDs. */
|
||||||
|
FD_ZERO(&writefd);
|
||||||
|
FD_ZERO(&readfd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check for auth timeout, rekeying required etc */
|
/* check for auth timeout, rekeying required etc */
|
||||||
checktimeouts();
|
checktimeouts();
|
||||||
|
|
||||||
if (val == 0) {
|
|
||||||
/* timeout */
|
|
||||||
TRACE(("select timeout"))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* process session socket's incoming/outgoing data */
|
/* process session socket's incoming/outgoing data */
|
||||||
if (ses.sock != -1) {
|
if (ses.sock != -1) {
|
||||||
if (FD_ISSET(ses.sock, &writefd) && !isempty(&ses.writequeue)) {
|
if (FD_ISSET(ses.sock, &writefd) && !isempty(&ses.writequeue)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user