mirror of
https://github.com/curl/curl.git
synced 2026-07-30 20:58:06 +03:00
urldata: remove fields not used depending on used features
Reduced size of dynamically_allocated_data structure. Reduced number of stored values in enum dupstring and enum dupblob. This affects the reduced array placed in the UserDefined structure. Closes #13188
This commit is contained in:
parent
11d27cf341
commit
f46385d36d
14 changed files with 157 additions and 44 deletions
18
lib/url.c
18
lib/url.c
|
|
@ -278,10 +278,12 @@ CURLcode Curl_close(struct Curl_easy **datap)
|
|||
up_free(data);
|
||||
Curl_dyn_free(&data->state.headerb);
|
||||
Curl_flush_cookies(data, TRUE);
|
||||
#ifndef CURL_DISABLE_ALTSVC
|
||||
Curl_altsvc_save(data, data->asi, data->set.str[STRING_ALTSVC]);
|
||||
Curl_altsvc_cleanup(&data->asi);
|
||||
Curl_hsts_save(data, data->hsts, data->set.str[STRING_HSTS]);
|
||||
#endif
|
||||
#ifndef CURL_DISABLE_HSTS
|
||||
Curl_hsts_save(data, data->hsts, data->set.str[STRING_HSTS]);
|
||||
if(!data->share || !data->share->hsts)
|
||||
Curl_hsts_cleanup(&data->hsts);
|
||||
curl_slist_free_all(data->state.hstslist); /* clean up list */
|
||||
|
|
@ -305,7 +307,9 @@ CURLcode Curl_close(struct Curl_easy **datap)
|
|||
Curl_share_unlock(data, CURL_LOCK_DATA_SHARE);
|
||||
}
|
||||
|
||||
#ifndef CURL_DISABLE_PROXY
|
||||
Curl_safefree(data->state.aptr.proxyuserpwd);
|
||||
#endif
|
||||
Curl_safefree(data->state.aptr.uagent);
|
||||
Curl_safefree(data->state.aptr.userpwd);
|
||||
Curl_safefree(data->state.aptr.accept_encoding);
|
||||
|
|
@ -313,12 +317,18 @@ CURLcode Curl_close(struct Curl_easy **datap)
|
|||
Curl_safefree(data->state.aptr.rangeline);
|
||||
Curl_safefree(data->state.aptr.ref);
|
||||
Curl_safefree(data->state.aptr.host);
|
||||
#ifndef CURL_DISABLE_COOKIES
|
||||
Curl_safefree(data->state.aptr.cookiehost);
|
||||
#endif
|
||||
#ifndef CURL_DISABLE_RTSP
|
||||
Curl_safefree(data->state.aptr.rtsp_transport);
|
||||
#endif
|
||||
Curl_safefree(data->state.aptr.user);
|
||||
Curl_safefree(data->state.aptr.passwd);
|
||||
#ifndef CURL_DISABLE_PROXY
|
||||
Curl_safefree(data->state.aptr.proxyuser);
|
||||
Curl_safefree(data->state.aptr.proxypasswd);
|
||||
#endif
|
||||
|
||||
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_FORM_API)
|
||||
Curl_mime_cleanpart(data->state.formp);
|
||||
|
|
@ -429,20 +439,22 @@ CURLcode Curl_init_userdefined(struct Curl_easy *data)
|
|||
result = Curl_setstropt(&set->str[STRING_SSL_CAFILE], CURL_CA_BUNDLE);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
#ifndef CURL_DISABLE_PROXY
|
||||
result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_PROXY],
|
||||
CURL_CA_BUNDLE);
|
||||
if(result)
|
||||
return result;
|
||||
#endif
|
||||
#endif
|
||||
#if defined(CURL_CA_PATH)
|
||||
result = Curl_setstropt(&set->str[STRING_SSL_CAPATH], CURL_CA_PATH);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
#ifndef CURL_DISABLE_PROXY
|
||||
result = Curl_setstropt(&set->str[STRING_SSL_CAPATH_PROXY], CURL_CA_PATH);
|
||||
if(result)
|
||||
return result;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue