diff libpurple/protocols/oscar/flap_connection.c @ 25022:f6ef3a9534db

Shuffle a few comments around to make it look like I did something
author Mark Doliner <mark@kingant.net>
date Tue, 27 Jan 2009 10:00:32 +0000
parents c6772d61af1f
children 454d46e9cbb7
line wrap: on
line diff
--- a/libpurple/protocols/oscar/flap_connection.c	Tue Jan 27 09:36:35 2009 +0000
+++ b/libpurple/protocols/oscar/flap_connection.c	Tue Jan 27 10:00:32 2009 +0000
@@ -999,6 +999,13 @@
 	flap_connection_recv(conn);
 }
 
+/**
+ * @param source When this function is called as a callback source is
+ *        set to the fd that triggered the callback.  But this function
+ *        is also called directly from flap_connection_send_byte_stream(),
+ *        in which case source will be -1.  So don't use source--use
+ *        conn->gsc or conn->fd instead.
+ */
 static void
 send_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
@@ -1066,11 +1073,11 @@
 		if (conn->gsc) {
 			conn->watcher_outgoing = purple_input_add(conn->gsc->fd,
 					PURPLE_INPUT_WRITE, send_cb, conn);
-			send_cb(conn, 0, 0);
+			send_cb(conn, -1, 0);
 		} else if (conn->fd >= 0) {
 			conn->watcher_outgoing = purple_input_add(conn->fd,
 					PURPLE_INPUT_WRITE, send_cb, conn);
-			send_cb(conn, 0, 0);
+			send_cb(conn, -1, 0);
 		}
 	}
 }