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
Erik Huelsmann
gajim
Commits
8d8db580
Commit
8d8db580
authored
15 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
ignore invalid SRV reply from libasyncns. Fixes #5507
parent
5ec5886c
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
+20
-7
20 additions, 7 deletions
src/common/resolver.py
with
20 additions
and
7 deletions
src/common/resolver.py
+
20
−
7
View file @
8d8db580
...
@@ -23,8 +23,14 @@ import re
...
@@ -23,8 +23,14 @@ import re
import
logging
import
logging
log
=
logging
.
getLogger
(
'
gajim.c.resolver
'
)
log
=
logging
.
getLogger
(
'
gajim.c.resolver
'
)
if
__name__
==
'
__main__
'
:
sys
.
path
.
append
(
'
..
'
)
from
common
import
i18n
import
common.configpaths
common
.
configpaths
.
gajimpaths
.
init
(
None
)
from
common
import
helpers
from
common
import
helpers
from
xmpp.idlequeue
import
IdleCommand
from
common.
xmpp.idlequeue
import
IdleCommand
# it is good to check validity of arguments, when calling system commands
# it is good to check validity of arguments, when calling system commands
ns_type_pattern
=
re
.
compile
(
'
^[a-z]+$
'
)
ns_type_pattern
=
re
.
compile
(
'
^[a-z]+$
'
)
...
@@ -126,18 +132,23 @@ class LibAsyncNSResolver(CommonResolver):
...
@@ -126,18 +132,23 @@ class LibAsyncNSResolver(CommonResolver):
while
resq
is
not
None
:
while
resq
is
not
None
:
try
:
try
:
rl
=
resq
.
get_done
()
rl
=
resq
.
get_done
()
except
:
except
Exception
:
rl
=
[]
rl
=
[]
hosts
=
[]
requested_type
=
resq
.
userdata
[
'
type
'
]
requested_host
=
resq
.
userdata
[
'
host
'
]
if
rl
:
if
rl
:
for
r
in
rl
:
for
r
in
rl
:
if
r
[
'
type
'
]
!=
requested_type
:
# Answer doesn't contain valid SRV data
continue
r
[
'
prio
'
]
=
r
[
'
pref
'
]
r
[
'
prio
'
]
=
r
[
'
pref
'
]
self
.
_on_ready
(
hosts
.
append
(
r
)
host
=
resq
.
userdata
[
'
host
'
],
self
.
_on_ready
(
host
=
requested_host
,
type
=
requested_type
,
type
=
resq
.
userdata
[
'
type
'
],
result_list
=
hosts
)
result_list
=
rl
)
try
:
try
:
resq
=
self
.
asyncns
.
get_next
()
resq
=
self
.
asyncns
.
get_next
()
except
:
except
Exception
:
resq
=
None
resq
=
None
elif
type
(
resq
)
==
libasyncns
.
AddrInfoQuery
:
elif
type
(
resq
)
==
libasyncns
.
AddrInfoQuery
:
# getaddrinfo result (A or AAAA)
# getaddrinfo result (A or AAAA)
...
@@ -324,6 +335,8 @@ if __name__ == '__main__':
...
@@ -324,6 +335,8 @@ if __name__ == '__main__':
win
.
add
(
hbox
)
win
.
add
(
hbox
)
win
.
show_all
()
win
.
show_all
()
gobject
.
timeout_add
(
200
,
idlequeue
.
process
)
gobject
.
timeout_add
(
200
,
idlequeue
.
process
)
if
USE_LIBASYNCNS
:
gobject
.
timeout_add
(
200
,
resolver
.
process
)
gtk
.
main
()
gtk
.
main
()
# vim: se ts=3:
# vim: se ts=3:
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