/pidgin/main: d2294123c226: oscar: Fix coding style, no whitespa...
Youness Alaoui
kakaroto at kakaroto.homelinux.net
Fri Jun 17 19:11:41 EDT 2016
Changeset: d2294123c2269a0cf2bbdec52dbd9a7a143a5514
Author: Youness Alaoui <kakaroto at kakaroto.homelinux.net>
Date: 2016-06-16 13:13 -0400
Branch: oscar_auth
URL: https://hg.pidgin.im/pidgin/main/rev/d2294123c226
Description:
oscar: Fix coding style, no whitespace before parenthesis of function calls
diffstat:
libpurple/protocols/oscar/kerberos.c | 108 +++++++++++++++++-----------------
1 files changed, 54 insertions(+), 54 deletions(-)
diffs (199 lines):
diff --git a/libpurple/protocols/oscar/kerberos.c b/libpurple/protocols/oscar/kerberos.c
--- a/libpurple/protocols/oscar/kerberos.c
+++ b/libpurple/protocols/oscar/kerberos.c
@@ -91,9 +91,9 @@ static gchar *get_kdc_url(OscarData *od)
server = purple_account_get_string(account, "server", AIM_DEFAULT_KDC_SERVER);
port = purple_account_get_int(account, "port", AIM_DEFAULT_KDC_PORT);
if (port != 443)
- port_str = g_strdup_printf (":%d", port);
- url = g_strdup_printf ("https://%s%s/", server, port_str ? port_str : "");
- g_free (port_str);
+ port_str = g_strdup_printf(":%d", port);
+ url = g_strdup_printf("https://%s%s/", server, port_str ? port_str : "");
+ g_free(port_str);
return url;
}
@@ -140,21 +140,21 @@ aim_xsnac_free(aim_xsnac_t *xsnac)
{
gint i;
- g_free (xsnac->principal1);
- g_free (xsnac->principal2);
- aim_tlvlist_free (xsnac->tlvlist);
+ g_free(xsnac->principal1);
+ g_free(xsnac->principal2);
+ aim_tlvlist_free(xsnac->tlvlist);
for (i = 0; i < xsnac->num_tokens; i++) {
g_free(xsnac->tokens[i].main_tlv->value);
g_free(xsnac->tokens[i].main_tlv);
- g_free (xsnac->tokens[i].principal1);
- g_free (xsnac->tokens[i].service);
- g_free (xsnac->tokens[i].principal1_again);
- g_free (xsnac->tokens[i].principal2);
- g_free (xsnac->tokens[i].footer);
- aim_tlvlist_free (xsnac->tokens[i].tlvlist);
+ g_free(xsnac->tokens[i].principal1);
+ g_free(xsnac->tokens[i].service);
+ g_free(xsnac->tokens[i].principal1_again);
+ g_free(xsnac->tokens[i].principal2);
+ g_free(xsnac->tokens[i].footer);
+ aim_tlvlist_free(xsnac->tokens[i].tlvlist);
}
- g_free (xsnac->tokens);
+ g_free(xsnac->tokens);
}
static void
@@ -197,9 +197,9 @@ kerberos_login_cb(PurpleHttpConnection *
got_data = purple_http_response_get_data(response, &got_len);
purple_debug_info("oscar", "Received kerberos login HTTP response %lu : ", got_len);
- byte_stream_init (&bs, (guint8 *)got_data, got_len);
+ byte_stream_init(&bs, (guint8 *)got_data, got_len);
- xsnac.family = byte_stream_get16 (&bs);
+ xsnac.family = byte_stream_get16(&bs);
xsnac.subtype = byte_stream_get16(&bs);
byte_stream_getrawbuf(&bs, (guint8 *) xsnac.flags, 8);
@@ -226,14 +226,14 @@ kerberos_login_cb(PurpleHttpConnection *
purple_debug_info("oscar", "KDC: %d tokens between '%s' and '%s'\n",
xsnac.num_tokens, xsnac.principal1, xsnac.principal2);
- xsnac.tokens = g_new0 (aim_xsnac_token_t, xsnac.num_tokens);
+ xsnac.tokens = g_new0(aim_xsnac_token_t, xsnac.num_tokens);
for (i = 0; i < xsnac.num_tokens; i++) {
GSList *tlv;
tlv = aim_tlvlist_readnum(&bs, 1);
if (tlv)
xsnac.tokens[i].main_tlv = tlv->data;
- g_slist_free (tlv);
+ g_slist_free(tlv);
len = byte_stream_get16(&bs);
xsnac.tokens[i].principal1 = byte_stream_getstr(&bs, len);
@@ -267,7 +267,7 @@ kerberos_login_cb(PurpleHttpConnection *
xsnac.tlvlist = aim_tlvlist_readnum(&bs, len);
for (i = 0; i < xsnac.num_tokens; i++) {
- if (purple_strequal (xsnac.tokens[i].service, "im/boss")) {
+ if (purple_strequal(xsnac.tokens[i].service, "im/boss")) {
aim_tlv_t *tlv;
GSList *tlvlist;
ByteStream tbs;
@@ -276,11 +276,11 @@ kerberos_login_cb(PurpleHttpConnection *
if (tlv != NULL) {
byte_stream_init(&tbs, tlv->value, tlv->length);
byte_stream_get32(&tbs);
- tlvlist = aim_tlvlist_read (&tbs);
- if (aim_tlv_gettlv (tlvlist, 0x0005, 1))
- bosip = aim_tlv_getstr (tlvlist, 0x0005, 1);
- if (aim_tlv_gettlv (tlvlist, 0x0005, 1))
- tlsCertName = aim_tlv_getstr (tlvlist, 0x008D, 1);
+ tlvlist = aim_tlvlist_read(&tbs);
+ if (aim_tlv_gettlv(tlvlist, 0x0005, 1))
+ bosip = aim_tlv_getstr(tlvlist, 0x0005, 1);
+ if (aim_tlv_gettlv(tlvlist, 0x0005, 1))
+ tlsCertName = aim_tlv_getstr(tlvlist, 0x008D, 1);
tlv = aim_tlv_gettlv(tlvlist, 0x0006, 1);
if (tlv) {
cookie_len = tlv->length;
@@ -300,15 +300,15 @@ kerberos_login_cb(PurpleHttpConnection *
}
host = g_strndup(bosip, i);
oscar_connect_to_bos(gc, od, host, port, cookie, cookie_len, tlsCertName);
- g_free (host);
+ g_free(host);
} else {
purple_connection_error(gc,
PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
_("Unknown error during authentication"));
}
- aim_xsnac_free (&xsnac);
- g_free (tlsCertName);
- g_free (bosip);
+ aim_xsnac_free(&xsnac);
+ g_free(tlsCertName);
+ g_free(bosip);
}
/**
@@ -382,41 +382,41 @@ void send_kerberos_login(OscarData *od,
gc = od->gc;
password = purple_connection_get_password(gc);
- aim_encode_password (password, password_xored);
+ aim_encode_password(password, password_xored);
client_key = get_client_key(od);
- imapp_key = g_strdup_printf ("imApp key=%s", client_key);
+ imapp_key = g_strdup_printf("imApp key=%s", client_key);
/* Construct the body of the HTTP POST request */
body = g_string_new(NULL);
- g_string_append_len (body, header, sizeof(header));
+ g_string_append_len(body, header, sizeof(header));
reqid = (guint16) g_random_int();
- g_string_overwrite_len (body, 0xC, (void *)&reqid, sizeof(guint16));
+ g_string_overwrite_len(body, 0xC, (void *)&reqid, sizeof(guint16));
- len_be = GUINT16_TO_BE (strlen (imapp_key));
- g_string_append_len (body, (void *)&len_be, sizeof(guint16));
- g_string_append (body, imapp_key);
+ len_be = GUINT16_TO_BE(strlen(imapp_key));
+ g_string_append_len(body, (void *)&len_be, sizeof(guint16));
+ g_string_append(body, imapp_key);
- len_be = GUINT16_TO_BE (strlen (username));
- g_string_append_len (body, pre_username, sizeof(pre_username));
- g_string_append_len (body, (void *)&len_be, sizeof(guint16));
- g_string_append (body, username);
- g_string_append_len (body, post_username, sizeof(post_username));
+ len_be = GUINT16_TO_BE(strlen(username));
+ g_string_append_len(body, pre_username, sizeof(pre_username));
+ g_string_append_len(body, (void *)&len_be, sizeof(guint16));
+ g_string_append(body, username);
+ g_string_append_len(body, post_username, sizeof(post_username));
- len_be = GUINT16_TO_BE (strlen (password) + 0x10);
- g_string_append_len (body, (void *)&len_be, sizeof(guint16));
- g_string_append_len (body, pre_password, sizeof(pre_password));
- len_be = GUINT16_TO_BE (strlen (password) + 4);
- g_string_append_len (body, (void *)&len_be, sizeof(guint16));
- len_be = GUINT16_TO_BE (strlen (password));
- g_string_append_len (body, (void *)&len_be, sizeof(guint16));
- g_string_append_len (body, password_xored, strlen (password));
- g_string_append_len (body, post_password, sizeof(post_password));
+ len_be = GUINT16_TO_BE(strlen(password) + 0x10);
+ g_string_append_len(body, (void *)&len_be, sizeof(guint16));
+ g_string_append_len(body, pre_password, sizeof(pre_password));
+ len_be = GUINT16_TO_BE(strlen(password) + 4);
+ g_string_append_len(body, (void *)&len_be, sizeof(guint16));
+ len_be = GUINT16_TO_BE(strlen(password));
+ g_string_append_len(body, (void *)&len_be, sizeof(guint16));
+ g_string_append_len(body, password_xored, strlen(password));
+ g_string_append_len(body, post_password, sizeof(post_password));
- len_be = GUINT16_TO_BE (strlen (client_key));
- g_string_append_len (body, (void *)&len_be, sizeof(guint16));
- g_string_append (body, client_key);
- g_string_append_len (body, footer, sizeof(footer));
+ len_be = GUINT16_TO_BE(strlen(client_key));
+ g_string_append_len(body, (void *)&len_be, sizeof(guint16));
+ g_string_append(body, client_key);
+ g_string_append_len(body, footer, sizeof(footer));
g_free(imapp_key);
@@ -431,6 +431,6 @@ void send_kerberos_login(OscarData *od,
od->hc = purple_http_request(gc, req, kerberos_login_cb, od);
purple_http_request_unref(req);
- g_string_free (body, TRUE);
- g_free (url);
+ g_string_free(body, TRUE);
+ g_free(url);
}
More information about the Commits
mailing list