mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +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,10 +271,13 @@ ErrorOr<bool> TLSv12::flush()
|
||||||
size_t written;
|
size_t written;
|
||||||
do {
|
do {
|
||||||
auto result = stream.write_some(out_bytes);
|
auto result = stream.write_some(out_bytes);
|
||||||
if (result.is_error() && result.error().code() != EINTR && result.error().code() != EAGAIN) {
|
if (result.is_error()) {
|
||||||
error = result.release_error();
|
if (result.error().code() != EINTR && result.error().code() != EAGAIN) {
|
||||||
dbgln("TLS Socket write error: {}", *error);
|
error = result.release_error();
|
||||||
break;
|
dbgln("TLS Socket write error: {}", *error);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
written = result.value();
|
written = result.value();
|
||||||
out_bytes = out_bytes.slice(written);
|
out_bytes = out_bytes.slice(written);
|
||||||
|
|
Loading…
Reference in a new issue