Lennart Poettering wrote:
On Wed, 10.05.06 09:20, Padraig O'Briain ([EMAIL PROTECTED]) wrote:
I made the changes in the first attachment to get client-test to run on
Solaris and got the results in the second attachment.
Most of the changes I made were because printf crashes when a NULL
argument is provided for %s on Solaris.
I guess Solaris' printf sucks, then. ;-)
The patch you posted is reversed? And it contains some superfluous
changes (like printing the value of AVAHI_BROWSER_CACHE_EXHAUSTED)? If
you clean it up I will definitely merge it. In fact I already merged
the avahi_address_parse() issue, since that's a real bug even on
Linux. (see http://avahi.org/changeset/1217)
Patch attached.
I don't think client-test is a good test program for your purposes. We
probably should remove it entirely from the distribution. Instead use
the the better tested and supported end-user utilities we ship:
avahi-browse, avahi-publish-* and so on.
I noticed that the name of a service is NULL in
avahi_service_browser_callback. Is this what should happen? I was
expecting to get "Lathiat's Site".
I assume that you're talking of these two lines?
SERVICE-BROWSER: Callback on 28c58, interface (-1), protocol (-1), event (2),
name (NULL), type (_http._tcp), domain (NULL), data (omghai3u) 2
SERVICE-BROWSER: Callback on 28c58, interface (-1), protocol (-1), event (3),
name (NULL), type (_http._tcp), domain (NULL), data (omghai3u) 2
These are events 2 and 3. Those are AVAHI_BROWSER_CACHE_EXHAUSTED and
AVAHI_BROWSER_ALL_FOR_NOW. These are "meta" events that inform you
that all entries from the cache have been read or that no more
services are expected to be read in the near feature. They do not pass
actual data. For more information see:
http://avahi.org/download/doxygen/defs_8h.html#f7ff3b95259b3441a282b87d82eebd87
In short: yes this is the intended behaviour.
OK. Thanks. I am beginning to understand what is going on.
Lennart
--- /usr/tmp/clean/avahi-0.6.10/avahi-client/client-test.c 2005-11-08 22:28:24.000000000 +0000
+++ ./client-test.c 2006-05-15 08:33:50.448636000 +0100
@@ -60,7 +60,7 @@
AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
void *userdata) {
- printf ("DOMAIN-BROWSER: Callback on %p, interface (%d), protocol (%d), event (%d), domain (%s), data (%s)\n", (void*) b, interface, protocol, event, domain, (char*)userdata);
+ printf ("DOMAIN-BROWSER: Callback on %p, interface (%d), protocol (%d), event (%d), domain (%s), data (%s)\n", (void*) b, interface, protocol, event, domain ? domain : "NULL", (char*)userdata);
}
static void avahi_service_resolver_callback(
@@ -103,7 +103,7 @@
AvahiServiceResolver *sr;
- printf ("SERVICE-BROWSER: Callback on %p, interface (%d), protocol (%d), event (%d), name (%s), type (%s), domain (%s), data (%s)\n", (void*) b, interface, protocol, event, name, type, domain, (char*)userdata);
+ printf ("SERVICE-BROWSER: Callback on %p, interface (%d), protocol (%d), event (%d), name (%s), type (%s), domain (%s), data (%s)\n", (void*) b, interface, protocol, event, name ? name : "NULL", type, domain ? domain : "NULL", (char*)userdata);
if (b && name)
{
@@ -122,7 +122,7 @@
AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
void *userdata) {
- printf ("SERVICE-TYPE-BROWSER: Callback on %p, interface (%d), protocol (%d), event (%d), type (%s), domain (%s), data (%s)\n", (void*) b, interface, protocol, event, type, domain, (char*)userdata);
+ printf ("SERVICE-TYPE-BROWSER: Callback on %p, interface (%d), protocol (%d), event (%d), type (%s), domain (%s), data (%s)\n", (void*) b, interface, protocol, event, type ? type : "NULL", domain ? domain : "NULL", (char*)userdata);
}
static void avahi_address_resolver_callback (
@@ -220,6 +220,7 @@
AvahiServiceTypeBrowser *st;
AvahiHostNameResolver *hnr;
AvahiAddress *aar;
+ AvahiAddress ar;
const char *ret;
int error;
uint32_t cookie;
@@ -287,7 +288,7 @@
else
printf ("Successfully created hostname resolver object\n");
- aar = avahi_address_parse ("224.0.0.251", AVAHI_PROTO_UNSPEC, aar);
+ aar = avahi_address_parse ("224.0.0.251", AVAHI_PROTO_UNSPEC, &ar);
if (aar == NULL) {
printf ("failed to create address object\n");
} else {
_______________________________________________
avahi mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/avahi