cpw.darkrain42.oscar.ssl: 95292cbd: Shuffle a few comments around to make it...
markdoliner at pidgin.im
markdoliner at pidgin.im
Tue Jan 27 05:05:22 EST 2009
-----------------------------------------------------------------
Revision: 95292cbdc267f26b5dc7bfbad187fc47ce870e9c
Ancestor: a751a8b443ef7077d156d8f0eddda14e37663bc6
Author: markdoliner at pidgin.im
Date: 2009-01-27T10:00:32
Branch: im.pidgin.cpw.darkrain42.oscar.ssl
URL: http://d.pidgin.im/viewmtn/revision/info/95292cbdc267f26b5dc7bfbad187fc47ce870e9c
Modified files:
libpurple/protocols/oscar/family_oservice.c
libpurple/protocols/oscar/flap_connection.c
libpurple/protocols/oscar/oscar.c
ChangeLog:
Shuffle a few comments around to make it look like I did something
-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/family_oservice.c a60f6fe7bfc7c10db3f092258d94537080969662
+++ libpurple/protocols/oscar/family_oservice.c 25093954f77cfe6b3f32e8b1eb135bcad739acd8
@@ -115,10 +115,8 @@ aim_srv_requestnew(OscarData *od, guint1
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_chat_join(OscarData *od, guint16 exc
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);
============================================================
--- libpurple/protocols/oscar/flap_connection.c 697d0bbf8a5ee6dbdea8580d29371b530781fe52
+++ libpurple/protocols/oscar/flap_connection.c 38f6deccbed44e2348a66126a718fb8a8f164732
@@ -999,6 +999,13 @@ flap_connection_recv_cb_ssl(gpointer dat
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 @@ flap_connection_send_byte_stream(ByteStr
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);
}
}
}
============================================================
--- libpurple/protocols/oscar/oscar.c 126b2611ae79155c76cf22c7cbc99ebb389e4c60
+++ libpurple/protocols/oscar/oscar.c af6614db2fc18b8f37b786e594b123142c1592fc
@@ -1094,14 +1094,15 @@ connection_common_error_cb(FlapConnectio
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 @@ connection_common_established_cb(FlapCon
static void
connection_common_established_cb(FlapConnection *conn)
{
+ OscarData *od;
PurpleConnection *gc;
- OscarData *od;
PurpleAccount *account;
od = conn->od;
@@ -1144,6 +1145,7 @@ connection_common_established_cb(FlapCon
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 @@ oscar_login(PurpleAccount *account)
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 @@ oscar_login(PurpleAccount *account)
} 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 @@ purple_handle_redirect(OscarData *od, Fl
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);
More information about the Commits
mailing list