Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
norstbox
gajim
Commits
cbbfe98d
Commit
cbbfe98d
authored
15 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
add some debug info when resolving hostnames. see #5466
parent
77953187
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/common/resolver.py
+5
-0
5 additions, 0 deletions
src/common/resolver.py
with
5 additions
and
0 deletions
src/common/resolver.py
+
5
−
0
View file @
cbbfe98d
...
...
@@ -62,6 +62,7 @@ class CommonResolver():
self
.
handlers
=
{}
def
resolve
(
self
,
host
,
on_ready
,
type
=
'
srv
'
):
log
.
debug
(
'
resolve %s type=%s
'
%
(
host
,
type
))
assert
(
type
in
[
'
srv
'
,
'
txt
'
])
if
not
host
:
# empty host, return empty list of srv records
...
...
@@ -69,19 +70,23 @@ class CommonResolver():
return
if
self
.
resolved_hosts
.
has_key
(
host
+
type
):
# host is already resolved, return cached values
log
.
debug
(
'
%s already resolved: %s
'
)
on_ready
(
host
,
self
.
resolved_hosts
[
host
+
type
])
return
if
self
.
handlers
.
has_key
(
host
+
type
):
# host is about to be resolved by another connection,
# attach our callback
log
.
debug
(
'
already resolving %s
'
%
host
)
self
.
handlers
[
host
+
type
].
append
(
on_ready
)
else
:
# host has never been resolved, start now
log
.
debug
(
'
Starting to resolve %s using %s
'
%
(
host
,
self
))
self
.
handlers
[
host
+
type
]
=
[
on_ready
]
self
.
start_resolve
(
host
,
type
)
def
_on_ready
(
self
,
host
,
type
,
result_list
):
# practically it is impossible to be the opposite, but who knows :)
log
.
debug
(
'
Resolving result for %s: %s
'
%
(
host
,
result_list
))
if
not
self
.
resolved_hosts
.
has_key
(
host
+
type
):
self
.
resolved_hosts
[
host
+
type
]
=
result_list
if
self
.
handlers
.
has_key
(
host
+
type
):
...
...
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