[libsoup/wip/tpopela/negotiate: 29/64] Fix style nitpicks
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/wip/tpopela/negotiate: 29/64] Fix style nitpicks
- Date: Tue, 16 Feb 2016 12:14:29 +0000 (UTC)
commit e2e8ac4d73bd824f4c9bc33b27c8d107aadcbd98
Author: Tomas Popela <tpopela redhat com>
Date: Mon Oct 5 09:25:29 2015 +0200
Fix style nitpicks
libsoup/soup-auth-negotiate.c | 31 ++++++++++++-------------------
libsoup/soup-gssapi.c | 9 ++++-----
2 files changed, 16 insertions(+), 24 deletions(-)
---
diff --git a/libsoup/soup-auth-negotiate.c b/libsoup/soup-auth-negotiate.c
index 79db107..11696b1 100644
--- a/libsoup/soup-auth-negotiate.c
+++ b/libsoup/soup-auth-negotiate.c
@@ -82,7 +82,6 @@ soup_auth_negotiate_free_connection_state (SoupConnectionAuth *auth,
g_free (conn->response_header);
}
-
static gboolean
soup_auth_negotiate_update_connection (SoupConnectionAuth *auth, SoupMessage *msg,
const char *header, gpointer state)
@@ -160,7 +159,6 @@ soup_auth_negotiate_is_ready (SoupAuth *auth,
return check_auth_trusted_uri (negotiate, msg);
}
-
static void
check_server_response(SoupMessage *msg, gpointer state)
{
@@ -199,7 +197,6 @@ check_server_response(SoupMessage *msg, gpointer state)
g_strfreev (parts);
}
-
static void
remove_server_response_handler(SoupMessage *msg, gpointer state)
{
@@ -223,7 +220,6 @@ soup_auth_negotiate_get_connection_authorization (SoupConnectionAuth *auth,
conn->state = SOUP_NEGOTIATE_SENT_RESPONSE;
}
-
g_signal_connect (msg,
"finished",
G_CALLBACK (remove_server_response_handler),
@@ -278,7 +274,7 @@ static void
soup_auth_negotiate_class_init (SoupAuthNegotiateClass *auth_negotiate_class)
{
SoupAuthClass *auth_class = SOUP_AUTH_CLASS (auth_negotiate_class);
- SoupConnectionAuthClass *connauth_class =
+ SoupConnectionAuthClass *conn_auth_class =
SOUP_CONNECTION_AUTH_CLASS (auth_negotiate_class);
GObjectClass *object_class = G_OBJECT_CLASS (auth_negotiate_class);
@@ -292,11 +288,11 @@ soup_auth_negotiate_class_init (SoupAuthNegotiateClass *auth_negotiate_class)
auth_class->is_authenticated = soup_auth_negotiate_is_authenticated;
auth_class->is_ready = soup_auth_negotiate_is_ready;
- connauth_class->create_connection_state = soup_auth_negotiate_create_connection_state;
- connauth_class->free_connection_state = soup_auth_negotiate_free_connection_state;
- connauth_class->update_connection = soup_auth_negotiate_update_connection;
- connauth_class->get_connection_authorization = soup_auth_negotiate_get_connection_authorization;
- connauth_class->is_connection_ready = soup_auth_negotiate_is_connection_ready;
+ conn_auth_class->create_connection_state = soup_auth_negotiate_create_connection_state;
+ conn_auth_class->free_connection_state = soup_auth_negotiate_free_connection_state;
+ conn_auth_class->update_connection = soup_auth_negotiate_update_connection;
+ conn_auth_class->get_connection_authorization = soup_auth_negotiate_get_connection_authorization;
+ conn_auth_class->is_connection_ready = soup_auth_negotiate_is_connection_ready;
object_class->finalize = soup_auth_negotiate_finalize;
@@ -339,7 +335,6 @@ parse_trusted_uris(void)
return uris;
}
-
/* check if scheme://host:port from msg matches the trusted uri */
static gboolean
match_base_uri (SoupMessage *msg, const gchar *trusted)
@@ -390,16 +385,15 @@ match_base_uri (SoupMessage *msg, const gchar *trusted)
trusted_host = trusted_host_port[0];
host = soup_uri_get_host (uri);
if (g_str_has_suffix (host, trusted_host)) {
- /* if the msg host ends with host from the trusted uri, then make
- * sure it is either an exact match, or prefixed with a dot. We
- * don't want "foobar.com" to match "bar.com"
- */
+ /* if the msg host ends with host from the trusted uri, then make
+ * sure it is either an exact match, or prefixed with a dot. We
+ * don't want "foobar.com" to match "bar.com"
+ */
if (g_ascii_strcasecmp (host, trusted_host) == 0) {
ret = TRUE;
goto out;
} else {
- /* we don't want example.com to match fooexample.com
- */
+ /* we don't want example.com to match fooexample.com */
trusted_host_len = strlen (trusted_host);
host_len = strlen (host);
if (host[host_len - trusted_host_len - 1] == '.') {
@@ -413,7 +407,6 @@ out:
return ret;
}
-
static gboolean
check_auth_trusted_uri (SoupAuthNegotiate *negotiate, SoupMessage *msg)
{
@@ -429,7 +422,7 @@ check_auth_trusted_uri (SoupAuthNegotiate *negotiate, SoupMessage *msg)
return FALSE;
}
- for (i=0; i < g_strv_length (trusted_uris); i++) {
+ for (i = 0; i < g_strv_length (trusted_uris); i++) {
if (match_base_uri (msg, trusted_uris[i]))
return TRUE;
}
diff --git a/libsoup/soup-gssapi.c b/libsoup/soup-gssapi.c
index 78aaa77..46225e6 100644
--- a/libsoup/soup-gssapi.c
+++ b/libsoup/soup-gssapi.c
@@ -43,7 +43,7 @@ soup_gss_error (OM_uint32 err_maj, OM_uint32 err_min, GError **err)
if (GSS_ERROR (maj_stat))
break;
- buf_maj = g_strdup ((char*) status.value);
+ buf_maj = g_strdup ((char *) status.value);
gss_release_buffer (&min_stat, &status);
maj_stat = gss_display_status (&min_stat,
@@ -53,7 +53,7 @@ soup_gss_error (OM_uint32 err_maj, OM_uint32 err_min, GError **err)
&msg_ctx,
&status);
if (!GSS_ERROR (maj_stat)) {
- buf_min = g_strdup ((char*) status.value);
+ buf_min = g_strdup ((char *) status.value);
gss_release_buffer (&min_stat, &status);
}
@@ -86,7 +86,7 @@ soup_gss_client_init (SoupNegotiateConnectionState *conn, const char *host, GErr
h = g_ascii_strdown (host, -1);
service = g_strconcat ("HTTP/", h, NULL);
token.length = strlen (service);
- token.value = (char *)service;
+ token.value = (char *) service;
maj_stat = gss_import_name (&min_stat,
&token,
@@ -144,7 +144,7 @@ soup_gss_client_step (SoupNegotiateConnectionState *conn, const char *challenge,
ret = (maj_stat == GSS_S_COMPLETE) ? AUTH_GSS_COMPLETE : AUTH_GSS_CONTINUE;
if (out.length) {
- char *response = g_base64_encode ((const unsigned char *)out.value, out.length);
+ char *response = g_base64_encode ((const unsigned char *) out.value, out.length);
conn->response_header = g_strconcat ("Negotiate ", response, NULL);
g_free (response);
maj_stat = gss_release_buffer (&min_stat, &out);
@@ -166,4 +166,3 @@ soup_gss_client_cleanup (SoupNegotiateConnectionState *conn)
gss_release_name (&min_stat, &conn->server_name);
}
-
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]