mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 14:57:34 +00:00
LibDNS: Use AllocatingMemoryStream
in DNS package construction
This commit is contained in:
parent
202175cf4c
commit
87c64834ca
8 changed files with 31 additions and 28 deletions
|
@ -62,7 +62,7 @@ ErrorOr<void> DNSServer::handle_client()
|
|||
else
|
||||
response.set_code(Packet::Code::NOERROR);
|
||||
|
||||
buffer = response.to_byte_buffer();
|
||||
buffer = TRY(response.to_byte_buffer());
|
||||
|
||||
TRY(send(buffer, client_address));
|
||||
return {};
|
||||
|
|
|
@ -234,7 +234,7 @@ ErrorOr<Vector<Answer>> LookupServer::lookup(Name const& name, DeprecatedString
|
|||
name_in_question.randomize_case();
|
||||
request.add_question({ name_in_question, record_type, RecordClass::IN, false });
|
||||
|
||||
auto buffer = request.to_byte_buffer();
|
||||
auto buffer = TRY(request.to_byte_buffer());
|
||||
|
||||
auto udp_socket = TRY(Core::Stream::UDPSocket::connect(nameserver, 53, Time::from_seconds(1)));
|
||||
TRY(udp_socket->set_blocking(true));
|
||||
|
|
|
@ -110,7 +110,7 @@ void MulticastDNS::announce()
|
|||
|
||||
ErrorOr<size_t> MulticastDNS::emit_packet(Packet const& packet, sockaddr_in const* destination)
|
||||
{
|
||||
auto buffer = packet.to_byte_buffer();
|
||||
auto buffer = TRY(packet.to_byte_buffer());
|
||||
if (!destination)
|
||||
destination = &mdns_addr;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue