changeset 1615:a1e5bcd9a6eb

jingle XEP-0166: fixed session creation on non session-initiate actions
author Goffi <goffi@goffi.org>
date Tue, 17 Nov 2015 19:39:08 +0100
parents 1ced93821c35
children 1e05b776a55b
files src/plugins/plugin_xep_0166.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0166.py	Tue Nov 17 19:37:09 2015 +0100
+++ b/src/plugins/plugin_xep_0166.py	Tue Nov 17 19:39:08 2015 +0100
@@ -411,6 +411,11 @@
         try:
             session = client.jingle_sessions[sid]
         except KeyError:
+            if action != XEP_0166.A_SESSION_INITIATE:
+                log.warning(u"Received request for an unknown session id: {}".format(sid))
+                self.sendError('not-acceptable', None, request, profile=profile)
+                return
+
             session = client.jingle_sessions[sid] = {'id': sid,
                                                      'state': STATE_PENDING,
                                                      'initiator': peer_jid,