From: Lennart Poettering Date: Mon, 24 Oct 2005 23:56:34 +0000 (+0000) Subject: * rename all limit defs so that they end with _MAX X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=3073103812f0ea376582eb0ff1479945a847b361;p=catta * rename all limit defs so that they end with _MAX * fix some minor typos git-svn-id: file:///home/lennart/svn/public/avahi/trunk@863 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-core/browse.c b/avahi-core/browse.c index e7e01d1..5fd3a01 100644 --- a/avahi-core/browse.c +++ b/avahi-core/browse.c @@ -36,7 +36,7 @@ #include "log.h" #include "querier.h" -#define AVAHI_MAX_LOOKUPS_PER_BROWSER 15 +#define AVAHI_LOOKUPS_PER_BROWSER_MAX 15 struct AvahiSRBLookup { AvahiSRecordBrowser *record_browser; @@ -92,7 +92,7 @@ static AvahiSRBLookup* lookup_new( assert(AVAHI_IF_VALID(interface)); assert(AVAHI_PROTO_VALID(protocol)); - if (b->n_lookups >= AVAHI_MAX_LOOKUPS_PER_BROWSER) + if (b->n_lookups >= AVAHI_LOOKUPS_PER_BROWSER_MAX) /* We don't like cyclic CNAMEs */ return NULL; diff --git a/avahi-core/cache.c b/avahi-core/cache.c index ef7293d..bfbbf85 100644 --- a/avahi-core/cache.c +++ b/avahi-core/cache.c @@ -32,7 +32,7 @@ #include "cache.h" #include "log.h" -#define AVAHI_MAX_CACHE_ENTRIES 500 +#define AVAHI_CACHE_ENTRIES_MAX 500 static void remove_entry(AvahiCache *c, AvahiCacheEntry *e) { AvahiCacheEntry *t; @@ -331,7 +331,7 @@ void avahi_cache_update(AvahiCache *c, AvahiRecord *r, int cache_flush, const Av /* avahi_log_debug("cache: couldn't find matching cache entry for %s", txt); */ - if (c->n_entries >= AVAHI_MAX_CACHE_ENTRIES) + if (c->n_entries >= AVAHI_CACHE_ENTRIES_MAX) return; if (!(e = avahi_new(AvahiCacheEntry, 1))) { diff --git a/avahi-core/core.h b/avahi-core/core.h index 4223bf7..6875218 100644 --- a/avahi-core/core.h +++ b/avahi-core/core.h @@ -48,7 +48,7 @@ AVAHI_C_DECL_BEGIN #endif /** Maximum number of defined DNS servers for wide area DNS */ -#define AVAHI_MAX_WIDE_AREA_SERVERS 4 +#define AVAHI_WIDE_AREA_SERVERS_MAX 4 /** Prototype for callback functions which are called whenever the state of an AvahiServer object changes */ typedef void (*AvahiServerCallback) (AvahiServer *s, AvahiServerState state, void* userdata); @@ -69,7 +69,7 @@ typedef struct AvahiServerConfig { int reflect_ipv; /**< if enable_reflector is 1, enable/disable reflecting between IPv4 and IPv6 */ int add_service_cookie; /**< Add magic service cookie to all locally generated records implicitly */ int enable_wide_area; /**< Enable wide area support */ - AvahiAddress wide_area_servers[AVAHI_MAX_WIDE_AREA_SERVERS]; /** Unicast DNS server to use for wide area lookup */ + AvahiAddress wide_area_servers[AVAHI_WIDE_AREA_SERVERS_MAX]; /** Unicast DNS server to use for wide area lookup */ unsigned n_wide_area_servers; /**< Number of servers in wide_area_servers[] */ int disallow_other_stacks; /**< Make sure that only one mDNS responder is run at the same time on the local machine. If this is enable Avahi will not set SO_REUSADDR on its sockets, effectively preventing other stacks from running on the local machine */ } AvahiServerConfig; diff --git a/avahi-core/dns.c b/avahi-core/dns.c index a9ccda5..8c8b42b 100644 --- a/avahi-core/dns.c +++ b/avahi-core/dns.c @@ -41,7 +41,7 @@ AvahiDnsPacket* avahi_dns_packet_new(unsigned mtu) { size_t max_size; if (mtu <= 0) - max_size = AVAHI_DNS_PACKET_MAX_SIZE; + max_size = AVAHI_DNS_PACKET_SIZE_MAX; else if (mtu >= AVAHI_DNS_PACKET_EXTRA_SIZE) max_size = mtu - AVAHI_DNS_PACKET_EXTRA_SIZE; else diff --git a/avahi-core/dns.h b/avahi-core/dns.h index 743ad4e..61ec189 100644 --- a/avahi-core/dns.h +++ b/avahi-core/dns.h @@ -25,7 +25,7 @@ #include "rr.h" #include "hashmap.h" -#define AVAHI_DNS_PACKET_MAX_SIZE 9000 +#define AVAHI_DNS_PACKET_SIZE_MAX 9000 #define AVAHI_DNS_PACKET_HEADER_SIZE 12 #define AVAHI_DNS_PACKET_EXTRA_SIZE 48 diff --git a/avahi-core/iface-linux.c b/avahi-core/iface-linux.c index 4fc4add..985fe3f 100644 --- a/avahi-core/iface-linux.c +++ b/avahi-core/iface-linux.c @@ -124,8 +124,8 @@ static void netlink_callback(AvahiNetlink *nl, struct nlmsghdr *n, void* userdat /* Fill in hardware (MAC) address */ hw->mac_address_size = RTA_PAYLOAD(a); - if (hw->mac_address_size > AVAHI_MAX_MAC_ADDRESS) - hw->mac_address_size = AVAHI_MAX_MAC_ADDRESS; + if (hw->mac_address_size > AVAHI_MAC_ADDRESS_MAX) + hw->mac_address_size = AVAHI_MAC_ADDRESS_MAX; memcpy(hw->mac_address, RTA_DATA(a), hw->mac_address_size); break; diff --git a/avahi-core/iface-pfroute.c b/avahi-core/iface-pfroute.c index f2401e9..4822d59 100644 --- a/avahi-core/iface-pfroute.c +++ b/avahi-core/iface-pfroute.c @@ -87,8 +87,8 @@ static void rtm_info(struct rt_msghdr *rtm, AvahiInterfaceMonitor *m) hw->mtu = ifm->ifm_data.ifi_mtu; hw->mac_address_size = sdl->sdl_alen; - if (hw->mac_address_size > AVAHI_MAX_MAC_ADDRESS) - hw->mac_address_size = AVAHI_MAX_MAC_ADDRESS; + if (hw->mac_address_size > AVAHI_MAC_ADDRESS_MAX) + hw->mac_address_size = AVAHI_MAC_ADDRESS_MAX; memcpy(hw->mac_address, sdl->sdl_data + sdl->sdl_nlen, hw->mac_address_size); diff --git a/avahi-core/iface.h b/avahi-core/iface.h index e45ab10..1671753 100644 --- a/avahi-core/iface.h +++ b/avahi-core/iface.h @@ -48,7 +48,7 @@ typedef struct AvahiHwInterface AvahiHwInterface; #error "No network configuration notification system available" #endif -#define AVAHI_MAX_MAC_ADDRESS 32 +#define AVAHI_MAC_ADDRESS_MAX 32 struct AvahiInterfaceMonitor { AvahiServer *server; @@ -72,7 +72,7 @@ struct AvahiHwInterface { unsigned mtu; - uint8_t mac_address[AVAHI_MAX_MAC_ADDRESS]; + uint8_t mac_address[AVAHI_MAC_ADDRESS_MAX]; size_t mac_address_size; AvahiSEntryGroup *entry_group; diff --git a/avahi-core/internal.h b/avahi-core/internal.h index 8f18219..813eacd 100644 --- a/avahi-core/internal.h +++ b/avahi-core/internal.h @@ -41,7 +41,7 @@ typedef struct AvahiEntry AvahiEntry; #include "multicast-lookup.h" #include "dns-srv-rr.h" -#define AVAHI_MAX_LEGACY_UNICAST_REFLECT_SLOTS 100 +#define AVAHI_LEGACY_UNICAST_REFLECT_SLOTS_MAX 100 #define AVAHI_FLAGS_VALID(flags, max) (!((flags) & ~(max))) diff --git a/avahi-core/probe-sched.c b/avahi-core/probe-sched.c index 8a4d8b0..71359b5 100644 --- a/avahi-core/probe-sched.c +++ b/avahi-core/probe-sched.c @@ -247,8 +247,8 @@ static void elapse_callback(AvahiTimeEvent *e, void* data) { avahi_record_get_estimate_size(pj->record) + AVAHI_DNS_PACKET_HEADER_SIZE; - if (size > AVAHI_DNS_PACKET_MAX_SIZE) - size = AVAHI_DNS_PACKET_MAX_SIZE; + if (size > AVAHI_DNS_PACKET_SIZE_MAX) + size = AVAHI_DNS_PACKET_SIZE_MAX; if (!(p = avahi_dns_packet_new_query(size))) return; /* OOM */ diff --git a/avahi-core/response-sched.c b/avahi-core/response-sched.c index 6bc48ca..65a32af 100644 --- a/avahi-core/response-sched.c +++ b/avahi-core/response-sched.c @@ -244,8 +244,8 @@ static void send_response_packet(AvahiResponseScheduler *s, AvahiResponseJob *rj /* OK, the packet was too small, so create one that fits */ size = avahi_record_get_estimate_size(rj->record) + AVAHI_DNS_PACKET_HEADER_SIZE; - if (size > AVAHI_DNS_PACKET_MAX_SIZE) - size = AVAHI_DNS_PACKET_MAX_SIZE; + if (size > AVAHI_DNS_PACKET_SIZE_MAX) + size = AVAHI_DNS_PACKET_SIZE_MAX; if (!(p = avahi_dns_packet_new_response(size, 1))) return; /* OOM */ diff --git a/avahi-core/server.c b/avahi-core/server.c index fe5b45f..3edd96e 100644 --- a/avahi-core/server.c +++ b/avahi-core/server.c @@ -409,8 +409,8 @@ void avahi_server_generate_response(AvahiServer *s, AvahiInterface *i, AvahiDnsP avahi_dns_packet_free(reply); size = avahi_record_get_estimate_size(r) + AVAHI_DNS_PACKET_HEADER_SIZE; - if (size > AVAHI_DNS_PACKET_MAX_SIZE) - size = AVAHI_DNS_PACKET_MAX_SIZE; + if (size > AVAHI_DNS_PACKET_SIZE_MAX) + size = AVAHI_DNS_PACKET_SIZE_MAX; if (!(reply = avahi_dns_packet_new_reply(p, size, 0, 1))) break; /* OOM */ @@ -652,10 +652,10 @@ static AvahiLegacyUnicastReflectSlot* allocate_slot(AvahiServer *s) { assert(s); if (!s->legacy_unicast_reflect_slots) - s->legacy_unicast_reflect_slots = avahi_new0(AvahiLegacyUnicastReflectSlot*, AVAHI_MAX_LEGACY_UNICAST_REFLECT_SLOTS); + s->legacy_unicast_reflect_slots = avahi_new0(AvahiLegacyUnicastReflectSlot*, AVAHI_LEGACY_UNICAST_REFLECT_SLOTS_MAX); - for (n = 0; n < AVAHI_MAX_LEGACY_UNICAST_REFLECT_SLOTS; n++, s->legacy_unicast_reflect_id++) { - idx = s->legacy_unicast_reflect_id % AVAHI_MAX_LEGACY_UNICAST_REFLECT_SLOTS; + for (n = 0; n < AVAHI_LEGACY_UNICAST_REFLECT_SLOTS_MAX; n++, s->legacy_unicast_reflect_id++) { + idx = s->legacy_unicast_reflect_id % AVAHI_LEGACY_UNICAST_REFLECT_SLOTS_MAX; if (!s->legacy_unicast_reflect_slots[idx]) break; @@ -680,7 +680,7 @@ static void deallocate_slot(AvahiServer *s, AvahiLegacyUnicastReflectSlot *slot) assert(s); assert(slot); - idx = slot->id % AVAHI_MAX_LEGACY_UNICAST_REFLECT_SLOTS; + idx = slot->id % AVAHI_LEGACY_UNICAST_REFLECT_SLOTS_MAX; assert(s->legacy_unicast_reflect_slots[idx] == slot); @@ -697,7 +697,7 @@ static void free_slots(AvahiServer *s) { if (!s->legacy_unicast_reflect_slots) return; - for (idx = 0; idx < AVAHI_MAX_LEGACY_UNICAST_REFLECT_SLOTS; idx ++) + for (idx = 0; idx < AVAHI_LEGACY_UNICAST_REFLECT_SLOTS_MAX; idx ++) if (s->legacy_unicast_reflect_slots[idx]) deallocate_slot(s, s->legacy_unicast_reflect_slots[idx]); @@ -713,7 +713,7 @@ static AvahiLegacyUnicastReflectSlot* find_slot(AvahiServer *s, uint16_t id) { if (!s->legacy_unicast_reflect_slots) return NULL; - idx = id % AVAHI_MAX_LEGACY_UNICAST_REFLECT_SLOTS; + idx = id % AVAHI_LEGACY_UNICAST_REFLECT_SLOTS_MAX; if (!s->legacy_unicast_reflect_slots[idx] || s->legacy_unicast_reflect_slots[idx]->id != id) return NULL; @@ -862,7 +862,7 @@ static void dispatch_packet(AvahiServer *s, AvahiDnsPacket *p, const struct sock return; } -/* avahi_log_debug("new packet recieved on interface '%s.%i'.", i->hardware->name, i->protocol); */ +/* avahi_log_debug("new packet received on interface '%s.%i'.", i->hardware->name, i->protocol); */ port = avahi_port_from_sockaddr(sa); avahi_address_from_sockaddr(sa, &a); @@ -923,7 +923,7 @@ static void dispatch_packet(AvahiServer *s, AvahiDnsPacket *p, const struct sock if (!is_mdns_mcast_address(dest) && !avahi_interface_address_on_link(i, &a)) { - avahi_log_warn("Recivied non-local response on interface '%s.%i'.", i->hardware->name, i->protocol); + avahi_log_warn("Received non-local response on interface '%s.%i'.", i->hardware->name, i->protocol); return; } @@ -955,7 +955,7 @@ static void dispatch_legacy_unicast_packet(AvahiServer *s, AvahiDnsPacket *p, co return; } -/* avahi_log_debug("new legacy unicast packet recieved on interface '%s.%i'.", i->hardware->name, i->protocol); */ +/* avahi_log_debug("new legacy unicast packet received on interface '%s.%i'.", i->hardware->name, i->protocol); */ avahi_address_from_sockaddr(sa, &a); diff --git a/avahi-core/wide-area.c b/avahi-core/wide-area.c index 83337a5..9dd1e73 100644 --- a/avahi-core/wide-area.c +++ b/avahi-core/wide-area.c @@ -39,7 +39,7 @@ #include "hashmap.h" #include "wide-area.h" -#define MAX_CACHE_ENTRIES 500 +#define CACHE_ENTRIES_MAX 500 typedef struct AvahiWideAreaCacheEntry AvahiWideAreaCacheEntry; @@ -97,7 +97,7 @@ struct AvahiWideAreaLookupEngine { int cleanup_dead; - AvahiAddress dns_servers[AVAHI_MAX_WIDE_AREA_SERVERS]; + AvahiAddress dns_servers[AVAHI_WIDE_AREA_SERVERS_MAX]; unsigned n_dns_servers; unsigned current_dns_server; }; @@ -416,7 +416,7 @@ static void add_to_cache(AvahiWideAreaLookupEngine *e, AvahiRecord *r) { is_new = 1; /* Enforce cache size */ - if (e->cache_n_entries >= MAX_CACHE_ENTRIES) + if (e->cache_n_entries >= CACHE_ENTRIES_MAX) /* Eventually we should improve the caching algorithm here */ goto finish; @@ -662,7 +662,7 @@ void avahi_wide_area_set_servers(AvahiWideAreaLookupEngine *e, const AvahiAddres assert(e); if (a) { - for (e->n_dns_servers = 0; n > 0 && e->n_dns_servers < AVAHI_MAX_WIDE_AREA_SERVERS; a++, n--) + for (e->n_dns_servers = 0; n > 0 && e->n_dns_servers < AVAHI_WIDE_AREA_SERVERS_MAX; a++, n--) if ((a->proto == AVAHI_PROTO_INET && e->fd_ipv4 >= 0) || (a->proto == AVAHI_PROTO_INET6 && e->fd_ipv6 >= 0)) e->dns_servers[e->n_dns_servers++] = *a; } else { diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c index b6a4e5d..0b1a6e8 100644 --- a/avahi-daemon/dbus-protocol.c +++ b/avahi-daemon/dbus-protocol.c @@ -68,9 +68,9 @@ typedef struct ServiceBrowserInfo ServiceBrowserInfo; typedef struct SyncServiceResolverInfo SyncServiceResolverInfo; typedef struct AsyncServiceResolverInfo AsyncServiceResolverInfo; -#define MAX_CLIENTS 256 -#define MAX_OBJECTS_PER_CLIENT 50 -#define MAX_ENTRIES_PER_ENTRY_GROUP 20 +#define CLIENTS_MAX 256 +#define OBJECTS_PER_CLIENT_MAX 50 +#define ENTRIES_PER_ENTRY_GROUP_MAX 20 /* #define VALGRIND_WORKAROUND 1 */ @@ -394,7 +394,7 @@ static Client *client_get(const char *name, int create) { if (!create) return NULL; - if (server->n_clients >= MAX_CLIENTS) + if (server->n_clients >= CLIENTS_MAX) return NULL; /* If not existant yet, create a new entry */ @@ -863,7 +863,7 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m, goto fail; } - if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= MAX_ENTRIES_PER_ENTRY_GROUP) { + if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= ENTRIES_PER_ENTRY_GROUP_MAX) { avahi_string_list_free(strlst); return respond_error(c, m, AVAHI_ERR_TOO_MANY_ENTRIES, NULL); } @@ -906,7 +906,7 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m, goto fail; } - if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= MAX_ENTRIES_PER_ENTRY_GROUP) + if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= ENTRIES_PER_ENTRY_GROUP_MAX) return respond_error(c, m, AVAHI_ERR_TOO_MANY_ENTRIES, NULL); if (domain && !*domain) @@ -971,7 +971,7 @@ static DBusHandlerResult msg_entry_group_impl(DBusConnection *c, DBusMessage *m, goto fail; } - if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= MAX_ENTRIES_PER_ENTRY_GROUP) + if (!(flags & AVAHI_PUBLISH_UPDATE) && i->n_entries >= ENTRIES_PER_ENTRY_GROUP_MAX) return respond_error(c, m, AVAHI_ERR_TOO_MANY_ENTRIES, NULL); if (!(avahi_address_parse(address, AVAHI_PROTO_UNSPEC, &a))) @@ -1918,7 +1918,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void return respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL); } - if (client->n_objects >= MAX_OBJECTS_PER_CLIENT) { + if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { avahi_log_warn("Too many objects for client '%s', client request failed.", client->name); return respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL); } @@ -1963,7 +1963,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void return respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL); } - if (client->n_objects >= MAX_OBJECTS_PER_CLIENT) { + if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { avahi_log_warn("Too many objects for client '%s', client request failed.", client->name); return respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL); } @@ -2008,7 +2008,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void return respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL); } - if (client->n_objects >= MAX_OBJECTS_PER_CLIENT) { + if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { avahi_log_warn("Too many objects for client '%s', client request failed.", client->name); return respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL); } @@ -2058,7 +2058,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void return respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL); } - if (client->n_objects >= MAX_OBJECTS_PER_CLIENT) { + if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { avahi_log_warn("Too many objects for client '%s', client request failed.", client->name); return respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL); } @@ -2113,7 +2113,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void } - if (client->n_objects >= MAX_OBJECTS_PER_CLIENT) { + if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { avahi_log_warn("Too many objects for client '%s', client request failed.", client->name); return respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL); } @@ -2169,7 +2169,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void } - if (client->n_objects >= MAX_OBJECTS_PER_CLIENT) { + if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { avahi_log_warn("Too many objects for client '%s', client request failed.", client->name); return respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL); } @@ -2218,7 +2218,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void return respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL); } - if (client->n_objects >= MAX_OBJECTS_PER_CLIENT) { + if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { avahi_log_warn("Too many objects for client '%s', client request failed.", client->name); return respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL); } @@ -2276,7 +2276,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void return respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL); } - if (client->n_objects >= MAX_OBJECTS_PER_CLIENT) { + if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { avahi_log_warn(__FILE__": Too many objects for client '%s', client request failed.", client->name); return respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL); } @@ -2336,7 +2336,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void return respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL); } - if (client->n_objects >= MAX_OBJECTS_PER_CLIENT) { + if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { avahi_log_warn(__FILE__": Too many objects for client '%s', client request failed.", client->name); return respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL); } @@ -2391,7 +2391,7 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, void return respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL); } - if (client->n_objects >= MAX_OBJECTS_PER_CLIENT) { + if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) { avahi_log_warn(__FILE__": Too many objects for client '%s', client request failed.", client->name); return respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL); } diff --git a/avahi-daemon/main.c b/avahi-daemon/main.c index 0e7bbf4..cf87e23 100644 --- a/avahi-daemon/main.c +++ b/avahi-daemon/main.c @@ -130,9 +130,9 @@ static int load_resolv_conf(const DaemonConfig *c) { goto finish; } - resolv_conf = avahi_new0(char*, AVAHI_MAX_WIDE_AREA_SERVERS+1); + resolv_conf = avahi_new0(char*, AVAHI_WIDE_AREA_SERVERS_MAX+1); - while (!feof(f) && i < AVAHI_MAX_WIDE_AREA_SERVERS) { + while (!feof(f) && i < AVAHI_WIDE_AREA_SERVERS_MAX) { char ln[128]; char *p; @@ -204,11 +204,11 @@ static void remove_dns_server_entry_groups(void) { } static void update_wide_area_servers(void) { - AvahiAddress a[AVAHI_MAX_WIDE_AREA_SERVERS]; + AvahiAddress a[AVAHI_WIDE_AREA_SERVERS_MAX]; unsigned n = 0; char **p; - for (p = resolv_conf; *p && n < AVAHI_MAX_WIDE_AREA_SERVERS; p++) { + for (p = resolv_conf; *p && n < AVAHI_WIDE_AREA_SERVERS_MAX; p++) { if (!avahi_address_parse(*p, AVAHI_PROTO_UNSPEC, &a[n])) avahi_log_warn("Failed to parse address '%s', ignoring.", *p); else @@ -987,7 +987,7 @@ int main(int argc, char *argv[]) { /** Parent **/ if ((ret = daemon_retval_wait(20)) < 0) { - avahi_log_error("Could not recieve return value from daemon process."); + avahi_log_error("Could not receive return value from daemon process."); goto finish; } diff --git a/avahi-dnsconfd/main.c b/avahi-dnsconfd/main.c index faf0490..327d738 100644 --- a/avahi-dnsconfd/main.c +++ b/avahi-dnsconfd/main.c @@ -588,7 +588,7 @@ int main(int argc, char *argv[]) { /** Parent **/ if ((ret = daemon_retval_wait(20)) < 0) { - daemon_log(LOG_ERR, "Could not recieve return value from daemon process."); + daemon_log(LOG_ERR, "Could not receive return value from daemon process."); goto finish; } diff --git a/docs/TODO b/docs/TODO index dc1883d..65a606a 100644 --- a/docs/TODO +++ b/docs/TODO @@ -5,7 +5,6 @@ for 0.6: * add support for subtypes in static services * Add static host configuration like static services [lathiat] * wrap avahi_server_add_record() via DBUS and in avahi-client [lathiat] -* make sure that all limit definitions end with _MAX * unify argument oder of functions returning a string in a user supplied buffer later: @@ -96,3 +95,4 @@ done: * replace avahi_server_is_service_local() by AVAHI_PUBLISH flag * drop partially created created entries on failure * add error state for server and entry group +* make sure that all limit definitions end with _MAX