changeset 34318236c9b8 in /home/hg/repos/gajim
author: Yann Leboulanger asterix@lagaule.org branches: gajim_0.16 details:http://hg.gajim.org/gajim?cmd=changeset;node=34318236c9b8 description: correctly close jingle session when no intersection between the remote codecs and the local ones. Fixes #8210
diffstat:
src/common/jingle_rtp.py | 9 +++++---- src/common/jingle_session.py | 9 +++++++++ 2 files changed, 14 insertions(+), 4 deletions(-)
diffs (52 lines):
diff -r 00fb9f8cfb30 -r 34318236c9b8 src/common/jingle_rtp.py --- a/src/common/jingle_rtp.py Mon Apr 18 22:38:17 2016 +0200 +++ b/src/common/jingle_rtp.py Sun Jan 03 22:26:15 2016 +0100 @@ -32,6 +32,7 @@ from jingle_transport import JingleTransportICEUDP from jingle_content import contents, JingleContent, JingleContentSetupException from connection_handlers_events import InformationEvent +from common.jingle_session import FailedApplication
import logging @@ -279,10 +280,10 @@ codecs.append(c)
if codecs: - # FIXME: Handle this case: - # glib.GError: There was no intersection between the remote codecs and - # the local ones - self.p2pstream.set_remote_codecs(codecs) + try: + self.p2pstream.set_remote_codecs(codecs) + except GError: + raise FailedApplication
def iter_codecs(self): codecs = self.p2psession.get_property('codecs') diff -r 00fb9f8cfb30 -r 34318236c9b8 src/common/jingle_session.py --- a/src/common/jingle_session.py Mon Apr 18 22:38:17 2016 +0200 +++ b/src/common/jingle_session.py Sun Jan 03 22:26:15 2016 +0100 @@ -59,6 +59,11 @@ action """
+class FailedApplication(Exception): + """ + Exception that should be raised in case responder supports none of the payload-types offered by the initiator + """ + class JingleSession(object): """ This represents one jingle session, that is, one or more content types @@ -348,6 +353,10 @@ except OutOfOrder: # FIXME self.__send_error(stanza, 'unexpected-request', 'out-of-order') + except FailedApplication: + reason = nbxmpp.Node('reason') + reason.addChild('failed-application') + self._session_terminate(reason)
def __ack(self, stanza, jingle, error, action): """