mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
LibTLS: Retry sending in TLSv12::flush() on EAGAIN or EINTR
Crashing here is not very helpful.
This commit is contained in:
parent
c93d367d95
commit
baa26d10a8
Notes:
sideshowbarker
2024-07-17 18:46:57 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/baa26d10a8 Pull-request: https://github.com/SerenityOS/serenity/pull/21697 Reviewed-by: https://github.com/alimpfard ✅
1 changed files with 7 additions and 4 deletions
|
@ -271,11 +271,14 @@ ErrorOr<bool> TLSv12::flush()
|
|||
size_t written;
|
||||
do {
|
||||
auto result = stream.write_some(out_bytes);
|
||||
if (result.is_error() && result.error().code() != EINTR && result.error().code() != EAGAIN) {
|
||||
if (result.is_error()) {
|
||||
if (result.error().code() != EINTR && result.error().code() != EAGAIN) {
|
||||
error = result.release_error();
|
||||
dbgln("TLS Socket write error: {}", *error);
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
written = result.value();
|
||||
out_bytes = out_bytes.slice(written);
|
||||
} while (!out_bytes.is_empty());
|
||||
|
|
Loading…
Reference in a new issue