Avahi drops service browser events when re-anouncing services. Attached there is a minimal test case demonstrating the problem. Current behavior is:
mathias@pergamaunz:~/Desktop$ ./avahi-bug2
/usr/bin/gcc avahi-bug2.c -o avahi-bug2 -Wall -D_REENTRANT -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lavahi-glib -lglib-2.0 -lavahi-common -lavahi-client
service_browser_cb: b=0x804bd70, e=2(cache-exhausted), n=(null), t=_yadda._sub._test._tcp
service_browser_cb: b=0x804bd70, e=0(new), n=YaddaTest, t=_test._tcp
service_browser_cb: b=0x804bd70, e=3(all-for-now), n=(null), t=_yadda._sub._test._tcp
kill_cb: using immediate strategy
mathias@pergamaunz:~/Desktop$ IDLE=1 ./avahi-bug2
service_browser_cb: b=0x804bd70, e=2(cache-exhausted), n=(null), t=_yadda._sub._test._tcp
service_browser_cb: b=0x804bd70, e=0(new), n=YaddaTest, t=_test._tcp
service_browser_cb: b=0x804bd70, e=3(all-for-now), n=(null), t=_yadda._sub._test._tcp
kill_cb: using idle strategy
mathias@pergamaunz:~/Desktop$ DELAY=1 ./avahi-bug2
service_browser_cb: b=0x804bd70, e=2(cache-exhausted), n=(null), t=_yadda._sub._test._tcp
service_browser_cb: b=0x804bd70, e=3(all-for-now), n=(null), t=_yadda._sub._test._tcp
service_browser_cb: b=0x804bd70, e=0(new), n=YaddaTest, t=_test._tcp
kill_cb: using delay strategy
service_browser_cb: b=0x804bd70, e=1(remove), n=YaddaTest, t=_test._tcp
service_browser_cb: b=0x804bd70, e=0(new), n=YaddaTest, t=_test._tcp
The cases with immediate and idle strategy do not see the AVAHI_BROWSER_REMOVE and the AVAHI_BROWSER_NEW event, whereas they should.