Skip to content

Commit edb9081

Browse files
committed
Check 'SSL_ERROR_ZERO_RETURN' for a closed SSL connection.
1 parent 37b56b8 commit edb9081

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/kernel/poller.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,10 +453,15 @@ static void __poller_handle_read(struct __poller_node *node,
453453
else
454454
{
455455
nleft = SSL_read(node->data.ssl, p, POLLER_BUFSIZE);
456-
if (nleft < 0)
456+
if (nleft <= 0)
457457
{
458458
if (__poller_handle_ssl_error(node, nleft, poller) >= 0)
459459
return;
460+
461+
if (errno == -SSL_ERROR_ZERO_RETURN)
462+
nleft = 0;
463+
else
464+
nleft = -1;
460465
}
461466
}
462467

0 commit comments

Comments
 (0)