update to latest adns, synced with Go's net

This commit is contained in:
Mechiel Lukkien
2024-03-08 15:31:54 +01:00
parent a00b0ba6cd
commit 4fbd7abb57
17 changed files with 187 additions and 85 deletions

View File

@ -68,7 +68,7 @@ func SplitHostPort(hostport string) (host, port string, err error) {
j, k := 0, 0
// The port starts after the last colon.
i := last(hostport, ':')
i := bytealg.LastIndexByteString(hostport, ':')
if i < 0 {
return addrErr(hostport, missingPort)
}
@ -115,7 +115,7 @@ func SplitHostPort(hostport string) (host, port string, err error) {
func splitHostZone(s string) (host, zone string) {
// The IPv6 scoped addressing zone identifier starts after the
// last percent sign.
if i := last(s, '%'); i > 0 {
if i := bytealg.LastIndexByteString(s, '%'); i > 0 {
host, zone = s[:i], s[i+1:]
} else {
host = s