Summary: | Per-connection resource randomization increases the window in which you lose messages | ||
---|---|---|---|
Product: | Telepathy | Reporter: | Will Thompson <will> |
Component: | gabble | Assignee: | Will Thompson <will> |
Status: | RESOLVED FIXED | QA Contact: | Telepathy bugs list <telepathy-bugs> |
Severity: | normal | ||
Priority: | medium | CC: | will |
Version: | unspecified | Keywords: | patch |
Hardware: | Other | ||
OS: | All | ||
URL: | http://git.collabora.co.uk/?p=user/wjt/telepathy-gabble-wjt.git;a=commitdiff;h=refs/heads/stable-resource | ||
Whiteboard: | review+ | ||
i915 platform: | i915 features: |
Description
Will Thompson
2009-09-01 11:23:57 UTC
Gabble should also probably forget the most-recent-sender resource when a resource appears or disappears for a contact, to avoid this situation: * You're talking to me on my desktop. * I walk out of the house, leaving it connected, and sign in on my internet tablet. * Your messages keep going to the desktop. (Of course, if the tablet is already signed in when I leave the house, this won't help. Maybe we should also drop the binding when a resource becomes more away than others...) Patch in my branch 'stable-resource'. > + /* 32 bytes of hex. The first 8 should be unique enough... */ > + return g_strndup (local_machine_id, 8); This assumes that the machine ID is uniformly pseudo-random, and therefore any byte is as good as any other, but the D-Bus spec doesn't guarantee that. It does note that: > To generate a UUID, the current reference implementation concatenates 96 > bits of random data followed by the 32-bit time in seconds since the UNIX > epoch (in big endian byte order). So, in fact your assumption is right for libdbus, but it needn't be. Perhaps we should hash the machine ID and use that, in order to mix the pseudo-random and deterministic parts; also, perhaps telepathy-glib should grow a utility function to do this? (IMO libdbus should hash the random number and the time with a 128-bit algorithm of its choice, and use *that* as the machine ID, and the D-Bus specification should say that the machine ID is uniformly pseudo-random. However, it doesn't.) (In reply to comment #3) > > + /* 32 bytes of hex. The first 8 should be unique enough... */ > > + return g_strndup (local_machine_id, 8); > > This assumes that the machine ID is uniformly pseudo-random, and therefore any > byte is as good as any other, but the D-Bus spec doesn't guarantee that. It > does note that: > > > To generate a UUID, the current reference implementation concatenates 96 > > bits of random data followed by the 32-bit time in seconds since the UNIX > > epoch (in big endian byte order). > > So, in fact your assumption is right for libdbus, but it needn't be. Perhaps we > should hash the machine ID and use that, in order to mix the pseudo-random and > deterministic parts; also, perhaps telepathy-glib should grow a utility > function to do this? http://dbus.freedesktop.org/doc/dbus-specification.html#uuids: > Implementations should, however, stick to random data for the first 96 bits of the UUID. But okay, whatever, branch updated. ++ Merged to master and 0.8; will be in 0.9.3 and 0.8.8, respectively. commit bd6522afe807be0f8c2a57ed9fbc47a989cfef45 Merge: b45e8ba 9f690c0 Author: Will Thompson <will.thompson@collabora.co.uk> Date: Mon Nov 9 11:32:15 2009 +0000 Merge branch 'stable-resource-0.9' Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> commit edf6f8f6486ee9d44e4e9602ae2a56ae38780a87 Merge: 453fe6c 07d1195 Author: Will Thompson <will.thompson@collabora.co.uk> Date: Mon Nov 9 11:03:14 2009 +0000 Merge branch 'stable-resource' into telepathy-gabble-0.8 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.