Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
laozhoubuluo authored Feb 16, 2024
1 parent 09b2651 commit 70dc4ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ def _custom_getaddrinfo(host, port, family=0, type=0, proto=0, flags=0):
return _orig_getaddrinfo(host, port, family, type, proto, flags)


getaddrinfo = _custom_getaddrinfo
socket.getaddrinfo = _custom_getaddrinfo


def _open(url, reg, sock):
try:
debug("open: %s", url)
parse = urlparse(url)
ip = getaddrinfo(parse.hostname, None, sock)[0][4][0]
ip = _orig_getaddrinfo(parse.hostname, None, sock)[0][4][0]
debug("ip address: %s", ip)
dns_mapping[parse.hostname] = ip
res = urlopen(
Expand Down

0 comments on commit 70dc4ff

Please sign in to comment.