mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-25 04:09:31 +03:00
gen_auth: simplified value assignment
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
|
||||
struct MHD_RqBAuth
|
||||
{
|
||||
struct _MHD_cstr_w_len token68;
|
||||
struct _MHD_str_w_len token68;
|
||||
};
|
||||
|
||||
#endif /* ! MHD_BASICAUTH_H */
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
struct MHD_RqDAuthParam
|
||||
{
|
||||
struct _MHD_cstr_w_len value;
|
||||
struct _MHD_str_w_len value;
|
||||
bool quoted;
|
||||
};
|
||||
|
||||
|
||||
@@ -91,8 +91,8 @@ parse_bauth_params (const char *str,
|
||||
else
|
||||
{
|
||||
/* No more data in the string, only single token68. */
|
||||
const struct _MHD_cstr_w_len tkn = { str + token68_start, token68_len};
|
||||
memcpy (&pbauth->token68, &tkn, sizeof(tkn));
|
||||
pbauth->token68.str = str + token68_start;
|
||||
pbauth->token68.len = token68_len;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -251,11 +251,8 @@ parse_dauth_params (const char *str,
|
||||
|
||||
/* Have valid parameter name and value */
|
||||
mhd_assert (! quoted || 0 != value_len);
|
||||
if (1)
|
||||
{
|
||||
const struct _MHD_cstr_w_len val = {str + value_start, value_len};
|
||||
memcpy (&aparam->param->value, &val, sizeof(val));
|
||||
}
|
||||
aparam->param->value.str = str + value_start;
|
||||
aparam->param->value.len = value_len;
|
||||
aparam->param->quoted = quoted;
|
||||
|
||||
break; /* Found matching parameter name */
|
||||
|
||||
@@ -63,6 +63,15 @@ struct _MHD_cstr_w_len
|
||||
const size_t len;
|
||||
};
|
||||
|
||||
/**
|
||||
* String with length
|
||||
*/
|
||||
struct _MHD_str_w_len
|
||||
{
|
||||
const char *str;
|
||||
size_t len;
|
||||
};
|
||||
|
||||
/**
|
||||
* Static string initialiser for struct _MHD_str_w_len
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user