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
eta
gajim
Commits
7dd8a27b
Commit
7dd8a27b
authored
17 years ago
by
sb
Browse files
Options
Downloads
Patches
Plain Diff
fix #3186 (thanks dkirov)
parent
24c8a3dc
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/zeroconf/client_zeroconf.py
+11
-6
11 additions, 6 deletions
src/common/zeroconf/client_zeroconf.py
with
11 additions
and
6 deletions
src/common/zeroconf/client_zeroconf.py
+
11
−
6
View file @
7dd8a27b
...
...
@@ -121,6 +121,7 @@ class P2PClient(IdleObject):
self
.
sock_type
=
TYPE_SERVER
else
:
self
.
sock_type
=
TYPE_CLIENT
self
.
fd
=
-
1
conn
=
P2PConnection
(
''
,
_sock
,
host
,
port
,
self
.
_caller
,
self
.
on_connect
,
self
)
self
.
sock_hash
=
conn
.
_sock
.
__hash__
self
.
fd
=
conn
.
fd
...
...
@@ -129,10 +130,14 @@ class P2PClient(IdleObject):
for
val
in
self
.
stanzaqueue
:
stanza
,
is_message
=
val
if
is_message
:
if
self
.
conn_holder
.
number_of_awaiting_messages
.
has_key
(
self
.
fd
):
self
.
conn_holder
.
number_of_awaiting_messages
[
self
.
fd
]
+=
1
if
self
.
fd
==
-
1
:
self
.
_caller
.
dispatch
(
'
MSGERROR
'
,[
unicode
(
self
.
to
),
-
1
,
\
_
(
'
Connection to host could not be established
'
),
None
,
None
])
else
:
self
.
conn_holder
.
number_of_awaiting_messages
[
self
.
fd
]
=
1
if
self
.
conn_holder
.
number_of_awaiting_messages
.
has_key
(
self
.
fd
):
self
.
conn_holder
.
number_of_awaiting_messages
[
self
.
fd
]
+=
1
else
:
self
.
conn_holder
.
number_of_awaiting_messages
[
self
.
fd
]
=
1
def
add_stanza
(
self
,
stanza
,
is_message
=
False
):
if
self
.
Connection
:
...
...
@@ -207,11 +212,11 @@ class P2PClient(IdleObject):
def
on_disconnect
(
self
):
if
self
.
conn_holder
:
if
self
.
conn_holder
.
number_of_awaiting_messages
.
has_key
(
self
.
fd
):
if
self
.
conn_holder
.
number_of_awaiting_messages
[
self
.
fd
]
>
0
:
if
self
.
conn_holder
.
number_of_awaiting_messages
.
has_key
(
self
.
conn_holder
.
fd
):
if
self
.
conn_holder
.
number_of_awaiting_messages
[
self
.
conn_holder
.
fd
]
>
0
:
self
.
_caller
.
dispatch
(
'
MSGERROR
'
,[
unicode
(
self
.
to
),
-
1
,
\
_
(
'
Connection to host could not be established
'
),
None
,
None
])
del
self
.
conn_holder
.
number_of_awaiting_messages
[
self
.
fd
]
del
self
.
conn_holder
.
number_of_awaiting_messages
[
self
.
conn_holder
.
fd
]
self
.
conn_holder
.
remove_connection
(
self
.
sock_hash
)
if
self
.
__dict__
.
has_key
(
'
Dispatcher
'
):
self
.
Dispatcher
.
PlugOut
()
...
...
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