diff options
-rw-r--r-- | src/IO/http.c | 3 | ||||
-rw-r--r-- | src/auth.c | 11 | ||||
-rw-r--r-- | src/auth.h | 2 |
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(""); @@ -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; @@ -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); |