Marcel Raad [Wed, 31 May 2017 17:05:50 +0000 (19:05 +0200)]
lib583: fix compiler warning
Use CURLMcode for variable 'res' and cast to int where necessary
instead of the other way around. Other tests do the same.
This fixes the following clang warning:
lib583.c:68:15: warning: cast from function call of type 'CURLMcode' to
non-matching type 'int' [-Wbad-function-cast]
Daniel Stenberg [Mon, 29 May 2017 22:45:54 +0000 (00:45 +0200)]
transfer: init the infilesize from the postfields...
... with a strlen() if no size was set, and do this in the pretransfer
function so that the info is set early. Otherwise, the default strlen()
done on the POSTFIELDS data never sets state.infilesize.
Akhil Kedia [Mon, 22 May 2017 08:34:45 +0000 (17:34 +0900)]
cmake: fix build on Ubuntu 14.04
Fixed a syntax error with setting cache variables (The type and
docstring were missing), resulting in build errors. Quoted the
CURL_CA_PATH and CURL_CA_BUNDLE otherwise the path was written without
quotes in C code, resulting in build errors.
Kamil Dudka [Mon, 22 May 2017 17:00:15 +0000 (19:00 +0200)]
memdebug: fix compilation failure
.... caused by a typo in the last commit (fixing issue #1504):
memdebug.c: In function ‘curl_fclose’:
memdebug.c:444:3: error: implicit declaration of function
‘DEBUGDEBUGASSERT’ [-Werror=implicit-function-declaration]
Daniel Stenberg [Sun, 14 May 2017 15:09:45 +0000 (17:09 +0200)]
curl: show the libcurl release date in --version output
... and support and additional "security patched" date for those who
enhance older versions that way. Pass on the define CURL_PATCHSTAMP with
a date for that.
Building with non-release headers shows the date as [unreleased].
Also: this changes the date format generated in the curlver.h file to be
"YYYY-MM-DD" (no name of the day or month, no time, no time zone) to
make it easier on the eye and easier to parse. Example (new) date
string: 2017-05-09
Dan Fandrich [Sat, 13 May 2017 20:54:59 +0000 (22:54 +0200)]
url.c: add a compile-time check that CURL_MAX_WRITE_SIZE is large enough
Some code (e.g. Curl_fillreadbuffer) assumes that this buffer is not
exceedingly tiny and will break if it is. This same check is already
done at run time in the CURLOPT_BUFFERSIZE option.
Dan Fandrich [Sat, 13 May 2017 17:04:10 +0000 (19:04 +0200)]
tests: made a couple of prechecks consistent with others
Also removed a TODO suggesting caching the precheck results. Tests
showed this would save about 0.1 sec on the total test run time on a
relatively modern system, an unnoticeable gain at the cost of longer and
more complicated code. There would also be a danger that a cached test
result would be inappropriately returned, such as when other test
dependencies (like environment variables) are different or when the
precheck causes side effects (like filesystem changes).
Daniel Stenberg [Fri, 12 May 2017 14:29:06 +0000 (16:29 +0200)]
pipeline: fix mistakenly trying to pipeline POSTs
The function IsPipeliningPossible() would return TRUE if either
pipelining OR HTTP/2 were possible on a connection, which would lead to
it returning TRUE even for POSTs on HTTP/1 connections.
It now returns a bitmask so that the caller can differentiate which kind
the connection allows.
Fixes #1481
Closes #1483 Reported-by: stootill at github
Richard Hsu [Tue, 9 May 2017 21:30:15 +0000 (14:30 -0700)]
tests: remove superfluous test 1399
@MarcelRaad noted that `test1399` causes infinite loop on MinGW.
Looking into this, seems like it is related to how Windows handles
CRLF. See https://github.com/curl/curl/commit/9e093f by @mback2k.
Removing `test1399` as it's identical to `test1326` then with such a
fix.
Dan Fandrich [Tue, 9 May 2017 17:49:17 +0000 (19:49 +0200)]
tests: make test file names more unique
Include the test number in the names of files written out by tests to
reduce the chance of accidental duplication and to make it more clear
which test is associated with which file.
Jay Satiro [Mon, 8 May 2017 21:23:28 +0000 (23:23 +0200)]
rand: treat fake entropy the same regardless of endianness
When the random seed is purposely made predictable for testing purposes
by using the CURL_ENTROPY environment variable, process that data in an
endian agnostic way so the the initial random seed is the same
regardless of endianness.
- Change Curl_rand to write to a char array instead of int array.
- Add Curl_rand_hex to write random hex characters to a buffer.
Fixes #1315
Closes #1468
Co-authored-by: Daniel Stenberg Reported-by: Michael Kaufmann
Marcel Raad [Mon, 8 May 2017 17:59:46 +0000 (19:59 +0200)]
libtest: fix MinGW-w64 warnings
long is 32 bits while size_t is 64 bits on MinGW-w64, so
typecheck-gcc.h complains when using size_t for a long option.
Also, curl_socket_t is unsigned long long rather than int.
Daniel Stenberg [Wed, 3 May 2017 12:28:40 +0000 (14:28 +0200)]
curl: remove tool_writeenv.[ch]
... and USE_ENVIRONMENT and --environment. It was once added for RISC OS
support and its platform specific behavior has been annoying ever
since. Added in commit c3c8bbd3b2688da8e, mostly unchanged since
then. Most probably not actually used for years.