AuthParse managed by unique ptr.
I have to get back to the decommissioning of dList.
This commit is contained in:
+6
-13
@@ -56,9 +56,9 @@ struct AuthDialogData_t
|
||||
*/
|
||||
static std::vector< AuthHost_t * > auth_hosts;
|
||||
|
||||
static AuthParse_t *Auth_parse_new(void)
|
||||
static std::unique_ptr< AuthParse_t > Auth_parse_new(void)
|
||||
{
|
||||
AuthParse_t *auth_parse = std::make_unique< AuthParse_t >().release();
|
||||
auto auth_parse = std::make_unique< AuthParse_t >();
|
||||
auth_parse->ok = 0;
|
||||
auth_parse->type = TYPENOTSET;
|
||||
auth_parse->stale = 0;
|
||||
@@ -67,11 +67,6 @@ static AuthParse_t *Auth_parse_new(void)
|
||||
return auth_parse;
|
||||
}
|
||||
|
||||
static void Auth_parse_free(AuthParse_t *auth_parse)
|
||||
{
|
||||
delete auth_parse;
|
||||
}
|
||||
|
||||
static int Auth_path_is_inside(const char *path1, const char *path2, int len)
|
||||
{
|
||||
/*
|
||||
@@ -628,19 +623,17 @@ static int Auth_do_auth_dialog(const AuthParse_t *auth_parse,
|
||||
static int Auth_do_auth(char *challenge, enum AuthParseHTTPAuthType_t type,
|
||||
const DilloUrl *url)
|
||||
{
|
||||
AuthParse_t *auth_parse;
|
||||
int reload = 0;
|
||||
|
||||
_MSG("auth.c: Auth_do_auth: challenge={%s}\n", challenge);
|
||||
auth_parse = Auth_parse_new();
|
||||
auto auth_parse = Auth_parse_new();
|
||||
auth_parse->type = type;
|
||||
Auth_parse_challenge(auth_parse, challenge);
|
||||
Auth_parse_challenge(auth_parse.get(), challenge);
|
||||
if (auth_parse->ok)
|
||||
reload =
|
||||
Auth_do_auth_required(auth_parse, url) ?
|
||||
Auth_do_auth_dialog(auth_parse, url)
|
||||
Auth_do_auth_required(auth_parse.get(), url) ?
|
||||
Auth_do_auth_dialog(auth_parse.get(), url)
|
||||
: 1;
|
||||
Auth_parse_free(auth_parse);
|
||||
|
||||
return reload;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user