comparison libpurple/protocols/bonjour/mdns_win32.c @ 32819:2c6510167895 default tip

propagate from branch 'im.pidgin.pidgin.2.x.y' (head 3315c5dfbd0ad16511bdcf865e5b07c02d07df24) to branch 'im.pidgin.pidgin' (head cbd1eda6bcbf0565ae7766396bb8f6f419cb6a9a)
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 02 Jun 2012 02:30:49 +0000
parents 01b832cc602a
children
comparison
equal deleted inserted replaced
32818:01ff09d4a463 32819:2c6510167895
103 DNSServiceErrorType errorCode = DNSServiceProcessResult(srh->sdRef); 103 DNSServiceErrorType errorCode = DNSServiceProcessResult(srh->sdRef);
104 if (errorCode != kDNSServiceErr_NoError) { 104 if (errorCode != kDNSServiceErr_NoError) {
105 purple_debug_error("bonjour", "Error (%d) handling mDNS response.\n", errorCode); 105 purple_debug_error("bonjour", "Error (%d) handling mDNS response.\n", errorCode);
106 /* This happens when the mDNSResponder goes down, I haven't seen it happen any other time (in my limited testing) */ 106 /* This happens when the mDNSResponder goes down, I haven't seen it happen any other time (in my limited testing) */
107 if (errorCode == kDNSServiceErr_Unknown) { 107 if (errorCode == kDNSServiceErr_Unknown) {
108 purple_connection_error_reason(srh->account->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, 108 purple_connection_error(srh->account->gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
109 _("Error communicating with local mDNSResponder.")); 109 _("Error communicating with local mDNSResponder."));
110 } 110 }
111 } 111 }
112 } 112 }
113 113
175 DNSServiceRefDeallocate(args->resolver_query->sdRef); 175 DNSServiceRefDeallocate(args->resolver_query->sdRef);
176 g_free(args->resolver_query); 176 g_free(args->resolver_query);
177 args->resolver_query = NULL; 177 args->resolver_query = NULL;
178 178
179 if ((pb = purple_find_buddy(args->account, args->res_data->name))) { 179 if ((pb = purple_find_buddy(args->account, args->res_data->name))) {
180 if (pb->proto_data != args->bb) { 180 if (purple_buddy_get_protocol_data(pb) != args->bb) {
181 purple_debug_error("bonjour", "Found purple buddy for %s not matching bonjour buddy record.", 181 purple_debug_error("bonjour", "Found purple buddy for %s not matching bonjour buddy record.",
182 args->res_data->name); 182 args->res_data->name);
183 goto cleanup; 183 goto cleanup;
184 } 184 }
185 /* Make sure that the BonjourBuddy associated with this request is still around */ 185 /* Make sure that the BonjourBuddy associated with this request is still around */
346 Win32SvcResolverData *rd; 346 Win32SvcResolverData *rd;
347 Win32BuddyImplData *idata; 347 Win32BuddyImplData *idata;
348 348
349 /* Is there an existing buddy? */ 349 /* Is there an existing buddy? */
350 if ((pb = purple_find_buddy(account, serviceName))) 350 if ((pb = purple_find_buddy(account, serviceName)))
351 bb = pb->proto_data; 351 bb = purple_buddy_get_protocol_data(pb);
352 /* Is there a pending buddy? */ 352 /* Is there a pending buddy? */
353 else { 353 else {
354 while (tmp) { 354 while (tmp) {
355 BonjourBuddy *bb_tmp = tmp->data; 355 BonjourBuddy *bb_tmp = tmp->data;
356 if (!strcmp(bb_tmp->name, serviceName)) { 356 if (!strcmp(bb_tmp->name, serviceName)) {
366 366
367 /* This is only necessary for the wacky case where someone previously manually added a buddy. */ 367 /* This is only necessary for the wacky case where someone previously manually added a buddy. */
368 if (pb == NULL) 368 if (pb == NULL)
369 pending_buddies = g_slist_prepend(pending_buddies, bb); 369 pending_buddies = g_slist_prepend(pending_buddies, bb);
370 else 370 else
371 pb->proto_data = bb; 371 purple_buddy_set_protocol_data(pb, bb);
372 } 372 }
373 373
374 rd = g_new0(Win32SvcResolverData, 1); 374 rd = g_new0(Win32SvcResolverData, 1);
375 rd->if_idx = interfaceIndex; 375 rd->if_idx = interfaceIndex;
376 rd->name = g_strdup(serviceName); 376 rd->name = g_strdup(serviceName);
406 pb = purple_find_buddy(account, serviceName); 406 pb = purple_find_buddy(account, serviceName);
407 if (pb != NULL) { 407 if (pb != NULL) {
408 GSList *l; 408 GSList *l;
409 /* There may be multiple presences, we should only get rid of this one */ 409 /* There may be multiple presences, we should only get rid of this one */
410 Win32SvcResolverData *rd_search; 410 Win32SvcResolverData *rd_search;
411 BonjourBuddy *bb = pb->proto_data; 411 BonjourBuddy *bb = purple_buddy_get_protocol_data(pb);
412 Win32BuddyImplData *idata; 412 Win32BuddyImplData *idata;
413 413
414 g_return_if_fail(bb != NULL); 414 g_return_if_fail(bb != NULL);
415 415
416 idata = bb->mdns_impl_data; 416 idata = bb->mdns_impl_data;