pidgin.2.x.y: 14d1bcde: *** Plucked rev 4b5c688e1486f88c95bbe694...

markdoliner at pidgin.im markdoliner at pidgin.im
Sun Feb 12 22:55:26 EST 2012


----------------------------------------------------------------------
Revision: 14d1bcdec5d90bcadbee7130f55ec007b7b01d14
Parent:   57c389a367e2a0144578bfaea92d7cd3d24fa4b3
Author:   markdoliner at pidgin.im
Date:     02/12/12 22:32:29
Branch:   im.pidgin.pidgin.2.x.y
URL: http://d.pidgin.im/viewmtn/revision/info/14d1bcdec5d90bcadbee7130f55ec007b7b01d14

Changelog: 

*** Plucked rev 4b5c688e1486f88c95bbe6946367a00b2d1e02dd (markdoliner at pidgin.im):
Adjust this debug statement.  listener_ip is based off of the bos connection
fd, not the listener_fd, so it's more useful to log info about the bos conn
fd.

*** Plucked rev 9ac3dc3dac01d52f74ef1da3fe9122a233650e5a (markdoliner at pidgin.im):
We don't need to abort the file transfer attempt entirely when this happens.
We can just try the next connection method (both users connect to a 3rd
party proxy)

*** Plucked rev 77872b7f18741bca0e5bda735debf9ea3e3d386f (markdoliner at pidgin.im):
Move this check up a level so that it affects direct connections, too.

I think this will fix the crash reported in http://trac.adium.im/ticket/15839
Still not sure why ip_atoi fails here.

Changes against parent 57c389a367e2a0144578bfaea92d7cd3d24fa4b3

  patched  libpurple/protocols/oscar/peer.c

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/peer.c	815bc7a8ebfe86c526229a62531dabb0b62e4d0e
+++ libpurple/protocols/oscar/peer.c	0f47ae9898b8096e2b6fc4183f7b363502eafe36
@@ -660,6 +660,7 @@ peer_connection_establish_listener_cb(in
 	char *tmp;
 	FlapConnection *bos_conn;
 	const char *listener_ip;
+	const guchar *ip_atoi;
 	unsigned short listener_port;
 
 	conn = data;
@@ -694,11 +695,28 @@ peer_connection_establish_listener_cb(in
 		listener_ip = purple_network_get_my_ip(bos_conn->gsc->fd);
 	else
 		listener_ip = purple_network_get_my_ip(bos_conn->fd);
+
+	ip_atoi = purple_network_ip_atoi(listener_ip);
+	if (ip_atoi == NULL) {
+		/* Could not convert IP to 4 byte array--weird, but this does
+		   happen for some users (#4829, Adium #15839).  Maybe they're
+		   connecting with IPv6...?  Maybe through a proxy? */
+		purple_debug_error("oscar", "Can't ask peer to connect to us "
+				"because purple_network_ip_atoi(%s) returned NULL. "
+				"fd=%d. is_ssl=%d\n",
+				listener_ip ? listener_ip : "(null)",
+				bos_conn->gsc ? bos_conn->gsc->fd : bos_conn->fd,
+				bos_conn->gsc ? 1 : 0);
+		peer_connection_trynext(conn);
+		return;
+	}
+
 	listener_port = purple_network_get_port_from_fd(conn->listenerfd);
+
 	if (conn->type == OSCAR_CAPABILITY_DIRECTIM)
 	{
 		aim_im_sendch2_odc_requestdirect(od,
-				conn->cookie, conn->bn, purple_network_ip_atoi(listener_ip),
+				conn->cookie, conn->bn, ip_atoi,
 				listener_port, ++conn->lastrequestnumber);
 
 		/* Print a message to a local conversation window */
@@ -710,15 +728,6 @@ peer_connection_establish_listener_cb(in
 	}
 	else if (conn->type == OSCAR_CAPABILITY_SENDFILE)
 	{
-		const guchar *ip_atoi = purple_network_ip_atoi(listener_ip);
-		if (ip_atoi == NULL) {
-			purple_debug_error("oscar", "Cannot send file. atoi(%s) failed.\n"
-					"Other possibly useful information: fd = %d, port = %d\n",
-					listener_ip ? listener_ip : "(null!)", conn->listenerfd,
-					listener_port);
-			purple_xfer_cancel_local(conn->xfer);
-			return;
-		}
 		aim_im_sendch2_sendfile_requestdirect(od,
 				conn->cookie, conn->bn,
 				ip_atoi,


More information about the Commits mailing list