mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Listen IPv6 address if available
This commit is contained in:
parent
091404eb0d
commit
4d3553a115
@ -29,6 +29,7 @@ from calibre.utils.localization import _
|
|||||||
from calibre.utils.logging import ThreadSafeLog
|
from calibre.utils.logging import ThreadSafeLog
|
||||||
from calibre.utils.mdns import get_external_ip
|
from calibre.utils.mdns import get_external_ip
|
||||||
from calibre.utils.monotonic import monotonic
|
from calibre.utils.monotonic import monotonic
|
||||||
|
from calibre.utils.network import get_fallback_server_addr
|
||||||
from calibre.utils.socket_inheritance import set_socket_inherit
|
from calibre.utils.socket_inheritance import set_socket_inherit
|
||||||
from polyglot.builtins import iteritems
|
from polyglot.builtins import iteritems
|
||||||
from polyglot.queue import Empty, Full
|
from polyglot.queue import Empty, Full
|
||||||
@ -399,7 +400,7 @@ class ServerLoop:
|
|||||||
ba = (self.opts.listen_on, int(self.opts.port))
|
ba = (self.opts.listen_on, int(self.opts.port))
|
||||||
if not ba[0]:
|
if not ba[0]:
|
||||||
# AI_PASSIVE does not work with host of '' or None
|
# AI_PASSIVE does not work with host of '' or None
|
||||||
ba = ('0.0.0.0', ba[1])
|
ba = (get_fallback_server_addr(), ba[1])
|
||||||
self.bind_address = ba
|
self.bind_address = ba
|
||||||
self.bound_address = None
|
self.bound_address = None
|
||||||
self.connection_map = {}
|
self.connection_map = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user