setopt: move the CURLOPT_CHUNK_DATA pointer to the set struct

To make duphandle work etc

Closes #10635
This commit is contained in:
Daniel Stenberg 2023-02-27 23:44:39 +01:00
parent 51211a31a5
commit c9c3ec482b
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 5 additions and 9 deletions

View file

@ -3255,7 +3255,7 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status,
if(data->state.wildcardmatch) {
if(data->set.chunk_end && ftpc->file) {
Curl_set_in_callback(data, true);
data->set.chunk_end(data->wildcard.customptr);
data->set.chunk_end(data->set.wildcardptr);
Curl_set_in_callback(data, false);
}
ftpc->known_filesize = -1;
@ -3909,7 +3909,7 @@ static CURLcode wc_statemach(struct Curl_easy *data)
long userresponse;
Curl_set_in_callback(data, true);
userresponse = data->set.chunk_bgn(
finfo, wildcard->customptr, (int)wildcard->filelist.size);
finfo, data->set.wildcardptr, (int)wildcard->filelist.size);
Curl_set_in_callback(data, false);
switch(userresponse) {
case CURL_CHUNK_BGN_FUNC_SKIP:
@ -3949,7 +3949,7 @@ static CURLcode wc_statemach(struct Curl_easy *data)
case CURLWC_SKIP: {
if(data->set.chunk_end) {
Curl_set_in_callback(data, true);
data->set.chunk_end(data->wildcard.customptr);
data->set.chunk_end(data->set.wildcardptr);
Curl_set_in_callback(data, false);
}
Curl_llist_remove(&wildcard->filelist, wildcard->filelist.head, NULL);

View file

@ -2849,7 +2849,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
data->set.fnmatch = va_arg(param, curl_fnmatch_callback);
break;
case CURLOPT_CHUNK_DATA:
data->wildcard.customptr = va_arg(param, void *);
data->set.wildcardptr = va_arg(param, void *);
break;
case CURLOPT_FNMATCH_DATA:
data->set.fnmatch_data = va_arg(param, void *);

View file

@ -1739,6 +1739,7 @@ struct UserDefined {
curl_fnmatch_callback fnmatch; /* callback to decide which file corresponds
to pattern (e.g. if WILDCARDMATCH is on) */
void *fnmatch_data;
void *wildcardptr;
#endif
/* GSS-API credential delegation, see the documentation of
CURLOPT_GSSAPI_DELEGATION */

View file

@ -61,14 +61,10 @@ void Curl_wildcard_dtor(struct WildcardData *wc)
DEBUGASSERT(wc->protdata == NULL);
Curl_llist_destroy(&wc->filelist, NULL);
free(wc->path);
wc->path = NULL;
free(wc->pattern);
wc->pattern = NULL;
wc->customptr = NULL;
wc->state = CURLWC_INIT;
}

View file

@ -54,7 +54,6 @@ struct WildcardData {
struct Curl_llist filelist; /* llist with struct Curl_fileinfo */
void *protdata; /* pointer to protocol specific temporary data */
wildcard_dtor dtor;
void *customptr; /* for CURLOPT_CHUNK_DATA pointer */
};
CURLcode Curl_wildcard_init(struct WildcardData *wc);