1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00
Commit Graph

1479 Commits

Author SHA1 Message Date
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
Yang Tse
0572ad6d01 curl tool: symbol check adjustment 2011-10-05 02:58:18 +02:00
Yang Tse
aa7d5b946a curl tool: header inclusion adjustment 2011-10-05 01:19:58 +02:00
Yang Tse
49b79b7631 curl tool: code moved to tool_*.[ch] files 2011-10-05 00:03:58 +02:00
Yang Tse
0435800f65 curl tool: reviewed code moved to tool_*.[ch] files 2011-10-03 23:00:47 +02:00
Yang Tse
7be872c389 curl tool: fix some more OOM handling 2011-09-30 21:10:58 +02:00
Yang Tse
ff5ba6e43d curl tool: adjust header callback single call write limit warning
Maximum amount of data a header callback is supposed to get in
a single call from libcurl is limited by the lowest value of
CURL_MAX_WRITE_SIZE and CURL_MAX_HTTP_HEADER.
2011-09-28 19:04:38 +02:00
Guenter Knauf
b4fccc1d8e Added SPNEGO to NetWare build. 2011-09-27 16:02:07 +02:00
Yang Tse
e2be8ceed9 curl tool: fix a compiler warning 2011-09-26 21:19:41 +02:00
Yang Tse
d439830621 curl tool: fix some OOM handling - f4853db5 follow-up 2011-09-26 13:44:24 +02:00
Yang Tse
f4853db5e6 curl tool: fix some OOM handling 2011-09-26 13:07:34 +02:00
Yang Tse
d9f686db88 remove short-lived CURL_WRITEFUNC_OUT_OF_MEMORY 2011-09-26 13:05:42 +02:00
Yang Tse
119f43360b allow write callbacks to indicate OOM to libcurl
Allow (*curl_write_callback) write callbacks to return
CURL_WRITEFUNC_OUT_OF_MEMORY to properly indicate libcurl of OOM conditions
inside the callback itself.
2011-09-25 19:05:46 +02:00
Guenter Knauf
230459dd00 NetWare makefile tweaks to select different builds. 2011-09-25 16:29:08 +02:00
Daniel Stenberg
745014b726 POST: always set postfieldsize
When we use binary posts and regular ones intermixed on a single command
line, we cannot do strlen() etc on the data to figure out the length
(when inserting '&' and more). We must therefore keep track of the post
data length. Then we also end up setting the libcurl option with the
known size, so that we don't risk that libcurl will do strlen() on the
data.

This has the minor side-effect that --libcurl source codes now always
will use CURLOPT_POSTFIELDSIZE but I don't consider that terribly
damaging.

Bug: http://curl.haxx.se/bug/view.cgi?id=3413181
Reported by: Taneli Vhkangas
2011-09-25 00:02:58 +02:00
Yang Tse
b3ea4881a8 curl tool: fix a compiler warning 2011-09-24 18:33:59 +02:00
Yang Tse
c6702c7d3f curl tool: reviewed code moved to tool_*.[ch] files 2011-09-24 17:40:46 +02:00
Yang Tse
081e289315 curl tool: fix some OOM handling issues 2011-09-24 05:33:41 +02:00
Yang Tse
fa775b56de curl tool: fix some OOM handling issues 2011-09-22 21:21:21 +02:00
Yang Tse
fb3845a438 curl tool: reviewed code moved to tool_*.[ch] files
my_setopt and my_setopt_str no longer ignores curl_easy_setopt result.

Fixed some OOM handling issues.
2011-09-22 21:21:20 +02:00
Yang Tse
28526ed6e0 curl tool: make my_setopt ignore curl_easy_setopt result again.
Related code not ready yet for this kind of checks.
2011-09-21 04:30:08 +02:00
Guenter Knauf
e4172d934d Changed suffix rules to pattern rules.
Suffix rules cannot have any prerequisites of their own.
2011-09-21 03:25:19 +02:00
Guenter Knauf
a6b69b64ad Some more MinGW build tweaks.
Added envvars to specify OpenSSL include, libpath and lib.
Added rule to create curlbuild.h from curlbuild.h.dist.
2011-09-21 02:06:05 +02:00
Yang Tse
9ecf53e154 curl tool: reviewed code moved to tool_*.[ch] files
my_setopt and my_setopt_str no longer ignores curl_easy_setopt result.

Fixed some OOM handling issues.
2011-09-21 01:54:14 +02:00
Yang Tse
84221006c9 curl tool: reviewed code moved to tool_*.[ch] files
Overhauled FindWin32CACert()
2011-09-20 15:59:19 +02:00
Guenter Knauf
a6c168b893 A bunch of MinGW build tweaks.
All paths to dependencies now quoted; synced examples makefile.
2011-09-20 15:05:28 +02:00
Guenter Knauf
98a61d8e2e Added _WIN32_WINNT define for IPv6 builds. 2011-09-20 11:59:49 +02:00
Yang Tse
49c35a7f9f curl tool: truly fix compiler warning 2011-09-19 20:27:25 +02:00
Yang Tse
57119495da curl tool: fix compiler warning 2011-09-19 19:45:58 +02:00
Yang Tse
fdecb56cbf curl tool: reviewed code moved to tool_*.[ch] files 2011-09-19 18:18:17 +02:00
Yang Tse
260b0f4d0c curl tool: create tool_myfunc.[ch] which later on will hold my_* functions
Additionally function my_useragent() now provides default User-Agent string
2011-09-18 01:59:25 +02:00
Yang Tse
f50d4647d0 curl tool: reorder free_config_fields() field handling
Reorder handling of fields to match same order as the one given by current
definition order of 'Configurable' struct fields. Fields currently not handled
marked for further inspection.
2011-09-18 01:59:21 +02:00
Guenter Knauf
805b4740c7 Fixed MinGW WinIDN lib dependency. 2011-09-17 17:59:35 +02:00
Yang Tse
a75888f1d3 tool_convert.c: fix no newline at end of file 2011-09-17 03:28:57 +02:00
Yang Tse
c0159d0edc curl tool: move 'Configurable' and free_config_fields() to tool_cfgable.[ch]
Reviewing fields being free'd in free_config_fields() still pending
2011-09-16 21:44:45 +02:00
Yang Tse
93579cc363 src/setup.h: add conditional include of assert.h 2011-09-16 21:12:32 +02:00
Yang Tse
4322d512ea curl tool: move so called 'multi_files' stuff into tool_mfiles.[ch]
Additionally some code reorganization and direct OOM handling fixes,
just another step towards fixing curl tool issues uncovered 2011-09-15
2011-09-16 19:46:01 +02:00