summaryrefslogtreecommitdiffstats
path: root/avahi-core/rr.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-05-17 00:03:50 +0000
committerLennart Poettering <lennart@poettering.net>2005-05-17 00:03:50 +0000
commit28d336020ca1f6dbb88d64cac3ffdd1a67ee3de7 (patch)
tree3562ceea432fa92aed64c3c8b365555165c87318 /avahi-core/rr.c
parent7ef880c32da573ba044cde87ae99a98a6038b7d1 (diff)
* split packet scheduler into three seperate parts
* test against Aplle test suit, most tests pass now * suppress auxiliary records by known answers * handle very large records git-svn-id: file:///home/lennart/svn/public/avahi/trunk@74 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-core/rr.c')
-rw-r--r--avahi-core/rr.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/avahi-core/rr.c b/avahi-core/rr.c
index 5b5ec7e..a21595f 100644
--- a/avahi-core/rr.c
+++ b/avahi-core/rr.c
@@ -452,21 +452,21 @@ static gint lexicographical_memcmp(gconstpointer a, size_t al, gconstpointer b,
}
static gint uint16_cmp(guint16 a, guint16 b) {
- return a == b ? 0 : (a < b ? a : b);
+ return a == b ? 0 : (a < b ? -1 : 1);
}
gint avahi_record_lexicographical_compare(AvahiRecord *a, AvahiRecord *b) {
gint r;
-/* gchar *t1, *t2; */
+ gchar *t1, *t2;
g_assert(a);
g_assert(b);
-/* t1 = avahi_record_to_string(a); */
-/* t2 = avahi_record_to_string(b); */
-/* g_message("lexicocmp: %s %s", t1, t2); */
-/* g_free(t1); */
-/* g_free(t2); */
+ t1 = avahi_record_to_string(a);
+ t2 = avahi_record_to_string(b);
+ g_message("lexicocmp: %s %s", t1, t2);
+ g_free(t1);
+ g_free(t2);
if (a == b)
return 0;
@@ -486,6 +486,8 @@ gint avahi_record_lexicographical_compare(AvahiRecord *a, AvahiRecord *b) {
(r = uint16_cmp(a->data.srv.weight, b->data.srv.weight)) == 0 &&
(r = uint16_cmp(a->data.srv.port, b->data.srv.port)) == 0)
r = avahi_binary_domain_cmp(a->data.srv.name, b->data.srv.name);
+
+ g_message("SRV: %i", r);
return r;
}
@@ -529,3 +531,9 @@ gint avahi_record_lexicographical_compare(AvahiRecord *a, AvahiRecord *b) {
}
}
+
+gboolean avahi_record_is_goodbye(AvahiRecord *r) {
+ g_assert(r);
+
+ return r->ttl == 0;
+}