comparison libpurple/protocols/oscar/oscar.c @ 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 6fe309e61bf9
children 86946237b284
comparison
equal deleted inserted replaced
25380:951b7ff9a888 25381:f6ef3a9534db
1092 * a TCP connection with an oscar host if an error occurred. 1092 * a TCP connection with an oscar host if an error occurred.
1093 */ 1093 */
1094 static void 1094 static void
1095 connection_common_error_cb(FlapConnection *conn, const gchar *error_message) 1095 connection_common_error_cb(FlapConnection *conn, const gchar *error_message)
1096 { 1096 {
1097 OscarData *od;
1097 PurpleConnection *gc; 1098 PurpleConnection *gc;
1098 OscarData *od;
1099 1099
1100 od = conn->od; 1100 od = conn->od;
1101 gc = od->gc; 1101 gc = od->gc;
1102 1102
1103 purple_debug_error("oscar", "unable to connect to FLAP " 1103 purple_debug_error("oscar", "unable to connect to FLAP "
1104 "server of type 0x%04hx\n", conn->type); 1104 "server of type 0x%04hx\n", conn->type);
1105
1105 if (conn->type == SNAC_FAMILY_AUTH) 1106 if (conn->type == SNAC_FAMILY_AUTH)
1106 { 1107 {
1107 gchar *msg; 1108 gchar *msg;
1108 msg = g_strdup_printf(_("Could not connect to authentication server:\n%s"), 1109 msg = g_strdup_printf(_("Could not connect to authentication server:\n%s"),
1109 error_message); 1110 error_message);
1132 * of host, we do a few different things here. 1133 * of host, we do a few different things here.
1133 */ 1134 */
1134 static void 1135 static void
1135 connection_common_established_cb(FlapConnection *conn) 1136 connection_common_established_cb(FlapConnection *conn)
1136 { 1137 {
1138 OscarData *od;
1137 PurpleConnection *gc; 1139 PurpleConnection *gc;
1138 OscarData *od;
1139 PurpleAccount *account; 1140 PurpleAccount *account;
1140 1141
1141 od = conn->od; 1142 od = conn->od;
1142 gc = od->gc; 1143 gc = od->gc;
1143 account = purple_connection_get_account(gc); 1144 account = purple_connection_get_account(gc);
1144 1145
1145 purple_debug_info("oscar", "connected to FLAP server of type 0x%04hx\n", 1146 purple_debug_info("oscar", "connected to FLAP server of type 0x%04hx\n",
1146 conn->type); 1147 conn->type);
1148
1147 if (conn->cookie == NULL) 1149 if (conn->cookie == NULL)
1148 flap_connection_send_version(od, conn); 1150 flap_connection_send_version(od, conn);
1149 else 1151 else
1150 { 1152 {
1151 flap_connection_send_version_with_cookie(od, conn, 1153 flap_connection_send_version_with_cookie(od, conn,
1520 1522
1521 newconn = flap_connection_new(od, SNAC_FAMILY_AUTH); 1523 newconn = flap_connection_new(od, SNAC_FAMILY_AUTH);
1522 if (od->use_ssl) { 1524 if (od->use_ssl) {
1523 if (purple_ssl_is_supported()) { 1525 if (purple_ssl_is_supported()) {
1524 const char *server = purple_account_get_string(account, "server", OSCAR_DEFAULT_SSL_LOGIN_SERVER); 1526 const char *server = purple_account_get_string(account, "server", OSCAR_DEFAULT_SSL_LOGIN_SERVER);
1525 /* If the account's server is what the oscar prpl has offered as 1527 /*
1528 * If the account's server is what the oscar prpl has offered as
1526 * the default login server through the vast eons (all two of 1529 * the default login server through the vast eons (all two of
1527 * said default options, AFAIK) and the user wants SSL, we'll 1530 * said default options, AFAIK) and the user wants SSL, we'll
1528 * do what we know is best for them and change the setting out 1531 * do what we know is best for them and change the setting out
1529 * from under them to the SSL login server. 1532 * from under them to the SSL login server.
1530 */ 1533 */
1542 _("SSL support unavailable")); 1545 _("SSL support unavailable"));
1543 } 1546 }
1544 } else { 1547 } else {
1545 const char *server = purple_account_get_string(account, "server", OSCAR_DEFAULT_LOGIN_SERVER); 1548 const char *server = purple_account_get_string(account, "server", OSCAR_DEFAULT_LOGIN_SERVER);
1546 1549
1547 /* See the comment above. We do the reverse here. If they don't want 1550 /*
1551 * See the comment above. We do the reverse here. If they don't want
1548 * SSL but their server is set to OSCAR_DEFAULT_SSL_LOGIN_SERVER, 1552 * SSL but their server is set to OSCAR_DEFAULT_SSL_LOGIN_SERVER,
1549 * set it back to the default. 1553 * set it back to the default.
1550 */ 1554 */
1551 if (!strcmp(server, OSCAR_DEFAULT_SSL_LOGIN_SERVER)) { 1555 if (!strcmp(server, OSCAR_DEFAULT_SSL_LOGIN_SERVER)) {
1552 purple_debug_info("oscar", "Account does not use SSL, so changing server back to non-SSL\n"); 1556 purple_debug_info("oscar", "Account does not use SSL, so changing server back to non-SSL\n");
2035 } 2039 }
2036 2040
2037 2041
2038 if (redir->use_ssl) 2042 if (redir->use_ssl)
2039 { 2043 {
2040 /* FIXME: It should be possible to specify a certificate common name 2044 /*
2045 * TODO: It should be possible to specify a certificate common name
2041 * distinct from the host we're passing to purple_ssl_connect. The 2046 * distinct from the host we're passing to purple_ssl_connect. The
2042 * way to work around that is to use purple_proxy_connect + 2047 * way to work around that is to use purple_proxy_connect +
2043 * purple_ssl_connect_with_host_fd */ 2048 * purple_ssl_connect_with_host_fd
2049 */
2044 newconn->ssl_cert_cn = g_strdup(redir->ssl_cert_cn); 2050 newconn->ssl_cert_cn = g_strdup(redir->ssl_cert_cn);
2045 newconn->connect_data = purple_proxy_connect(NULL, account, host, port, 2051 newconn->connect_data = purple_proxy_connect(NULL, account, host, port,
2046 ssl_proxy_conn_established_cb, newconn); 2052 ssl_proxy_conn_established_cb, newconn);
2047 } 2053 }
2048 else 2054 else