Your message dated Sun, 24 Feb 2013 13:12:51 -0500
with message-id <[email protected]>
and subject line 
has caused the Debian Bug report #623315,
regarding libpurple0: bonjour aborts chat if the connection with the first IP 
address fails
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
623315: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=623315
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libpurple0
Version: 2.7.11-1
Severity: normal
Tags: patch

(17:16:43) bonjour: Starting conversation with foo@bar
(17:16:43) proxy: Attempting connection to x:x:dx:x:226:b0ff:fee8:4fdc
(17:16:43) proxy: Connecting to x:x:x:x:226:b0ff:fee8:4fdc%2:51404 with no
proxy
(17:16:43) proxy: Connection in progress
(17:16:43) proxy: Connecting to x:x:x:x:226:b0ff:fee8:4fdc%2:51404.
(17:16:43) proxy: Error connecting to x:x:x:x:226:b0ff:fee8:4fdc%2:51404
(Connection refused).
(17:16:43) proxy: Connection attempt failed: Connection refused
(17:16:43) bonjour: Error connecting to buddy foo@bar at
x:x:x:x:226:b0ff:fee8:4fdc%2:51404 error: Connection refused

foo@bar is an Apple iChat buddy. It appears that iChat advertises an IPv6
address but does not bind to it. Nevertheless, it binds to an IPv4 address and
advertises it as well. The bonjour implementation in libpurple only tries to
connect to the first IP address in its list, which in this case should not be
advertised. It seem reasonable to make libpurple try to connect to the other
addresses then.

I attach a patch to implement this behavior.



-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.38.3-thinkpad (SMP w/2 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libpurple0 depends on:
ii  libavahi-client3 0.6.30-2                Avahi client library
ii  libavahi-common3 0.6.30-2                Avahi common library
ii  libavahi-glib1   0.6.30-2                Avahi glib integration library
ii  libc6            2.11.2-13               Embedded GNU C Library: Shared lib
ii  libdbus-1-3      1.4.6-1                 simple interprocess messaging syst
ii  libdbus-glib-1-2 0.92-1                  simple interprocess messaging syst
ii  libgadu3         1:1.10.1-1              Gadu-Gadu protocol library - runti
ii  libglib2.0-0     2.28.6-1                The GLib library of C routines
ii  libgstfarsight0. 0.0.26-1                Audio/Video communications framewo
ii  libgstreamer-plu 0.10.32-2               GStreamer libraries from the "base
ii  libgstreamer0.10 0.10.32-6               Core GStreamer libraries and eleme
ii  libidn11         1.20-1                  GNU Libidn library, implementation
ii  libmeanwhile1    1.0.2-3                 open implementation of the Lotus S
ii  libnspr4-0d      4.8.7-2                 NetScape Portable Runtime Library
ii  libnss3-1d       3.12.9.with.ckbi.1.82-1 Network Security Service libraries
ii  libperl5.10      5.10.1-19               shared Perl library
ii  libsasl2-2       2.1.23.dfsg1-8          Cyrus SASL - authentication abstra
ii  libsasl2-modules 2.1.23.dfsg1-8          Cyrus SASL - pluggable authenticat
ii  libsilc-1.1-2    1.1.10-2                SILC generic library
ii  libsilcclient-1. 1.1.10-2                SILC client library
ii  libxml2          2.7.8.dfsg-2+b1         GNOME XML library
ii  libzephyr4       3.0.1-1                 Project Athena's notification serv
ii  perl-base [perla 5.10.1-19               minimal Perl system
ii  pidgin-data      2.7.11-1                multi-protocol instant messaging c

Versions of packages libpurple0 recommends:
ii  ca-certificates            20090814+nmu3 Common CA certificates
ii  libpurple-bin              2.7.11-1      multi-protocol instant messaging l

Versions of packages libpurple0 suggests:
ii  tcl8.5                        8.5.9-2    Tcl (the Tool Command Language) v8
ii  tk8.5                         8.5.9-2    Tk toolkit for Tcl and X11, v8.5 -

-- no debconf information
Description: Upstream changes introduced in version 2.7.11-1local1
 This patch has been created by dpkg-source during the package build.
 Here's the last changelog entry, hopefully it gives details on why
 those changes were made:
 .
 pidgin (2.7.11-1local1) unstable; urgency=low
 .
   * Recurse through IP addresses with Bonjour instead of using the first
     one only
 .
 The person named in the Author field signed this changelog entry.
Author: Simon van der Linden <[email protected]>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- pidgin-2.7.11.orig/libpurple/protocols/bonjour/jabber.c
+++ pidgin-2.7.11/libpurple/protocols/bonjour/jabber.c
@@ -831,12 +831,39 @@ _connected_to_buddy(gpointer data, gint
        if (source < 0) {
                PurpleConversation *conv = NULL;
                PurpleAccount *account = NULL;
+               GSList *tmp = bb->ips;
+
+               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);
 
-               purple_debug_error("bonjour", "Error connecting to buddy %s at 
%s:%d error: %s\n",
-                                  purple_buddy_get_name(pb), 
bb->conversation->ip, bb->port_p2pj, error ? error : "(null)");
+               for (; strcmp(bb->conversation->ip, tmp->data) != 0; tmp = 
g_slist_next(tmp));
+               tmp = g_slist_next(tmp);
 
                account = purple_buddy_get_account(pb);
 
+               if (tmp != NULL) {
+                       const gchar *ip;
+                       PurpleProxyConnectData *connect_data;
+
+                       ip = tmp->data;
+
+                       purple_debug_info("bonjour", "Starting conversation 
with %s at %s:%d\n",
+                                         purple_buddy_get_name(pb), ip, 
bb->port_p2pj);
+
+                       connect_data = 
purple_proxy_connect(purple_account_get_connection(account),
+                                                           account, ip, 
bb->port_p2pj, _connected_to_buddy, pb);
+
+                       if (connect_data != NULL) {
+                               g_free(bb->conversation->ip);
+                               bb->conversation->ip = g_strdup(ip);
+                               bb->conversation->connect_data = connect_data;
+
+                               return;
+                       }
+               }
+
+               purple_debug_error("bonjour", "No more addresses for buddy %s. 
Aborting", purple_buddy_get_name(pb));
+
                conv = 
purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, bb->name, account);
                if (conv != NULL)
                        purple_conversation_write(conv, NULL,
@@ -995,10 +1022,9 @@ _find_or_start_conversation(BonjourJabbe
        {
                PurpleProxyConnectData *connect_data;
                PurpleProxyInfo *proxy_info;
-               /* For better or worse, use the first IP*/
-               const char *ip = bb->ips->data;
+               const char *ip = bb->ips->data; /* Start with the first IP 
address. */
 
-               purple_debug_info("bonjour", "Starting conversation with %s\n", 
to);
+               purple_debug_info("bonjour", "Starting conversation with %s at 
%s:%d\n", to, ip, bb->port_p2pj);
 
                /* Make sure that the account always has a proxy of "none".
                 * This is kind of dirty, but proxy_connect_none() isn't 
exposed. */

--- End Message ---
--- Begin Message ---
Version: 2.8.0-1

Fixed upstream.

--- End Message ---

Reply via email to