Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Blomdell
mio
Commits
da881d49
Commit
da881d49
authored
1 year ago
by
Anders Blomdell
Browse files
Options
Downloads
Patches
Plain Diff
Add workaround for (bogus) reverse address lookups
parent
0a28f937
Branches
Branches containing commit
Tags
v0.9.16
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mio/filecache.py
+19
-3
19 additions, 3 deletions
src/mio/filecache.py
with
19 additions
and
3 deletions
src/mio/filecache.py
+
19
−
3
View file @
da881d49
...
@@ -76,9 +76,25 @@ class Unalias:
...
@@ -76,9 +76,25 @@ class Unalias:
byaddr
.
add
(
sa
[
0
])
byaddr
.
add
(
sa
[
0
])
pass
pass
self
.
by_name
[
host
]
=
set
()
self
.
by_name
[
host
]
=
set
()
for
name
,
_
,
_
in
map
(
socket
.
gethostbyaddr
,
byaddr
):
for
addr
in
byaddr
:
# Temporary fix for totally broken design
# we should not rely on reverse lookups since that
# mostly fails for local addresses, we should implemennt
# handling of mirrorlists/metalinks
try
:
name
,
_
,
_
=
socket
.
gethostbyaddr
(
addr
)
self
.
by_name
[
host
].
add
(
str
(
name
))
self
.
by_name
[
host
].
add
(
str
(
name
))
pass
pass
except
:
pass
pass
pass
if
not
self
.
by_name
[
host
]:
# Temporary fix for totally broken design
# we should not rely on reverse lookups since that
# mostly fails for local addresses, we should implemennt
# handling of mirrorlists/metalinks
self
.
by_name
[
host
].
add
(
host
)
pass
pass
return
sorted
(
self
.
by_name
[
host
])
return
sorted
(
self
.
by_name
[
host
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment