mirror of
https://github.com/strongswan/strongswan.git
synced 2025-11-13 00:00:38 -05:00
libtls: Catch POLLHUP/NVAL in TLS socket splicing
If one of the sockets gets disconnected, some systems return POLLHUP. Signal the socket as ready to let the read/write call fail properly.
This commit is contained in:
parent
015fb3134d
commit
4ef819a379
@ -308,7 +308,7 @@ METHOD(tls_socket_t, splice, bool,
|
|||||||
DBG1(DBG_TLS, "TLS select error: %s", strerror(errno));
|
DBG1(DBG_TLS, "TLS select error: %s", strerror(errno));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
while (!plain_eof && pfd[0].revents & POLLIN)
|
while (!plain_eof && pfd[0].revents & (POLLIN | POLLHUP | POLLNVAL))
|
||||||
{
|
{
|
||||||
in = read_(this, buf, sizeof(buf), FALSE);
|
in = read_(this, buf, sizeof(buf), FALSE);
|
||||||
switch (in)
|
switch (in)
|
||||||
@ -341,7 +341,7 @@ METHOD(tls_socket_t, splice, bool,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!crypto_eof && pfd[1].revents & POLLIN)
|
if (!crypto_eof && pfd[1].revents & (POLLIN | POLLHUP | POLLNVAL))
|
||||||
{
|
{
|
||||||
in = read(rfd, buf, sizeof(buf));
|
in = read(rfd, buf, sizeof(buf));
|
||||||
switch (in)
|
switch (in)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user