# HG changeset patch # User Daniel Atallah # Date 1304440636 0 # Node ID e1d31abb245c11723668b531b5a8ef393a11a57c # Parent 6ec53e134447d82088f3b53b477d8c42fbc0691d bonjour: Update to 427f3622bbeb4 to match the last used IP more reliably. Without this, there will be an infinite loop when there are duplicate IPs in the list for a buddy (e.g. when you receive notifications on multiple interfaces). Refs #13773 diff -r 6ec53e134447 -r e1d31abb245c libpurple/protocols/bonjour/jabber.c --- a/libpurple/protocols/bonjour/jabber.c Tue May 03 16:12:36 2011 +0000 +++ b/libpurple/protocols/bonjour/jabber.c Tue May 03 16:37:16 2011 +0000 @@ -836,8 +836,14 @@ purple_debug_error("bonjour", "Error connecting to buddy %s at %s:%d (%s); Trying next IP address\n", purple_buddy_get_name(pb), bb->conversation->ip, bb->port_p2pj, error); - for (; strcmp(bb->conversation->ip, tmp->data) != 0; tmp = g_slist_next(tmp)); - tmp = g_slist_next(tmp); + /* There may be multiple entries for the same IP - one per + * presence recieved (e.g. multiple interfaces). + * We need to make sure that we find the previously used entry. + */ + while (tmp && bb->conversation->ip_link != tmp->data) + tmp = g_slist_next(tmp); + if (tmp) + tmp = g_slist_next(tmp); account = purple_buddy_get_account(pb); @@ -845,7 +851,7 @@ const gchar *ip; PurpleProxyConnectData *connect_data; - ip = tmp->data; + bb->conversation->ip_link = ip = tmp->data; purple_debug_info("bonjour", "Starting conversation with %s at %s:%d\n", purple_buddy_get_name(pb), ip, bb->port_p2pj); @@ -1047,6 +1053,7 @@ bb->conversation = bonjour_jabber_conv_new(pb, jdata->account, ip); bb->conversation->connect_data = connect_data; + bb->conversation->ip_link = ip; /* We don't want _send_data() to register the tx_handler; * that neeeds to wait until we're actually connected. */ bb->conversation->tx_handler = 0; diff -r 6ec53e134447 -r e1d31abb245c libpurple/protocols/bonjour/jabber.h --- a/libpurple/protocols/bonjour/jabber.h Tue May 03 16:12:36 2011 +0000 +++ b/libpurple/protocols/bonjour/jabber.h Tue May 03 16:37:16 2011 +0000 @@ -63,6 +63,8 @@ /* The following are only needed before attaching to a PurpleBuddy */ gchar *buddy_name; gchar *ip; + /* This points to a data entry in BonjourBuddy->ips */ + const gchar *ip_link; } BonjourJabberConversation; /**