Commit Graph

1615 Commits

Author SHA1 Message Date
Yang Tse 7d49d774fd VC6 IDE: link with advapi32.lib when using WIN32 crypto API (md5.c) 2012-12-18 13:29:45 +01:00
Yang Tse a0b207164c setup_once.h: refactor inclusion of <unistd.h> and <sys/socket.h>
Inclusion of top two most included header files now done in setup_once.h
2012-12-14 17:38:18 +01:00
Yang Tse b908376bef build: explain current role of LIBS in our Makefile.am files
BLANK_AT_MAKETIME may be used in our Makefile.am files to blank
LIBS variable used in generated makefile at makefile processing
time. Doing this functionally prevents LIBS from being used for
all link targets in given makefile.
2012-12-04 23:32:05 +01:00
Yang Tse 068f7ae264 build: prevent global LIBS from influencing src and lib build targets
Currently, LIBS is already used through other macros.
2012-12-03 22:41:18 +01:00
Yang Tse 79954a1b07 avoid mixing of enumerated type with another type 2012-11-26 16:23:48 +01:00
Kamil Dudka 1099f3a071 tool_metalink: fix error detection of hash alg initialization
The {MD5,SHA1,SHA256}_Init functions from OpenSSL are called directly
without any wrappers and they return 1 for success, 0 otherwise.  Hence,
we have to use the same approach in all the wrapper functions that are
used for the other crypto libraries.

This commit fixes a regression introduced in commit dca8ae5f.
2012-11-13 13:17:45 +01:00
Kamil Dudka 49c37e6c1c tool_metalink: allow to use hash algorithms provided by NSS
Fixes bug #3578163:
http://sourceforge.net/tracker/?func=detail&atid=100976&aid=3578163&group_id=976
2012-11-09 10:42:54 +01:00
Kamil Dudka dca8ae5f02 tool_metalink: allow to handle failure of hash alg initialization 2012-11-09 10:27:10 +01:00
Kamil Dudka cf75a64651 tool_metalink: introduce metalink_cleanup() in the internal API
... to release resources allocated at global scope
2012-11-09 10:27:10 +01:00
Guenter Knauf 5a4f6413d1 Added deps for static metalink-aware MinGW builds. 2012-11-08 18:41:59 +01:00
Daniel Stenberg a1be8e7f9b curl: set CURLOPT_SSL_VERIFYHOST to 0 to disable 2012-11-06 22:27:25 +01:00
Dave Reisner 550e403f00 uniformly use AM_CPPFLAGS, avoid deprecated INCLUDES
Since automake 1.12.4, the warnings are issued on running automake:

  warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')

Avoid INCLUDES and roll these flags into AM_CPPFLAGS.

Compile tested on:
  Ubuntu 10.04 (automake 1:1.11.1-1)
  Ubuntu 12.04 (automake 1:1.11.3-1ubuntu2)
  Arch Linux (automake 1.12.4)
2012-11-06 00:32:21 +01:00
Nick Zitzmann 94891ff296 metalink/md5: Use CommonCrypto on Apple operating systems
Previously the Metalink code used Apple's CommonCrypto library only if
curl was built using the --with-darwinssl option. Now we use CommonCrypto
on all Apple operating systems including Tiger or later, or iOS 5 or
later, so you don't need to build --with-darwinssl anymore. Also rolled
out this change to libcurl's md5 code.
2012-10-22 23:32:59 +02:00
Guenter Knauf c79c0909d9 Fix now broken libmetalink-aware OpenSSL build. 2012-10-13 01:03:34 +02:00
Guenter Knauf 3fc5779b91 Revert c44e674; add OpenSSL includes/defines.
The makefile is designed to build against a libmetalink devel package;
therefore is does not matter what will change inside libmetalink.
Add OpenSSL includes and defines for libmetalink-aware OpenSSL builds.
2012-10-13 00:48:05 +02:00
Tatsuhiro Tsujikawa 42bbc5ce10 tool_metalink.c: Filtered resource URLs by type
In Metalink v3, the type attribute of url element indicates the
type of the resource the URL points to. It can include URL to the
meta data, such as BitTorrent metainfo file.  In Curl, we are not
interested in these meta data URLs. Instead, we are only
interested in the HTTP and FTP URLs. This change filters out
non-HTTP and FTP URLs. If we don't filter out them, it will be
downloaded by curl and hash check will fail if hash is provided
and next URL will be tried. This change will cut this useless
network transfer.
2012-10-01 22:03:07 +02:00
Marc Hoersken d89861f651 Makefile.vc6: Follow up on 0c8ccf7 2012-09-24 10:26:15 +02:00
Marc Hoersken a34197ef77 tool_metalink.c: Added name of validation hash to messages
This makes it easier to debug broken hashes or hash functions.
2012-09-12 00:09:23 +02:00
Marc Hoersken 7f7e2ea72f wincrypt: Fixed cross-compilation issues caused by include name
For some reason WinCrypt.h is named wincrypt.h under MinGW.
2012-09-11 14:35:18 +02:00
Marc Hoersken c44e6741ce Makefile.m32: Updated to build against libmetalink 0.1.2
The include and library path were moved within libmetalink, this
patch adjusts the defaults provided within the curl MinGW makefile.
2012-09-11 13:37:37 +02:00
Marc Hoersken 94c3e0f702 tool_metalink.c: Added support for Microsoft Windows CryptoAPI
Since Metalink support requires a crypto library for hash functions
and Windows comes with the builtin CryptoAPI, this patch adds that
API as a fallback to the supported crypto libraries.
It is automatically used on Windows if no other library is provided.
2012-09-11 13:37:30 +02:00
Marc Hoersken 71813f5e46 tool_metalink.c: Fixed error: 'O_BINARY' undeclared
Check for O_BINARY which is not available on every system.
2012-09-11 08:20:43 +02:00
Marc Hoersken a6df3550cf tool_metalink.c: Fixed validation of binary files containing EOF
Since Windows/MinGW threat 0x1A as the EOF character, reading binary
files which contain that byte does not work using text mode.
The read function will only read until the first 0x1A byte. This
means that the hash is not computed from the whole file and the
final validation check using hash comparision fails.
2012-09-11 01:42:58 +02:00
David Blaikie 8b5d050267 tool_easysrc.c: Test pointers against NULL
While validating a new Clang diagnostic (-Wnon-literal-null-conversion -
yes, the name isn't quite correct in this case, but it suffices) I found
a few violations of it in Curl.
2012-09-06 21:00:26 +02:00
Nick Zitzmann 1de496cf0f metalink: Un-broke the build when building --with-darwinssl 2012-08-08 11:16:26 +02:00
Daniel Stenberg 73b1a965f7 globbing: fix segfault when >9 globs were used
Stupid lack of range checks caused the code to overwrite local variables
after glob number nine. Added checks now.

Bug: http://curl.haxx.se/bug/view.cgi?id=3546353
2012-08-07 13:45:59 +02:00
Daniel Stenberg 3b9103e4a6 operate: fix clang-analyzer warnings for never read variables
Two separate "Value stored to 'XXX' is never read" warnings
2012-08-06 23:59:28 +02:00
Daniel Stenberg 77c66e0247 operate: fix clang-analyzer warning
Value stored to 'separator' is never read
2012-08-06 23:32:49 +02:00
Daniel Stenberg 9f304291bd metalink: change code order to build with gnutls-nettle
Bug: http://curl.haxx.se/bug/view.cgi?id=3554668
Reported by: Anthony G. Basile
2012-08-06 22:39:13 +02:00
Kamil Dudka 487406c3c0 tool_operate: fix misplaced initialization of orig_noprogress
... and orig_isatty which caused --silent to be entirely ignored in case
the standard output was redirected to a file!
2012-07-22 02:06:22 +02:00
Daniel Stenberg ff318a6302 getparam: fix the GetStr() macro
It should return PARAM_NO_MEM if the strdup fails. Spotted by
clang-analyzer
2012-07-15 20:33:11 +02:00
Guenter Knauf a39789c85c Minor fixes to MinGW makefiles. 2012-07-12 14:15:58 +02:00
Guenter Knauf dfe405076e Removed libcurl.imp from Makefile.am.
Updated .gitignore for NetWare created files.
2012-07-11 17:40:09 +02:00
Guenter Knauf f9dfd7e4b7 Changed MinGW makefiles to use WINSSL now. 2012-07-11 11:33:08 +02:00
Daniel Stenberg f2b6ebed7b cmdline: parse numerical options stricter
1 - str2offset() no longer accepts negative numbers since offsets are by
nature positive.

2 - introduced str2unum() for the command line parser that accepts
numericals which are not supposed to be negative, so that it will
properly complain on apparent bad uses and mistakes.

Bug: http://curl.haxx.se/mail/archive-2012-07/0013.html
2012-07-10 23:11:30 +02:00
Guenter Knauf 9a158f1ef0 Removed obsolete include path to project root. 2012-07-08 18:06:15 +02:00
Guenter Knauf 6388ac7dc1 Renamed vars to avoid shadow global declaration. 2012-07-04 12:54:21 +02:00
Guenter Knauf 6fb0ed88d6 Moved some patterns to subfolder's .gitignore. 2012-07-03 14:31:50 +02:00
Guenter Knauf 1ba5712f88 MinGW makefile tweaks for running from sh.
Added function macros to make path converting easier.
Added CROSSPREFIX to all compile tools.
2012-07-03 12:56:41 +02:00
Tatsuhiro Tsujikawa 89b431f60f curl: Added runtime version check for libmetalink 2012-07-02 16:28:01 +02:00
Tatsuhiro Tsujikawa 4e3320a679 Include metalink/metalink.h for libmetalink functions 2012-07-02 03:39:21 +02:00
Tatsuhiro Tsujikawa bf4580d5fd Metalink: message updates
Print "parsing (...) OK" only when no warnings are generated.  If
no file is found in Metalink, treat it FAILED.

If no digest is provided, print WARNING in parse_metalink().
Also print validating FAILED after download.

These changes make tests 2012 to 2016 pass.
2012-06-28 00:26:16 +02:00
Tatsuhiro Tsujikawa 3e6dfe138a Metalink: updated message format 2012-06-27 13:15:59 +02:00
Tatsuhiro Tsujikawa 7f59577fdd Metalink: ignore --include if --metalink is used.
Including headers in response body will break Metalink XML parser.
If it is included in the file described in Metalink XML, hash check
will fail. Therefore, --include should be ignored if --metalink is
used.
2012-06-22 18:58:30 +02:00
Tatsuhiro Tsujikawa aefb9196cf curl: Prefixed all Metalink related messages with "Metalink: " 2012-06-21 17:34:54 +02:00
Tatsuhiro Tsujikawa 7561a0fc83 curl: Restore noprogress and isatty config values.
The noprogress and isatty in Configurable are global, in a sense
that they persist in one curl invocation. Currently once one
download writes its response data to tty, they are set to FALSE
and they are not restored on successive downloads.  This change
first backups the current noprogress and isatty, and restores
them when download does not write its data to tty.
2012-06-21 03:35:52 +02:00
Tatsuhiro Tsujikawa 196c8242ca curl: Made --metalink option toggle Metalink functionality
In this change, --metalink option no longer takes argument.  If
it is specified, given URIs are processed as Metalink XML file.
If given URIs are remote (e.g., http URI), curl downloads it
first. Regardless URI is local file (e.g., file URI scheme) or
remote, Metalink XML file is not written to local file system and
the received data is fed into Metalink XML parser directly.  This
means with --metalink option, filename related options like -O
and -o are ignored.

Usage examples:

$ curl --metalink http://example.org/foo.metalink

This will download foo.metalink and parse it and then download
the URI described there.

$ curl --metalink file://foo.metalink

This will parse local file foo.metalink and then download the URI
described there.
2012-06-21 03:35:23 +02:00
Tatsuhiro Tsujikawa 424bb35877 curl: Refactored metalink_checksum
When creating metalink_checksum from metalink_checksum_t, first
check hex digest is valid for the given hash function.  We do
this check in the order of digest_aliases so that first good
match will be chosen (strongest hash function available).  As a
result, the metalinkfile now only contains at most one
metalink_checksum because other entries are just redundant.
2012-06-21 03:34:37 +02:00
Gisle Vanem 08e0ad7b39 tool_doswin.c: fix djgpp function _use_lfn() used without a prototype
http://curl.haxx.se/mail/archive-2012-06/0028.html
2012-06-20 23:40:42 +02:00
Guenter Knauf feaf8f9590 Fixed NetWare makefile broken from last commit. 2012-06-19 11:55:06 +02:00
Guenter Knauf 705330c750 Some more NetWare makefile tweaks for metalink. 2012-06-18 23:19:35 +02:00
Yang Tse 599a2c1f1a tool_cb_see.c: WinCE build adjustment 2012-06-18 18:52:29 +02:00
Yang Tse 819afe46ee schannel: remove version number and identify its use with 'schannel' literal
Version number is removed in order to make this info consistent with
how we do it with other MS and Linux system libraries for which we don't
provide this info.

Identifier changed from 'WinSSPI' to 'schannel' given that this is the
actual provider of the SSL/TLS support. libcurl can still be built with
SSPI and without SCHANNEL support.
2012-06-13 16:42:48 +02:00
Daniel Stenberg af0888aaf6 Revert: 634f7cfee4 partially
Make sure CURL_VERSION_SSPI is present and works as in previous releases
for ABI and API compatibility reasons.
2012-06-11 22:58:39 +02:00
Steve Holme 9a51c11074 Makefile.vc6: Added version.lib if built with SSPI 2012-06-11 19:04:16 +02:00
Marc Hoersken 7da6a9128b mingw32: Fixed warning of USE_SSL being redefined 2012-06-11 19:00:37 +02:00
Marc Hoersken 634f7cfee4 version: Replaced SSPI feature information with version string details
Added Windows SSPI version information to the curl version string when
SCHANNEL SSL is not enabled, as the version of the library should also
be included when SSPI is used to generate security contexts.

Removed SSPI from the feature list as the features are GSS-Negotiate,
NTLM and SSL depending on the usage of the SSPI library.
2012-06-11 19:00:36 +02:00
Marc Hoersken c1311c2b8f curl_sspi: Added Curl_sspi_version function
Added new function to get SSPI version as string.
Added required library version.lib to makefiles.
Changed curl_schannel.c to use Curl_sspi_version.
2012-06-11 19:00:35 +02:00
Guenter Knauf 0bb5ff5d1a schannel: Updated mingw32 makefiles 2012-06-11 19:00:35 +02:00
Guenter Knauf 6ea32b8b76 Added metalink support to NetWare builds. 2012-06-09 23:10:47 +02:00
Yang Tse a884ffe430 Fixes allowing 26 more test cases in 1334 to 1393 range to succeed 2012-06-09 05:49:49 +02:00
Daniel Stenberg dd576194ce tool_getparam.h: fix compiler error
forward declare the Configurable struct
2012-06-08 23:14:30 +02:00
Daniel Stenberg 870c99b7e7 metalink: restore some includes
Commit eeeba1496c removed them and thus broke my Linux build
2012-06-08 23:13:32 +02:00
Yang Tse eeeba1496c metalink: build fixes and adjustments II
Additionally, make hash checking ability mandatory in order to allow metalink
support in curl.

A command line option could be introduced to skip hash checking at runtime,
but the ability to check hashes should always be built-in when providing
metalink support.
2012-06-08 14:27:45 +02:00
Guenter Knauf 186b101deb Added metalink support to MinGW builds. 2012-06-08 14:16:43 +02:00
Yang Tse 04ca9aecd1 metalink: build fixes and adjustments I 2012-06-07 23:50:12 +02:00
Yang Tse 7352ac408b Fixes allowing HTTP test cases 1338, 1339, 1368 and 1369 to succeed 2012-06-07 21:57:53 +02:00
Guenter Knauf ca8b4e9742 Enabled OpenSSL static linkage. 2012-05-27 07:16:45 +02:00
Guenter Knauf cd4cf989bb Try to detect OpenSSL build type automatically. 2012-05-27 03:28:43 +02:00
Daniel Stenberg 6015b71c4e metalink: fix build errors when disabled 2012-05-26 23:20:23 +02:00
Tatsuhiro Tsujikawa 1bfd750f3f Reduced #ifdef HAVE_METALINK 2012-05-26 23:12:09 +02:00
Tatsuhiro Tsujikawa 7bdb9fba95 Disable hash check if neither OpenSSL nor GNUTLS is installed. 2012-05-26 23:12:02 +02:00
Tatsuhiro Tsujikawa 6927153703 Format GETOUT_METALINK nicely 2012-05-26 23:11:58 +02:00
Tatsuhiro Tsujikawa 6a655ca192 Minimize usage of structs from libmetalink 2012-05-26 23:11:52 +02:00
Tatsuhiro Tsujikawa 9f7f7925da Check checksum of downloaded file if checksum is available
Metalink file contains several hash types of checksums, such as
md5, sha-1, sha-256, etc. To deal with these checksums, I created
abstraction layer based on lib/curl_md5.h and
lib/md5.c. Basically, they are almost the same but I changed the
code so that it is not hash type dependent. Currently,
GNUTLS(nettle or gcrypt) and OpenSSL functions are supported.

Checksum checking is done by reopening download file.  If there
is an I/O error, the current implementation just prints error
message and does not try next resource.

In this patch, the supported hash types are: md5, sha-1 and sha-256.
2012-05-26 23:11:46 +02:00
Tatsuhiro Tsujikawa c3ef63f167 Always create directory hierarchy for Metalink.
Filenames contained in Metalink file can include directory information.
Filenames are unique in Metalink file, taking into account the directory
information. So we need to create the directory hierarchy.

Curl has --create-dirs option, but we create directory hierarchy for
Metalink downloads regardless of the option value.

This patch also put metalink int variable outside of HAVE_LIBMETALINK
guard. This reduces the number of #ifdefs.
2012-05-26 23:11:40 +02:00
Tatsuhiro Tsujikawa 94eb132896 Fixed segmentation fault when Metalink has no valid file or no resource. 2012-05-26 23:11:14 +02:00
Tatsuhiro Tsujikawa 383641d70a Support media-type parameter in Content-Type 2012-05-26 23:11:06 +02:00
Tatsuhiro Tsujikawa 963bcde476 Print "Metalink" in Features if Metalink support is enabled. 2012-05-26 23:11:01 +02:00
ant 89747794fe Add --metalink to --help 2012-05-26 23:10:53 +02:00
Tatsuhiro Tsujikawa fd17cd4d9c --metalink option is available regardless of Metalink support. 2012-05-26 23:09:57 +02:00
Tatsuhiro Tsujikawa 53f2c02ac7 metalink: parse downloaded Metalink file
Parse downloaded Metalink file and add downloads described there. Fixed
compile error without metalink support.
2012-05-26 23:09:37 +02:00
Tatsuhiro Tsujikawa 9f9f9ed1b2 metalink: minor metalinkfile fix
Don't update config->metalinkfile_last in operate(). Use local variable
to point to the current metalinkfile.
2012-05-26 23:08:56 +02:00
Tatsuhiro Tsujikawa a0d7a26e32 metalink: show help message even if disabled
Print message if --metalink is used while metalink support is not
enabled. Migrated Metalink support in tool_operate.c and removed
operatemetalink().
2012-05-26 23:08:13 +02:00
Tatsuhiro Tsujikawa bb1ce6cc0b Applied patches from Daniel 2012-05-26 23:07:53 +02:00
Tatsuhiro Tsujikawa b5fdbe848b Support Metalink.
This change adds experimental Metalink support to curl.
To enable Metalink support, run configure with --with-libmetalink.
To feed Metalink file to curl, use --metalink option like this:

  $ curl -O --metalink foo.metalink

We use libmetalink to parse Metalink files.
2012-05-26 23:07:42 +02:00
Tatsuhiro Tsujikawa b061fed981 Made -D option work with -O and -J.
To achieve this, first new structure HeaderData is defined to hold
necessary data to perform header-related work.  Then tool_header_cb now
receives HeaderData pointer as userdata.  All header-related work
(currently, dumping header and Content-Disposition inspection) are done
in this callback function.  HeaderData.outs->config is used to determine
whether each work is done.

Unit tests were also updated because after this change, curl code always
sets CURLOPT_HEADERFUNCTION and CURLOPT_HEADERDATA.

Tested with -O -J -D, -O -J -i and -O -J -D -i and all worked fine.
2012-05-25 23:06:08 +02:00
Guenter Knauf 1c58f291cc Updated dependency libary versions. 2012-05-22 04:15:37 +02:00
Daniel Stenberg e7257dcf2e my_useragent: shorten user-agent
The built-in user-agent will now only say curl/[version] and nothing
else in an attempt to decrease overhead in HTTP requests.
2012-05-12 15:07:07 +02:00
Guenter Knauf 1beda0cbb7 Updated dependency lib versions. 2012-04-26 14:40:50 +02:00
Yang Tse d6c449e3b4 Revert "sspi: Added version information"
This reverts commit 2976de4808.
2012-04-23 16:28:01 +02:00
Steve Holme 2976de4808 sspi: Added version information
Added version information for Windows SSPI to curl's main version
string and removed SSPI from the features string.
2012-04-22 18:49:27 +01:00
Guenter Knauf 0f54880277 Updated dependency lib versions. 2012-04-20 13:33:54 +02:00
Yang Tse 94111bbbd4 Take in account that CURLAUTH_* bitmasks are now 'unsigned long' - follow-up
MIPSPro compiler detected curl_easy_getinfo() related missing adjustments.
SunPro compiler detected curl tool --libcurl option related missing adjustments.
2012-04-19 16:31:11 +02:00
Yang Tse 9421b06397 Take in account that CURLAUTH_* bitmasks are now 'unsigned long'
Data type of internal vars holding CURLAUTH_* bitmasks changed from 'long' to
'unsigned long' for proper handling and operating.
2012-04-18 23:04:35 +02:00
Yang Tse ce8a321dd0 Some explicit conversion to 'long' of curl_easy_setopt() third argument
Explicit conversion to 'long' of curl_easy_setopt() third argument for options
CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH given that this is how its bitmasks are
docummented to be used.
2012-04-18 21:03:20 +02:00
Daniel Stenberg 4d28a59fc2 -# progress meter: avoid superfluous updates and duplicate lines
By comparing if a different "progress point" is reached or not since the
previous update, the progress function callback for this now avoids many
superfluous screen updates. This has the nice side-effect that it fixes
a problem that causes a second progress meter line.

The second line output happened because when we use the -# progress
meter, we force a newline output after the transfer in the main loop in
curl, but when libcurl calls the progress callback from
curl_easy_cleanup() it would then output the progress display
again. Possibly the naive newline output is wrong but this optimization
was suitable anyway...

Reported by: Daniel Theron
Bug: http://curl.haxx.se/bug/view.cgi?id=3517418
2012-04-17 00:45:20 +02:00
Yang Tse 5f04843e5b tool_operate.c: fix compiler warning 2012-04-12 21:21:09 +02:00
Guenter Knauf 82306ebfba Updated dependency lib versions (2nd try). 2012-04-12 20:51:29 +02:00
Guenter Knauf 03d4b9f078 Updated dependency lib versions. 2012-04-12 20:44:50 +02:00
Yang Tse 51114f07f1 tool_formparse.c: rename a couple of vars to avoid declaration shadowing 2012-04-12 19:28:46 +02:00
Yang Tse a144bb8b76 build adjustments: functionally revert commits 4d3fb91f and bbfe1182
Undefining CURL_HIDDEN_SYMBOLS in source files isn't the proper fix.
2012-04-11 19:28:40 +02:00
Yang Tse e5c14674f0 curl tool: make setup.h first header included in tool_setup.h again 2012-04-10 03:20:30 +02:00
Yang Tse 21423497ef configure: Windows cross-compilation fixes
BUILDING_LIBCURL and CURL_STATICLIB are no longer defined in curl_config.h,
configure will generate appropriate conditionals so that mentioned symbols
get defined and used in Makefiles at compilation time
2012-04-09 21:24:16 +02:00
Yang Tse 01b0f1061d curl tool: make curl.h first header included in tool_setup.h 2012-04-08 13:50:18 +02:00
Yang Tse 919c97fa65 curl tool: use configuration files from lib directory
Configuration files such as curl_config.h and all config-*.h no longer exist
nor are generated/copied into 'src' directory, now these only exist in 'lib'
directory from where curl tool sources uses them.

Additionally old src/setup.h has been refactored into src/tool_setup.h which
now pulls lib/setup.h

The possibility of a makefile needing an include path adjustment exists.
2012-04-06 23:37:05 +02:00
Daniel Stenberg 29e68b200c curl: add --post303 to set the CURL_REDIR_POST_303 option 2012-04-05 23:34:12 +02:00
Dave Reisner ddfe821bcf curl tool: add filename_effective token for --write-out
By modifying the parameter list for ourWriteOut() and passing the
OutStruct that collects data in tool_operate, we get access to the
remote name that we're writing to. Shell scripters should find this
useful when used in conjuntion with the --remote-header-name option.
2012-04-01 23:52:05 +02:00
Olaf Flebbe 4bdb664c33 tool_cb_dbg.c: fix tool_cb_dbg() to behave properly even for size 0
curl segfault in debug callback triggered with CURLINFO_HEADER_OUT and size 0

bug: http://curl.haxx.se/bug/view.cgi?id=3511794
2012-03-27 22:16:25 +02:00
Yang Tse fe7613932e tool_easysrc.c: fix --libcurl option output file text translation mode
Use fopen() with "w" mode instead of "wt" to fix cygwin builds.
2012-03-18 05:54:10 +01:00
Yang Tse ffb67599b3 build: remove tool_cb_skt.[ch] references 2012-03-18 05:35:30 +01:00
Yang Tse 804da995c5 tool_setopt.c: more OOM handling fixes 2012-03-17 20:55:15 +01:00
Yang Tse 862bb7bade tool_setopt.c: fix OOM handling 2012-03-16 20:10:08 +01:00
Yang Tse b329fc7023 fix several compiler warnings 2012-03-16 20:06:18 +01:00
Yang Tse 8af4b657d0 fix some compiler warnings 2012-03-16 19:06:34 +01:00
Colin Hogben 9954242980 Generate lists and use symbols in --libcurl code output.
This patch improves the output of curl's --libcurl option by
generating code which builds curl_httppost and curl_slist lists, and
uses symbolic names for enum and flag values.  Variants of the
my_setopt macro in tool_setopt.h are added in order to pass extra type
information to the code-generation step in tool_setopt.c.

If curl is configured with --disable-libcurl-option then the macros
call curl_easy_setopt directly.
2012-02-23 22:32:57 +01:00
Steve Holme a053560cfa curl: Added support for --mail-auth
Added an extra command-line argument to support the optional AUTH
parameter in SMTPs MAIL FROM command.
2012-02-16 13:19:47 +01:00
Colin Hogben 2b26eb9857 configure: add option disable --libcurl output 2012-02-13 22:36:10 +01:00
Alessandro Ghedini e71ac0c6fa curl tool: allow negative numbers as option values
Fix the str2num() function to not check if the input string starts with a
digit, since strtol() supports numbers prepended with '-' (and '+') too.
This makes the --max-redirs option work as documented.
2012-02-13 19:58:23 +01:00
Kamil Dudka ebf3138992 nss: add support for the CURLSSLOPT_ALLOW_BEAST option
... and fix some typos from the 62d15f1 commit.
2012-02-09 23:25:55 +01:00
Daniel Stenberg 62d15f159e --ssl-allow-beast added
This new option tells curl to not work around a security flaw in the
SSL3 and TLS1.0 protocols. It uses the new libcurl option
CURLOPT_SSL_OPTIONS with the CURLSSLOPT_ALLOW_BEAST bit set.
2012-02-09 22:28:58 +01:00
Dave Reisner 2a266c1c7c curl: use new library-side TCP_KEEPALIVE options
Use the new library CURLOPT_TCP_KEEPALIVE rather than disabling this via
the sockopt callback. If --keepalive-time is used, apply the value to
CURLOPT_TCP_KEEPIDLE and CURLOPT_TCP_KEEPINTVL.
2012-02-09 19:05:40 +01:00
Yang Tse 4405039fdc curl tool: allow glob-loops to abort again upon critical errors
This prevents clobbering of non recoverable error return codes while
retaining intended functionality of commit 65103efe
2012-02-07 22:10:01 +01:00
Daniel Stenberg 65103efe49 curl tool: don't abort glob-loop due to failures
We want to continue to the next URL to try even on failures returned
from libcurl. This makes -f with ranges still get subsequent URLs even
if occasional ones return error. This was a regression as it used to
work and broke in the 7.23.0 release.

Added test case 1328 to verify the fix.

Bug: http://curl.haxx.se/bug/view.cgi?id=3481223
Reported by: Juan Barreto
2012-02-06 16:52:17 +01:00
Colin Hogben 51c485342b Remove bogus optimisation of telnet upload.
Remove wrongly implemented optimisation of telnet upload, apparently
intended to allow the library to avoid manually polling for input.
2012-01-18 22:17:46 +01:00
Yang Tse 3a55daee3d tool_formparse.c: fix compiler warning: enumerated type mixed with another type 2012-01-04 19:11:55 +01:00
Yang Tse ed0364343d removed trailing whitespace 2011-12-30 03:36:18 +01:00
Daniel Stenberg b0eb963bc7 operate: removed a single trailing space 2011-12-21 21:17:34 +01:00
Dan Fandrich 2cf9e78a22 --retry: Retry transfers on timeout and DNS errors 2011-12-21 11:09:09 -08:00
Daniel Stenberg 7b8590d1f5 curl -F: fix multiple file upload with custom type
Test case 1315 was added to verify this functionality. When passing in
multiple files to a single -F, the parser would get all confused if one
of the specified files had a custom type= assigned.

Reported by: Colin Hogben
2011-12-16 11:43:25 +01:00
Yang Tse 97d7a9260e tvdiff_secs(): sub-zero time difference adjustment
Skip a floating point addition operation when integral part of time difference
is zero. This avoids potential floating point addition rounding problems while
preserving decimal part value.
2011-11-25 13:51:55 +01:00
Daniel Stenberg c532604b13 -J -O: use -O name if no Content-Disposition header comes!
A regression between 7.22.0 and 7.23.0 -- downloading a file with the
flags -O and -J results in the content being written to stdout if and
only if there was no Content-Disposition header in the http response. If
there is a C-D header with a filename attribute, the output is correctly
written.

Reported by: Dave Reisner
Bug: http://curl.haxx.se/mail/archive-2011-11/0030.html
2011-11-20 23:35:49 +01:00
Daniel Stenberg b9660dc4b2 FindWin32CACert: return OK even if CA cert isn't found
Bug: http://curl.haxx.se/mail/lib-2011-11/0180.html
Reported by: Mark Brand
2011-11-17 18:05:27 +01:00
Daniel Stenberg 10120e6ab5 progress_cb: avoid buffer overflow
The progress bar output function would blindly use the terminal width
without bounds checking. When using a very wide terminal that caused a
buffer overflow and segfault.

We now limit the max bar with to 255 columns, and I simplified the code
to avoid an extra snprintf and buffer.

Bug: http://curl.haxx.se/bug/view.cgi?id=3435710
Reported by: Alexey Zakhlestin
2011-11-11 19:57:49 +01:00
Yang Tse 5b57c54416 tool_cb_wrt.c: disambiguate warning message 2011-11-03 23:26:38 +01:00
Yang Tse 7fe9a50ab5 tool_cfgable.c: pending check done 2011-11-03 23:21:01 +01:00
Yang Tse 9cfc0c73a7 tool_cb_see.h: fix compiler warning 2011-11-01 12:53:23 +01:00
Yang Tse 49e3b2e03a setup.h: fix compiler warning 2011-10-31 22:42:43 +01:00
Daniel Stenberg 515f11e79b large headers: have curl accept >16K headers
As commit 5850cc4808 clarifies, libcurl can deliver header lines that
are longer than CURL_MAX_WRITE_SIZE, only body data is limited to that
size. The curl tool has check (when built debug-enabled) that made the
wrong checks and this new test 1205 verifies that larger headers work.
2011-10-24 17:28:41 +02:00
Yang Tse cc76bbe79b tool_operate.c: OOM handling fix
Move curl_easy_perform source code geneartion out of curl_easy_perform's loop
for proper OOM handling and source code geneartion.
2011-10-22 14:49:02 +02:00
Daniel Stenberg b229c8ca8b --show-error: position indepdenent
Previously we required that -S/--show-error was used _after_
-s/--silent. This was slightly confusing since we strive to make
arguments as position independent as possible.

Now, you can use them in any order and the result should still be the
same.

Bug: http://curl.haxx.se/bug/view.cgi?id=3424286
Reported by: Andreas Olsson
2011-10-16 23:39:59 +02:00
Yang Tse 17f48fe879 libcurl: some OOM handling fixes 2011-10-07 20:50:57 +02:00
Yang Tse f7bfdbabf2 curl tool: reviewed code moved to tool_*.[ch] files 2011-10-06 17:39:00 +02:00
Yang Tse 4a57bf6d10 curl tool: fix compiler warning 2011-10-05 22:27:29 +02:00
Yang Tse 7296b2aa25 curl tool: OOM handling fixes 2011-10-05 22:01:42 +02:00
Yang Tse 6c849321d7 curl tool: reviewed code moved to tool_*.[ch] files 2011-10-05 20:16:16 +02:00
Yang Tse 0f19e0145a curl tool: OOM handling fixes 2011-10-05 19:33:46 +02:00
Yang Tse ec73fd89ed curl tool: OOM handling fixes 2011-10-05 16:41:04 +02:00
Yang Tse 5bf0d74120 curl tool: OOM handling fixes 2011-10-05 15:06:26 +02:00
Yang Tse fd87d9d2b9 curl tool: header inclusion adjustment 2011-10-05 12:40:30 +02:00