cpw.malu.xmpp.jingle_ft: e4585f93: Don't try to stop connecting when not al...

malu at pidgin.im malu at pidgin.im
Tue Jan 12 14:41:36 EST 2010


-----------------------------------------------------------------
Revision: e4585f9396c61a0e5e75073c9a4b76604e228ea0
Ancestor: 503d1db56c7dfd33d1582ad86432093c2e1cd2d1
Author: malu at pidgin.im
Date: 2010-01-12T19:39:16
Branch: im.pidgin.cpw.malu.xmpp.jingle_ft
URL: http://d.pidgin.im/viewmtn/revision/info/e4585f9396c61a0e5e75073c9a4b76604e228ea0

Modified files:
        libpurple/protocols/jabber/jingle/file-transfer.c
        libpurple/protocols/jabber/jingle/s5b.c
        libpurple/protocols/jabber/jingle/s5b.h

ChangeLog: 

Don't try to stop connecting when not already connected

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jingle/file-transfer.c	474cf0f68ff10d82b9ad158c8a2fcd4f30208091
+++ libpurple/protocols/jabber/jingle/file-transfer.c	bdb5b3b6a5afc0fc3027ac06e9b7918c276f5df9
@@ -549,7 +549,8 @@ jingle_file_transfer_cancel_send(PurpleX
 	if (session) {
 		JingleTransport *transport = jingle_content_get_transport(content);
 
-		if (JINGLE_IS_S5B(transport)) {
+		if (JINGLE_IS_S5B(transport) &&
+		    jingle_s5b_is_connected(JINGLE_S5B(transport))) {
 			jingle_s5b_stop_connection_attempts(JINGLE_S5B(transport));
 		}
 
@@ -574,7 +575,8 @@ jingle_file_transfer_cancel_recv(PurpleX
 	if (session) {
 		JingleTransport *transport = jingle_content_get_transport(content);
 
-		if (JINGLE_IS_S5B(transport)) {
+		if (JINGLE_IS_S5B(transport) 
+		    && !jingle_s5b_is_connected(JINGLE_S5B(transport))) {
 			jingle_s5b_stop_connection_attempts(JINGLE_S5B(transport));
 		}
 
============================================================
--- libpurple/protocols/jabber/jingle/s5b.c	31b0103dd60b87454ef674347c5a3f96c0742efe
+++ libpurple/protocols/jabber/jingle/s5b.c	73986f7a050b22f5f12cfbf00e32ddf666d5d0b0
@@ -1598,3 +1598,9 @@ jingle_s5b_has_remaining_remote_candidat
 {
 	return s5b->priv->remaining_candidates != NULL;
 }
+
+gboolean
+jingle_s5b_is_connected(const JingleS5B *s5b)
+{
+	return s5b->priv->fd != -1;
+}
============================================================
--- libpurple/protocols/jabber/jingle/s5b.h	9d993ebbc9da48a427e0022ed1251227340c62a4
+++ libpurple/protocols/jabber/jingle/s5b.h	1f9c9a497784d3488dcbc9c57710cb768a6153ff
@@ -97,6 +97,8 @@ void jingle_s5b_stop_connection_attempts
 
 void jingle_s5b_stop_connection_attempts(JingleS5B *s5b);
 
+gboolean jingle_s5b_is_connected(const JingleS5B *s5b);
+	
 #ifdef __cplusplus
 }
 #endif


More information about the Commits mailing list