changeset 25381: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 951b7ff9a888
children 86946237b284
files libpurple/protocols/oscar/family_oservice.c libpurple/protocols/oscar/flap_connection.c libpurple/protocols/oscar/oscar.c
diffstat 3 files changed, 23 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/oscar/family_oservice.c	Tue Jan 27 09:36:35 2009 +0000
+++ b/libpurple/protocols/oscar/family_oservice.c	Tue Jan 27 10:00:32 2009 +0000
@@ -115,10 +115,8 @@
 
 	byte_stream_put16(&bs, serviceid);
 
-	/*
-	 * Request SSL Connection
-	 */
 	if (od->use_ssl)
+		/* Request SSL Connection */
 		aim_tlvlist_add_noval(&tlvlist, 0x008c);
 
 	aim_tlvlist_write(&bs, &tlvlist);
@@ -163,10 +161,8 @@
 
 	aim_tlvlist_add_chatroom(&tlvlist, 0x0001, exchange, roomname, instance);
 
-	/*
-	 * Request SSL Connection
-	 */
 	if (od->use_ssl)
+		/* Request SSL Connection */
 		aim_tlvlist_add_noval(&tlvlist, 0x008c);
 
 	aim_tlvlist_write(&bs, &tlvlist);
--- 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);
 		}
 	}
 }
--- a/libpurple/protocols/oscar/oscar.c	Tue Jan 27 09:36:35 2009 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Tue Jan 27 10:00:32 2009 +0000
@@ -1094,14 +1094,15 @@
 static void
 connection_common_error_cb(FlapConnection *conn, const gchar *error_message)
 {
+	OscarData *od;
 	PurpleConnection *gc;
-	OscarData *od;
 
 	od = conn->od;
 	gc = od->gc;
 
 	purple_debug_error("oscar", "unable to connect to FLAP "
 			"server of type 0x%04hx\n", conn->type);
+
 	if (conn->type == SNAC_FAMILY_AUTH)
 	{
 		gchar *msg;
@@ -1134,8 +1135,8 @@
 static void
 connection_common_established_cb(FlapConnection *conn)
 {
+	OscarData *od;
 	PurpleConnection *gc;
-	OscarData *od;
 	PurpleAccount *account;
 
 	od = conn->od;
@@ -1144,6 +1145,7 @@
 
 	purple_debug_info("oscar", "connected to FLAP server of type 0x%04hx\n",
 			conn->type);
+
 	if (conn->cookie == NULL)
 		flap_connection_send_version(od, conn);
 	else
@@ -1522,7 +1524,8 @@
 	if (od->use_ssl) {
 		if (purple_ssl_is_supported()) {
 			const char *server = purple_account_get_string(account, "server", OSCAR_DEFAULT_SSL_LOGIN_SERVER);
-			/* If the account's server is what the oscar prpl has offered as
+			/*
+			 * If the account's server is what the oscar prpl has offered as
 			 * the default login server through the vast eons (all two of
 			 * said default options, AFAIK) and the user wants SSL, we'll
 			 * do what we know is best for them and change the setting out
@@ -1544,7 +1547,8 @@
 	} else {
 		const char *server = purple_account_get_string(account, "server", OSCAR_DEFAULT_LOGIN_SERVER);
 
-		/* See the comment above. We do the reverse here. If they don't want
+		/*
+		 * See the comment above. We do the reverse here. If they don't want
 		 * SSL but their server is set to OSCAR_DEFAULT_SSL_LOGIN_SERVER,
 		 * set it back to the default.
 		 */
@@ -2037,10 +2041,12 @@
 
 	if (redir->use_ssl)
 	{
-		/* FIXME: It should be possible to specify a certificate common name
+		/*
+		 * TODO: It should be possible to specify a certificate common name
 		 * distinct from the host we're passing to purple_ssl_connect. The
 		 * way to work around that is to use purple_proxy_connect +
-		 * purple_ssl_connect_with_host_fd */
+		 * purple_ssl_connect_with_host_fd
+		 */
 		newconn->ssl_cert_cn = g_strdup(redir->ssl_cert_cn);
 		newconn->connect_data = purple_proxy_connect(NULL, account, host, port,
 				ssl_proxy_conn_established_cb, newconn);