]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Philippe Hameau found out that -Q "+[command]" didn't work, although some code
authorDaniel Stenberg <daniel@haxx.se>
Thu, 20 Jan 2005 22:22:12 +0000 (22:22 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 20 Jan 2005 22:22:12 +0000 (22:22 +0000)
was written for it. I fixed and added test case 227 to verify it.  The curl.1
man page didn't mention the '+' so I added it.

CHANGES
RELEASE-NOTES
docs/curl.1
src/main.c
tests/data/Makefile.am
tests/data/test227 [new file with mode: 0644]

diff --git a/CHANGES b/CHANGES
index 5959147f66e5ffc95fe37361af1a08374116274a..24db8ef7bf0fe20cd70830000806ae23d7d327ce 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,11 @@
                                   Changelog
 
 
+Daniel (20 January 2005)
+- Philippe Hameau found out that -Q "+[command]" didn't work, although some
+  code was written for it. I fixed and added test case 227 to verify it.
+  The curl.1 man page didn't mention the '+' so I added it.
+
 Daniel (19 January 2005)
 - Stephan Bergmann made libcurl return CURLE_URL_MALFORMAT if an FTP URL
   contains %0a or %0d in the user, password or CWD parts. (A future fix would
index e622bdd9f87595755a000677efdc5bfde82d8fdf..47b789a38460ee449e25dcc0a79712b5486c05d7 100644 (file)
@@ -10,6 +10,7 @@ Curl and libcurl 7.12.4
 
 This release includes the following changes:
 
+ o -Q "+[command]" was added
  o src/getpass.c license issue sorted (code was rewritten)
  o curl -w now supports 'http_connect' for the proxy's response to CONNECT
  o introducing "curl-config --protocols"
@@ -42,6 +43,6 @@ advice from friends like these:
  Werner Koch, Gisle Vanem, Alex Neblett, Kai Sommerfeld, Marty Kuhrt,
  Hzhijun, Pavel Orehov, Bruce Mitchener, Cyrill Osterwalder, Dan Torop,
  Martijn Koster, Alex aka WindEagle, Cody Jones, Samuel Díaz García,
- Stephan Bergmann
+ Stephan Bergmann, Philippe Hameau
 
         Thanks! (and sorry if I forgot to mention someone)
index 9c9b16cfa2bb0a6b7f1d401c1bbc0e1139a0cb2b..f9faadbdaec0cfbe68af071715c646dec40a5689 100644 (file)
@@ -5,7 +5,7 @@
 .\" *                            | (__| |_| |  _ <| |___
 .\" *                             \___|\___/|_| \_\_____|
 .\" *
-.\" * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2005, 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 @@
 .\" * $Id$
 .\" **************************************************************************
 .\"
-.TH curl 1 "7 Dec 2004" "Curl 7.12.3" "Curl Manual"
+.TH curl 1 "20 Jan 2005" "Curl 7.12.4" "Curl Manual"
 .SH NAME
 curl \- transfer a URL
 .SH SYNOPSIS
@@ -677,9 +677,11 @@ If used as the first parameter on the command line, the \fI$HOME/.curlrc\fP
 file will not be read and used as a config file.
 .IP "-Q/--quote <comand>"
 (FTP) Send an arbitrary command to the remote FTP server. Quote commands are
-sent BEFORE the transfer is taking place. To make commands take place after a
-successful transfer, prefix them with a dash '-'. You may specify any amount
-of commands to be run before and after the transfer. If the server returns
+sent BEFORE the transfer is taking place (just after the initial PWD command
+to be exact). To make commands take place after a successful transfer, prefix
+them with a dash '-'. To make commands get sent after libcurl has changed
+working directory, just before the transfer command(s), prefix the command
+with '+'. You may specify any amount of commands. If the server returns
 failure for one of the commands, the entire operation will be aborted. You
 must send syntactically correct FTP commands as RFC959 defines.
 
index ad3a5f4cd881542d57fbfee4ad62854ddf64f999..bcf2cd2b4b45503e4d38609cfcb8a0937bc73aff 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2005, 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
@@ -2784,8 +2784,9 @@ static void free_config_fields(struct Configurable *config)
     free(config->cookiejar);
 
   curl_slist_free_all(config->quote); /* checks for config->quote == NULL */
-  curl_slist_free_all(config->postquote); /*  */
-  curl_slist_free_all(config->headers); /*  */
+  curl_slist_free_all(config->prequote);
+  curl_slist_free_all(config->postquote);
+  curl_slist_free_all(config->headers);
 }
 
 #if defined(WIN32) && !defined(__CYGWIN32__)
@@ -3490,6 +3491,7 @@ operate(struct Configurable *config, int argc, char *argv[])
         curl_easy_setopt(curl, CURLOPT_CRLF, config->crlf);
         curl_easy_setopt(curl, CURLOPT_QUOTE, config->quote);
         curl_easy_setopt(curl, CURLOPT_POSTQUOTE, config->postquote);
+        curl_easy_setopt(curl, CURLOPT_PREQUOTE, config->prequote);
         curl_easy_setopt(curl, CURLOPT_WRITEHEADER,
                          config->headerfile?&heads:NULL);
         curl_easy_setopt(curl, CURLOPT_COOKIEFILE, config->cookiefile);
index 8267d7ab1da3f0e2d70a1b2587ce422fdcc68925..4f8b3d670a082833b7fadf57e3d22c45ef4b1b37 100644 (file)
@@ -31,7 +31,7 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46        \
  test517 test518 test210 test211 test212 test220 test221 test222       \
  test223 test224 test206 test207 test208 test209 test213 test240       \
  test241 test242 test519 test214 test215 test216 test217 test218       \
- test199 test225 test226
+ test199 test225 test226 test227
 
 # The following tests have been removed from the dist since they no longer
 # work. We need to fix the test suite's FTPS server first, then bring them
diff --git a/tests/data/test227 b/tests/data/test227
new file mode 100644 (file)
index 0000000..34331d4
--- /dev/null
@@ -0,0 +1,46 @@
+# Server-side
+<reply>
+<data>
+data
+    to
+      see
+that FTP
+works
+  so does it?
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP with quote ops
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/227 -Q "NOOP 1" -Q "+NOOP 2" -Q "-NOOP 3"
+</command>
+</test>
+<file name="log/ftpserver.cmd">
+REPLY EPSV 500 no such command
+</file>
+
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous\r
+PASS curl_by_daniel@haxx.se\r
+PWD\r
+NOOP 1\r
+EPSV\r
+PASV\r
+TYPE I\r
+NOOP 2\r
+SIZE 227\r
+RETR 227\r
+NOOP 3\r
+QUIT\r
+</protocol>
+</verify>