mirror of
https://github.com/curl/curl.git
synced 2026-08-25 02:53:32 +03:00
ftp: allocate the wildcard struct on demand
The feature is rarely used so this frees up data for the vast majority of easy handles that don't use it. Rename "protdata" to "ftpwc" since it is always an FTP wildcard struct pointer. Made the state struct field an unsigned char to save space. Closes #10639
This commit is contained in:
parent
c84c0f9aa3
commit
9c188e771c
7 changed files with 33 additions and 24 deletions
|
|
@ -1402,7 +1402,13 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
|
|||
#ifndef CURL_DISABLE_FTP
|
||||
data->state.wildcardmatch = data->set.wildcard_enabled;
|
||||
if(data->state.wildcardmatch) {
|
||||
struct WildcardData *wc = &data->wildcard;
|
||||
struct WildcardData *wc;
|
||||
if(!data->wildcard) {
|
||||
data->wildcard = calloc(1, sizeof(struct WildcardData));
|
||||
if(!data->wildcard)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
wc = data->wildcard;
|
||||
if(wc->state < CURLWC_INIT) {
|
||||
result = Curl_wildcard_init(wc); /* init wildcard structures */
|
||||
if(result)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue