summaryrefslogtreecommitdiff
path: root/libsoup/server/soup-auth-domain-basic.c
diff options
context:
space:
mode:
authorCarlos Garcia Campos <cgarcia@igalia.com>2020-10-09 11:29:11 +0200
committerCarlos Garcia Campos <cgarcia@igalia.com>2020-10-19 14:02:25 +0200
commit99c19cc27ae837e665ace3c1f0e99cd1088e6c24 (patch)
treebbb7f7a7a9c9544801c66cf3e543ee3ea93291be /libsoup/server/soup-auth-domain-basic.c
parentd5cd7249b20beee01dc26c09ec80f270ef8962fd (diff)
downloadlibsoup-carlosgc/split-io.tar.gz
Split SoupMessage into client and server partscarlosgc/split-io
Add SoupServerMessage and move there all the server only functionality.
Diffstat (limited to 'libsoup/server/soup-auth-domain-basic.c')
-rw-r--r--libsoup/server/soup-auth-domain-basic.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/libsoup/server/soup-auth-domain-basic.c b/libsoup/server/soup-auth-domain-basic.c
index 9a850050..0cba37d2 100644
--- a/libsoup/server/soup-auth-domain-basic.c
+++ b/libsoup/server/soup-auth-domain-basic.c
@@ -204,8 +204,9 @@ pw_free (char *pw)
}
static gboolean
-parse_basic (SoupMessage *msg, const char *header,
- char **username, char **password)
+parse_basic (const char *header,
+ char **username,
+ char **password)
{
char *decoded, *colon;
gsize len, plen;
@@ -232,15 +233,16 @@ parse_basic (SoupMessage *msg, const char *header,
}
static char *
-soup_auth_domain_basic_accepts (SoupAuthDomain *domain, SoupMessage *msg,
- const char *header)
+soup_auth_domain_basic_accepts (SoupAuthDomain *domain,
+ SoupServerMessage *msg,
+ const char *header)
{
SoupAuthDomainBasicPrivate *priv =
soup_auth_domain_basic_get_instance_private (SOUP_AUTH_DOMAIN_BASIC (domain));
char *username, *password;
gboolean ok = FALSE;
- if (!parse_basic (msg, header, &username, &password))
+ if (!parse_basic (header, &username, &password))
return NULL;
if (priv->auth_callback) {
@@ -262,7 +264,8 @@ soup_auth_domain_basic_accepts (SoupAuthDomain *domain, SoupMessage *msg,
}
static char *
-soup_auth_domain_basic_challenge (SoupAuthDomain *domain, SoupMessage *msg)
+soup_auth_domain_basic_challenge (SoupAuthDomain *domain,
+ SoupServerMessage *msg)
{
GString *challenge;
@@ -272,18 +275,18 @@ soup_auth_domain_basic_challenge (SoupAuthDomain *domain, SoupMessage *msg)
}
static gboolean
-soup_auth_domain_basic_check_password (SoupAuthDomain *domain,
- SoupMessage *msg,
- const char *username,
- const char *password)
+soup_auth_domain_basic_check_password (SoupAuthDomain *domain,
+ SoupServerMessage *msg,
+ const char *username,
+ const char *password)
{
const char *header;
char *msg_username, *msg_password;
gboolean ok;
- header = soup_message_headers_get_one (msg->request_headers,
+ header = soup_message_headers_get_one (soup_server_message_get_request_headers (msg),
"Authorization");
- if (!parse_basic (msg, header, &msg_username, &msg_password))
+ if (!parse_basic (header, &msg_username, &msg_password))
return FALSE;
ok = (!strcmp (username, msg_username) &&