changeset 93c39dc1b2a3 in /home/hg/repos/gajim
author: Yann Leboulanger asterix@lagaule.org branches: details:http://hg.gajim.org/gajim?cmd=changeset;node=93c39dc1b2a3 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 a3d3f11a2cd4 -r 93c39dc1b2a3 src/common/jingle_rtp.py --- a/src/common/jingle_rtp.py Sun Jan 03 20:44:03 2016 +0100 +++ b/src/common/jingle_rtp.py Sun Jan 03 22:26:15 2016 +0100 @@ -36,6 +36,7 @@ from common.jingle_transport import JingleTransportICEUDP from common.jingle_content import contents, JingleContent, JingleContentSetupException from common.connection_handlers_events import InformationEvent +from common.jingle_session import FailedApplication
import logging @@ -283,10 +284,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 GLib.Error: + raise FailedApplication
def iter_codecs(self): codecs = self.p2psession.props.codecs_without_config diff -r a3d3f11a2cd4 -r 93c39dc1b2a3 src/common/jingle_session.py --- a/src/common/jingle_session.py Sun Jan 03 20:44:03 2016 +0100 +++ 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 @@ -347,6 +352,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): """