]> granicus.if.org Git - curl/log
curl
7 years agomulti: clarify condition in curl_multi_wait
Alan Jenkins [Sat, 22 Apr 2017 20:16:44 +0000 (21:16 +0100)]
multi: clarify condition in curl_multi_wait

`if(nfds || extra_nfds) {` is followed by `malloc(nfds * ...)`.

If `extra_fs` could be non-zero when `nfds` was zero, then we have
`malloc(0)` which is allowed to return `NULL`. But, malloc returning
NULL can be confusing. In this code, the next line would treat the NULL
as an allocation failure.

It turns out, if `nfds` is zero then `extra_nfds` must also be zero.
The final value of `nfds` includes `extra_nfds`.  So the test for
`extra_nfds` is redundant.  It can only confuse the reader.

Closes #1439

7 years agolib: fix maybe-uninitialized warnings
Marcel Raad [Sat, 22 Apr 2017 20:12:37 +0000 (22:12 +0200)]
lib: fix maybe-uninitialized warnings

With -Og, GCC complains:

easy.c:628:7: error: ‘mcode’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

../lib/strcase.h:35:29: error: ‘tok_buf’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
vauth/digest.c:208:9: note: ‘tok_buf’ was declared here

../lib/strcase.h:35:29: error: ‘tok_buf’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
vauth/digest.c:566:15: note: ‘tok_buf’ was declared here

Fix this by initializing the variables.

7 years agognutls: removed some code when --disable-verbose is configured
Dan Fandrich [Sat, 22 Apr 2017 10:07:13 +0000 (12:07 +0200)]
gnutls: removed some code when --disable-verbose is configured

This reduces the binary size and fixes a compile warning.

7 years agollist: no longer uses malloc
Daniel Stenberg [Thu, 20 Apr 2017 13:10:04 +0000 (15:10 +0200)]
llist: no longer uses malloc

The 'list element' struct now has to be within the data that is being
added to the list. Removes 16.6% (tiny) mallocs from a simple HTTP
transfer. (96 => 80)

Also removed return codes since the llist functions can't fail now.

Test 1300 updated accordingly.

Closes #1435

7 years agotypecheck-gcc: handle function pointers properly
Marcel Raad [Mon, 10 Apr 2017 13:24:44 +0000 (15:24 +0200)]
typecheck-gcc: handle function pointers properly

All the callbacks passed to curl_easy_setopt are defined as function
pointers. The possibility to pass both functions and function pointers
was handled for the callbacks that typecheck-gcc.h defined as
compatible, but not for the public callback types themselves.

This makes all compatible callback types defined in typecheck-gcc.h
function pointers too and checks all functions uniformly with
_curl_callback_compatible, which handles both functions and function
pointers.

A symptom of the problem was a warning in tool_operate.c with
--disable-libcurl-option and without --enable-debug as that file
passes the callback functions to curl_easy_setopt directly.

Fixes https://github.com/curl/curl/issues/1403
Closes https://github.com/curl/curl/pull/1404

7 years agombedtls: enable NTLM (& SMB) even if MD4 support is unavailable
Dan Fandrich [Fri, 21 Apr 2017 20:33:17 +0000 (22:33 +0200)]
mbedtls: enable NTLM (& SMB) even if MD4 support is unavailable

In that case, use libcurl's internal MD4 routine. This fixes tests 1013
and 1014 which were failing due to configure assuming NTLM and SMB were
always available whenever mbed TLS was in use (which is now true).

7 years agotests: remove the html and PDF versions from the tarball
Daniel Stenberg [Fri, 21 Apr 2017 14:26:53 +0000 (16:26 +0200)]
tests: remove the html and PDF versions from the tarball

7 years agoopenssl: fix memory leak in servercert
Daniel Stenberg [Thu, 20 Apr 2017 13:46:03 +0000 (15:46 +0200)]
openssl: fix memory leak in servercert

... when failing to get the server certificate.

7 years agoRevert "src/Makefile.am: avoid explicit $<"
Daniel Stenberg [Thu, 20 Apr 2017 07:16:12 +0000 (09:16 +0200)]
Revert "src/Makefile.am: avoid explicit $<"

This reverts commit 5b4cbcf11d5100ff793a8e9edbaa6fe1fc7495f5.

Since it broke out-of-tree builds from tarballs. See discussion in #1432

7 years agobump: start working on next release
Daniel Stenberg [Wed, 19 Apr 2017 21:16:10 +0000 (23:16 +0200)]
bump: start working on next release

7 years agosrc/Makefile.am: avoid explicit $<
Daniel Stenberg [Wed, 19 Apr 2017 21:11:44 +0000 (23:11 +0200)]
src/Makefile.am: avoid explicit $<

... since apparently "BSD make" doesn't support it.

Reported-by: Thomas Klausner
Fixes #1432

7 years agoTHANKS: add contributors from 7.54.0 release notes curl-7_54_0
Daniel Stenberg [Tue, 18 Apr 2017 07:16:56 +0000 (09:16 +0200)]
THANKS: add contributors from 7.54.0 release notes

7 years agoRELEASE-NOTES: curl 7.54.0
Daniel Stenberg [Tue, 18 Apr 2017 06:41:23 +0000 (08:41 +0200)]
RELEASE-NOTES: curl 7.54.0

7 years agonss: fix MinGW compiler warnings
Marcel Raad [Thu, 6 Apr 2017 17:52:39 +0000 (19:52 +0200)]
nss: fix MinGW compiler warnings

This fixes 3 warnings issued by MinGW:
1. PR_ImportTCPSocket actually has a paramter of type PROsfd instead of
PRInt32, which is 64 bits on Windows. Fixed this by including the
corresponding header file instead of redeclaring the function, which is
supported even though it is in the private include folder. [1]
2. In 64-bit mode, size_t is 64 bits while CK_ULONG is 32 bits, so an explicit
narrowing cast is needed.
3. Curl_timeleft returns time_t instead of long since commit
21aa32d30dbf319f2d336e0cb68d3a3235869fbb.

[1] https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_ImportTCPSocket

Closes https://github.com/curl/curl/pull/1393

7 years agoTLS: Fix switching off SSL session id when client cert is used
Jay Satiro [Wed, 22 Mar 2017 05:59:49 +0000 (01:59 -0400)]
TLS: Fix switching off SSL session id when client cert is used

Move the sessionid flag to ssl_primary_config so that ssl and proxy_ssl
will each have their own sessionid flag.

Regression since HTTPS-Proxy support was added in cb4e2be. Prior to that
this issue had been fixed in 247d890, CVE-2016-5419.

Bug: https://github.com/curl/curl/issues/1341
Reported-by: lijian996@users.noreply.github.com
The new incarnation of this bug is called CVE-2017-7468 and is documented
here: https://curl.haxx.se/docs/adv_20170419.html

7 years agoopenssl: don't try to print nonexistant peer private keys
David Benjamin [Mon, 17 Apr 2017 14:20:26 +0000 (10:20 -0400)]
openssl: don't try to print nonexistant peer private keys

X.509 certificates carry public keys, not private keys. Fields
corresponding to the private half of the key will always be NULL.

Closes #1425

7 years agoopenssl: fix thread-safety bugs in error-handling
David Benjamin [Mon, 17 Apr 2017 14:01:40 +0000 (10:01 -0400)]
openssl: fix thread-safety bugs in error-handling

ERR_error_string with NULL parameter is not thread-safe. The library
writes the string into some static buffer. Two threads doing this at
once may clobber each other and run into problems. Switch to
ERR_error_string_n which avoids this problem and is explicitly
bounds-checked.

Also clean up some remnants of OpenSSL 0.9.5 around here. A number of
comments (fixed buffer size, explaining that ERR_error_string_n was
added in a particular version) date to when ossl_strerror tried to
support pre-ERR_error_string_n OpenSSLs.

Closes #1424

7 years agoopenssl: make SSL_ERROR_to_str more future-proof
David Benjamin [Mon, 17 Apr 2017 13:42:03 +0000 (09:42 -0400)]
openssl: make SSL_ERROR_to_str more future-proof

Rather than making assumptions about the values, use a switch-case.

Closes #1424

7 years agocode: fix typos and style in comments
Daniel Gustafsson [Mon, 17 Apr 2017 09:04:48 +0000 (11:04 +0200)]
code: fix typos and style in comments

A few random typos, and minor whitespace cleanups, found in comments
while reading code.

Closes #1423

7 years agoextern-scan.pl: strip trailing CR
Marcel Raad [Sun, 16 Apr 2017 12:58:08 +0000 (14:58 +0200)]
extern-scan.pl: strip trailing CR

This makes test 1135 pass with CRLF checkouts.

Ref: https://github.com/curl/curl/pull/1344#issuecomment-289243166
Closes https://github.com/curl/curl/pull/1422

7 years agoconfigure.ac: ignore CR after version numbers
Marcel Raad [Sat, 15 Apr 2017 06:32:23 +0000 (08:32 +0200)]
configure.ac: ignore CR after version numbers

Ignore everything after the version numbers in LIBCURL_VERSION and
LIBCURL_VERSION_NUM to ged rid of the extra CR character.
This makes tests 1022 and 1023 pass on Linux with a CRLF checkout.

Ref: https://github.com/curl/curl/pull/1344#issuecomment-289243166
Closes https://github.com/curl/curl/pull/1422

7 years ago.gitattributes: force shell scripts to LF
Marcel Raad [Fri, 14 Apr 2017 22:10:27 +0000 (00:10 +0200)]
.gitattributes: force shell scripts to LF

Bash on Linux errors out on CR characters.
This makes tests 1221 and 1222 pass on Linux with a CRLF checkout.

Ref: https://github.com/curl/curl/pull/1344#issuecomment-289243166
Closes https://github.com/curl/curl/pull/1422

7 years agounit1303: fix compiler warning
Marcel Raad [Sun, 16 Apr 2017 11:54:21 +0000 (13:54 +0200)]
unit1303: fix compiler warning

MinGW-w64 complains:
warning: conversion to 'long int' from 'time_t {aka long long int}' may
alter its value [-Wconversion]
Fix this by using the correct type.

7 years agoRELEASE-NOTES: synced with 1451271e0
Daniel Stenberg [Sun, 16 Apr 2017 08:37:18 +0000 (10:37 +0200)]
RELEASE-NOTES: synced with 1451271e0

7 years agohttp2: fix handle leak in error path
Larry Stefani [Thu, 13 Apr 2017 14:06:14 +0000 (10:06 -0400)]
http2: fix handle leak in error path

Add missing newhandle free call in push_promise().

Closes #1416

7 years agombedtls: fix memory leak in error path
Larry Stefani [Thu, 13 Apr 2017 14:10:42 +0000 (10:10 -0400)]
mbedtls: fix memory leak in error path

Add missing our_ssl_sessionid free call in mbed_connect_step3().

Closes #1417

7 years agocurl-compilers.m4: turn implicit function declarations into errors
Marcel Raad [Fri, 14 Apr 2017 10:48:27 +0000 (12:48 +0200)]
curl-compilers.m4: turn implicit function declarations into errors

This adds -Werror-implicit-function-declaration for GCC 2.95+ so that
these errors are visible at the point where they occur instead of only
at link time.
Implicit function declarations are illegal in C99 and C++ anyway, and
the same warning has been turned into an error for ICC in commit
3072c5b8a127057aa922b7c51051bbb4a630b091.

Ref: https://gcc.gnu.org/onlinedocs/gcc-2.95.2/gcc_2.html#SEC8
Ref: https://curl.haxx.se/mail/lib-2017-04/0001.html
Closes https://github.com/curl/curl/pull/1419

7 years agotest1541: also test for CURL_PULL_WS2TCPIP_H
Marcel Raad [Wed, 12 Apr 2017 06:32:24 +0000 (08:32 +0200)]
test1541: also test for CURL_PULL_WS2TCPIP_H

Ref: https://github.com/curl/curl/issues/1408
Closes https://github.com/curl/curl/pull/1412

7 years agotests/server/util: prefer <poll.h> over <sys/poll.h>
Marcel Raad [Wed, 12 Apr 2017 06:45:54 +0000 (08:45 +0200)]
tests/server/util: prefer <poll.h> over <sys/poll.h>

Follow-up to aa573c3c55cda72ec5ef677d87f6f46a53385f0c

Ref: https://github.com/curl/curl/pull/1406

7 years agoCurl_expire_latest: ignore already expired timers
Daniel Stenberg [Mon, 10 Apr 2017 21:53:33 +0000 (23:53 +0200)]
Curl_expire_latest: ignore already expired timers

If the existing timer is still in there but has expired, the new timer
should be added.

Reported-by: Rainer Canavan
Bug: https://curl.haxx.se/mail/lib-2017-04/0030.html
Closes #1407

7 years agosystem.h: fix mingw section
Daniel Stenberg [Tue, 11 Apr 2017 11:45:56 +0000 (13:45 +0200)]
system.h: fix mingw section

Reported-by: Marcel Raad
Fixes #1408
Closes #1409

7 years agopolarssl: unbreak build with versions < 1.3.8
Marcel Raad [Tue, 11 Apr 2017 10:55:23 +0000 (12:55 +0200)]
polarssl: unbreak build with versions < 1.3.8

ssl_session_init was only introduced in version 1.3.8, the penultimate
version. The function only contains a memset, so replace it with that.

Suggested-by: Jay Satiro
Fixes https://github.com/curl/curl/issues/1401

7 years agopoll: prefer <poll.h> over <sys/poll.h>
Marcel Raad [Mon, 10 Apr 2017 19:59:42 +0000 (21:59 +0200)]
poll: prefer <poll.h> over <sys/poll.h>

The POSIX standard location is <poll.h>. Using <sys/poll.h> results in
warning spam when using the musl standard library.

Closes https://github.com/curl/curl/pull/1406

7 years agoopenssl: fix this statement may fall through [-Wimplicit-fallthrough=]
Alexis La Goutte [Mon, 10 Apr 2017 10:59:30 +0000 (12:59 +0200)]
openssl: fix this statement may fall through [-Wimplicit-fallthrough=]

Closes #1402

7 years agonss: load CA certificates even with --insecure
Kamil Dudka [Mon, 6 Mar 2017 15:20:33 +0000 (16:20 +0100)]
nss: load CA certificates even with --insecure

... because they may include an intermediate certificate for a client
certificate and the intermediate certificate needs to be presented to
the server, no matter if we verify the peer or not.

Reported-by: thraidh
Closes #851

7 years agoRELEASE-NOTES: synced with f9d1e9a27f7e1
Daniel Stenberg [Mon, 10 Apr 2017 08:24:12 +0000 (10:24 +0200)]
RELEASE-NOTES: synced with f9d1e9a27f7e1

7 years agolibcurl-thread.3: fixed a bad macro that caused test 1140 to fail
Dan Fandrich [Mon, 10 Apr 2017 05:42:22 +0000 (07:42 +0200)]
libcurl-thread.3: fixed a bad macro that caused test 1140 to fail

7 years agolibcurl-thread.3: also mention threaded-resolver
Daniel Stenberg [Sun, 9 Apr 2017 21:09:50 +0000 (23:09 +0200)]
libcurl-thread.3: also mention threaded-resolver

Reported-by: Alex Bligh
Bug: https://curl.haxx.se/mail/lib-2017-04/0044.html

7 years ago.github/stale.yml: enable the stale bot
Daniel Stenberg [Fri, 7 Apr 2017 09:43:06 +0000 (11:43 +0200)]
.github/stale.yml: enable the stale bot

Issues and PRs with no activity for 180 days will get marked as stale,
and if no further activity happens within 14 more days, the issue gets
closed.

This follows our established policy of not letting stalled bugs "get in
the way": https://curl.haxx.se/docs/bugs.html#Closing_off_stalled_bugs

Closes #1398

7 years agoCURLINFO_SCHEME.3: fix variable type
Jay Satiro [Sat, 8 Apr 2017 19:44:39 +0000 (15:44 -0400)]
CURLINFO_SCHEME.3: fix variable type

- Change documented param type to char ** from incorrect long *.

7 years agoINSTALL.md: fix secure transport configure arguments
Marcel Raad [Sat, 8 Apr 2017 12:44:18 +0000 (14:44 +0200)]
INSTALL.md: fix secure transport configure arguments

--without-ssl is needed instead of --with-winssl.

7 years agovtls: fix unreferenced variable warnings
Marcel Raad [Sat, 8 Apr 2017 11:40:41 +0000 (13:40 +0200)]
vtls: fix unreferenced variable warnings

... by moving the variables into the correct #ifdef block.

7 years agoBUGS: "Bugs in old versions"
Daniel Stenberg [Fri, 7 Apr 2017 11:33:08 +0000 (13:33 +0200)]
BUGS: "Bugs in old versions"

7 years agosystem.h: add section for tcc
Daniel Stenberg [Fri, 7 Apr 2017 06:22:09 +0000 (08:22 +0200)]
system.h: add section for tcc

Closes #1397

7 years agoschannel: fix compiler warnings
Marcel Raad [Thu, 6 Apr 2017 18:04:58 +0000 (20:04 +0200)]
schannel: fix compiler warnings

When UNICODE is not defined, the Curl_convert_UTF8_to_tchar macro maps
directly to its argument. As it is declared as a pointer to const and
InitializeSecurityContext expects a pointer to non-const, both MSVC and MinGW
issue a warning about implicitly casting away the const. Fix this by declaring
the variables as pointers to non-const.

Closes https://github.com/curl/curl/pull/1394

7 years agosspi: print out InitializeSecurityContext() error message
Isaac Boukris [Thu, 6 Apr 2017 19:31:45 +0000 (22:31 +0300)]
sspi: print out InitializeSecurityContext() error message

Reported-by: Carsten (talksinmath)
Fixes #1384
Closes #1395

7 years agogtls: fix compiler warning
Marcel Raad [Thu, 6 Apr 2017 17:34:44 +0000 (19:34 +0200)]
gtls: fix compiler warning

Curl_timeleft returns time_t instead of long since commit
21aa32d30dbf319f2d336e0cb68d3a3235869fbb.

7 years agotest1606: verify speedcheck
Daniel Stenberg [Thu, 6 Apr 2017 13:34:46 +0000 (15:34 +0200)]
test1606: verify speedcheck

7 years agolow_speed_limit: improved function for longer time periods
Daniel Stenberg [Tue, 4 Apr 2017 22:42:34 +0000 (00:42 +0200)]
low_speed_limit: improved function for longer time periods

Previously, periods of fast speed between periods of slow speed would
not count and could still erroneously trigger a timeout.

Reported-by: Paul Harris
Fixes #1345
Closes #1390

7 years agosystem.h: set sizeof long to 4 on "default 32 bit" systems
Daniel Stenberg [Thu, 6 Apr 2017 15:31:48 +0000 (17:31 +0200)]
system.h: set sizeof long to 4 on "default 32 bit" systems

Triggered a test failure on test 1541 for the build known as
"Linux 4.4 i686 tcc 0.9.26 glibc 2.20"

7 years agonss: fix build after e60fe20fdf94e829ba5fce33f7a9d6c281149f7d
Marcel Raad [Wed, 5 Apr 2017 21:25:28 +0000 (23:25 +0200)]
nss: fix build after e60fe20fdf94e829ba5fce33f7a9d6c281149f7d

Curl_llist_alloc is now Curl_llist_init.

Closes https://github.com/curl/curl/pull/1391

7 years agoINSTALL.cmake: more problems
Daniel Stenberg [Thu, 6 Apr 2017 06:04:12 +0000 (08:04 +0200)]
INSTALL.cmake: more problems

and mention specific issues where they are discussed

7 years agotest1541: ignore the curl_off_t variable type name comparison
Daniel Stenberg [Wed, 5 Apr 2017 13:12:55 +0000 (15:12 +0200)]
test1541: ignore the curl_off_t variable type name comparison

... the sizes and the formatting strings are what's really important and
avoids problems with int64_t vs "long long".

Bug: https://curl.haxx.se/mail/lib-2017-04/0019.html

7 years agoRevert "configure: prefer 'long long' to int64_t for curl_off_t"
Daniel Stenberg [Wed, 5 Apr 2017 13:08:33 +0000 (15:08 +0200)]
Revert "configure: prefer 'long long' to int64_t for curl_off_t"

This reverts commit 81284374bf3c670d2050f8562edeb69f060b07cc.

Due to mingw32 brekage.

7 years agotool_operate: fix MinGW compiler warning
Marcel Raad [Sat, 1 Apr 2017 09:50:39 +0000 (11:50 +0200)]
tool_operate: fix MinGW compiler warning

MinGW complains:
tool_operate.c:197:15: error: comparison is always true due to limited range
of data type [-Werror=type-limits]

Fix this by only doing the comparison if 'long' is large enough to hold the
constant it is compared with.

Closes https://github.com/curl/curl/pull/1378

7 years agotool_operate: move filetime code to its own function
Marcel Raad [Sat, 1 Apr 2017 09:22:53 +0000 (11:22 +0200)]
tool_operate: move filetime code to its own function

Ref: https://github.com/curl/curl/pull/1378

7 years agoconfigure: prefer 'long long' to int64_t for curl_off_t
Daniel Stenberg [Tue, 4 Apr 2017 11:50:03 +0000 (13:50 +0200)]
configure: prefer 'long long' to int64_t for curl_off_t

Since it is a native type and it makes it less complicated to find a
matching one in system.h

Bug: https://curl.haxx.se/mail/lib-2017-04/0010.html
Reported-by: Dan Fandrich
Closes #1388

7 years agotests: added test for Curl_splaygetbest to unit1309
Dániel Bakai [Mon, 3 Apr 2017 07:16:21 +0000 (09:16 +0200)]
tests: added test for Curl_splaygetbest to unit1309

This checks the new behavior of Curl_splaygetbest, so that the smallest
node not larger than the key is removed, and FIFO behavior is kept even
when there are multiple nodes with the same key.

Closes #1358

7 years agomulti: fix queueing of pending easy handles
Dániel Bakai [Fri, 24 Mar 2017 08:43:27 +0000 (09:43 +0100)]
multi: fix queueing of pending easy handles

Multi handles repeatedly invert the queue of pending easy handles when
used with CURLMOPT_MAX_TOTAL_CONNECTIONS. This is caused by a multistep
process involving Curl_splaygetbest and violates the FIFO property of
the multi handle.
This patch fixes this issue by redefining the "best" node in the
context of timeouts as the "smallest not larger than now", and
implementing the necessary data structure modifications to do this
effectively, namely:
 - splay nodes with the same key are now stored in a doubly-linked
   circular list instead of a non-circular one to enable O(1)
   insertion to the tail of the list
 - Curl_splayinsert inserts nodes with the same key to the tail of
   the same list
 - in case of multiple nodes with the same key, the one on the head of
   the list gets selected

7 years agotool: fix Windows Unicode build
Marcel Raad [Tue, 4 Apr 2017 21:02:16 +0000 (23:02 +0200)]
tool: fix Windows Unicode build

... by explicitly calling the ANSI versions of Windows API functions where
required.

7 years agocurl_sasl: declare mechtable static
Martin Kepplinger [Tue, 4 Apr 2017 20:04:38 +0000 (22:04 +0200)]
curl_sasl: declare mechtable static

struct mechtable is only used locally here. It can be declared static.

7 years agourl: don't free postponed data on connection reuse
Antti Hätälä [Tue, 4 Apr 2017 19:50:36 +0000 (15:50 -0400)]
url: don't free postponed data on connection reuse

- Don't free postponed data on a connection that will be reused since
  doing so can cause data loss when pipelining.

Only Windows builds are affected by this.

Closes https://github.com/curl/curl/issues/1380

7 years agoRELEASE-NOTES: synced with 4f2e348f9b42c69c480
Daniel Stenberg [Tue, 4 Apr 2017 15:24:33 +0000 (17:24 +0200)]
RELEASE-NOTES: synced with 4f2e348f9b42c69c480

7 years agohash: move key into hash struct to reduce mallocs
Daniel Stenberg [Fri, 31 Mar 2017 23:12:32 +0000 (01:12 +0200)]
hash: move key into hash struct to reduce mallocs

This removes one tiny malloc for each hash struct allocated. In a simple
case like "curl localhost", this save three mallocs.

Closes #1376

7 years agollist: replace Curl_llist_alloc with Curl_llist_init
Daniel Stenberg [Mon, 3 Apr 2017 08:32:43 +0000 (10:32 +0200)]
llist: replace Curl_llist_alloc with Curl_llist_init

No longer allocate the curl_llist head struct for lists separately.

Removes 17 (15%) tiny allocations in a normal "curl localhost" invoke.

closes #1381

7 years agoeasy: silence compiler warning
Jay Satiro [Tue, 4 Apr 2017 06:43:21 +0000 (02:43 -0400)]
easy: silence compiler warning

Safe to silence warning adding time delta of poll, which can trigger on
Windows since sizeof time_t > sizeof long.

warning C4244: '+=' : conversion from 'time_t' to 'long', possible loss
of data

7 years agodocs: minor typo in write-out.d
Richlv [Mon, 3 Apr 2017 23:04:03 +0000 (02:04 +0300)]
docs: minor typo in write-out.d

Closes #1382

7 years agoinclude: curl/system.h is a run-time version of curlbuild.h
Daniel Stenberg [Wed, 29 Mar 2017 12:38:56 +0000 (14:38 +0200)]
include: curl/system.h is a run-time version of curlbuild.h

system.h is aimed to replace curlbuild.h at a later point in time when
we feel confident system.h works sufficiently well.

curl/system.h is currently used in parallel with curl/curlbuild.h

curl/system.h determines a data sizes, data types and include file
status based on available preprocessor defines instead of getting
generated at build-time. This, in order to avoid relying on a build-time
generated file that makes it complicated to do 32 and 64 bit bields from
the same installed set of headers.

Test 1541 verifies that system.h comes to the same conclusion that
curlbuild.h offers.

Closes #1373

7 years agomulti: make curl_multi_wait avoid malloc in the typical case
Daniel Stenberg [Fri, 31 Mar 2017 23:27:24 +0000 (01:27 +0200)]
multi: make curl_multi_wait avoid malloc in the typical case

When only a few additional file descriptors are used, avoid the malloc.

Closes #1377

7 years agotests/server/util: remove in6addr_any for recent MinGW
Marcel Raad [Sun, 2 Apr 2017 17:22:42 +0000 (19:22 +0200)]
tests/server/util: remove in6addr_any for recent MinGW

In ancient MinGW versions, in6addr_any was declared as extern, but not
defined. Because of that, 22a0c57746ae12506b1ba0f0fafffd26c1907d6a added
definitions for in6addr_any when compiling with MinGW. The bug was fixed in
w32api version 3.6 from 2006, so this workaround is not needed anymore for
recent versions.

This fixes the following MinGW-w64 warnings because the MinGW-w64 version of
IN6ADDR_ANY_INIT has the two additional braces inside the macro:
util.c:59:14: warning: braces around scalar initializer
util.c:59:40: warning: excess elements in scalar initializer

Ref: https://sourceforge.net/p/mingw/mingw-org-wsl/ci/e4803e0da25c57ae1ad0fa75ae2b7182ff7fa339/tree/w32api/ChangeLog
Closes https://github.com/curl/curl/pull/1379

7 years agodocs: added examples for CURLINFO_FILETIME.3 and CURLOPT_FILETIME.3
Daniel Stenberg [Sun, 2 Apr 2017 22:00:43 +0000 (00:00 +0200)]
docs: added examples for CURLINFO_FILETIME.3 and CURLOPT_FILETIME.3

7 years agofail-early.d: fix typos
Jay Satiro [Sat, 1 Apr 2017 02:36:46 +0000 (22:36 -0400)]
fail-early.d: fix typos

7 years agodocs: Explain --fail-early does not imply --fail
Jay Satiro [Fri, 31 Mar 2017 19:59:07 +0000 (15:59 -0400)]
docs: Explain --fail-early does not imply --fail

Closes https://github.com/curl/curl/pull/1375

7 years agotelnet: (win32) fix read callback return variable
Daniel Stenberg [Fri, 31 Mar 2017 12:20:13 +0000 (14:20 +0200)]
telnet: (win32) fix read callback return variable

telnet.c(1427,21): warning: comparison of constant 268435456 with
expression of type 'CURLcode' is always false

telnet.c(1433,21): warning: comparison of constant 268435457 with
expression of type 'CURLcode' is always false

Reviewed-by: Jay Satiro
Reported-by: Gisle Vanem
Bug: https://github.com/curl/curl/issues/1225#issuecomment-290340890

Closes #1374

7 years agoCTestConfig.cmake: removed, unused
Daniel Stenberg [Fri, 31 Mar 2017 11:42:06 +0000 (13:42 +0200)]
CTestConfig.cmake: removed, unused

7 years agolibcurl.def: removed, unused
Daniel Stenberg [Thu, 30 Mar 2017 22:09:11 +0000 (00:09 +0200)]
libcurl.def: removed, unused

7 years agodocs/index.html: removed, was not shipped anyway
Daniel Stenberg [Thu, 30 Mar 2017 21:58:29 +0000 (23:58 +0200)]
docs/index.html: removed, was not shipped anyway

7 years agodist: add missing files to the tarball
Daniel Stenberg [Thu, 30 Mar 2017 21:56:55 +0000 (23:56 +0200)]
dist: add missing files to the tarball

7 years agocmake: fix build with cmake 2.8.12.2
Peter Wu [Thu, 30 Mar 2017 12:27:51 +0000 (14:27 +0200)]
cmake: fix build with cmake 2.8.12.2

For some reason, CMake 2.8.12.2 did not expand the list argument in a
single DEPENDS argument. Remove the quotes, so it gets expanded into
multiple arguments for add_custom_command and add_custom_target.

Fixes https://github.com/curl/curl/issues/1370
Closes #1372

7 years agossh: fix narrowing conversion warning
Marcel Raad [Thu, 30 Mar 2017 16:41:50 +0000 (18:41 +0200)]
ssh: fix narrowing conversion warning

'left' is used as time_t but declared as long.
MinGW complains:
error: conversion to 'long int' from 'time_t {aka long long int}' may alter
its value [-Werror=conversion]
Changed the declaration to time_t.

7 years agohttp2: silence unused parameter warnings
Marcel Raad [Thu, 30 Mar 2017 16:13:20 +0000 (18:13 +0200)]
http2: silence unused parameter warnings

In release mode, MinGW complains:
error: unused parameter 'lib_error_code' [-Werror=unused-parameter]

7 years agocurl: fix callback functions to match prototype
Hanno Böck [Thu, 30 Mar 2017 12:59:14 +0000 (14:59 +0200)]
curl: fix callback functions to match prototype

The function tool_debug_cb doesn't match curl_debug_callback in curl.h
(unsigned vs. signed char* for 3rd param).

Bug: https://curl.haxx.se/mail/lib-2017-03/0120.html

7 years agogcc7: fix ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]
Alexis La Goutte [Thu, 30 Mar 2017 12:14:53 +0000 (14:14 +0200)]
gcc7: fix ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool-context]

Closes #1371

7 years agoschannel: fix unused variable warning
Marcel Raad [Thu, 30 Mar 2017 08:35:46 +0000 (10:35 +0200)]
schannel: fix unused variable warning

If CURL_DISABLE_VERBOSE_STRINGS is defined, hostname is not used in
schannel_connect_step3.

7 years agoconnect: fix unreferenced parameter warning
Marcel Raad [Thu, 30 Mar 2017 08:14:34 +0000 (10:14 +0200)]
connect: fix unreferenced parameter warning

When CURL_DISABLE_VERBOSE_STRINGS is defined, the reason parameter in
Curl_conncontrol is not used as the infof macro expands to nothing.

7 years agoselect: use correct SIZEOF_ constant
Marcel Raad [Mon, 27 Mar 2017 23:37:31 +0000 (01:37 +0200)]
select: use correct SIZEOF_ constant

At least under Windows, there is no SIZEOF_LONG, so it evaluates to 0 even
though sizeof(int) == sizeof(long). This should probably have been
CURL_SIZEOF_LONG, but the type of timeout_ms changed from long to time_t
anyway.
This triggered MSVC warning C4668 about implicitly replacing undefined
macros with '0'.

Closes https://github.com/curl/curl/pull/1362

7 years agocmake: add cmake file in docs/libcurl/opts/ to dist
Daniel Stenberg [Thu, 30 Mar 2017 06:16:56 +0000 (08:16 +0200)]
cmake: add cmake file in docs/libcurl/opts/ to dist

7 years agocmake: add more missing files to the dist
Daniel Stenberg [Thu, 30 Mar 2017 06:12:37 +0000 (08:12 +0200)]
cmake: add more missing files to the dist

7 years agodocs/Makefile.am: include CMakeLists.txt in the dist tarball
Daniel Stenberg [Wed, 29 Mar 2017 22:36:04 +0000 (00:36 +0200)]
docs/Makefile.am: include CMakeLists.txt in the dist tarball

7 years agoNTLM: check for features with #ifdef instead of #if
Marcel Raad [Wed, 29 Mar 2017 11:16:25 +0000 (13:16 +0200)]
NTLM: check for features with #ifdef instead of #if

Feature defines are normally checked with #ifdef instead of #if in the rest of
the codebase. Additionally, some compilers warn when a macro is implicitly
evaluated to 0 because it is not defined, which was the case here.

Ref: https://github.com/curl/curl/pull/1362#discussion_r108605101
Closes https://github.com/curl/curl/pull/1367

7 years agocurl: fix callback argument inconsistency
Hanno Böck [Wed, 29 Mar 2017 08:02:34 +0000 (10:02 +0200)]
curl: fix callback argument inconsistency

As you can see the callback definition uses a char* for the first
argument, while the function uses a void*.

URL: https://curl.haxx.se/mail/lib-2017-03/0116.html

7 years agoRELEASE-NOTES: synced with 556c51a2df
Daniel Stenberg [Wed, 29 Mar 2017 07:50:23 +0000 (09:50 +0200)]
RELEASE-NOTES: synced with 556c51a2df

7 years agoKNOWN_BUGS: typo
madblobfish [Tue, 28 Mar 2017 07:45:12 +0000 (09:45 +0200)]
KNOWN_BUGS: typo

Closes #1364

7 years agomake: use the variable MAKE for recursive calls
Maksim Stsepanenka [Tue, 28 Mar 2017 22:20:32 +0000 (01:20 +0300)]
make: use the variable MAKE for recursive calls

Closes #1366

7 years agoconncache: make hashkey avoid malloc
Daniel Stenberg [Tue, 28 Mar 2017 17:18:24 +0000 (19:18 +0200)]
conncache: make hashkey avoid malloc

... to make it much faster. Idea developed with primepie on IRC.

Closes #1365

7 years agohttp: do not treat FTPS over CONNECT as HTTPS
Kamil Dudka [Tue, 28 Mar 2017 13:50:59 +0000 (15:50 +0200)]
http: do not treat FTPS over CONNECT as HTTPS

If we use FTPS over CONNECT, the TLS handshake for the FTPS control
connection needs to be initiated in the SENDPROTOCONNECT state, not
the WAITPROXYCONNECT state.  Otherwise, if the TLS handshake completed
without blocking, the information about the completed TLS handshake
would be saved to a wrong flag.  Consequently, the TLS handshake would
be initiated in the SENDPROTOCONNECT state once again on the same
connection, resulting in a failure of the TLS handshake.  I was able to
observe the failure with the NSS backend if curl ran through valgrind.

Note that this commit partially reverts curl-7_21_6-52-ge34131d.

7 years agopause: handle mixed types of data when paused
Daniel Stenberg [Mon, 27 Mar 2017 10:14:57 +0000 (12:14 +0200)]
pause: handle mixed types of data when paused

When receiving chunked encoded data with trailers, and the write
callback returns PAUSE, there might be both body and header to store to
resend on unpause. Previously libcurl returned error for that case.

Added test case 1540 to verify.

Reported-by: Stephen Toub
Fixes #1354
Closes #1357

7 years agohttp: Fix proxy connection reuse with basic-auth
Isaac Boukris [Thu, 23 Mar 2017 19:28:28 +0000 (21:28 +0200)]
http: Fix proxy connection reuse with basic-auth

When using basic-auth, connections and proxy connections
can be re-used with different Authorization headers since
it does not authenticate the connection (like NTLM does).

For instance, the below command should re-use the proxy
connection, but it currently doesn't:
curl -v -U alice:a -x http://localhost:8181 http://localhost/
  --next -U bob:b -x http://localhost:8181 http://localhost/

This is a regression since refactoring of ConnectionExists()
as part of: cb4e2be7c6d42ca0780f8e0a747cecf9ba45f151

Fix the above by removing the username and password compare
when re-using proxy connection at proxy_info_matches().

However, this fix brings back another bug would make curl
to re-print the old proxy-authorization header of previous
proxy basic-auth connection because it wasn't cleared.

For instance, in the below command the second request should
fail if the proxy requires authentication, but would succeed
after the above fix (and before aforementioned commit):
curl -v -U alice:a -x http://localhost:8181 http://localhost/
  --next -x http://localhost:8181 http://localhost/

Fix this by clearing conn->allocptr.proxyuserpwd after use
unconditionally, same as we do for conn->allocptr.userpwd.

Also fix test 540 to not expect digest auth header to be
resent when connection is reused.

Signed-off-by: Isaac Boukris <iboukris@gmail.com>
Closes https://github.com/curl/curl/pull/1350

7 years agoopenssl: exclude DSA code when OPENSSL_NO_DSA is defined
Jay Satiro [Tue, 28 Mar 2017 06:56:00 +0000 (02:56 -0400)]
openssl: exclude DSA code when OPENSSL_NO_DSA is defined

- Fix compile errors that occur in openssl.c when OpenSSL lib was
  built without DSA support.

Bug: https://github.com/curl/curl/issues/1361
Reported-by: neheb@users.noreply.github.com
7 years agoexamples/fopen: checksrc compliance
Jay Satiro [Tue, 28 Mar 2017 06:55:14 +0000 (02:55 -0400)]
examples/fopen: checksrc compliance