]> git.meshlink.io Git - catta/commitdiff
* Do not allow adding RRs to entry groups that are already commited
authorLennart Poettering <lennart@poettering.net>
Tue, 8 Nov 2005 23:37:05 +0000 (23:37 +0000)
committerLennart Poettering <lennart@poettering.net>
Tue, 8 Nov 2005 23:37:05 +0000 (23:37 +0000)
* Reword some misleading log messages

git-svn-id: file:///home/lennart/svn/public/avahi/trunk@939 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-core/entry.c
avahi-core/iface.c
avahi-core/server.c
avahi-daemon/main.c

index f65f7b145e36f5d088a5afe2c48378fb00811440..d2946474a3403c3906ab32ac62e1049f3b25d8cd 100644 (file)
@@ -187,6 +187,7 @@ static AvahiEntry * server_add_internal(
     assert(s);
     assert(r);
 
+    AVAHI_CHECK_VALIDITY_RETURN_NULL(s, s->state != AVAHI_SERVER_FAILURE && s->state != AVAHI_SERVER_INVALID, AVAHI_ERR_BAD_STATE);
     AVAHI_CHECK_VALIDITY_RETURN_NULL(s, AVAHI_IF_VALID(interface), AVAHI_ERR_INVALID_INTERFACE);
     AVAHI_CHECK_VALIDITY_RETURN_NULL(s, AVAHI_PROTO_VALID(protocol), AVAHI_ERR_INVALID_PROTOCOL);
     AVAHI_CHECK_VALIDITY_RETURN_NULL(s, AVAHI_FLAGS_VALID(
@@ -215,6 +216,7 @@ static AvahiEntry * server_add_internal(
     transport_flags_from_domain(s, &flags, r->key->name);
     AVAHI_CHECK_VALIDITY_RETURN_NULL(s, flags & AVAHI_PUBLISH_USE_MULTICAST, AVAHI_ERR_NOT_SUPPORTED);
     AVAHI_CHECK_VALIDITY_RETURN_NULL(s, !s->config.disable_publishing, AVAHI_ERR_NOT_PERMITTED);
+    AVAHI_CHECK_VALIDITY_RETURN_NULL(s, !g || (g->state != AVAHI_ENTRY_GROUP_ESTABLISHED && g->state != AVAHI_ENTRY_GROUP_REGISTERING), AVAHI_ERR_BAD_STATE);
     
     if (flags & AVAHI_PUBLISH_UPDATE) {
         AvahiRecord *old_record;
index d117b9bd79fe1e2b65722c3628d2bb1efa271ba9..0e3ef686f99d6a9fdfd99d6ec0eeadcc8785c6d6 100644 (file)
@@ -69,7 +69,7 @@ void avahi_interface_address_update_rrs(AvahiInterfaceAddress *a, int remove_rrs
             char t[AVAHI_ADDRESS_STR_MAX];
             avahi_address_snprint(t, sizeof(t), &a->address);
 
-            avahi_log_info("Registering new address %s on %s.", t, a->interface->hardware->name);
+            avahi_log_info("Registering new address record for %s on %s.", t, a->interface->hardware->name);
 
             if (avahi_server_add_address(m->server, a->entry_group, a->interface->hardware->index, a->interface->protocol, 0, NULL, &a->address) < 0) {
                 avahi_log_warn(__FILE__": avahi_server_add_address() failed: %s", avahi_strerror(m->server->error));
@@ -92,7 +92,7 @@ void avahi_interface_address_update_rrs(AvahiInterfaceAddress *a, int remove_rrs
                m->server->state == AVAHI_SERVER_REGISTERING)
                 avahi_server_decrease_host_rr_pending(m->server);
 
-            avahi_log_info("Withdrawing address %s on %s.", t, a->interface->hardware->name);
+            avahi_log_info("Withdrawing address record for %s on %s.", t, a->interface->hardware->name);
             
             avahi_s_entry_group_reset(a->entry_group);
         }
@@ -200,7 +200,7 @@ static int interface_mdns_mcast_join(AvahiInterface *i, int join) {
         i->local_mcast_address = a->address;
     }
 
-    avahi_log_info("%s mDNS multicast group on interface %s.%s with address %s",
+    avahi_log_info("%s mDNS multicast group on interface %s.%s with address %s.",
                    join ? "Joining" : "Leaving",
                    i->hardware->name,
                    avahi_proto_to_string(i->protocol),
@@ -431,7 +431,7 @@ void avahi_interface_check_relevant(AvahiInterface *i) {
     b = avahi_interface_is_relevant(i);
 
     if (m->list_complete && b && !i->announcing) {
-        avahi_log_info("New relevant interface %s.%s.", i->hardware->name, avahi_proto_to_string(i->protocol));
+        avahi_log_info("New relevant interface %s.%s for mDNS.", i->hardware->name, avahi_proto_to_string(i->protocol));
 
         interface_mdns_mcast_join(i, 1);
 
@@ -439,7 +439,7 @@ void avahi_interface_check_relevant(AvahiInterface *i) {
         avahi_announce_interface(m->server, i);
         avahi_multicast_lookup_engine_new_interface(m->server->multicast_lookup_engine, i);
     } else if (!b && i->announcing) {
-        avahi_log_info("Interface %s.%s no longer relevant.", i->hardware->name, avahi_proto_to_string(i->protocol));
+        avahi_log_info("Interface %s.%s no longer relevant for mDNS.", i->hardware->name, avahi_proto_to_string(i->protocol));
 
         interface_mdns_mcast_join(i, 0);
 
index e42692f198860bb1a573a9aeee1ad7f03fb5a67f..eb04ec1cef394d2681fd597be32a652ac696cf40 100644 (file)
@@ -1141,7 +1141,7 @@ static void register_hinfo(AvahiServer *s) {
             r->data.hinfo.cpu = avahi_strdup(avahi_strup(utsname.machine));
             r->data.hinfo.os = avahi_strdup(avahi_strup(utsname.sysname));
             
-            avahi_log_info("Adding HINFO record with values '%s/%s'", r->data.hinfo.cpu, r->data.hinfo.os);
+            avahi_log_info("Registering HINFO record with values '%s'/'%s'.", r->data.hinfo.cpu, r->data.hinfo.os);
             
             if (avahi_server_add(s, s->hinfo_entry_group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AVAHI_PUBLISH_UNIQUE, r) < 0) {
                 avahi_log_warn("Failed to add HINFO RR: %s", avahi_strerror(s->error));
index 44300ffc0fbc759cf51b5fa3784b3a4ec88994ac..efb167e63a72e84858ac2c044ed2dc042272b40d 100644 (file)
@@ -747,14 +747,14 @@ static int run_server(DaemonConfig *c) {
             goto finish;
         }
         
+        avahi_log_info("Successfully called chroot().");
         chdir("/");
         
         if (avahi_caps_drop_all() < 0) {
             avahi_log_error("Failed to drop capabilities.");
             goto finish;
         }
-
-        avahi_log_info("chroot() successful.");
+        avahi_log_info("Successfully dropped remaining capabilities.");
     }
     
 #endif