commit 8ec83e5b6ebab7711854b45048771661a0f9ec98 from: Tobias Heider via: Thomas Adam date: Thu Apr 25 14:57:36 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 - 29460ff0cab862cacf5ec17a35c653e83ffff229 commit + 8ec83e5b6ebab7711854b45048771661a0f9ec98 blob - 144bb6edab83dff032ca0613fd3117ae00c88da6 blob + 3d06e7083870f02f1904215e1a6aa63a6b50853e --- lib/bufio.c +++ lib/bufio.c @@ -289,6 +289,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;