server: Return error on address lookup fails.
This corrects an issue introduced by commit
e8f63bc295
where a failure to lookup a
hostname could lead to a panic in certain circumstances. An error is
now returned in that case as expected.
This commit is contained in:
parent
089611a61b
commit
0d4546c965
1 changed files with 3 additions and 0 deletions
|
@ -2516,6 +2516,9 @@ func addrStringToNetAddr(addr string) (net.Addr, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
if len(ips) == 0 {
|
||||||
|
return nil, fmt.Errorf("no addresses found for %s", host)
|
||||||
|
}
|
||||||
|
|
||||||
port, err := strconv.Atoi(strPort)
|
port, err := strconv.Atoi(strPort)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue