Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Yann Leboulanger
python-nbxmpp
Commits
9dcd1fa3
Commit
9dcd1fa3
authored
Dec 08, 2017
by
Yann Leboulanger
Browse files
send unrequested ack when we haven't acked more than 100 stanza. Fixes
gajim/gajim#8758
parent
e79bf285
Pipeline
#688
passed with stages
in 13 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
nbxmpp/dispatcher_nb.py
View file @
9dcd1fa3
...
...
@@ -589,6 +589,8 @@ class XMPPDispatcher(PlugIn):
if
len
(
self
.
sm
.
uqueue
)
>
self
.
sm
.
max_queue
:
self
.
sm
.
request_ack
()
if
(
self
.
sm
.
in_h
-
self
.
sm
.
last_sent_in_h
)
>
100
:
self
.
sm
.
send_ack
()
return
ID
...
...
nbxmpp/smacks.py
View file @
9dcd1fa3
...
...
@@ -18,6 +18,7 @@ class Smacks(object):
self
.
con
=
con
# Connection object
self
.
out_h
=
0
# Outgoing stanzas handled
self
.
in_h
=
0
# Incoming stanzas handled
self
.
last_sent_in_h
=
0
# Last acked stanza.
self
.
uqueue
=
[]
# Unhandled stanzas queue
self
.
old_uqueue
=
[]
# Unhandled stanzas queue of the last session
self
.
session_id
=
None
...
...
@@ -68,6 +69,7 @@ class Smacks(object):
log
.
debug
(
"Clearing smacks uqueue"
)
self
.
uqueue
=
[]
self
.
in_h
=
0
self
.
last_sent_in_h
=
0
self
.
out_h
=
0
self
.
session_id
=
None
self
.
enabled
=
True
...
...
@@ -99,11 +101,13 @@ class Smacks(object):
self
.
uqueue
=
[]
resume
=
Acks
()
resume
.
buildResume
(
self
.
in_h
,
self
.
session_id
)
self
.
last_sent_in_h
=
self
.
in_h
self
.
_owner
.
Connection
.
send
(
resume
,
False
)
def
send_ack
(
self
,
disp
,
stanza
):
def
send_ack
(
self
,
disp
=
None
,
stanza
=
None
):
ack
=
Acks
()
ack
.
buildAnswer
(
self
.
in_h
)
self
.
last_sent_in_h
=
self
.
in_h
self
.
_owner
.
Connection
.
send
(
ack
,
False
)
def
send_closing_ack
(
self
):
...
...
@@ -112,6 +116,7 @@ class Smacks(object):
return
ack
=
Acks
()
ack
.
buildAnswer
(
self
.
in_h
)
self
.
last_sent_in_h
=
self
.
in_h
self
.
_owner
.
Connection
.
send
(
ack
,
True
)
def
request_ack
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment