Commit 6e38cc90 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

- Markus Koetter provided a polished and updated version of Chad Monroe's TFTP

  rework patch that now integrates TFTP properly into libcurl so that it can
  be used non-blocking with the multi interface and more. BLKSIZE also works.

  The --tftp-blksize option was added to allow setting the TFTP BLKSIZE from
  the command line.
parent a240f4d1
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -8,6 +8,14 @@



Daniel Stenberg (28 Nov 2009)
- Markus Koetter provided a polished and updated version of Chad Monroe's TFTP
  rework patch that now integrates TFTP properly into libcurl so that it can
  be used non-blocking with the multi interface and more. BLKSIZE also works.

  The --tftp-blksize option was added to allow setting the TFTP BLKSIZE from
  the command line.

Daniel Stenberg (26 Nov 2009)
- Extended and fixed the change I did on Dec 11 for the the progress
  meter/callback during FTP command/response sequences. It turned out it was
+4 −1
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ This release includes the following changes:

 o support SSL_FILETYPE_ENGINE for client certificate
 o curl-config can now show the arguments used when building curl
 o non-blocking TFTP

This release includes the following bugfixes:

@@ -26,6 +27,7 @@ This release includes the following bugfixes:
 o HTTP proxy tunnel re-used connection even if tunnel got disabled
 o SSL lib post-close write
 o curl failed to report write errors for tiny failed downloads
 o TFTP BLKSIZE

This release includes the following known bugs:

@@ -36,6 +38,7 @@ advice from friends like these:

 Yang Tse, Kamil Dudka, Christian Schmitz, Constantine Sapuntzakis,
 Marco Maggi, Camille Moncelier, Claes Jakobsson, Kevin Baughman,
 Marc Kleine-Budde, Jad Chamcham, Bjorn Augustsson, David Byron
 Marc Kleine-Budde, Jad Chamcham, Bjorn Augustsson, David Byron,
 Markus Koetter, Chad Monroe

        Thanks! (and sorry if I forgot to mention someone)
+470 −215

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Original line number Diff line number Diff line
@@ -932,8 +932,8 @@ struct connectdata {
#define PROT_SSL     (1<<22) /* protocol requires SSL */
#define PROT_MISSING (1<<23)

#define PROT_CLOSEACTION PROT_FTP /* these ones need action before socket
                                     close */
/* these ones need action before socket close */
#define PROT_CLOSEACTION (PROT_FTP | PROT_TFTP) 
#define PROT_DUALCHANNEL PROT_FTP /* these protocols use two connections */

  /* 'dns_entry' is the particular host we use. This points to an entry in the
+10 −2
Original line number Diff line number Diff line
@@ -602,7 +602,7 @@ struct Configurable {
  char *ftp_account; /* for ACCT */
  char *ftp_alternative_to_user; /* send command if USER/PASS fails */
  int ftp_filemethod;

  long tftp_blksize; /* TFTP BLKSIZE option */
  bool ignorecl; /* --ignore-content-length */
  bool disable_sessionid;

@@ -877,6 +877,7 @@ static void help(void)
    "    --stderr <file> Where to redirect stderr. - means stdout",
    "    --tcp-nodelay   Use the TCP_NODELAY option",
    " -t/--telnet-option <OPT=val> Set telnet option",
    "    --tftp-blksize <value> Set TFTP BLKSIZE option (must be >512)",
    " -z/--time-cond <time> Transfer based on a time condition",
    " -1/--tlsv1         Use TLSv1 (SSL)",
    "    --trace <file>  Write a debug trace to the given file",
@@ -1732,12 +1733,13 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
    {"$3", "keepalive-time",  TRUE},
    {"$4", "post302",    FALSE},
    {"$5", "noproxy",    TRUE},

#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
    {"$6", "socks5-gssapi-service",  TRUE},
    {"$7", "socks5-gssapi-nec",  FALSE},
#endif
    {"$8", "proxy1.0",   TRUE},

    {"$9", "tftp-blksize", TRUE},
    {"0", "http1.0",     FALSE},
    {"1", "tlsv1",       FALSE},
    {"2", "sslv2",       FALSE},
@@ -2264,6 +2266,9 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
        GetStr(&config->proxy, nextarg);
        config->proxyver = CURLPROXY_HTTP_1_0;
        break;
      case '9': /* --tftp-blksize */
        str2num(&config->tftp_blksize, nextarg);
        break;
      }
      break;
    case '#': /* --progress-bar */
@@ -5000,6 +5005,9 @@ operate(struct Configurable *config, int argc, argv_item_t argv[])
        my_setopt(curl, CURLOPT_POSTREDIR, config->post301 |
                  (config->post302 ? CURL_REDIR_POST_302 : FALSE));

        if(config->tftp_blksize)
          my_setopt(curl, CURLOPT_TFTP_BLKSIZE, config->tftp_blksize);

        retry_numretries = config->req_retry;

        retrystart = cutil_tvnow();