summaryrefslogtreecommitdiff
path: root/libsoup/soup-auth-basic.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2007-09-25 03:11:18 +0000
committerDan Winship <danw@src.gnome.org>2007-09-25 03:11:18 +0000
commit1ef84727183daf0fcf8043383c012834576ee359 (patch)
treef08d1d4f6bf343f822c87288673f48cd7ea43bbf /libsoup/soup-auth-basic.c
parentb8b3779563f8f49a81b0bf117ba8f0256671ee14 (diff)
downloadlibsoup-1ef84727183daf0fcf8043383c012834576ee359.tar.gz
add "realm" field to the struct. (SoupAuthClass) remove "get_realm"
* libsoup/soup-auth.h (SoupAuth): add "realm" field to the struct. (SoupAuthClass) remove "get_realm" virtual method. * libsoup/soup-auth.c (soup_auth_new_from_header_list): Parse the WWW-Authenticate/Proxy-Authenticate header here, set realm, and pass the params hash to the construct method. (soup_auth_get_info): Return an identifier for the auth: "SCHEME:REALM" * libsoup/soup-auth-basic.c: * libsoup/soup-auth-digest.c: update * libsoup/soup-session.c (invalidate_auth, update_auth_internal): use soup_auth_get_info(). svn path=/trunk/; revision=934
Diffstat (limited to 'libsoup/soup-auth-basic.c')
-rw-r--r--libsoup/soup-auth-basic.c27
1 files changed, 4 insertions, 23 deletions
diff --git a/libsoup/soup-auth-basic.c b/libsoup/soup-auth-basic.c
index 235b7f34..003bda6f 100644
--- a/libsoup/soup-auth-basic.c
+++ b/libsoup/soup-auth-basic.c
@@ -17,15 +17,14 @@
#include "soup-misc.h"
#include "soup-uri.h"
-static void construct (SoupAuth *auth, const char *header);
+static void construct (SoupAuth *auth, GHashTable *auth_params);
static GSList *get_protection_space (SoupAuth *auth, const SoupUri *source_uri);
-static const char *get_realm (SoupAuth *auth);
static void authenticate (SoupAuth *auth, const char *username, const char *password);
static gboolean is_authenticated (SoupAuth *auth);
static char *get_authorization (SoupAuth *auth, SoupMessage *msg);
typedef struct {
- char *realm, *token;
+ char *token;
} SoupAuthBasicPrivate;
#define SOUP_AUTH_BASIC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SOUP_TYPE_AUTH_BASIC, SoupAuthBasicPrivate))
@@ -41,7 +40,6 @@ finalize (GObject *object)
{
SoupAuthBasicPrivate *priv = SOUP_AUTH_BASIC_GET_PRIVATE (object);
- g_free (priv->realm);
g_free (priv->token);
G_OBJECT_CLASS (soup_auth_basic_parent_class)->finalize (object);
@@ -59,7 +57,6 @@ soup_auth_basic_class_init (SoupAuthBasicClass *auth_basic_class)
auth_class->construct = construct;
auth_class->get_protection_space = get_protection_space;
- auth_class->get_realm = get_realm;
auth_class->authenticate = authenticate;
auth_class->is_authenticated = is_authenticated;
auth_class->get_authorization = get_authorization;
@@ -69,19 +66,9 @@ soup_auth_basic_class_init (SoupAuthBasicClass *auth_basic_class)
static void
-construct (SoupAuth *auth, const char *header)
+construct (SoupAuth *auth, GHashTable *auth_params)
{
- SoupAuthBasicPrivate *priv = SOUP_AUTH_BASIC_GET_PRIVATE (auth);
- GHashTable *tokens;
-
- header += sizeof ("Basic");
-
- tokens = soup_header_param_parse_list (header);
- if (!tokens)
- return;
-
- priv->realm = soup_header_param_copy_token (tokens, "realm");
- soup_header_param_destroy_hash (tokens);
+ ;
}
static GSList *
@@ -99,12 +86,6 @@ get_protection_space (SoupAuth *auth, const SoupUri *source_uri)
return g_slist_prepend (NULL, space);
}
-static const char *
-get_realm (SoupAuth *auth)
-{
- return SOUP_AUTH_BASIC_GET_PRIVATE (auth)->realm;
-}
-
static void
authenticate (SoupAuth *auth, const char *username, const char *password)
{