1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-24 00:58:48 -05:00

ftplistparser: remove use of conn->data

Closes #6482
This commit is contained in:
Daniel Stenberg 2021-01-18 22:59:25 +01:00
parent a304051620
commit f86fcd0080
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -272,8 +272,7 @@ static CURLcode ftp_pl_insert_finfo(struct Curl_easy *data,
struct fileinfo *infop) struct fileinfo *infop)
{ {
curl_fnmatch_callback compare; curl_fnmatch_callback compare;
struct connectdata *conn = data->conn; struct WildcardData *wc = &data->wildcard;
struct WildcardData *wc = &conn->data->wildcard;
struct ftp_wc *ftpwc = wc->protdata; struct ftp_wc *ftpwc = wc->protdata;
struct Curl_llist *llist = &wc->filelist; struct Curl_llist *llist = &wc->filelist;
struct ftp_parselist_data *parser = ftpwc->parser; struct ftp_parselist_data *parser = ftpwc->parser;
@ -294,13 +293,13 @@ static CURLcode ftp_pl_insert_finfo(struct Curl_easy *data,
str + parser->offsets.user : NULL; str + parser->offsets.user : NULL;
/* get correct fnmatch callback */ /* get correct fnmatch callback */
compare = conn->data->set.fnmatch; compare = data->set.fnmatch;
if(!compare) if(!compare)
compare = Curl_fnmatch; compare = Curl_fnmatch;
/* filter pattern-corresponding filenames */ /* filter pattern-corresponding filenames */
Curl_set_in_callback(conn->data, true); Curl_set_in_callback(data, true);
if(compare(conn->data->set.fnmatch_data, wc->pattern, if(compare(data->set.fnmatch_data, wc->pattern,
finfo->filename) == 0) { finfo->filename) == 0) {
/* discard symlink which is containing multiple " -> " */ /* discard symlink which is containing multiple " -> " */
if((finfo->filetype == CURLFILETYPE_SYMLINK) && finfo->strings.target && if((finfo->filetype == CURLFILETYPE_SYMLINK) && finfo->strings.target &&
@ -311,7 +310,7 @@ static CURLcode ftp_pl_insert_finfo(struct Curl_easy *data,
else { else {
add = FALSE; add = FALSE;
} }
Curl_set_in_callback(conn->data, false); Curl_set_in_callback(data, false);
if(add) { if(add) {
Curl_llist_insert_next(llist, llist->tail, finfo, &infop->list); Curl_llist_insert_next(llist, llist->tail, finfo, &infop->list);