aboutsummaryrefslogtreecommitdiff
path: root/core/net
diff options
context:
space:
mode:
authorLaytan Laats <laytanlaats@hotmail.com>2024-04-03 00:05:31 +0200
committerLaytan Laats <laytanlaats@hotmail.com>2024-04-03 00:52:58 +0200
commit3a0df800664105f5944ad9e0230debe3a3207969 (patch)
treef2ac5c150bae1b0fc62bf6381bded50bfad5b6bf /core/net
parent21fcf7c8744260c904e7040bdb1d550a0931aa3e (diff)
correct newly found vets
Diffstat (limited to 'core/net')
-rw-r--r--core/net/addr.odin4
-rw-r--r--core/net/dns.odin1
-rw-r--r--core/net/dns_windows.odin7
-rw-r--r--core/net/socket.odin7
4 files changed, 7 insertions, 12 deletions
diff --git a/core/net/addr.odin b/core/net/addr.odin
index 508399bf4..c01724d99 100644
--- a/core/net/addr.odin
+++ b/core/net/addr.odin
@@ -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
diff --git a/core/net/dns.odin b/core/net/dns.odin
index c556450c6..48cd8bf29 100644
--- a/core/net/dns.odin
+++ b/core/net/dns.odin
@@ -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
}
diff --git a/core/net/dns_windows.odin b/core/net/dns_windows.odin
index e54b067b6..ccec7ea4b 100644
--- a/core/net/dns_windows.odin
+++ b/core/net/dns_windows.odin
@@ -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)
diff --git a/core/net/socket.odin b/core/net/socket.odin
index 1bfa52257..5f137401e 100644
--- a/core/net/socket.odin
+++ b/core/net/socket.odin
@@ -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")
}
}