im.pidgin.pidgin: ee665e939ab5c8c3da1f8f62d844250bb01a84bf

datallah at pidgin.im datallah at pidgin.im
Sun Nov 18 22:20:39 EST 2007


-----------------------------------------------------------------
Revision: ee665e939ab5c8c3da1f8f62d844250bb01a84bf
Ancestor: 20980aa064aa66b9e3305aeed18ce8914f4eb98e
Author: datallah at pidgin.im
Date: 2007-11-19T03:16:29
Branch: im.pidgin.pidgin

Modified files:
        libpurple/ft.c libpurple/protocols/irc/dcc_send.c

ChangeLog: 

Fix #3983 by canceling the file transfer when connecting to the remote host fails.

-------------- next part --------------
============================================================
--- libpurple/ft.c	e4378574d55f93733a556d6d955ca8b56f033992
+++ libpurple/ft.c	519449a17b7bd6f340de9b0758f371ce9ab711fe
@@ -998,6 +998,11 @@ connect_cb(gpointer data, gint source, c
 {
 	PurpleXfer *xfer = (PurpleXfer *)data;
 
+	if (source < 0) {
+		purple_xfer_cancel_local(xfer);
+		return;
+	}
+
 	xfer->fd = source;
 
 	begin_transfer(xfer, PURPLE_INPUT_READ);
============================================================
--- libpurple/protocols/irc/dcc_send.c	580e2831117feab9a4dcd353003ef999ff1d586d
+++ libpurple/protocols/irc/dcc_send.c	54e23061ab525ca1d830befe7012f09973c83ed3
@@ -40,9 +40,7 @@ static void irc_dccsend_recv_destroy(Pur
 {
 	struct irc_xfer_rx_data *xd = xfer->data;
 
-	if (xd->ip != NULL)
-		g_free(xd->ip);
-
+	g_free(xd->ip);
 	g_free(xd);
 }
 
@@ -123,8 +121,8 @@ void irc_dccsend_recv(struct irc_conn *i
 		} else {
 			xd->ip = g_strdup(token[i]);
 		}
-		purple_debug(PURPLE_DEBUG_INFO, "irc", "Receiving file from %s\n",
-				   xd->ip);
+		purple_debug(PURPLE_DEBUG_INFO, "irc", "Receiving file (%s) from %s\n",
+			     filename->str, xd->ip);
 		purple_xfer_set_size(xfer, token[i+2] ? atoi(token[i+2]) : 0);
 		
 		purple_xfer_set_init_fnc(xfer, irc_dccsend_recv_init);
@@ -166,8 +164,7 @@ static void irc_dccsend_send_destroy(Pur
 	if (xd->fd != -1)
 		close(xd->fd);
 
-	if (xd->rxqueue)
-		g_free(xd->rxqueue);
+	g_free(xd->rxqueue);
 
 	g_free(xd);
 }


More information about the Commits mailing list