mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:48:12 +00:00
Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safe
This commit is contained in:
parent
3a9f00c59b
commit
97e97bccab
105 changed files with 629 additions and 290 deletions
|
@ -69,7 +69,11 @@ OwnPtr<Request> start_request(TBadgedProtocol&& protocol, ClientConnection& clie
|
|||
request.set_method(HTTP::HttpRequest::Method::GET);
|
||||
request.set_url(url);
|
||||
request.set_headers(headers);
|
||||
request.set_body(body);
|
||||
|
||||
auto allocated_body_result = ByteBuffer::copy(body);
|
||||
if (!allocated_body_result.has_value())
|
||||
return {};
|
||||
request.set_body(allocated_body_result.release_value());
|
||||
|
||||
auto output_stream = make<OutputFileStream>(pipe_result.value().write_fd);
|
||||
output_stream->make_unbuffered();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue