]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
setopt: move the CURLOPT_CHUNK_DATA pointer to the set struct
authorDaniel Stenberg <daniel@haxx.se>
Mon, 27 Feb 2023 22:44:39 +0000 (23:44 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 28 Feb 2023 07:44:28 +0000 (08:44 +0100)
To make duphandle work etc

Closes #10635

lib/ftp.c
lib/setopt.c
lib/urldata.h
lib/wildcard.c
lib/wildcard.h

index 0513dd3d08acea6f693f395eb9d2e50bc3359ed2..2f72e0c3bb8943cdf42e60887cca4d09776f4e73 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -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);
index 604693ad94687e41a0f0523fdbf08e089aa19f70..24d4897a12991b180848c245ed381c05de5be028 100644 (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 *);
index 4cfffa773703ae79b36b7867a7d64b4aa358f3d7..ca8e3074d70b15920348c52c6adec4298b9779d7 100644 (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 */
index 3b81c7a8690ee1bc06b8be2481c649762f1c3a60..dea2a01bf821951073204235b11601423819cd89 100644 (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;
 }
 
index 9dccab01ab741d001a0fe22b21857ab58b717b0f..5b363fc585be7e138d760438425e3096edc7f87e 100644 (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);