diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-06-21 12:58:06 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-06-21 12:58:06 +0000 |
commit | 9bc2eb5311514a53243c9e771658779524e70b9a (patch) | |
tree | 33df8456ca98d69567c5659c72b9356743a0faeb /avahi-core/avahi-test.c | |
parent | 14b64d63bc620fce2008437a874bf285ac9b8e6e (diff) |
* Update configure.ac to check for the availabilty of more functions
* really return sensible error codes from avahi_server_add_xx()
* make all users of avahi_server_add_xxx() check for the validity
* check for local RR conflicts
* only suppress local queries by remote queries if they have an empty known answer suppresion list
* fix FIONREAD call
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@136 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-core/avahi-test.c')
-rw-r--r-- | avahi-core/avahi-test.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/avahi-core/avahi-test.c b/avahi-core/avahi-test.c index 5f4b91e..0d47941 100644 --- a/avahi-core/avahi-test.c +++ b/avahi-core/avahi-test.c @@ -114,12 +114,29 @@ static void create_entries(gboolean new_name) { service_name = n; } - avahi_server_add_service(server, group, 0, AF_UNSPEC, "_http._tcp", service_name, NULL, NULL, 80, "foo", NULL); - avahi_server_add_service(server, group, 0, AF_UNSPEC, "_ftp._tcp", service_name, NULL, NULL, 21, "foo", NULL); - avahi_server_add_service(server, group, 0, AF_UNSPEC, "_webdav._tcp", service_name, NULL, NULL, 80, "foo", NULL); + if (avahi_server_add_service(server, group, 0, AF_UNSPEC, "_http._tcp", service_name, NULL, NULL, 80, "foo", NULL) < 0) { + avahi_log_error("Failed to add HTTP service"); + goto fail; + } + + if (avahi_server_add_service(server, group, 0, AF_UNSPEC, "_ftp._tcp", service_name, NULL, NULL, 21, "foo", NULL) < 0) { + avahi_log_error("Failed to add FTP service"); + goto fail; + } + + if (avahi_server_add_service(server, group, 0, AF_UNSPEC, "_webdav._tcp", service_name, NULL, NULL, 80, "foo", NULL) < 0) { + avahi_log_error("Failed to add WEBDAV service"); + goto fail; + } - avahi_entry_group_commit(group); + avahi_entry_group_commit(group); + return; +fail: + if (group) + avahi_entry_group_free(group); + + group = NULL; } static void hnr_callback(AvahiHostNameResolver *r, gint iface, guchar protocol, AvahiBrowserEvent event, const gchar *hostname, const AvahiAddress *a, gpointer userdata) { |