summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Doliner <markdoliner@pidgin.im>2009-01-27 10:00:32 +0000
committerMark Doliner <markdoliner@pidgin.im>2009-01-27 10:00:32 +0000
commitc356253ef254f96f9708dc360c9be256bac16696 (patch)
tree093b6b813686f3ef669f6682a50d556868d79a0e
parentb2044a8b8ac12e739e96ad93ba80e2930f3eda56 (diff)
downloadpidgin-c356253ef254f96f9708dc360c9be256bac16696.tar.gz
Shuffle a few comments around to make it look like I did something
-rw-r--r--libpurple/protocols/oscar/family_oservice.c8
-rw-r--r--libpurple/protocols/oscar/flap_connection.c11
-rw-r--r--libpurple/protocols/oscar/oscar.c18
3 files changed, 23 insertions, 14 deletions
diff --git a/libpurple/protocols/oscar/family_oservice.c b/libpurple/protocols/oscar/family_oservice.c
index d7722a28fe..746f3b28a6 100644
--- a/libpurple/protocols/oscar/family_oservice.c
+++ b/libpurple/protocols/oscar/family_oservice.c
@@ -115,10 +115,8 @@ aim_srv_requestnew(OscarData *od, guint16 serviceid)
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 exchange, const char *roomname, guint16 ins
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);
diff --git a/libpurple/protocols/oscar/flap_connection.c b/libpurple/protocols/oscar/flap_connection.c
index 7ed3553193..c94224d192 100644
--- a/libpurple/protocols/oscar/flap_connection.c
+++ b/libpurple/protocols/oscar/flap_connection.c
@@ -999,6 +999,13 @@ flap_connection_recv_cb_ssl(gpointer data, PurpleSslConnection *gsc, PurpleInput
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(ByteStream *bs, FlapConnection *conn, size_t co
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);
}
}
}
diff --git a/libpurple/protocols/oscar/oscar.c b/libpurple/protocols/oscar/oscar.c
index e0671d3574..b45bd9a570 100644
--- a/libpurple/protocols/oscar/oscar.c
+++ b/libpurple/protocols/oscar/oscar.c
@@ -1094,14 +1094,15 @@ oscar_chat_kill(PurpleConnection *gc, struct chat_connection *cc)
static void
connection_common_error_cb(FlapConnection *conn, const gchar *error_message)
{
- PurpleConnection *gc;
OscarData *od;
+ PurpleConnection *gc;
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_error_cb(FlapConnection *conn, const gchar *error_message)
static void
connection_common_established_cb(FlapConnection *conn)
{
- PurpleConnection *gc;
OscarData *od;
+ PurpleConnection *gc;
PurpleAccount *account;
od = conn->od;
@@ -1144,6 +1145,7 @@ connection_common_established_cb(FlapConnection *conn)
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, FlapConnection *conn, FlapFrame *fr, ...)
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);