mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use the new algorthm preferentially when getting external IP
This commit is contained in:
parent
ccd34f8d3f
commit
3a1bb4ad0a
@ -89,7 +89,11 @@ _ext_ip = None
|
|||||||
def get_external_ip():
|
def get_external_ip():
|
||||||
global _ext_ip
|
global _ext_ip
|
||||||
if _ext_ip is None:
|
if _ext_ip is None:
|
||||||
_ext_ip = _get_external_ip()
|
from calibre.utils.ip_routing import get_default_route_src_address
|
||||||
|
try:
|
||||||
|
_ext_ip = get_default_route_src_address()
|
||||||
|
except Exception:
|
||||||
|
_ext_ip = _get_external_ip()
|
||||||
return _ext_ip
|
return _ext_ip
|
||||||
|
|
||||||
def start_server():
|
def start_server():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user