diff options
author | Tim Schumacher <timschumi@gmx.de> | 2023-03-01 17:24:50 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-03-13 15:16:20 +0000 |
commit | ae51c1821c0d32ba40b866d8e5561f6de3359b17 (patch) | |
tree | 6bd2d0964841bf5bd56797ad4a887e8e4e3ac63c /Userland/Libraries/LibWeb/WebDriver | |
parent | 26516ee1601b0662bb1753f834a179bf1a20082d (diff) | |
download | serenity-ae51c1821c0d32ba40b866d8e5561f6de3359b17.zip |
Everywhere: Remove unintentional partial stream reads and writes
Diffstat (limited to 'Userland/Libraries/LibWeb/WebDriver')
-rw-r--r-- | Userland/Libraries/LibWeb/WebDriver/Client.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Userland/Libraries/LibWeb/WebDriver/Client.cpp b/Userland/Libraries/LibWeb/WebDriver/Client.cpp index 99b645bb65..6161e8b61f 100644 --- a/Userland/Libraries/LibWeb/WebDriver/Client.cpp +++ b/Userland/Libraries/LibWeb/WebDriver/Client.cpp @@ -279,8 +279,7 @@ ErrorOr<void, Client::WrappedError> Client::send_success_response(JsonValue resu builder.append("\r\n"sv); auto builder_contents = TRY(builder.to_byte_buffer()); - // FIXME: This should write the entire span. - TRY(m_socket->write_some(builder_contents)); + TRY(m_socket->write_until_depleted(builder_contents)); while (!content.is_empty()) { auto bytes_sent = TRY(m_socket->write_some(content.bytes())); @@ -320,9 +319,8 @@ ErrorOr<void, Client::WrappedError> Client::send_error_response(Error const& err header_builder.appendff("Content-Length: {}\r\n", content_builder.length()); header_builder.append("\r\n"sv); - // FIXME: This should write the entire span. - TRY(m_socket->write_some(TRY(header_builder.to_byte_buffer()))); - TRY(m_socket->write_some(TRY(content_builder.to_byte_buffer()))); + TRY(m_socket->write_until_depleted(TRY(header_builder.to_byte_buffer()))); + TRY(m_socket->write_until_depleted(TRY(content_builder.to_byte_buffer()))); log_response(error.http_status); return {}; |