From 5d67f2aefcdb84d2938fdc522d1f906ca6616e3d Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 22 May 2005 21:33:28 +0000 Subject: [PATCH] * fix pkgconfig file * fix recursive resolving * install header files git-svn-id: file:///home/lennart/svn/public/avahi/trunk@89 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-core.pc.in | 2 +- avahi-core/Makefile.am | 9 +++++++++ avahi-core/avahi-test.c | 2 +- avahi-core/resolve-address.c | 9 +++++---- avahi-core/resolve-host-name.c | 19 ++++++++++--------- avahi-core/resolve-service.c | 14 ++++++-------- 6 files changed, 32 insertions(+), 23 deletions(-) diff --git a/avahi-core.pc.in b/avahi-core.pc.in index e91c068..442c867 100644 --- a/avahi-core.pc.in +++ b/avahi-core.pc.in @@ -6,5 +6,5 @@ includedir=${prefix}/include Name: avahi-core Description: Avahi Embeddable Multicast DNS Engine Version: @PACKAGE_VERSION@ -Libs: -L${libdir} -lavahic-core +Libs: -L${libdir} -lavahi-core Cflags: -D_REENTRANT -I${includedir} diff --git a/avahi-core/Makefile.am b/avahi-core/Makefile.am index 0e73c7f..6fe184a 100644 --- a/avahi-core/Makefile.am +++ b/avahi-core/Makefile.am @@ -26,6 +26,15 @@ AM_LDADD=$(GLIB20_LIBS) # This cool debug trap works on i386/gcc only AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")' +avahiincludedir=$(includedir)/avahi-core + +avahiinclude_HEADERS = \ + rr.h \ + address.h \ + strlst.h \ + core.h \ + alternative.h + lib_LTLIBRARIES = \ libavahi-core.la diff --git a/avahi-core/avahi-test.c b/avahi-core/avahi-test.c index 805453a..1c3dc57 100644 --- a/avahi-core/avahi-test.c +++ b/avahi-core/avahi-test.c @@ -206,7 +206,7 @@ int main(int argc, char *argv[]) { loop = g_main_loop_new(NULL, FALSE); /* g_timeout_add(1000*5, dump_timeout, server); */ -/* g_timeout_add(1000*30, quit_timeout, loop); */ + g_timeout_add(1000*30, quit_timeout, loop); g_main_loop_run(loop); g_main_loop_unref(loop); diff --git a/avahi-core/resolve-address.c b/avahi-core/resolve-address.c index f6fa635..53e4468 100644 --- a/avahi-core/resolve-address.c +++ b/avahi-core/resolve-address.c @@ -94,6 +94,11 @@ AvahiAddressResolver *avahi_address_resolver_new(AvahiServer *server, gint inter r->callback = callback; r->userdata = userdata; + avahi_elapse_time(&tv, 1000, 0); + r->time_event = avahi_time_event_queue_add(server->time_event_queue, &tv, time_event_callback, r); + + AVAHI_LLIST_PREPEND(AvahiAddressResolver, resolver, server->address_resolvers, r); + if (address->family == AF_INET) n = avahi_reverse_lookup_name_ipv4(&address->data.ipv4); else @@ -105,10 +110,6 @@ AvahiAddressResolver *avahi_address_resolver_new(AvahiServer *server, gint inter r->record_browser = avahi_record_browser_new(server, interface, protocol, k, record_browser_callback, r); avahi_key_unref(k); - avahi_elapse_time(&tv, 1000, 0); - r->time_event = avahi_time_event_queue_add(server->time_event_queue, &tv, time_event_callback, r); - - AVAHI_LLIST_PREPEND(AvahiAddressResolver, resolver, server->address_resolvers, r); return r; } diff --git a/avahi-core/resolve-host-name.c b/avahi-core/resolve-host-name.c index 751ba72..f29b575 100644 --- a/avahi-core/resolve-host-name.c +++ b/avahi-core/resolve-host-name.c @@ -119,24 +119,25 @@ AvahiHostNameResolver *avahi_host_name_resolver_new(AvahiServer *server, gint in r->callback = callback; r->userdata = userdata; + r->record_browser_a = r->record_browser_aaaa = NULL; + + avahi_elapse_time(&tv, 1000, 0); + r->time_event = avahi_time_event_queue_add(server->time_event_queue, &tv, time_event_callback, r); + + AVAHI_LLIST_PREPEND(AvahiHostNameResolver, resolver, server->host_name_resolvers, r); + + if (aprotocol == AF_INET || aprotocol == AF_UNSPEC) { k = avahi_key_new(host_name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_A); r->record_browser_a = avahi_record_browser_new(server, interface, protocol, k, record_browser_callback, r); avahi_key_unref(k); - } else - r->record_browser_a = NULL; + } if (aprotocol == AF_INET6 || aprotocol == AF_UNSPEC) { k = avahi_key_new(host_name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_AAAA); r->record_browser_aaaa = avahi_record_browser_new(server, interface, protocol, k, record_browser_callback, r); avahi_key_unref(k); - } else - r->record_browser_aaaa = NULL; - - avahi_elapse_time(&tv, 1000, 0); - r->time_event = avahi_time_event_queue_add(server->time_event_queue, &tv, time_event_callback, r); - - AVAHI_LLIST_PREPEND(AvahiHostNameResolver, resolver, server->host_name_resolvers, r); + } return r; } diff --git a/avahi-core/resolve-service.c b/avahi-core/resolve-service.c index 5c0c988..e854cca 100644 --- a/avahi-core/resolve-service.c +++ b/avahi-core/resolve-service.c @@ -221,7 +221,12 @@ AvahiServiceResolver *avahi_service_resolver_new(AvahiServer *server, gint inter avahi_escape_label((guint8*) name, strlen(name), &n, &l); snprintf(n, l, ".%s%s", r->service_type, r->domain_name); - g_message("<%s>", t); + avahi_elapse_time(&tv, 1000, 0); + r->time_event = avahi_time_event_queue_add(server->time_event_queue, &tv, time_event_callback, r); + + AVAHI_LLIST_PREPEND(AvahiServiceResolver, resolver, server->service_resolvers, r); + + r->record_browser_a = r->record_browser_aaaa = r->record_browser_srv = r->record_browser_txt = NULL; k = avahi_key_new(t, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_SRV); r->record_browser_srv = avahi_record_browser_new(server, interface, protocol, k, record_browser_callback, r); @@ -231,13 +236,6 @@ AvahiServiceResolver *avahi_service_resolver_new(AvahiServer *server, gint inter r->record_browser_txt = avahi_record_browser_new(server, interface, protocol, k, record_browser_callback, r); avahi_key_unref(k); - r->record_browser_a = r->record_browser_aaaa = NULL; - - avahi_elapse_time(&tv, 1000, 0); - r->time_event = avahi_time_event_queue_add(server->time_event_queue, &tv, time_event_callback, r); - - AVAHI_LLIST_PREPEND(AvahiServiceResolver, resolver, server->service_resolvers, r); - return r; } -- 2.39.5