summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJorge Arellano Cid <jcid@dillo.org>2008-12-20 20:31:44 -0300
committerJorge Arellano Cid <jcid@dillo.org>2008-12-20 20:31:44 -0300
commit98c25153adbd82548b67c18f098bb68835bfa329 (patch)
treea11565a2feae955b78269a60d9fdc87b247a6688 /src
parent9b532026d3fc5c379827351c4da8b219012cb1c7 (diff)
Minor fixes in auth.c
Diffstat (limited to 'src')
-rw-r--r--src/IO/http.c3
-rw-r--r--src/auth.c11
-rw-r--r--src/auth.h2
3 files changed, 8 insertions, 8 deletions
diff --git a/src/IO/http.c b/src/IO/http.c
index 9deb961a..328a8601 100644
--- a/src/IO/http.c
+++ b/src/IO/http.c
@@ -197,7 +197,8 @@ Dstr *Http_make_content_type(const DilloUrl *url)
*/
Dstr *a_Http_make_query_str(const DilloUrl *url, bool_t use_proxy)
{
- char *ptr, *cookies, *auth, *referer;
+ const char *auth;
+ char *ptr, *cookies, *referer;
Dstr *query = dStr_new(""),
*full_path = dStr_new(""),
*proxy_auth = dStr_new("");
diff --git a/src/auth.c b/src/auth.c
index 81e97188..ad77b3b4 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -295,21 +295,20 @@ static AuthRealm_t *Auth_realm_by_path(const AuthHost_t *host,
int i, j;
int match_length;
+ match_length = 0;
realm_best = NULL;
for (i = 0; (realm = dList_nth_data(host->realms, i)); i++) {
char *realm_path;
for (j = 0; (realm_path = dList_nth_data(realm->paths, j)); j++) {
- int realm_path_length;
-
- realm_path_length = strlen(realm_path);
+ int realm_path_length = strlen(realm_path);
if (Auth_path_is_inside(path, realm_path, realm_path_length) &&
!(realm_best && match_length >= realm_path_length)) {
realm_best = realm;
match_length = realm_path_length;
}
- } /* for (j = 0; (path = ... */
- } /* for (i = 0; (realm = ... */
+ }
+ }
return realm_best;
}
@@ -353,7 +352,7 @@ static void Auth_realm_add_path(AuthRealm_t *realm, const char *path)
/*
* Return the authorization header for an HTTP query.
*/
-char *a_Auth_get_auth_str(const DilloUrl *url)
+const char *a_Auth_get_auth_str(const DilloUrl *url)
{
AuthHost_t *host;
AuthRealm_t *realm;
diff --git a/src/auth.h b/src/auth.h
index 8813fc37..5f96f642 100644
--- a/src/auth.h
+++ b/src/auth.h
@@ -8,7 +8,7 @@ extern "C" {
#include "url.h"
-char *a_Auth_get_auth_str(const DilloUrl *request_url);
+const char *a_Auth_get_auth_str(const DilloUrl *request_url);
int a_Auth_do_auth(Dlist *auth_string, const DilloUrl *url);
void a_Auth_init(void);