A source URL may have an IP address that doesn't exist any more
This commit is contained in:
parent
cf7d60a704
commit
b898e07066
|
@ -9,6 +9,7 @@ import (
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"net"
|
"net"
|
||||||
|
@ -415,6 +416,9 @@ func (xTransport *XTransport) resolveAndUpdateCache(host string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if foundIP == nil {
|
||||||
|
return fmt.Errorf("no IP address found for [%s]", host)
|
||||||
|
}
|
||||||
xTransport.saveCachedIP(host, foundIP, ttl)
|
xTransport.saveCachedIP(host, foundIP, ttl)
|
||||||
dlog.Debugf("[%s] IP address [%s] added to the cache, valid for %v", host, foundIP, ttl)
|
dlog.Debugf("[%s] IP address [%s] added to the cache, valid for %v", host, foundIP, ttl)
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue