Mercurial > pidgin
comparison libpurple/protocols/bonjour/mdns_avahi.c @ 21696:fded60f269bc
Don't advertise our presence in avahi on IPv6 or listen for sevices since we don't support receiving connections from or connecting to IPv6 buddies. If someone needs to do that, they can submit a patch. Fixes #4188.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Fri, 30 Nov 2007 21:29:18 +0000 |
parents | 5b9da9db7e81 |
children | 41959f031322 |
comparison
equal
deleted
inserted
replaced
21695:52bbf38a1cd2 | 21696:fded60f269bc |
---|---|
153 /* A new peer has joined the network and uses iChat bonjour */ | 153 /* A new peer has joined the network and uses iChat bonjour */ |
154 purple_debug_info("bonjour", "_browser_callback - new service\n"); | 154 purple_debug_info("bonjour", "_browser_callback - new service\n"); |
155 /* Make sure it isn't us */ | 155 /* Make sure it isn't us */ |
156 if (purple_utf8_strcasecmp(name, account->username) != 0) { | 156 if (purple_utf8_strcasecmp(name, account->username) != 0) { |
157 if (!avahi_service_resolver_new(avahi_service_browser_get_client(b), | 157 if (!avahi_service_resolver_new(avahi_service_browser_get_client(b), |
158 interface, protocol, name, type, domain, AVAHI_PROTO_UNSPEC, | 158 interface, protocol, name, type, domain, AVAHI_PROTO_INET, |
159 0, _resolver_callback, account)) { | 159 0, _resolver_callback, account)) { |
160 purple_debug_warning("bonjour", "_browser_callback -- Error initiating resolver: %s\n", | 160 purple_debug_warning("bonjour", "_browser_callback -- Error initiating resolver: %s\n", |
161 avahi_strerror(avahi_client_errno(avahi_service_browser_get_client(b)))); | 161 avahi_strerror(avahi_client_errno(avahi_service_browser_get_client(b)))); |
162 } | 162 } |
163 } | 163 } |
313 /* Publish the service */ | 313 /* Publish the service */ |
314 switch (type) { | 314 switch (type) { |
315 case PUBLISH_START: | 315 case PUBLISH_START: |
316 publish_result = avahi_entry_group_add_service_strlst( | 316 publish_result = avahi_entry_group_add_service_strlst( |
317 idata->group, AVAHI_IF_UNSPEC, | 317 idata->group, AVAHI_IF_UNSPEC, |
318 AVAHI_PROTO_UNSPEC, 0, | 318 AVAHI_PROTO_INET, 0, |
319 purple_account_get_username(data->account), | 319 purple_account_get_username(data->account), |
320 ICHAT_SERVICE, NULL, NULL, data->port_p2pj, lst); | 320 ICHAT_SERVICE, NULL, NULL, data->port_p2pj, lst); |
321 break; | 321 break; |
322 case PUBLISH_UPDATE: | 322 case PUBLISH_UPDATE: |
323 publish_result = avahi_entry_group_update_service_txt_strlst( | 323 publish_result = avahi_entry_group_update_service_txt_strlst( |
324 idata->group, AVAHI_IF_UNSPEC, | 324 idata->group, AVAHI_IF_UNSPEC, |
325 AVAHI_PROTO_UNSPEC, 0, | 325 AVAHI_PROTO_INET, 0, |
326 purple_account_get_username(data->account), | 326 purple_account_get_username(data->account), |
327 ICHAT_SERVICE, NULL, lst); | 327 ICHAT_SERVICE, NULL, lst); |
328 break; | 328 break; |
329 } | 329 } |
330 | 330 |
352 gboolean _mdns_browse(BonjourDnsSd *data) { | 352 gboolean _mdns_browse(BonjourDnsSd *data) { |
353 AvahiSessionImplData *idata = data->mdns_impl_data; | 353 AvahiSessionImplData *idata = data->mdns_impl_data; |
354 | 354 |
355 g_return_val_if_fail(idata != NULL, FALSE); | 355 g_return_val_if_fail(idata != NULL, FALSE); |
356 | 356 |
357 idata->sb = avahi_service_browser_new(idata->client, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, ICHAT_SERVICE, NULL, 0, _browser_callback, data->account); | 357 idata->sb = avahi_service_browser_new(idata->client, AVAHI_IF_UNSPEC, AVAHI_PROTO_INET, ICHAT_SERVICE, NULL, 0, _browser_callback, data->account); |
358 if (!idata->sb) { | 358 if (!idata->sb) { |
359 | 359 |
360 purple_debug_error("bonjour", | 360 purple_debug_error("bonjour", |
361 "Unable to initialize service browser. Error: %s.\n", | 361 "Unable to initialize service browser. Error: %s.\n", |
362 avahi_strerror(avahi_client_errno(idata->client))); | 362 avahi_strerror(avahi_client_errno(idata->client))); |
398 | 398 |
399 svc_name = g_strdup_printf("%s." ICHAT_SERVICE "local", | 399 svc_name = g_strdup_printf("%s." ICHAT_SERVICE "local", |
400 purple_account_get_username(data->account)); | 400 purple_account_get_username(data->account)); |
401 | 401 |
402 ret = avahi_entry_group_add_record(idata->buddy_icon_group, AVAHI_IF_UNSPEC, | 402 ret = avahi_entry_group_add_record(idata->buddy_icon_group, AVAHI_IF_UNSPEC, |
403 AVAHI_PROTO_UNSPEC, flags, svc_name, | 403 AVAHI_PROTO_INET, flags, svc_name, |
404 AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_NULL, 120, avatar_data, avatar_len); | 404 AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_NULL, 120, avatar_data, avatar_len); |
405 | 405 |
406 g_free(svc_name); | 406 g_free(svc_name); |
407 | 407 |
408 if (ret < 0) { | 408 if (ret < 0) { |
484 | 484 |
485 purple_debug_info("bonjour", "Retrieving buddy icon for '%s'.\n", buddy->name); | 485 purple_debug_info("bonjour", "Retrieving buddy icon for '%s'.\n", buddy->name); |
486 | 486 |
487 name = g_strdup_printf("%s." ICHAT_SERVICE "local", buddy->name); | 487 name = g_strdup_printf("%s." ICHAT_SERVICE "local", buddy->name); |
488 idata->buddy_icon_rec_browser = avahi_record_browser_new(session_idata->client, AVAHI_IF_UNSPEC, | 488 idata->buddy_icon_rec_browser = avahi_record_browser_new(session_idata->client, AVAHI_IF_UNSPEC, |
489 AVAHI_PROTO_UNSPEC, name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_NULL, 0, | 489 AVAHI_PROTO_INET, name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_NULL, 0, |
490 _buddy_icon_record_cb, buddy); | 490 _buddy_icon_record_cb, buddy); |
491 g_free(name); | 491 g_free(name); |
492 | 492 |
493 if (!idata->buddy_icon_rec_browser) { | 493 if (!idata->buddy_icon_rec_browser) { |
494 purple_debug_error("bonjour", | 494 purple_debug_error("bonjour", |