summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Graveley <alex@ximian.com>2001-08-23 07:18:57 +0000
committerAlex Graveley <orph@src.gnome.org>2001-08-23 07:18:57 +0000
commit12d797f0e218a341510e5336be799d51ef2d52a3 (patch)
tree941875d027a11c136e41e61acb96495a346199f0
parent4fab732ab16c3cdd448f366bc4288bb134e43410 (diff)
downloadlibsoup-12d797f0e218a341510e5336be799d51ef2d52a3.tar.gz
Take an old_auth argument, if auth_types do not match always return TRUE.
2001-08-23 Alex Graveley <alex@ximian.com> * src/soup-core/soup-auth.c (soup_auth_invalidates_prior): Take an old_auth argument, if auth_types do not match always return TRUE. This allows for a server requested re-auth with a different auth mechanism.
-rw-r--r--ChangeLog7
-rw-r--r--libsoup/soup-auth.c9
-rw-r--r--libsoup/soup-auth.h5
-rw-r--r--libsoup/soup-message.c2
4 files changed, 17 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index a0e345b5..1451e2be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2001-08-23 Alex Graveley <alex@ximian.com>
+ * src/soup-core/soup-auth.c (soup_auth_invalidates_prior): Take an
+ old_auth argument, if auth_types do not match always return
+ TRUE. This allows for a server requested re-auth with a different
+ auth mechanism.
+
+2001-08-23 Alex Graveley <alex@ximian.com>
+
* src/soup-core/soup-ntlm.[ch]: Microsoft NTLM authentication
support compliments of Dan Winship (danw@ximian.com).
diff --git a/libsoup/soup-auth.c b/libsoup/soup-auth.c
index 822f7c6b..554d1610 100644
--- a/libsoup/soup-auth.c
+++ b/libsoup/soup-auth.c
@@ -600,13 +600,16 @@ soup_auth_free (SoupAuth *auth)
}
gboolean
-soup_auth_invalidates_prior (SoupAuth *auth)
+soup_auth_invalidates_prior (SoupAuth *new_auth, SoupAuth *old_auth)
{
- g_return_val_if_fail (auth != NULL, FALSE);
+ g_return_val_if_fail (new_auth != NULL, FALSE);
+ g_return_val_if_fail (old_auth != NULL, TRUE);
+
+ if (new_auth->auth_type != old_auth->auth_type) return TRUE;
switch (auth->type) {
case SOUP_AUTH_DIGEST:
- return ((SoupAuthDigest *) auth)->stale;
+ return ((SoupAuthDigest *) new_auth)->stale;
case SOUP_AUTH_NTLM:
return TRUE;
case SOUP_AUTH_BASIC:
diff --git a/libsoup/soup-auth.h b/libsoup/soup-auth.h
index e554a4f5..1ca06801 100644
--- a/libsoup/soup-auth.h
+++ b/libsoup/soup-auth.h
@@ -18,11 +18,12 @@
SoupAuth *soup_auth_new_from_header (SoupContext *context,
const char *header);
-void soup_auth_free (SoupAuth *auth);
+void soup_auth_free (SoupAuth *auth);
gchar *soup_auth_authorize (SoupAuth *auth,
SoupMessage *msg);
-gboolean soup_auth_invalidates_prior (SoupAuth *auth);
+gboolean soup_auth_invalidates_prior (SoupAuth *new_auth,
+ SoupAuth *old_auth);
#endif /* SOUP_AUTH_H */
diff --git a/libsoup/soup-message.c b/libsoup/soup-message.c
index 848cb7ab..3a14ab1b 100644
--- a/libsoup/soup-message.c
+++ b/libsoup/soup-message.c
@@ -34,7 +34,7 @@ authorize_handler (SoupMessage *msg, gboolean proxy)
if (!auth) return SOUP_ERROR_MALFORMED_HEADER;
if (ctx->auth) {
- if (soup_auth_invalidates_prior (auth))
+ if (soup_auth_invalidates_prior (auth, ctx->auth))
soup_auth_free (ctx->auth);
else {
soup_auth_free (auth);