[pulseaudio-discuss] Zeroconf-publish fails to run
Lennart Poettering
lennart at poettering.net
Mon Jul 30 13:42:13 PDT 2007
On Wed, 25.07.07 13:11, Rémi Cardona (remi at gentoo.org) wrote:
>
> Lennart Poettering wrote:
> > This is all probably due to limited maximum DNS-SD service name
> > length. DNS-SD enforces a maxium service name length of 63 UTF-8
> > characters. If the name returned by the HW driver is overly long this
> > results in an invalid string that Avahi refuses the accept.
> >
> > The fix is easy: just truncate/ellipsize the hw driver name so that the total
> > size never grows larger than 63 characters.
>
> Confirming that truncating solves the problem. However, I've done this
> just before the call to avahi_entry_group_add_service_strlst() in
> publish_service(). This is probably wrong for many reasons.
>
> Furthermore, I've done it using plain old strncpy() which knows nothing
> about unicode...
>
> > I updated the bug accordingly an will fix this in PA
> > eventually. (Unless -- of course -- someone else supplies me with a
> > patch for this.)
>
> Any chance you could point me where I should be doing these changes?
At two places:
get_service()
and in:
pa__init()
basically everywhere where one of the "service_name" variables are
written.
This stuff is far from trivial btw. Because you cannot just truncate
an UTf8 string, because it might become an invalid UTF8 string that
way.
(And while we're at it. Avahi's current implementation of
avahi_alternative_service_name() which generates an alternative
service name when a name conflict happens and basically just attaches
" #2", " #3" to it, generates a 66 character string when you pass a 63
character string to it. Which is obviously a bug in Avahi. I've posted
this as bug #151 in avahi BT now.)
> One last thing, it'd be nice if the avahi doxygen docs included the
> 63-character limit here [1]
Done in r1502 in avahi svn.
Thank you,
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net ICQ# 11060553
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
More information about the pulseaudio-discuss
mailing list