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
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Peter Shkenev
gajim
Commits
3200801b
Commit
3200801b
authored
19 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
revert last srv commit so svn is usable
parent
310baa52
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/xmpp/transports.py
+8
-16
8 additions, 16 deletions
src/common/xmpp/transports.py
with
8 additions
and
16 deletions
src/common/xmpp/transports.py
+
8
−
16
View file @
3200801b
...
...
@@ -33,13 +33,9 @@
from
protocol
import
*
try
:
import
DNS
,
random
DNS
.
ParseResolvConf
()
HAVE_DNS
=
True
import
dns.resolver
except
:
HAVE_DNS
=
False
self
.
DEBUG
(
"
Warning: cannot perform SRV queries because
'
dns
'
module is unavailable
"
,
'
warn
'
)
pass
DATA_RECEIVED
=
'
DATA RECEIVED
'
DATA_SENT
=
'
DATA SENT
'
...
...
@@ -64,23 +60,19 @@ def __init__(self, server=None):
self
.
_exported_methods
=
[
self
.
send
,
self
.
disconnect
]
# SRV resolver
if
HAVE_DNS
:
# if dnspython is available support SRV
if
'
dns
'
in
globals
()
:
# if dnspython is available support SRV
host
,
port
=
server
possible_queries
=
[
'
_xmpp-client._tcp.
'
+
host
]
dnsrequest
=
DNS
.
Request
()
for
query
in
possible_queries
:
try
:
response
=
dnsrequest
.
req
(
query
,
qtype
=
'
SRV
'
)
answers
=
[
x
for
x
in
response
.
answers
]
answers
=
[
x
for
x
in
dns
.
resolver
.
query
(
query
,
'
SRV
'
)]
if
answers
:
# extract the data from a random SRV RR
rr
=
random
.
choice
(
answers
)
_
,
_
,
port
,
host
=
rr
[
'
data
'
]
port
=
int
(
port
)
host
=
str
(
answers
[
0
].
target
)
port
=
int
(
answers
[
0
].
port
)
break
except
DNS
.
DNSError
,
err
:
self
.
DEBUG
(
"
An error occurred querying SRV record for %s
"
%
query
,
'
warn
'
)
except
:
pass
server
=
(
host
,
port
)
# end of SRV resolver
...
...
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