[avahi] [PATCH] Avahi support for gnome-games

Daniel S. Haischt me at daniel.stefan.haischt.name
Wed Feb 15 17:40:07 PST 2006


Hello,

attached you will find a new version of the patch.

Lennart Poettering schrieb:
> 
> 
> Threads? The gnome games use thread? Why's that?

forget about that.

> 
> Some issues:
> 
> When the entry group enters AVAHI_ENTRY_GROUP_FAILURE state you free
> the glib main loop adapater, but don't free the AvahiClient
> object. Thus, AvahiClient stills has a reference to the no longer
> existant AvahiGlibPoll object. This is a memory corruption bug. Same
> is true when when entering the fail label in create_services() and
> similarly in client_callback(), ganmes_browse().

fixed.

> 
> What is this?
>      
>      mtype = g_strdup_printf ("_%s%s", game_port,  NETWORK_ZEROCONF_TYPE);

That particular code orginiates from what was in gnome-games before
I did change anything (i.e. the Bonjour/Howl impl are doing the
same). Hence I did just re-use their code.

> 
> The service type is a concatination of the port number and a string?
> This looks very suspicous to me!

yea, maybe but it was already in there...

> 
> It's a good idea to inform the user about the exact cause why an
> operation failed. Use avahi_strerror(avahi_client_errno(client)) to
> get a human readable string.

I did enhance the error messages. Tho, there's little space on the GTK
dialog, which may lead to the fact that long messages will be trunkated.

> 
> The last NULL in your avahi_entry_group_add_service() call is
> superfluous and passing "test=blah" as TXT record is probably not a
> good idea in real world apps.

fixed.

> 
> You start your on main loop, and after it terminated you call
> games_start_server()? That doesn't look right to me! The GLIB main
> loop is run by the app itself, there shouldn't be a need to create
> your own!
> 

fixed.


-- 
Mit freundlichen Gruessen / With kind regards
DAn.I.El S. Haischt

Spammers, please please send any mail to:
Daniel S. Haischt <me_c at daniel.stefan.haischt.name>

Want a complete signature??? Type at a shell prompt:
$ > finger -l haischt at daniel.stefan.haischt.name
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gnome-games-avahi.diff.bz2
Type: application/x-tar-compressed
Size: 3724 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/avahi/attachments/20060216/27ce4e26/gnome-games-avahi.diff.bin


More information about the avahi mailing list