]> git.meshlink.io Git - catta/commitdiff
minor fixes to the conformance testing tool
authorLennart Poettering <lennart@poettering.net>
Wed, 12 Oct 2005 20:27:51 +0000 (20:27 +0000)
committerLennart Poettering <lennart@poettering.net>
Wed, 12 Oct 2005 20:27:51 +0000 (20:27 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@742 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-core/conformance-test.c

index 1856fc56d8f48ca2b4022bb19341d52495b04da7..b119e467fa08cab467c4e4770e989a0950ba2906 100644 (file)
@@ -107,6 +107,14 @@ static void server_callback(AvahiServer *s, AvahiServerState state, void* userda
     if (state == AVAHI_SERVER_RUNNING) {
         create_service("gurke");
         avahi_server_dump(avahi, dump_line, NULL);
+    } else if (state == AVAHI_SERVER_COLLISION) {
+        char *n;
+        
+        n = avahi_alternative_host_name(avahi_server_get_host_name(s));
+        avahi_log_warn("Host name conflict, retrying with <%s>", n);
+        avahi_server_set_host_name(s, n);
+        avahi_free(n);
+
     }
 }
 
@@ -114,11 +122,18 @@ int main(int argc, char *argv[]) {
     int error;
     AvahiSimplePoll *simple_poll;
     struct timeval tv;
+    struct AvahiServerConfig config;
 
     simple_poll = avahi_simple_poll_new();
     poll_api = avahi_simple_poll_get(simple_poll);
-    
-    avahi = avahi_server_new(poll_api, NULL, server_callback, NULL, &error);
+
+    avahi_server_config_init(&config);
+    config.publish_workstation = 0;
+    config.use_ipv6 = 0;
+    config.publish_domain = 0;
+    config.publish_hinfo = 0;
+    avahi = avahi_server_new(poll_api, &config, server_callback, NULL, &error);
+    avahi_server_config_free(&config);
 
     avahi_elapse_time(&tv, 5000, 0);
     poll_api->timeout_new(poll_api, &tv, dump_timeout_callback, avahi);