- add_static_service_group_to_server(g);
- } else if (state == AVAHI_ENTRY_GROUP_ESTABLISHED)
- avahi_log_info("Service \"%s\" (%s) successfully established.", g->chosen_name, g->filename);
+ remove_static_service_group_from_server(g);
+
+ n = avahi_alternative_service_name(g->chosen_name);
+ avahi_free(g->chosen_name);
+ g->chosen_name = n;
+
+ avahi_log_notice("Service name conflict for \"%s\" (%s), retrying with \"%s\".", g->name, g->filename, g->chosen_name);
+
+ add_static_service_group_to_server(g);
+ break;
+ }
+
+ case AVAHI_ENTRY_GROUP_ESTABLISHED:
+ avahi_log_info("Service \"%s\" (%s) successfully established.", g->chosen_name, g->filename);
+ break;
+
+ case AVAHI_ENTRY_GROUP_FAILURE:
+ avahi_log_warn("Failed to publish service \"%s\" (%s): %s", g->chosen_name, g->filename, avahi_strerror(avahi_server_errno(s)));
+ remove_static_service_group_from_server(g);
+ break;
+
+ case AVAHI_ENTRY_GROUP_UNCOMMITED:
+ case AVAHI_ENTRY_GROUP_REGISTERING:
+ ;
+ }