commit 813645df7b21d54ae779e80fc6e7ad9c913b67d6 from: Tobias Heider date: Mon Apr 15 14:52:33 2024 UTC Unset errno and bio->wantev if error was not TLS_WANT_*. This is commonly called in a loop, if we don't clear them we might keep on looping. ok stsp@ commit - fe24f0a37093d812e8f7eb29a626a6d3f0b92aea commit + 813645df7b21d54ae779e80fc6e7ad9c913b67d6 blob - 020f1c5b26ce81182b90f2762c14aaf6e1144176 blob + 8c41efaa709011edca44b1445296029d36c0644f --- lib/bufio.c +++ lib/bufio.c @@ -287,6 +287,8 @@ bufio_read(struct bufio *bio) bio->wantev = BUFIO_WANT_WRITE; return (-1); case -1: + bio->wantev = 0; + errno = 0; return (-1); default: bio->wantev = 0;