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
Weblate
gajim
Commits
7194260f
Commit
7194260f
authored
13 years ago
by
zimio
Browse files
Options
Downloads
Patches
Plain Diff
connects when server can't resume stream
parent
2090b9b9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/common/xmpp/dispatcher_nb.py
+1
-1
1 addition, 1 deletion
src/common/xmpp/dispatcher_nb.py
src/common/xmpp/smacks.py
+23
-9
23 additions, 9 deletions
src/common/xmpp/smacks.py
with
24 additions
and
10 deletions
src/common/xmpp/dispatcher_nb.py
+
1
−
1
View file @
7194260f
...
...
@@ -535,7 +535,7 @@ class XMPPDispatcher(PlugIn):
if
self
.
_owner
.
_registered_name
and
not
stanza
.
getAttr
(
'
from
'
):
stanza
.
setAttr
(
'
from
'
,
self
.
_owner
.
_registered_name
)
if
self
.
sm
:
if
self
.
sm
and
self
.
sm
.
enabled
:
self
.
sm
.
uqueue
.
append
(
stanza
)
self
.
sm
.
out_h
=
self
.
sm
.
out_h
+
1
if
len
(
self
.
sm
.
uqueue
)
>
self
.
sm
.
max_queue
:
...
...
This diff is collapsed.
Click to expand it.
src/common/xmpp/smacks.py
+
23
−
9
View file @
7194260f
...
...
@@ -24,7 +24,8 @@ class Smacks():
self
.
max_queue
=
5
self
.
_owner
=
None
self
.
resuming
=
False
self
.
enabled
=
False
# If SM is enabled
def
set_owner
(
self
,
owner
):
self
.
_owner
=
owner
...
...
@@ -50,6 +51,8 @@ class Smacks():
if
r
==
'
false
'
or
r
==
'
False
'
or
r
==
'
0
'
:
self
.
negociate
(
False
)
self
.
enabled
=
True
def
negociate
(
self
,
resume
=
True
):
# Every time we attempt to negociate, we must erase all previous info
...
...
@@ -69,7 +72,7 @@ class Smacks():
log
.
error
(
'
Attempted to resume without a valid session id
'
)
return
resume
=
Acks
()
resume
.
buildResume
(
self
.
in_h
,
self
.
session_id
)
resume
.
buildResume
(
self
.
in_h
,
None
)
#
self.session_id)
self
.
_owner
.
Connection
.
send
(
resume
,
True
)
def
send_ack
(
self
,
disp
,
stanza
):
...
...
@@ -105,17 +108,28 @@ class Smacks():
for
i
in
self
.
uqueue
:
self
.
_owner
.
Connection
.
send
(
i
,
False
)
def
error_handling
(
self
,
disp
,
stanza
):
# NEEDS TESTING
def
error_handling
(
self
,
disp
,
stanza
):
tag
=
stanza
.
getTag
(
'
item-not-found
'
)
# If the server doesn't recognize previd, forget about resuming
# Ask for service discovery, etc..
if
ta
g
:
self
.
negociate
()
if
s
ta
nza
.
getTag
(
'
item-not-found
'
)
:
self
.
enabled
=
False
self
.
resuming
=
False
self
.
negociate
()
self
.
con
.
_discover_server_at_connection
(
self
.
con
.
connection
)
return
tag
=
stanza
.
getTag
(
'
feature-not-implemented
'
)
# Doesn't support resumption
if
tag
:
self
.
negociate
(
False
)
\ No newline at end of file
if
stanza
.
getTag
(
'
feature-not-implemented
'
):
self
.
enabled
=
False
self
.
negociate
(
False
)
return
if
stanza
.
getTag
(
'
unexpected-request
'
):
self
.
enabled
=
False
log
.
error
(
'
Gajim failed to negociate Stream Management
'
)
return
\ No newline at end of file
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