diff options
author | Thibaut Girka <thib@sitedethib.com> | 2010-05-03 17:17:02 +0400 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2010-05-03 17:17:02 +0400 |
commit | af7238f4e769edfc3f6ed60f89fc2d7cafd64cfc (patch) | |
tree | 7709c5c5b4783e0e3a764053342b0a587da05641 | |
parent | 93e895dde18b4431dc344c986a78a7f66c8525db (diff) |
[Jingle] Sends bad-request when receiving jingle action on unknown content
-rw-r--r-- | src/common/jingle_session.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/common/jingle_session.py b/src/common/jingle_session.py index 09c732a3e..677bf5ec0 100644 --- a/src/common/jingle_session.py +++ b/src/common/jingle_session.py @@ -459,8 +459,13 @@ class JingleSession(object): for content in jingle.iterTags('content'): name = content['name'] creator = content['creator'] - cn = self.contents[(creator, name)] - cn.on_stanza(stanza, content, error, action) + if (creator, name) not in self.contents: + text = 'Content %s (created by %s) does not exist' % (name, creator) + self.__send_error(stanza, 'bad-request', text=text, type_='_modify') + raise xmpp.NodeProcessed + else: + cn = self.contents[(creator, name)] + cn.on_stanza(stanza, content, error, action) def __on_session_terminate(self, stanza, jingle, error, action): self.connection.delete_jingle_session(self.sid) |