Re: DNS-SD support in gnome-vfs

On Fri, 2004-07-02 at 09:48 +0200, Alexander Larsson wrote:
> On Thu, 2004-07-01 at 16:45, Murray Cumming wrote:
> > I have a question about one of the new functions:
> > 
> > GnomeVFSResult			      
> > gnome_vfs_dns_sd_resolve (GnomeVFSDNSSDResolveHandle **handle,
> > 			  const char *name,
> > 			  const char *type,
> > 			  const char *domain,
> > 			  int timeout,
> > 			  GnomeVFSDNSSDResolveCallback callback,
> > 			  gpointer callback_data,
> > 			  GDestroyNotify callback_data_destroy_func);
> > 
> > This function allocates a new GnomeVFSDNSSDResolveHandle, which is assigned 
> > to handle and also sent as a parameter to the callback. But shouldn't there 
> > be some function to free it afterwards?
> > 
> > test-dns-sd.c does not seem to free it at all:
> >
> Its automatically freed after the callback is called or after you cancel
> it with gnome_vfs_dns_sd_cancel_resolve(). Basically its used as a
> reference to the ongoing job so that you can cancel it.

For gnome_vfs_dns_sd_resolve() that's OK, because the callback is called
only once so the application can know when the
GnomeVFSDNSSDResolveHandle is no longer valid.

But for gnome_vfs_dns_sd_browse(), the callback seems to be called
multiple times, and there's no way to know which is the last call. I
guess it's not an error to call gnome_vfs_dns_sd_stop_browse() with an
invalid (released) GnomeVFSDNSSDResolveHandle - maybe it just checks the
value of the pointer without dereferencing it.

But that would be a problem for language-bindings, because we need to
release our GnomeVFSDNSSDResolveHandle binding instance at the same time
as the underlying GnomeVFSDNSSDResolveHandle, but we can not then
dereferencing our binding instance to get that pointer value.

I hope all these questions are not too annoying.

Murray Cumming
murrayc murrayc com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]