diff options
author | Ed Page <eopage@byu.net> | 2010-01-15 20:56:37 -0600 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2010-04-16 22:33:40 +0100 |
commit | 424c57bf2ce654ad7fe1ffe80be27c9596153bd3 (patch) | |
tree | e41ca904f01f2bfa7d2bfd576812c481d7de2c15 | |
parent | 02159c240e18b181c2fa1e3cd99784bdec7b2fcc (diff) |
After actually writing a hand test, fixing some issue (really I'm not sure if the add_client_handle should be called or not26059
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r-- | src/server/channelmanager.py | 4 | ||||
-rw-r--r-- | src/server/conn.py | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/server/channelmanager.py b/src/server/channelmanager.py index 6e24e88..9fecb7c 100644 --- a/src/server/channelmanager.py +++ b/src/server/channelmanager.py @@ -63,12 +63,12 @@ class ChannelManager(object): requested = props[CHANNEL_INTERFACE + '.Requested'] target_handle_type = \ - props.get(CHANNEL_INTERFACE + '.TargetHandleType', HANDLE_TYPE_NONE) + int(props.get(CHANNEL_INTERFACE + '.TargetHandleType', HANDLE_TYPE_NONE)) if target_handle_type == HANDLE_TYPE_NONE: handle = NoneHandle() else: - target_handle = props[CHANNEL_INTERFACE + '.TargetHandle'] + target_handle = int(props[CHANNEL_INTERFACE + '.TargetHandle']) handle = self._conn._handles[target_handle_type, target_handle] return (type, requested, handle) diff --git a/src/server/conn.py b/src/server/conn.py index 4e6e895..f48057c 100644 --- a/src/server/conn.py +++ b/src/server/conn.py @@ -172,6 +172,9 @@ class Connection(_Connection, DBusProperties): self._client_handles[sender] = set([(handle.get_type(), handle)]) def get_handle_by_id(self, handle_type, handle_id): + # Strip off dbus stuff so we can be consistent + handle_type, handle_id = int(handle_type), int(handle_id) + self.check_handle(handle_type, handle_id) return self._handles[handle_type, handle_id] @@ -495,8 +498,10 @@ class ConnectionInterfaceRequests( altered_properties = props.copy() if target_handle_type != HANDLE_TYPE_NONE: - if target_handle == None: - target_handle = self.get_handle_by_name(target_handle_type, target_id).get_id() + if target_handle is None: + handle = self.get_handle_by_name(target_handle_type, target_id) + self.add_client_handle(handle, None) + target_handle = handle.get_id() altered_properties[CHANNEL_INTERFACE + '.TargetHandle'] = \ target_handle else: |