correct newly found vets

This commit is contained in:
Laytan Laats
2024-04-03 00:52:58 +02:00
parent 21fcf7c874
commit 3a0df80066
18 changed files with 56 additions and 62 deletions
+2 -2
View File
@@ -119,9 +119,9 @@ aton :: proc(address_and_maybe_port: string, family: Address_Family, allow_decim
}
a: [4]u8 = ---
for v, i in buf {
for v, j in buf {
if v > 255 { return {}, false }
a[i] = u8(v)
a[j] = u8(v)
}
return IP4_Address(a), true
-1
View File
@@ -816,7 +816,6 @@ parse_response :: proc(response: []u8, filter: DNS_Record_Type = nil, allocator
dq_sz :: 4
hn_sz := skip_hostname(response, cur_idx) or_return
dns_query := mem.slice_data_cast([]u16be, response[cur_idx+hn_sz:cur_idx+hn_sz+dq_sz])
cur_idx += hn_sz + dq_sz
}
+2 -5
View File
@@ -85,11 +85,9 @@ _get_dns_records_os :: proc(hostname: string, type: DNS_Record_Type, allocator :
append(&recs, record)
case .CNAME:
hostname := strings.clone(string(r.Data.CNAME))
record := DNS_Record_CNAME{
base = base_record,
host_name = hostname,
host_name = strings.clone(string(r.Data.CNAME)),
}
append(&recs, record)
@@ -107,10 +105,9 @@ _get_dns_records_os :: proc(hostname: string, type: DNS_Record_Type, allocator :
}
case .NS:
hostname := strings.clone(string(r.Data.NS))
record := DNS_Record_NS{
base = base_record,
host_name = hostname,
host_name = strings.clone(string(r.Data.NS)),
}
append(&recs, record)
+3 -4
View File
@@ -161,11 +161,10 @@ recv_any :: proc(socket: Any_Socket, buf: []byte) -> (
) {
switch socktype in socket {
case TCP_Socket:
bytes_read, err := recv_tcp(socktype, buf)
return bytes_read, nil, err
bytes_read, err = recv_tcp(socktype, buf)
return
case UDP_Socket:
bytes_read, endpoint, err := recv_udp(socktype, buf)
return bytes_read, endpoint, err
return recv_udp(socktype, buf)
case: panic("Not supported")
}
}