titilambert/HeySms — pull request #17 by stesie (2012-10-08 07:32:35+00:00)
Title: Avahi force ipv4

Hi again :-)

in heysms/lib/lib.py HeySms calls ResolveService function of the avahi daemon. However it does *not* specify a protocol filter. If the N900 has an IPv6 address and the auth contact supports IPv6 also, avahi lists the presence twice (once for IPv4, once for IPv6).

If the IPv6 entry happens to be the first in the list, the `service_resolved` callback is triggered for that one. However it requires a dot to be in the host address (which is not the case for IPv6 addresses). `ret` is hence overwritten to `None` and passed forward, which of course causes problems later on.

I've limited the resolver to PROTO_INET, the IPv4 protocol.

Besides I've dropped `myhandler`. I suppose it's debug code written down when testing initially. At least it seems not used anywhere.

cheers,
stesie