cookies: Support multiple -b parameters

Previously only a single -b cookie parameter was supported with the last
one winning.  This adds support for supplying multiple -b params to have
them serialized semicolon separated.  Both cookiefiles and cookies can be
entered multiple times.

Closes #6649
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
This commit is contained in:
Daniel Gustafsson 2021-02-25 18:12:28 +01:00
parent 1b2098c3c9
commit 82c583dcf0
7 changed files with 48 additions and 15 deletions

View file

@ -1320,11 +1320,15 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
}
else if(strchr(nextarg, '=')) {
/* A cookie string must have a =-letter */
GetStr(&config->cookie, nextarg);
err = add2list(&config->cookies, nextarg);
if(err)
return err;
break;
}
/* We have a cookie file to read from! */
GetStr(&config->cookiefile, nextarg);
err = add2list(&config->cookiefiles, nextarg);
if(err)
return err;
}
break;
case 'B':