X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;ds=sidebyside;f=avahi-common%2Frr.c;h=b0c03a965ec09db687dca49ab0aebb7b231247ae;hb=41f4062e34d1e13c2d93d971334efbad060b6df0;hp=13160fcbc2d8222fa0d3e5519c5b2df19fb12e08;hpb=9962a048634c590db23a00db1d01daada779844c;p=catta diff --git a/avahi-common/rr.c b/avahi-common/rr.c index 13160fc..b0c03a9 100644 --- a/avahi-common/rr.c +++ b/avahi-common/rr.c @@ -70,7 +70,7 @@ void avahi_key_unref(AvahiKey *k) { } } -AvahiRecord *avahi_record_new(AvahiKey *k) { +AvahiRecord *avahi_record_new(AvahiKey *k, guint32 ttl) { AvahiRecord *r; g_assert(k); @@ -81,19 +81,19 @@ AvahiRecord *avahi_record_new(AvahiKey *k) { memset(&r->data, 0, sizeof(r->data)); - r->ttl = AVAHI_DEFAULT_TTL; + r->ttl = ttl != (guint32) -1 ? ttl : AVAHI_DEFAULT_TTL; return r; } -AvahiRecord *avahi_record_new_full(const gchar *name, guint16 class, guint16 type) { +AvahiRecord *avahi_record_new_full(const gchar *name, guint16 class, guint16 type, guint32 ttl) { AvahiRecord *r; AvahiKey *k; g_assert(name); k = avahi_key_new(name, class, type); - r = avahi_record_new(k); + r = avahi_record_new(k, ttl); avahi_key_unref(k); return r;