Commit Graph

558 Commits

Author SHA1 Message Date
Daniel Stenberg 9274d31690 - Bill Egert pointed out (http://curl.haxx.se/bug/view.cgi?id=2671602) that
curl didn't use sprintf() in a way that is documented to work in POSIX but
  since we use our own printf() code (from libcurl) that shouldn't be a
  problem. Nonetheless I modified the code to not rely on such particular
  features and to not cause further raised eyebrowse with no good reason.
2009-03-08 22:42:50 +00:00
Daniel Stenberg 8f81fd6be5 - CURLOPT_FTP_CREATE_MISSING_DIRS can now be set to 2 in addition to 1 for
plain FTP connections, and it will then allow MKD to fail once and retry the
  CWD afterwards. This is especially useful if you're doing many simultanoes
  connections against the same server and they all have this option enabled,
  as then CWD may first fail but then another connection does MKD before this
  connection and thus MKD fails but trying CWD works! The numbers can
  (should?) now be set with the convenience enums now called
  CURLFTP_CREATE_DIR and CURLFTP_CREATE_DIR_RETRY.

  Tests has proven that if you're making an application that uploads a set of
  files to an ftp server, you will get a noticable gain in speed if you're
  using multiple connections and this option will be then be very useful.
2009-02-17 09:07:25 +00:00
Dan Fandrich 77da9a0087 Added an explicit buffer limit check in msdosify() (patch based on FreeBSD).
This couldn't ever overflow in curl, but might if the code were used
elsewhere or under different conditions.
2009-02-05 00:13:40 +00:00
Daniel Stenberg bdd4294e79 - Craig A West brought us: libcurl now defaults to do CONNECT with HTTP
version 1.1 instead of 1.0 like before. This change also introduces the new
  proxy type for libcurl called 'CURLPROXY_HTTP_1_0' that then allows apps to
  switch (back) to CONNECT 1.0 requests. The curl tool also got a --proxy1.0
  option that works exactly like --proxy but sets CURLPROXY_HTTP_1_0.

  I updated all test cases cases that use CONNECT and I tried to do some using
  --proxy1.0 and some updated to do CONNECT 1.1 to get both versions run.
2009-02-02 16:19:23 +00:00
Daniel Stenberg de4610a55f - Markus Moeller introduced two new options to libcurl:
CURLOPT_SOCKS5_GSSAPI_SERVICE and CURLOPT_SOCKS5_GSSAPI_NEC to allow libcurl
  to do GSS-style authentication with SOCKS5 proxies. The curl tool got the
  options called --socks5-gssapi-service and --socks5-gssapi-nec to enable
  these.
2009-01-28 21:33:58 +00:00
Daniel Stenberg 5aeef9c1c8 - Craig A West brought CURLOPT_NOPROXY and the corresponding --noproxy option.
They basically offer the same thing the NO_PROXY environment variable only
  offered previously: list a set of host names that shall not use the proxy
  even if one is specified.
2009-01-25 23:26:25 +00:00
Dan Fandrich 80ffd3581f Created a CURLMIN macro to match CURLMAX 2009-01-07 19:39:35 +00:00
Gisle Vanem 2025193b7a Added the use of Watt-32 tcp/ip stack for Win32 targets.
Added USE_WATT32 unconditionally for MSDOS targets since
it's the only option. Adjusted the text for '--wdebug'.
2008-12-16 08:48:44 +00:00
Daniel Stenberg a65ce7b107 check for NULL returns from strdup() - reported by Jim Meyering
also prevent buffer overflow on MSDOS when you do for example -O on a url
with a file name part longer than PATH_MAX letters
2008-11-14 16:42:05 +00:00
Dan Fandrich 6cdd067faf curlx.h isn't a system include file so it gets double quotes 2008-10-28 19:51:04 +00:00
Yang Tse 6ea91af2f8 fix compiler warning 2008-10-24 01:27:00 +00:00
Daniel Stenberg b701ea36a7 moved the Curl_raw_ functions into the new lib/rawstr.c file for easier curlx_
inclusion by the curl tool without colliding with the curl_strequal functions.
2008-10-23 11:49:19 +00:00
Daniel Stenberg 2688cf343b Fixed potential memory leak in OOM situations. Detected by coverity.com 2008-10-19 21:00:40 +00:00
Daniel Stenberg 3f1b9f095a dumpeasycode() uses warnf() which uses config->errors so we must not close
that before dumpeasycode() is called. Found by coverity.com
2008-10-19 20:37:24 +00:00
Daniel Stenberg 8a6eeb82c5 Removed dead code, identified by coverity.com. 2008-10-19 20:28:41 +00:00
Daniel Stenberg a0d906739d After having studied one of the coverity.com reports at length last night, I
decided it was a good idea to properly document my thoughts in a comment near
the code that was identified as a possible flaw. A false positive as far as I
can see.
2008-10-17 06:03:37 +00:00
Daniel Stenberg 9d16b4081e Renamed Curl_ascii_equal to Curl_raw_equal and bugfixed the my_toupper function
used in strequal.c so now all test cases run fine for me again.
2008-10-16 08:23:48 +00:00
Daniel Stenberg a579d67064 - Pascal Terjan filed bug #2154627
(http://curl.haxx.se/bug/view.cgi?id=2154627) which pointed out that libcurl
  uses strcasecmp() in multiple places where it causes failures when the
  Turkish locale is used. This is because 'i' and 'I' isn't the same letter so
  strcasecmp() on those letters are different in Turkish than in English (or
  just about all other languages). I thus introduced a totally new internal
  function in libcurl (called Curl_ascii_equal) for doing case insentive
  comparisons for english-(ascii?) style strings that thus will make "file"
  and "FILE" match even if the Turkish locale is selected.
2008-10-15 21:43:48 +00:00
Daniel Stenberg b7722e7037 Prevent the accidental passing along NULL for the cases where the --trace
options don't succeed in opening the target file etc. Detected by coverity.com
2008-10-13 22:21:01 +00:00
Dan Fandrich bfeae0b5f5 Update docs now that SFTP supports file ranges. 2008-10-09 18:47:02 +00:00
Yang Tse 91bc396178 remove unnecessary typecast, otherwise triggering compiler warning:
dereferencing type-punned pointer will break strict-aliasing rules
2008-09-30 18:59:02 +00:00
Dan Fandrich df725aade2 Removed reference to curl-ca-bundle.crt in the host verification failure
error message.
2008-09-17 17:33:23 +00:00
Yang Tse 09aa4cf2ca fix compiler warning: external declaration in primary source file 2008-09-13 03:55:21 +00:00
Dan Fandrich 6cea51585f Checked in some code improvements and minor fixes that I discovered in the
FreeBSD ports system.
2008-09-10 20:05:45 +00:00
Yang Tse 59e378f48f remove unnecessary typecasting of malloc() 2008-09-06 05:29:05 +00:00
Daniel Stenberg 18110b519c - Martin Drasar provided the CURLOPT_POSTREDIR patch. It renames
CURLOPT_POST301 (but adds a define for backwards compatibility for you who
  don't define CURL_NO_OLDIES). This option allows you to now also change the
  libcurl behavior for a HTTP response 302 after a POST to not use GET in the
  subsequent request (when CURLOPT_FOLLOWLOCATION is enabled). I edited the
  patch somewhat before commit. The curl tool got a matching --post302
  option. Test case 1076 was added to verify this.
2008-09-05 16:13:20 +00:00
Yang Tse 3dcd2b82c4 fix print formatting string directives 2008-09-04 18:59:05 +00:00
Yang Tse c0f3e32447 remove duplicate va_start() call 2008-09-04 14:57:03 +00:00
Daniel Stenberg 18a21d5802 in the --libcurl output, mention that the large file stuff is only needed for
pre 7.19.0 libcurl-using apps
2008-09-02 06:48:11 +00:00
Yang Tse 9b7b2b347f When not using large file support WIN32's lseek offset is a 'long'. 2008-08-28 22:41:35 +00:00
Yang Tse 2fdd24c724 Fix default SIZEOF_OFF_T definition logic 2008-08-26 10:48:52 +00:00
Yang Tse 3e2487493e Use SIZEOF_OFF_T definition from config file 2008-08-26 01:40:19 +00:00
Dan Fandrich e3ad6d2bd1 Fixed a problem when --dump-header - was given with more than one URL,
which caused an error when the second header was dumped due to stdout
being closed.  Added test case 1066 to verify.  Also fixed a potential
problem where a closed file descriptor might be used for an upload
when more than one URL is given.
2008-08-22 22:57:25 +00:00
Yang Tse fcc8700218 Reinstate struct_stat definition that got lost in previous commit. 2008-08-22 19:01:00 +00:00
Yang Tse 9849c6b847 Adjustments to better select/differentiate when large/small file
support is provided using WIN32 functions directly.
2008-08-22 18:09:03 +00:00
Yang Tse cebaab8ee5 Use our CURL_LLONG_MAX and CURL_LLONG_MIN which are defined with the proper suffix. 2008-08-14 03:39:45 +00:00
Yang Tse feb03e4717 The size of long is a build time characteristic and as such it is now recorded
in curlbuild.h as CURL_SIZEOF_LONG. Definition now done from configure process
and in CVS curlbuild.h.dist for non-configure systems.
2008-08-13 15:32:20 +00:00
Yang Tse 64e3a091c3 Split comparison among several lines for debugging 2008-08-13 13:07:50 +00:00
Yang Tse 55a8098d48 Adjustment due to curl_off_t no longer following off_t 2008-08-13 03:05:00 +00:00
Yang Tse 24b1890710 s/SIZEOF_CURL_OFF_T/CURL_SIZEOF_CURL_OFF_T/g 2008-08-11 01:22:57 +00:00
Dan Fandrich 42cabc14d4 Added support for --append on SFTP uploads. Unfortunately, OpenSSH doesn't
support this so it goes untested.
2008-08-01 18:41:14 +00:00
Dan Fandrich d69a630989 Fixed a couple of buffer overflows in the MS-DOS port of the curl tool.
Factored out unslashquote. Added some 'const's in function parameters.
2008-07-31 01:12:06 +00:00
Daniel Stenberg 9b0fd007fd --remote-name-all 2008-07-10 20:29:27 +00:00
Dan Fandrich 8c377ad965 Honour --stderr with the -v option.
Fixed a file handle leak in the command line client if more than one
--stderr option was given.
2008-06-26 01:43:53 +00:00
Dan Fandrich 65ee4e4555 Fixed a memory leak in the command-line tool that caused a valgrind error. 2008-06-19 00:30:02 +00:00
Daniel Stenberg 5abfdc0140 - curl the tool now deals with its command line options somewhat differently!
All boolean options (such as -O, -I, -v etc), both short and long versions,
  now always switch on/enable the option named. Using the same option multiple
  times thus make no difference. To switch off one of those options, you need
  to use the long version of the option and type --no-OPTION. Like to disable
  verbose mode you use --no-verbose!

- Added --remote-name-all to curl, which if used changes the default for all
  given URLs to be dealt with as if -O is used. So if you want to disable that
  for a specific URL after --remote-name-all has been used, you muse use -o -
  or --no-remote-name.
2008-06-08 20:53:49 +00:00
Dan Fandrich c0d258ca17 Mention a few options that require an argument in --help 2008-06-04 23:44:53 +00:00
Marty Kuhrt 01e1c85304 return CURLE_OK instead of CURLE_FAILED_INIT if PARAM_HEKP_REQUESTED returned by getparameter 2008-06-01 16:01:37 +00:00
Dan Fandrich d0a506661f Made --stderr able to redirect all stderr messages. 2008-04-25 00:41:44 +00:00
Dan Fandrich 1960eebc2d Added support for running on Symbian OS. 2008-04-22 22:53:53 +00:00
Dan Fandrich 5825cf9457 Fixed typo in log message 2008-04-21 23:16:24 +00:00
Daniel Stenberg ead2618c31 - Brock Noland reported that curl behaved differently depending on which order
you used -i and -I.
2008-04-14 14:42:06 +00:00
Yang Tse 9bd28a021f STDIN_FILENO, STDOUT_FILENO and STDERR_FILENO clone macros 2008-01-23 06:11:11 +00:00
Yang Tse bdb2beb8e4 check availability of poll.h header at configuration time, and include
it when sys/poll.h is unavailable
2008-01-22 14:52:54 +00:00
Daniel Stenberg 8c66811e09 rephrased the --socks5-hostname help output somewhat 2008-01-19 10:30:15 +00:00
Yang Tse f6adae8d35 to actually allow really big HTTP POSTs curl's postfieldsize type is changed to
curl_off_t and CURLOPT_POSTFIELDSIZE_LARGE is used to pass value to libcurl
2008-01-18 05:58:00 +00:00
Yang Tse 5396121595 fix compiler warning 2008-01-17 18:03:07 +00:00
Yang Tse 3d55877764 fix handling of out of memory in the command line tool that afected
data url encoded HTTP POSTs when reading it from a file.
2008-01-16 21:01:30 +00:00
Yang Tse a8ae8087c4 fix compiler warning 2008-01-13 04:39:32 +00:00
Daniel Stenberg 4ab8ebb232 I re-arranged the curl --help output. All the options are now sorted on
their long option names and all descriptions are one-liners.
2008-01-12 22:56:12 +00:00
Daniel Stenberg f866af912d Eric Landes provided the patch (edited by me) that introduces the
--keepalive-time to curl to set the keepalive probe interval. I also took
the opportunity to rename the recently added no-keep-alive option to
no-keepalive to keep a consistent naming and to avoid getting two dashes in
these option names. Eric also provided an update to the man page for the new
option.
2008-01-12 22:10:53 +00:00
Daniel Stenberg e2c817731a I made the curl tool switch from using CURLOPT_IOCTLFUNCTION to now use the
spanking new CURLOPT_SEEKFUNCTION simply to take advantage of the improved
performance for the upload resume cases where you want to upload the last
few bytes of a very large file. To implement this decently, I had to switch
the client code for uploading from fopen()/fread() to plain open()/read() so
that we can use lseek() to do >32bit seeks (as fseek() doesn't allow that)
on systems that offer support for that.
2008-01-11 14:00:47 +00:00
Daniel Stenberg 18faa50940 Georg Lippitsch brought CURLOPT_SEEKFUNCTION and CURLOPT_SEEKDATA to allow
libcurl to seek in a given input stream. This is particularly important when
doing upload resumes when there's already a huge part of the file present
remotely. Before, and still if this callback isn't used, libcurl will read
and through away the entire file up to the point to where the resuming
begins (which of course can be a slow opereration depending on file size,
I/O bandwidth and more). This new function will also be preferred to get
used instead of the CURLOPT_IOCTLFUNCTION for seeking back in a stream when
doing multi-stage HTTP auth with POST/PUT.
2008-01-10 10:30:19 +00:00
Yang Tse 15f832d1c2 fix compiler warning 2008-01-09 19:11:56 +00:00
Daniel Stenberg 195e94c0fa Richard Atterer reverted back what I missed in my previous revert ;-) 2008-01-06 12:56:19 +00:00
Daniel Stenberg b430576436 Based on further discussion on curl-library, I reverted yesterday's SOCKS5
code to instead introduce support for a new proxy type called
CURLPROXY_SOCKS5_HOSTNAME that is used to send the host name to the proxy
instead of IP address and there's thus no longer any need for a new
curl_easy_setopt() option.

The default SOCKS5 proxy is again back to sending the IP address to the
proxy.  The new curl command line option for enabling sending host name to a
SOCKS5 proxy is now --socks5-hostname.
2008-01-05 22:04:18 +00:00
Yang Tse 2912189875 Don't abort operation when attempting to set SO_KEEPALIVE
fails, just issue a warning and ignore the failure.
2008-01-05 01:39:07 +00:00
Daniel Stenberg 2e42b0a252 Based on Maxim Perenesenko's patch, we now do SOCKS5 operations and let the
proxy do the host name resolving and only if --socks5ip (or
CURLOPT_SOCKS5_RESOLVE_LOCAL) is used we resolve the host name locally and
pass on the IP address only to the proxy.
2008-01-04 23:01:00 +00:00
Daniel Stenberg a46b40b7fd Richard Atterer brought a patch that added support for SOCKS4a proxies, which
is an inofficial PROXY4 variant that sends the hostname to the proxy instead
of the resolved address (which is already supported by SOCKS5).  --socks4a is
the curl command line option for it and CURLOPT_PROXYTYPE can now be set to
CURLPROXY_SOCKS4A as well.
2008-01-02 21:40:11 +00:00
Daniel Stenberg 7795eb6db8 Mohun Biswas pointed out that --libcurl generated a source code with an int
function but without a return statement. While fixing that, I also took care
about adding some better comments for the generated code.
2008-01-01 21:11:26 +00:00
Yang Tse 674845f239 (http://curl.haxx.se/mail/archive-2007-12/0039.html) reported and fixed
a file truncation problem on Windows build targets triggered when retrying
a download with curl.
2007-12-18 18:33:24 +00:00
Yang Tse 4fabe22173 Fix compiler warning 2007-12-13 14:39:51 +00:00
Daniel Stenberg dc24540ed1 Gilles Blanc made the curl tool enable SO_KEEPALIVE for the connections and
added the --no-keep-alive option that can disable that on demand.
2007-12-12 11:22:15 +00:00
Daniel Stenberg 636f5eb882 fix a crash in oom situations (thanks runtests.pl -t!) 2007-12-08 22:57:17 +00:00
Daniel Stenberg e963714de6 #1 fixed --data-urlencode when no = or @ was used
#2 extended the user-agent buffer since I hit the 128 byte boundary!
2007-11-26 11:03:32 +00:00
Daniel Stenberg 4bd2d49ca1 make nlen a size_t to better hold diffs between pointers etc 2007-11-22 09:39:04 +00:00
Daniel Stenberg ecfede9b3c Alessandro Vesely helped me improve the --data-urlencode's syntax, parser
and documentation.
2007-11-22 09:36:28 +00:00
Daniel Stenberg 600d0b1303 Introuced --data-urlencode to the curl tool for easier url encoding of the
data sent in a post.
2007-11-20 10:08:42 +00:00
Yang Tse 738e4f410c Replace isgraph with our uppercase macro version 2007-11-15 13:12:35 +00:00
Daniel Stenberg 51c6a5d43b Based on a patch brought by Johnny Luong, libcurl now offers
CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 and the curl tool --hostpubmd5. They both make
the SCP or SFTP connection verify the remote host's md5 checksum of the public
key before doing a connect, to reduce the risk of a man-in-the-middle attack.
2007-10-03 08:00:42 +00:00
Daniel Stenberg fd4cf78f36 Philip Langdale provided the new CURLOPT_POST301 option for
curl_easy_setopt() that alters how libcurl functions when following
redirects. It makes libcurl obey the RFC2616 when a 301 response is received
after a non-GET request is made. Default libcurl behaviour is to change
method to GET in the subsequent request (like it does for response code 302
- because that's what many/most browsers do), but with this CURLOPT_POST301
option enabled it will do what the spec says and do the next request using
the same method again. I.e keep POST after 301.

The curl tool got this option as --post301

Test case 1011 and 1012 were added to verify.
2007-09-26 12:44:59 +00:00
Daniel Stenberg 015d5869d7 Mark Davies fixed Negotiate authentication over proxy, and also introduced
the --proxy-negotiate command line option to allow a user to explicitly
select it.
2007-09-21 11:05:31 +00:00
Dan Fandrich 3fa60164af Renamed the CURLE_FTP_SSL_FAILED error code to CURLE_USE_SSL_FAILED.
Renamed the curl_ftpssl enum to curl_usessl and its enumerated constants,
creating macros for backward compatibility.
2007-08-31 19:36:32 +00:00
Dan Fandrich 9f44a95522 Renamed several libcurl error codes and options to make them more general
and allow reuse by multiple protocols. Several unused error codes were
removed.  In all cases, macros were added to preserve source (and binary)
compatibility with the old names.  These macros are subject to removal at
a future date, but probably not before 2009.  An application can be
tested to see if it is using any obsolete code by compiling it with the
CURL_NO_OLDIES macro defined.

Documented some newer error codes in libcurl-error(3)
2007-08-30 20:34:57 +00:00
Daniel Stenberg df3e8e19c1 minor change in language for the --libcurl source header 2007-08-12 20:36:06 +00:00
Dan Fandrich 93bd512357 Fixed a curl memory leak reported by Song Ma with a modified version
of the patch he suggested.  Added his test case as test289 to verify.
2007-07-10 22:23:16 +00:00
Daniel Stenberg 54967d2a3a Thomas J. Moore provided a patch that introduces Kerberos5 support in
libcurl. This also makes the options change name to --krb (from --krb4) and
CURLOPT_KRBLEVEL (from CURLOPT_KRB4LEVEL) but the old names are still
2007-07-01 22:01:18 +00:00
Gunter Knauf afdfa4bed2 minor patches to enable building for NetWare CLIB.
sent by Dmitry Mityugov.
2007-06-30 20:08:13 +00:00
Daniel Stenberg d978f85d55 Adam Piggott filed bug report #1740263
(http://curl.haxx.se/bug/view.cgi?id=1740263). Adam discovered that when
getting a large amount of URLs with curl, they were fetched slower and
slower... which turned out to be because the --libcurl data collecting which
wrongly always was enabled, but no longer is...
2007-06-20 21:57:28 +00:00
Daniel Stenberg b4d2fbae6d make -s/--silent properly toggle as it is documented 2007-06-06 20:08:40 +00:00
Daniel Stenberg 70b1900dd1 'mytx' in bug report #1723194 (http://curl.haxx.se/bug/view.cgi?id=1723194)
pointed out that the warnf() function in the curl tool didn't properly deal
with the cases when excessively long words were used in the string to chop
up.
2007-05-24 20:58:25 +00:00
Dan Fandrich eec105daba Fixed a logic error in the last patch and another out of memory issue.
Reduce the scope of some variables.
2007-05-02 00:50:06 +00:00
Dan Fandrich 19a80add95 Improved behaviour in out of memory conditions. 2007-05-01 20:52:05 +00:00
Yang Tse 94b253fde7 Steve Little's fixes to allow compilation on VMS 64-bit mode 2007-04-25 03:00:10 +00:00
Daniel Stenberg a93af43974 - Song Ma's warning if -r/--range is given with a "bad" range, also noted in
the man page now.
2007-04-22 09:31:27 +00:00
Dan Fandrich 945ba7cb7e Minor updates to --help output 2007-04-15 06:24:43 +00:00
Dan Fandrich fd016fb3ee Fixed curl_slist_append handling of out of memory conditions on the
easycode list (discovered by runtests' torture test).
2007-04-04 20:27:47 +00:00
Yang Tse f1b4f5e2ae fix MSDOS symbol check 2007-04-03 15:35:19 +00:00
Gisle Vanem d7088d1032 djgpp isn't the only possible DOS target.
Use the more traditional DJGPP define.
Added basename() for non-djgpp targets.
2007-04-03 10:55:01 +00:00
Gisle Vanem d07a874899 Simplify setting binary mode on file-descriptors.
Work around the non-standard _setmode() in Metaware's HighC.
2007-04-03 10:30:36 +00:00