Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Link Mauve
python-nbxmpp
Commits
abc42a9b
Commit
abc42a9b
authored
Feb 14, 2017
by
Philipp Hörist
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'smacks_rev_1.5' into 'master'
Smacks rev 1.5.2 See merge request
!5
parents
ed4a9e05
e30565e2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
nbxmpp/smacks.py
nbxmpp/smacks.py
+9
-0
nbxmpp/transports_nb.py
nbxmpp/transports_nb.py
+2
-0
No files found.
nbxmpp/smacks.py
View file @
abc42a9b
from
.protocol
import
Acks
from
.protocol
import
NS_STREAM_MGMT
from
.transports_nb
import
CONNECTED
,
CONNECTING
,
DISCONNECTED
,
DISCONNECTING
import
logging
log
=
logging
.
getLogger
(
'nbxmpp.smacks'
)
...
...
@@ -104,6 +105,14 @@ class Smacks(object):
ack
=
Acks
()
ack
.
buildAnswer
(
self
.
in_h
)
self
.
_owner
.
Connection
.
send
(
ack
,
False
)
def
send_closing_ack
(
self
):
if
self
.
_owner
.
Connection
.
get_state
()
!=
DISCONNECTING
:
log
.
error
(
"Not allowed to send closing smacks ack when not disconnecting!"
)
return
ack
=
Acks
()
ack
.
buildAnswer
(
self
.
in_h
)
self
.
_owner
.
Connection
.
send
(
ack
,
True
)
def
request_ack
(
self
):
r
=
Acks
()
...
...
nbxmpp/transports_nb.py
View file @
abc42a9b
...
...
@@ -304,6 +304,8 @@ class NonBlockingTransport(PlugIn):
# FIXME: where and why does this need to be called
def
start_disconnect
(
self
):
self
.
set_state
(
DISCONNECTING
)
if
self
.
_owner
.
_caller
.
sm
and
self
.
_owner
.
_caller
.
sm
.
enabled
:
self
.
_owner
.
_caller
.
sm
.
send_closing_ack
()
class
NonBlockingTCP
(
NonBlockingTransport
,
IdleObject
):
...
...
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