mime: store "form escape" as a single bit

Closes #12374
This commit is contained in:
Daniel Stenberg 2023-11-21 17:44:05 +01:00
parent 49c413cce2
commit 7f766637aa
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
3 changed files with 7 additions and 7 deletions

View File

@ -311,8 +311,7 @@ static char *escape_string(struct Curl_easy *data,
table = formtable;
/* data can be NULL when this function is called indirectly from
curl_formget(). */
if(strategy == MIMESTRATEGY_MAIL ||
(data && (data->set.mime_options & CURLMIMEOPT_FORMESCAPE)))
if(strategy == MIMESTRATEGY_MAIL || (data && (data->set.mime_formescape)))
table = mimetable;
Curl_dyn_init(&db, CURL_MAX_INPUT_LENGTH);

View File

@ -985,8 +985,9 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
break;
case CURLOPT_MIME_OPTIONS:
data->set.mime_options = (unsigned int)va_arg(param, long);
break;
arg = va_arg(param, long);
data->set.mime_formescape = !!(arg & CURLMIMEOPT_FORMESCAPE);
break;
# endif
#endif

View File

@ -1802,9 +1802,6 @@ struct UserDefined {
#endif
curl_prot_t allowed_protocols;
curl_prot_t redir_protocols;
#ifndef CURL_DISABLE_MIME
unsigned int mime_options; /* Mime option flags. */
#endif
#ifndef CURL_DISABLE_RTSP
void *rtp_out; /* write RTP to this if non-NULL */
/* Common RTSP header options */
@ -1857,6 +1854,9 @@ struct UserDefined {
IMAP or POP3 or others! (type: curl_usessl)*/
unsigned char connect_only; /* make connection/request, then let
application use the socket */
#ifndef CURL_DISABLE_MIME
BIT(mime_formescape);
#endif
BIT(is_fread_set); /* has read callback been set to non-NULL? */
#ifndef CURL_DISABLE_TFTP
BIT(tftp_no_options); /* do not send TFTP options requests */