mirror of https://github.com/wolfSSL/wolfssh.git
wolfsshd: retry select() on EINTR in relay loop
SIGCHLD from the exec child interrupts select(), returning -1 and breaking the loop. Any windowFull data awaiting a peer window adjust was then abandoned, causing intermittent 32 KB truncations on large exec transfers. Continue on EINTR.pull/1001/head
parent
13db37b1b4
commit
094c686142
|
|
@ -1543,8 +1543,14 @@ static int SHELL_Subsystem(WOLFSSHD_CONNECTION* conn, WOLFSSH* ssh,
|
|||
}
|
||||
|
||||
rc = select((int)maxFd + 1, &readFds, &writeFds, NULL, NULL);
|
||||
if (rc == -1)
|
||||
if (rc == -1) {
|
||||
/* Signal (e.g. SIGCHLD from child exit) interrupted select.
|
||||
* Re-evaluate the loop condition so any pending windowFull
|
||||
* data and remaining pipe contents still get drained. */
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
pending = 1; /* found some pending SSH data */
|
||||
|
|
|
|||
Loading…
Reference in New Issue