comparison libpurple/protocols/bonjour/mdns_avahi.c @ 28511:9d6e1327f614

Add some additional debug output to the avahi mdns implemenation.
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 06 Nov 2009 04:21:47 +0000
parents deecc1d663c4
children 755219afed9f
comparison
equal deleted inserted replaced
28510:7963477c2019 28511:9d6e1327f614
148 bonjour_buddy_signed_off(pb); 148 bonjour_buddy_signed_off(pb);
149 } 149 }
150 } 150 }
151 break; 151 break;
152 case AVAHI_RESOLVER_FOUND: 152 case AVAHI_RESOLVER_FOUND:
153
154 purple_debug_info("bonjour", "_resolve_callback - name:%s account:%p bb:%p\n",
155 name, account, bb);
156
153 /* create a buddy record */ 157 /* create a buddy record */
154 if (bb == NULL) 158 if (bb == NULL)
155 bb = bonjour_buddy_new(name, account); 159 bb = bonjour_buddy_new(name, account);
156 b_impl = bb->mdns_impl_data; 160 b_impl = bb->mdns_impl_data;
157 161
171 b_impl->resolvers = g_slist_prepend(b_impl->resolvers, rd); 175 b_impl->resolvers = g_slist_prepend(b_impl->resolvers, rd);
172 } 176 }
173 177
174 178
175 /* Get the ip as a string */ 179 /* Get the ip as a string */
180 ip[0] = '\0';
176 avahi_address_snprint(ip, AVAHI_ADDRESS_STR_MAX, a); 181 avahi_address_snprint(ip, AVAHI_ADDRESS_STR_MAX, a);
182
183 purple_debug_info("bonjour", "_resolve_callback - name:%s ip:%s prev_ip:%s\n",
184 name, ip, rd->ip);
177 185
178 if (rd->ip == NULL || strcmp(rd->ip, ip) != 0) { 186 if (rd->ip == NULL || strcmp(rd->ip, ip) != 0) {
179 /* We store duplicates in bb->ips, so we always remove the one */ 187 /* We store duplicates in bb->ips, so we always remove the one */
180 if (rd->ip != NULL) { 188 if (rd->ip != NULL) {
181 bb->ips = g_slist_remove(bb->ips, rd->ip); 189 bb->ips = g_slist_remove(bb->ips, rd->ip);