]> granicus.if.org Git - curl/log
curl
7 years agoBUGS: clarify how to report security related bugs
Daniel Stenberg [Tue, 1 Aug 2017 12:39:13 +0000 (14:39 +0200)]
BUGS: clarify how to report security related bugs

7 years agomulti: fix request timer management
Brad Spencer [Sat, 29 Jul 2017 14:44:39 +0000 (16:44 +0200)]
multi: fix request timer management

There are some bugs in how timers are managed for a single easy handle
that causes the wrong "next timeout" value to be reported to the
application when a new minimum needs to be recomputed and that new
minimum should be an existing timer that isn't currently set for the
easy handle.  When the application drives a set of easy handles via the
`curl_multi_socket_action()` API (for example), it gets told to wait the
wrong amount of time before the next call, which causes requests to
linger for a long time (or, it is my guess, possibly forever).

Bug: https://curl.haxx.se/mail/lib-2017-07/0033.html

7 years agocurl_setup: Define CURL_NO_OLDIES for building libcurl
Jay Satiro [Tue, 1 Aug 2017 06:56:48 +0000 (02:56 -0400)]
curl_setup: Define CURL_NO_OLDIES for building libcurl

.. to catch accidental use of deprecated error codes.

Ref: https://github.com/curl/curl/issues/1688#issuecomment-316764237

7 years agoconfigure: fix the check for IdnToUnicode
Jeremy Tan [Mon, 31 Jul 2017 11:24:38 +0000 (21:24 +1000)]
configure: fix the check for IdnToUnicode

Fixes #1669
Closes #1713

7 years agohttp: fix response code parser to avoid integer overflow
Daniel Stenberg [Mon, 31 Jul 2017 15:11:18 +0000 (17:11 +0200)]
http: fix response code parser to avoid integer overflow

test 1429 and 1433 were updated to work with the stricter HTTP status line
parser.

Closes #1714
Reported-by: Brian Carpenter
7 years agolibcurl: Stop using error codes defined under CURL_NO_OLDIES
Dwarakanath Yadavalli [Mon, 31 Jul 2017 05:52:04 +0000 (11:22 +0530)]
libcurl: Stop using error codes defined under CURL_NO_OLDIES

Fixes https://github.com/curl/curl/issues/1688
Closes https://github.com/curl/curl/pull/1712

7 years agoinclude.d: clarify --include is only for response headers
Jay Satiro [Sun, 30 Jul 2017 06:29:36 +0000 (02:29 -0400)]
include.d: clarify --include is only for response headers

Follow-up to 171f8de and de6de94.

Bug: https://github.com/curl/curl/commit/de6de94#commitcomment-23370851
Reported-by: Daniel Stenberg
7 years agocmake: support make uninstall
jasjuang [Mon, 10 Jul 2017 23:17:15 +0000 (16:17 -0700)]
cmake: support make uninstall

Closes #1674

7 years agoRELEASE-NOTES: synced with 001701c47
Daniel Stenberg [Sat, 29 Jul 2017 23:25:57 +0000 (01:25 +0200)]
RELEASE-NOTES: synced with 001701c47

7 years agoAppVeyor: now really use CURL_WERROR
Marcel Raad [Tue, 18 Jul 2017 17:06:55 +0000 (19:06 +0200)]
AppVeyor: now really use CURL_WERROR

It was misspelled as CURL_ERROR in commit
2d86e8d1286e0fbe3d811e2e87fa0b5e53722db4.

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

7 years agotool_help: clarify --include is only for response headers
Jay Satiro [Sat, 29 Jul 2017 05:33:25 +0000 (01:33 -0400)]
tool_help: clarify --include is only for response headers

Follow-up to 171f8de.

Ref: https://github.com/curl/curl/issues/1704

7 years agosplay: fix signed/unsigned mismatch warning
Jay Satiro [Sat, 29 Jul 2017 05:13:42 +0000 (01:13 -0400)]
splay: fix signed/unsigned mismatch warning

Follow-up to 4dee50b.

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

7 years agoinclude.d: clarify that it concerns the response headers
Daniel Stenberg [Fri, 28 Jul 2017 16:22:50 +0000 (18:22 +0200)]
include.d: clarify that it concerns the response headers

Reported-by: olesteban at github
Fixes #1704

7 years agocurl_rtmp: fix a compiler warning
Johannes Schindelin [Fri, 7 Jul 2017 09:52:48 +0000 (11:52 +0200)]
curl_rtmp: fix a compiler warning

The headers of librtmp declare the socket as `int`, and on Windows, that
disagrees with curl_socket_t.

Bug: #1652

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agotest1323: verify curlx_tvdiff
Daniel Stenberg [Fri, 28 Jul 2017 13:49:36 +0000 (15:49 +0200)]
test1323: verify curlx_tvdiff

7 years agotimeval: struct curltime is a struct timeval replacement
Daniel Stenberg [Fri, 28 Jul 2017 13:49:36 +0000 (15:49 +0200)]
timeval: struct curltime is a struct timeval replacement

... to make all libcurl internals able to use the same data types for
the struct members. The timeval struct differs subtly on several
platforms so it makes it cumbersome to use everywhere.

Ref: #1652
Closes #1693

7 years agodarwinssl: fix variable type mistake (regression)
Daniel Stenberg [Thu, 27 Jul 2017 16:30:11 +0000 (18:30 +0200)]
darwinssl: fix variable type mistake (regression)

... which made --tlsv1.2 not work because it would blank the max tls
version variable.

Reported-by: Nick Miyake
Bug: #1703

7 years agomulti: mention integer overflow risk if using > 500 million sockets
Daniel Stenberg [Wed, 26 Jul 2017 23:13:47 +0000 (01:13 +0200)]
multi: mention integer overflow risk if using > 500 million sockets

Reported-by: ovidiu-benea@users.noreply.github.com
Closes #1675
Closes #1683

7 years agochecksrc: escape open brace in regex
Daniel Stenberg [Wed, 26 Jul 2017 23:13:19 +0000 (01:13 +0200)]
checksrc: escape open brace in regex

... to silence warning.

7 years agonss: fix a possible use-after-free in SelectClientCert()
Kamil Dudka [Wed, 19 Jul 2017 16:02:26 +0000 (18:02 +0200)]
nss: fix a possible use-after-free in SelectClientCert()

... causing a SIGSEGV in showit() in case the handle used to initiate
the connection has already been freed.

This commit fixes a bug introduced in curl-7_19_5-204-g5f0cae803.

Reported-by: Rob Sanders
Bug: https://bugzilla.redhat.com/1436158

7 years agonss: unify the coding style of nss_send() and nss_recv()
Kamil Dudka [Thu, 20 Jul 2017 06:05:59 +0000 (08:05 +0200)]
nss: unify the coding style of nss_send() and nss_recv()

No changes in behavior intended by this commit.

7 years agotests/server/resolve.c: fix deprecation warning
Marcel Raad [Sun, 16 Jul 2017 12:28:10 +0000 (14:28 +0200)]
tests/server/resolve.c: fix deprecation warning

MSVC warns that gethostbyname is deprecated. Always use getaddrinfo
instead to fix this when IPv6 is enabled, also for IPv4 resolves. This
is also consistent with what libcurl does.

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

7 years agodarwinssl: fix pinnedpubkey build error
Jay Satiro [Mon, 17 Jul 2017 06:46:07 +0000 (02:46 -0400)]
darwinssl: fix pinnedpubkey build error

- s/SessionHandle/Curl_easy/

Bug: https://github.com/curl/curl/commit/eb16305#commitcomment-23035670
Reported-by: Gisle Vanem
7 years agortspd: fix GCC warning after MSVC warning fix
Marcel Raad [Sun, 16 Jul 2017 13:16:46 +0000 (15:16 +0200)]
rtspd: fix GCC warning after MSVC warning fix

Older GCC warns:
/tests/server/rtspd.c:1194:10: warning: missing braces around
initializer [-Wmissing-braces]

Fix this by using memset instead of an initializer.

7 years agolibtest: fix MSVC warning C4706
Marcel Raad [Sun, 16 Jul 2017 11:44:54 +0000 (13:44 +0200)]
libtest: fix MSVC warning C4706

With warning level 4, MSVC warns about assignments within conditional
expressions. Change the while loop to a do-while loop to fix this. This
change is also consistent with CODE_STYLE.md.

7 years agosockfilt: suppress conversion warning with explicit cast
Marcel Raad [Sun, 16 Jul 2017 11:28:45 +0000 (13:28 +0200)]
sockfilt: suppress conversion warning with explicit cast

MSVC warns when implicitly casting -1 to unsigned long.

7 years agortspd: fix MSVC level 4 warning
Marcel Raad [Sun, 16 Jul 2017 11:26:21 +0000 (13:26 +0200)]
rtspd: fix MSVC level 4 warning

warning C4701: potentially uninitialized local variable 'req' used

7 years agowinbuild: re-enable warning C4127 for curl tool
Marcel Raad [Fri, 14 Jul 2017 06:52:14 +0000 (08:52 +0200)]
winbuild: re-enable warning C4127 for curl tool

Disabled in cda19a345f6970e22fe8b7a808aeb8f086a21eac. It only needs to
be disabled for libcurl.

7 years agowinbuild: build with warning level 4
Marcel Raad [Sat, 8 Jul 2017 16:25:22 +0000 (18:25 +0200)]
winbuild: build with warning level 4

This is consistent with 7bc64561a2e63ca93e4b0b31d350773ba80955c2, which
changed the warning level from 3 to 4 for the Visual Studio project
files. But disable the level 4 warning C4127 "conditional expression is
constant", as that one is issued by older versions of the Windows SDK
as well as curl itself under some circumstances.

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

7 years agotravis: install libidn2
Max Dymond [Mon, 10 Jul 2017 16:56:36 +0000 (17:56 +0100)]
travis: install libidn2

Install libidn2 to increase test coverage (IDN tests)

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

7 years agotravis: enable warnings also in release mode
Marcel Raad [Sat, 8 Jul 2017 15:58:20 +0000 (17:58 +0200)]
travis: enable warnings also in release mode

... to get warnings also on Linux/GCC and OSX/clang.

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

7 years agotravis: install libssh2
Max Dymond [Fri, 7 Jul 2017 15:41:47 +0000 (16:41 +0100)]
travis: install libssh2

Install libssh2 to increase test coverage (SFTP, SCP)

7 years agosystem.h: include winsock2.h before windows.h
Marcel Raad [Wed, 12 Jul 2017 05:55:18 +0000 (07:55 +0200)]
system.h: include winsock2.h before windows.h

... to avoid compiler warnings if the user doesn't want
WIN32_LEAN_AND_MEAN.

7 years agobuild: remove WIN32_LEAN_AND_MEAN from individual build systems
Marcel Raad [Tue, 11 Jul 2017 14:51:48 +0000 (16:51 +0200)]
build: remove WIN32_LEAN_AND_MEAN from individual build systems

It's defined for all build systems in curl_setup.h since commit
beb08481d01a07a8b10938b1078a5e298b1c2912. This caused macro
redefinition warnings in the configure builds.

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

7 years agoISSUE_TEMPLATE: Add a comment not to file security issues on github
Jay Satiro [Tue, 11 Jul 2017 15:48:37 +0000 (11:48 -0400)]
ISSUE_TEMPLATE: Add a comment not to file security issues on github

7 years agocurl_setup: always define WIN32_LEAN_AND_MEAN on Windows
Marcel Raad [Mon, 10 Jul 2017 12:56:11 +0000 (14:56 +0200)]
curl_setup: always define WIN32_LEAN_AND_MEAN on Windows

Make sure to always define WIN32_LEAN_AND_MEAN before including any
Windows headers to avoid pulling in unnecessary headers. This avoids
unnecessary macro clashes and compiler warnings.

Ref: https://github.com/curl/curl/issues/1562
Closes https://github.com/curl/curl/pull/1672

7 years agostrerror: Preserve Windows error code in some functions
Jay Satiro [Tue, 11 Jul 2017 05:53:23 +0000 (01:53 -0400)]
strerror: Preserve Windows error code in some functions

This is a follow-up to af02162 which removed (SET_)ERRNO macros. That
commit was an earlier draft that I committed by mistake, which was then
remedied by a5834e5 and e909de6, and now this commit. With this commit
there is now no difference between the current code and the changes that
were approved in the final draft.

Thanks-to: Max Dymond, Marcel Raad, Daniel Stenberg, Gisle Vanem
Ref: https://github.com/curl/curl/pull/1589

7 years agotests: Fix up issues with errno in test files
Max Dymond [Mon, 10 Jul 2017 12:50:15 +0000 (13:50 +0100)]
tests: Fix up issues with errno in test files

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

7 years agoerrno: fix non-windows builds after af0216251b94e7
Daniel Stenberg [Mon, 10 Jul 2017 11:58:35 +0000 (13:58 +0200)]
errno: fix non-windows builds after af0216251b94e7

7 years agomake: fix docs build on OpenBSD
Ryan Winograd [Fri, 7 Jul 2017 22:02:43 +0000 (17:02 -0500)]
make: fix docs build on OpenBSD

Ref: #1591

7 years agoldap: fix MinGW compiler warning
Marcel Raad [Sat, 8 Jul 2017 15:33:58 +0000 (17:33 +0200)]
ldap: fix MinGW compiler warning

ldap_bind_s is marked as deprecated in w32api's winldap.h shipping with
the latest original MinGW, resulting in compiler warnings since commit
f0fe66f13c93d3d0af45d9fb1231c9164e0f9dc8. Fix this for the non-SSPI
case by using ldap_simple_bind_s again instead of ldap_bind_s with
LDAP_AUTH_SIMPLE.

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

7 years agocurl-compilers.m4: disable warning spam with Cygwin's clang
Marcel Raad [Sat, 8 Jul 2017 15:44:34 +0000 (17:44 +0200)]
curl-compilers.m4: disable warning spam with Cygwin's clang

When building with Cygwin or MinGW, libtool uses a wrapper executable
instead of a wrapper script [1], which is written in C and throws
missing-variable-declarations warnings. Don't enable these warnings on
Cygwin and MinGW in order to avoid warnings for every executable built,
which spams the test suite output when using Cygwin's clang.

[1] https://www.gnu.org/software/libtool/manual/html_node/Wrapper-executables.html

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

7 years agocurl_setup_once: Remove ERRNO/SET_ERRNO macros
Jay Satiro [Mon, 19 Jun 2017 04:52:38 +0000 (00:52 -0400)]
curl_setup_once: Remove ERRNO/SET_ERRNO macros

Prior to this change (SET_)ERRNO mapped to GetLastError/SetLastError
for Win32 and regular errno otherwise.

I reviewed the code and found no justifiable reason for conflating errno
on WIN32 with GetLastError/SetLastError. All Win32 CRTs support errno,
and any Win32 multithreaded CRT supports thread-local errno.

Fixes https://github.com/curl/curl/issues/895
Closes https://github.com/curl/curl/pull/1589

7 years agotool_getparam: fix potentially uninitialized err
Jay Satiro [Sun, 9 Jul 2017 16:04:42 +0000 (12:04 -0400)]
tool_getparam: fix potentially uninitialized err

7 years agosmb: rename variable to fix shadowing warning
Marcel Raad [Sat, 8 Jul 2017 21:19:36 +0000 (23:19 +0200)]
smb: rename variable to fix shadowing warning

GCC 4.6.3 on travis complains:
smb.c: In function ‘get_posix_time’:
smb.c:725:13: error: declaration of ‘time’ shadows a global declaration
[-Werror=shadow]

Fix this by renaming the variable.

7 years agotool_cb_wrt: fix variable shadowing warning
Marcel Raad [Sat, 8 Jul 2017 09:43:51 +0000 (11:43 +0200)]
tool_cb_wrt: fix variable shadowing warning

GCC 4.4 complains:
tool_cb_wrt.c:81: error: declaration of ‘isatty’ shadows a global
declaration
/usr/include/unistd.h:782: error: shadowed declaration is here

Fix this by renaming the variable.

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

7 years agoRELEASE-NOTES: synced with be2c999b8
Daniel Stenberg [Fri, 7 Jul 2017 22:15:03 +0000 (00:15 +0200)]
RELEASE-NOTES: synced with be2c999b8

7 years agotravis: install stunnel
Daniel Stenberg [Fri, 7 Jul 2017 14:42:44 +0000 (16:42 +0200)]
travis: install stunnel

7 years agovalgrind.supp: supress OpenSSL false positive seen on travis
Daniel Stenberg [Fri, 7 Jul 2017 14:23:13 +0000 (16:23 +0200)]
valgrind.supp: supress OpenSSL false positive seen on travis

7 years agotravis: detect and use valgrind for normal builds
Daniel Stenberg [Fri, 7 Jul 2017 12:46:17 +0000 (14:46 +0200)]
travis: detect and use valgrind for normal builds

Closes #1653

7 years agotravis: add SMB, DICT, TELNET torture to coverage test
Daniel Stenberg [Fri, 7 Jul 2017 09:03:24 +0000 (11:03 +0200)]
travis: add SMB, DICT, TELNET torture to coverage test

7 years agocmake: offer CMAKE_DEBUG_POSTFIX when building with MSVC
Paul Harris [Thu, 6 Jul 2017 15:53:41 +0000 (23:53 +0800)]
cmake: offer CMAKE_DEBUG_POSTFIX when building with MSVC

Removes BUILD_RELEASE_DEBUG_DIRS since it wasn't used anywhere.

Closes #1649

7 years agoCURLOPT_POSTFIELDS.3: explain the 100-continue magic better
Daniel Stenberg [Fri, 7 Jul 2017 10:43:17 +0000 (12:43 +0200)]
CURLOPT_POSTFIELDS.3: explain the 100-continue magic better

7 years agotest1452: add telnet negotiation
Max Dymond [Wed, 5 Jul 2017 09:12:10 +0000 (10:12 +0100)]
test1452: add telnet negotiation

Add a basic telnet server for negotiating some telnet options before
echoing back any data that's sent to it.

Closes #1645

7 years agotravis: do more tests in the coverage run
Daniel Stenberg [Fri, 7 Jul 2017 08:05:30 +0000 (10:05 +0200)]
travis: do more tests in the coverage run

I added a selection of torture and event tests that run "fast enough"

7 years agocurl_easy_escape.3: mention the (lack of) encoding
Daniel Stenberg [Fri, 7 Jul 2017 08:47:46 +0000 (10:47 +0200)]
curl_easy_escape.3: mention the (lack of) encoding

Fixes #1612
Reported-by: Jeroen Ooms
7 years agomemdebug: don't setbuf() if the file open failed
Gisle Vanem [Thu, 6 Jul 2017 21:14:29 +0000 (23:14 +0200)]
memdebug: don't setbuf() if the file open failed

Bug: https://github.com/curl/curl/issues/828#issuecomment-313475151

7 years agoappveyor: enable CURL_WERROR on all builds
Daniel Stenberg [Thu, 6 Jul 2017 10:12:51 +0000 (12:12 +0200)]
appveyor: enable CURL_WERROR on all builds

7 years agocmake: add CURL_WERROR for enabling "warning as errors"
Daniel Stenberg [Thu, 6 Jul 2017 10:12:31 +0000 (12:12 +0200)]
cmake: add CURL_WERROR for enabling "warning as errors"

7 years agocmake: remove spurious "-l" from linker flags
Hannes Magnusson [Wed, 7 Jun 2017 19:43:40 +0000 (12:43 -0700)]
cmake: remove spurious "-l" from linker flags

Fixes #1552

7 years agotest506: skip if threaded-resolver
Daniel Stenberg [Thu, 6 Jul 2017 09:11:43 +0000 (11:11 +0200)]
test506: skip if threaded-resolver

7 years agoruntests: support "threaded-resolver" as a feature
Daniel Stenberg [Thu, 6 Jul 2017 09:11:07 +0000 (11:11 +0200)]
runtests: support "threaded-resolver" as a feature

... to let tests require it or skip if present

7 years agoasyn-thread.c: fix unused variable warnings on macOS
Daniel Stenberg [Thu, 6 Jul 2017 08:22:28 +0000 (10:22 +0200)]
asyn-thread.c: fix unused variable warnings on macOS

7 years agohttp: s/TINY_INITIAL_POST_SIZE/EXPECT_100_THRESHOLD
Daniel Stenberg [Thu, 6 Jul 2017 09:20:57 +0000 (11:20 +0200)]
http: s/TINY_INITIAL_POST_SIZE/EXPECT_100_THRESHOLD

Make the name reflect its use better, and add a short comment describing
what it's for.

7 years agocmake: if inet_pton is used, bump _WIN32_WINNT
Daniel Stenberg [Wed, 5 Jul 2017 08:21:58 +0000 (10:21 +0200)]
cmake: if inet_pton is used, bump _WIN32_WINNT

... and make sure inet_pton is always checked for when *not* using Windows,
which is a regression from 4fc6ebe18.

Idea-by: Sergei Nikulov
7 years agoselect.h: avoid macro redefinition harder
Daniel Stenberg [Wed, 5 Jul 2017 10:32:09 +0000 (12:32 +0200)]
select.h: avoid macro redefinition harder

... by checking the POLLIN define, as the header file checks don't work
on Windows.

7 years agoinet_pton: fix include on windows to get prototype
Daniel Stenberg [Wed, 5 Jul 2017 08:21:58 +0000 (10:21 +0200)]
inet_pton: fix include on windows to get prototype

inet_pton() exists on Windows and gets used by our cmake builds. Make
sure the correct header file is included to avoid compiler warnings.

Closes #1639

7 years agoTODO: 1.10 auto-detect proxy
Daniel Stenberg [Wed, 5 Jul 2017 08:07:27 +0000 (10:07 +0200)]
TODO: 1.10 auto-detect proxy

Closes #1572

7 years agoTODO: HTTP proxy CONNECT is non-blocking now
Daniel Stenberg [Wed, 5 Jul 2017 08:00:26 +0000 (10:00 +0200)]
TODO: HTTP proxy CONNECT is non-blocking now

7 years agocmake: fix send/recv argument scanner for windows
Daniel Stenberg [Wed, 5 Jul 2017 06:29:43 +0000 (08:29 +0200)]
cmake: fix send/recv argument scanner for windows

... by simply trying the Windows argument types first.

Fixes #1640

7 years agoRELEASE-NOTES: synced with 596cfb6c0
Daniel Stenberg [Tue, 4 Jul 2017 23:11:41 +0000 (01:11 +0200)]
RELEASE-NOTES: synced with 596cfb6c0

7 years agosmb: add support for CURLOPT_FILETIME
Gisle Vanem [Tue, 4 Jul 2017 13:51:45 +0000 (15:51 +0200)]
smb: add support for CURLOPT_FILETIME

Bug: https://curl.haxx.se/mail/lib-2017-07/0005.html

Closes #1643

7 years agotravis: install nghttp2 on linux builds
Daniel Stenberg [Tue, 4 Jul 2017 21:03:49 +0000 (23:03 +0200)]
travis: install nghttp2 on linux builds

Closes #1642

7 years agosmb: fix build for djgpp/MSDOS
Gisle Vanem [Tue, 4 Jul 2017 13:42:33 +0000 (15:42 +0200)]
smb: fix build for djgpp/MSDOS

bug: https://curl.haxx.se/mail/lib-2017-07/0005.html

7 years agoconfigure: try ldap/lber in reversed order first
Daniel Stenberg [Tue, 4 Jul 2017 09:33:51 +0000 (11:33 +0200)]
configure: try ldap/lber in reversed order first

When scanning for which LDAP libraries to use, try the -lldap -llber
combination before the reversed order since it has a greater chance of
working when linking with libcurl statically.

Fixes #1619
Closes #1634
Reported-by: David E. Narváez
7 years agoconfigure: remove checks for 5 functions never used
Daniel Stenberg [Tue, 4 Jul 2017 07:01:39 +0000 (09:01 +0200)]
configure: remove checks for 5 functions never used

fork, getprotobyname, inet_addr, perror, uname

closes #1638

7 years agodist: add SMB python deps into the tarball
Daniel Stenberg [Tue, 4 Jul 2017 08:41:14 +0000 (10:41 +0200)]
dist: add SMB python deps into the tarball

7 years agotest1451: add SMB support to the testbed
Max Dymond [Mon, 3 Jul 2017 10:00:04 +0000 (11:00 +0100)]
test1451: add SMB support to the testbed

Add test 1451 which does some very basic SMB testing using the impacket
SMB server.

Closes #1630

7 years agotest: add impacket for SMB testing
Max Dymond [Fri, 30 Jun 2017 12:53:19 +0000 (13:53 +0100)]
test: add impacket for SMB testing

Import impacket 0.9.15 for use in SMB testing. This was generated by
doing "pip2.7 install -t . impacket"

Unnecessary files for current testing were deleted.

7 years agotravis.yml: use --enable-werror on debug builds
Daniel Stenberg [Tue, 4 Jul 2017 08:27:12 +0000 (10:27 +0200)]
travis.yml: use --enable-werror on debug builds

... to better detect and fault on compiler warnings/errors

Closes #1637

7 years agotool_sleep: typecast to avoid macos compiler warning
Daniel Stenberg [Tue, 4 Jul 2017 08:27:12 +0000 (10:27 +0200)]
tool_sleep: typecast to avoid macos compiler warning

tool_sleep.c:54:24: error: implicit conversion loses integer precision:
'long' to '__darwin_suseconds_t' (aka 'int')
[-Werror,-Wshorten-64-to-32]

7 years agotimeval.c: Use long long constant type for timeval assignment
Martin Kepplinger [Mon, 3 Jul 2017 11:23:47 +0000 (13:23 +0200)]
timeval.c: Use long long constant type for timeval assignment

On a 64 bit host, sparse says:

timeval.c:148:15: warning: constant 0x7fffffffffffffff is so big it is long
timeval.c:149:12: warning: constant 0x7fffffffffffffff is so big it is long

so let's use long long constant types in order to prevent undesired overflow
failures.

Bug: https://curl.haxx.se/mail/lib-2017-07/0003.html

Closes #1636

Signed-off-by: Martin Kepplinger <martink@posteo.de>
7 years agourl: make the original string get used on subsequent transfers
Daniel Stenberg [Mon, 3 Jul 2017 21:52:10 +0000 (23:52 +0200)]
url: make the original string get used on subsequent transfers

... since CURLOPT_URL should follow the same rules as other options:
they remain set until changed or cleared.

Added test 1551 to verify.

Fixes #1631
Closes #1632
Reported-by: Pavel Rochnyak
7 years agogtls: fix build when sizeof(long) < sizeof(void *)
Johannes Schindelin [Mon, 26 Jun 2017 21:15:22 +0000 (23:15 +0200)]
gtls: fix build when sizeof(long) < sizeof(void *)

- Change gnutls pointer/int macros to pointer/curl_socket_t.
  Prior to this change they used long type as well.

The size of the `long` data type can be shorter than that of pointer
types. This is the case most notably on Windows.

If C99 were acceptable, we could simply use `intptr_t` here. But we
want to retain C89 compatibility.

Simply use the trick of performing pointer arithmetic with the NULL
pointer: to convert an integer `i` to a pointer, simply take the
address of the `i`th element of a hypothetical character array
starting at address NULL. To convert back, simply cast the pointer
difference.

Thanks to Jay Satiro for the initial modification to use curl_socket_t
instead of int/long.

Closes #1617

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
7 years agounit1399: fix integer overflow
Ryan Winograd [Sun, 2 Jul 2017 23:35:36 +0000 (18:35 -0500)]
unit1399: fix integer overflow

Bug: #1616
Closes #1633

7 years agocmake: Added compatibility options for older Windows versions
Per Malmberg [Sat, 1 Jul 2017 23:02:12 +0000 (01:02 +0200)]
cmake: Added compatibility options for older Windows versions

CURL_STATIC_CRT and ENABLE_INET_PTON

Closes #1621

7 years agounit1399: add logging to time comparison
Daniel Stenberg [Sat, 1 Jul 2017 14:40:51 +0000 (16:40 +0200)]
unit1399: add logging to time comparison

... to enable tracking down why autobuilds fail on this

Bug: #1616

7 years agomake: build the docs subdir only from within src
Daniel Stenberg [Fri, 30 Jun 2017 14:42:26 +0000 (16:42 +0200)]
make: build the docs subdir only from within src

... and don't build at all in include

Prompted-by-work-by: Simon Warta
Ref: #1590
Closes #1591

7 years agotest1450: fix up DICT server in torture mode
Max Dymond [Fri, 30 Jun 2017 11:45:17 +0000 (12:45 +0100)]
test1450: fix up DICT server in torture mode

As per https://github.com/curl/curl/pull/1615, the DICT server is a
little spammy in torture mode due to the sockets being torn down
unexpectedly. Fix this by adding some error handling to the handling
function.

Closes #1629

7 years agotest1450: add simple testing for DICT
Max Dymond [Mon, 26 Jun 2017 15:46:53 +0000 (16:46 +0100)]
test1450: add simple testing for DICT

Add a new server which provides a DICT interface. This is intended to
begin coverage testing for lib/dict.c

Closes #1615

7 years agotest1521: fix out-of-tree builds, broken with 467da3af
Dan Fandrich [Thu, 29 Jun 2017 19:34:05 +0000 (21:34 +0200)]
test1521: fix out-of-tree builds, broken with 467da3af

The test.h file is no longer in the same directory as the source file,
so that directory needs to be added to the include path.

Fixes #1627
Closes #1628

7 years agohttp2: handle PING frames
Max Dymond [Wed, 31 May 2017 13:00:45 +0000 (14:00 +0100)]
http2: handle PING frames

Add a connection check function to HTTP2 based off RTSP. This causes
PINGs to be handled the next time the connection is reused.

Closes #1521

7 years agohandler: refactor connection checking
Max Dymond [Wed, 31 May 2017 11:09:56 +0000 (12:09 +0100)]
handler: refactor connection checking

Add a new type of callback to Curl_handler which performs checks on
the connection. Alter RTSP so that it uses this callback to do its
own check on connection health.

7 years agoopenssl: improve fallback seed of PRNG with a time based hash
dmitrykos [Tue, 27 Jun 2017 17:56:12 +0000 (20:56 +0300)]
openssl: improve fallback seed of PRNG with a time based hash

Fixes #1620

7 years agoprogress: prevent resetting t_starttransfer
Ryan Winograd [Mon, 26 Jun 2017 16:51:05 +0000 (11:51 -0500)]
progress: prevent resetting t_starttransfer

Prevent `Curl_pgrsTime` from modifying `t_starttransfer` when invoked
with `TIMER_STARTTRANSFER` more than once during a single request.

When a redirect occurs, this is considered a new request and
`t_starttransfer` can be updated to reflect the `t_starttransfer` time
of the redirect request.

Closes #1616

Bug: https://github.com/curl/curl/pull/1602#issuecomment-310267370

7 years agocurl_strequal.3: fix typo in SYNOPSIS
Daniel Stenberg [Wed, 28 Jun 2017 23:16:56 +0000 (01:16 +0200)]
curl_strequal.3: fix typo in SYNOPSIS

Reported-by: Jesse Chisholm
Fixes #1623

7 years agoRELEASE-NOTES: synced with ce2c3ebda
Daniel Stenberg [Wed, 28 Jun 2017 09:29:32 +0000 (11:29 +0200)]
RELEASE-NOTES: synced with ce2c3ebda

7 years agocurl --socks5-{basic,gssapi}: control socks5 auth
Kamil Dudka [Fri, 19 May 2017 16:11:47 +0000 (18:11 +0200)]
curl --socks5-{basic,gssapi}: control socks5 auth

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

7 years agoCURLOPT_SOCKS5_AUTH: allowed methods for SOCKS5 proxy auth
Kamil Dudka [Thu, 27 Apr 2017 13:18:49 +0000 (15:18 +0200)]
CURLOPT_SOCKS5_AUTH: allowed methods for SOCKS5 proxy auth

If libcurl was built with GSS-API support, it unconditionally advertised
GSS-API authentication while connecting to a SOCKS5 proxy.  This caused
problems in environments with improperly configured Kerberos: a stock
libcurl failed to connect, despite libcurl built without GSS-API
connected fine using username and password.

This commit introduces the CURLOPT_SOCKS5_AUTH option to control the
allowed methods for SOCKS5 authentication at run time.

Note that a new option was preferred over reusing CURLOPT_PROXYAUTH
for compatibility reasons because the set of authentication methods
allowed by default was different for HTTP and SOCKS5 proxies.

Bug: https://curl.haxx.se/mail/lib-2017-01/0005.html
Closes https://github.com/curl/curl/pull/1454

7 years agosocks: deduplicate the code for auth request
Kamil Dudka [Wed, 8 Mar 2017 11:16:01 +0000 (12:16 +0100)]
socks: deduplicate the code for auth request