Unverified Commit 0e2208ad authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

wildcard: disable from build when FTP isn't present

parent 7c70a3b1
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 *                            | (__| |_| |  _ <| |___
 *                             \___|\___/|_| \_\_____|
 *
 * Copyright (C) 2010 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
 * Copyright (C) 2010 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
 *
 * This software is licensed as described in the file COPYING, which
 * you should have received as part of this distribution. The terms
@@ -21,7 +21,7 @@
 ***************************************************************************/

#include "curl_setup.h"

#ifndef CURL_DISABLE_FTP
#include "strdup.h"
#include "fileinfo.h"
#include "curl_memory.h"
@@ -41,3 +41,4 @@ void Curl_fileinfo_cleanup(struct fileinfo *finfo)
  Curl_safefree(finfo->info.b_data);
  free(finfo);
}
#endif
+6 −1
Original line number Diff line number Diff line
@@ -1568,6 +1568,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,

        if(!result) {
          if(!dophase_done) {
#ifndef CURL_DISABLE_FTP
            /* some steps needed for wildcard matching */
            if(data->state.wildcardmatch) {
              struct WildcardData *wc = &data->wildcard;
@@ -1579,6 +1580,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
                break;
              }
            }
#endif
            /* DO was not completed in one function call, we must continue
               DOING... */
            multistate(data, CURLM_STATE_DOING);
@@ -1718,10 +1720,12 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
         (data->conn->writesockfd != CURL_SOCKET_BAD))
        multistate(data, CURLM_STATE_PERFORM);
      else {
#ifndef CURL_DISABLE_FTP
        if(data->state.wildcardmatch &&
           ((data->conn->handler->flags & PROTOPT_WILDCARD) == 0)) {
          data->wildcard.state = CURLWC_DONE;
        }
#endif
        multistate(data, CURLM_STATE_DONE);
      }
      rc = CURLM_CALL_MULTI_PERFORM;
@@ -1942,6 +1946,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
          detach_connnection(data);
      }

#ifndef CURL_DISABLE_FTP
      if(data->state.wildcardmatch) {
        if(data->wildcard.state != CURLWC_DONE) {
          /* if a wildcard is set and we are not ending -> lets start again
@@ -1950,7 +1955,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
          break;
        }
      }

#endif
      /* after we have DONE what we're supposed to do, go COMPLETED, and
         it doesn't matter what the multi_done() returned! */
      multistate(data, CURLM_STATE_COMPLETED);
+2 −0
Original line number Diff line number Diff line
@@ -2482,12 +2482,14 @@ static CURLcode vsetopt(struct Curl_easy *data, CURLoption option,
  case CURLOPT_FNMATCH_FUNCTION:
    data->set.fnmatch = va_arg(param, curl_fnmatch_callback);
    break;
#ifndef CURL_DISABLE_FTP
  case CURLOPT_CHUNK_DATA:
    data->wildcard.customptr = va_arg(param, void *);
    break;
  case CURLOPT_FNMATCH_DATA:
    data->set.fnmatch_data = va_arg(param, void *);
    break;
#endif
#ifdef USE_TLS_SRP
  case CURLOPT_TLSAUTH_USERNAME:
    result = Curl_setstropt(&data->set.str[STRING_TLSAUTH_USERNAME_ORIG],
+2 −0
Original line number Diff line number Diff line
@@ -1506,6 +1506,7 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
    data->state.authhost.picked &= data->state.authhost.want;
    data->state.authproxy.picked &= data->state.authproxy.want;

#ifndef CURL_DISABLE_FTP
    if(data->state.wildcardmatch) {
      struct WildcardData *wc = &data->wildcard;
      if(wc->state < CURLWC_INIT) {
@@ -1514,6 +1515,7 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
          return CURLE_OUT_OF_MEMORY;
      }
    }
#endif
  }

  return result;
+2 −0
Original line number Diff line number Diff line
@@ -1803,7 +1803,9 @@ struct Curl_easy {
  struct Progress progress;    /* for all the progress meter data */
  struct UrlState state;       /* struct for fields used for state info and
                                  other dynamic purposes */
#ifndef CURL_DISABLE_FTP
  struct WildcardData wildcard; /* wildcard download state info */
#endif
  struct PureInfo info;        /* stats, reports and info data */
  struct curl_tlssessioninfo tsi; /* Information about the TLS session, only
                                     valid after a client has asked for it */
Loading