Commit Graph

25761 Commits

Author SHA1 Message Date
Daniel Stenberg 54a2b63c70
http2: simplify and clean up trailer handling
Triggered by a crash detected by OSS-Fuzz after the dynbuf introduction in
ed35d6590e. This should make the trailer handling more straight forward and
hopefully less error-prone.

Deliver the trailer header to the callback already at receive-time. No
longer caches the trailers to get delivered at end of stream.

Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22030
Closes #5348
2020-05-07 09:49:51 +02:00
Marc Hoersken 7ae8801901
appveyor: disable test 1139 instead of ignoring it
Spending time on manpage checking makes no sense
for these builds due to lacking manpage support.
2020-05-07 06:51:22 +02:00
Marc Hoersken 4fdb2005a2
appveyor: disable flaky test 1501 and ignore broken 1056
Test 1501 is flaky on Windows CI due to being time sensitive
and the testsuite relying on taskkill.exe to check for the
existance of processes which can take to much time itself.

Test 1056 is broken in autotools-based Windows builds due
to scope ID support missing in these builds at the moment.
2020-05-07 06:45:26 +02:00
Marc Hoersken 2d1745fe2c
test613.pl: make tests 613 and 614 work with OpenSSH for Windows
OpenSSH for Windows shows group and other/world permissions as *,
because those concepts do not exist on Windows. It also does not
show the current or parent directory, so we just ignore those.

Reviewed-by: Daniel Stenberg
Closes #5328
2020-05-06 19:33:20 +02:00
Daniel Stenberg e1d81b52c0
runtests: set +x mode again 2020-05-06 08:14:47 +02:00
Daniel Stenberg 44645ca8b0
libssh2: convert over to use dynbuf
In my very basic test that lists sftp://127.0.0.1/tmp/, this patched
code makes 161 allocations compared to 194 in git master. A 17%
reduction.

Closes #5336
2020-05-05 14:54:07 +02:00
Daniel Stenberg 8810064655
travis: add "qlog" as feature in the quiche build 2020-05-05 14:50:46 +02:00
Daniel Stenberg 80b9db1283
quiche: enable qlog output
quiche has the potential to log qlog files. To enable this, you must
build quiche with the qlog feature enabled `cargo build --features
qlog`. curl then passes a file descriptor to quiche, which takes
ownership of the file. The FD transfer only works on UNIX.

The convention is to enable logging when the QLOGDIR environment is
set. This should be a path to a folder where files are written with the
naming template <SCID>.qlog.

Co-authored-by: Lucas Pardue
Replaces #5337
Closes #5341
2020-05-05 14:50:33 +02:00
Daniel Stenberg e0af243b61
urldata.h: remove #define HEADERSIZE, not used anymore
Follow-up to ed35d6590e
2020-05-04 16:53:05 +02:00
Daniel Stenberg 18815aa670
ngtcp2: convert to dynbuf
Closes #5335
2020-05-04 14:57:57 +02:00
Daniel Stenberg 7a86a25f5b
connect: make happy eyeballs work for QUIC (again)
Follow-up from dbd16c3e25 (regression in 7.70.0)

Closes #5334
2020-05-04 14:56:26 +02:00
Daniel Stenberg d2dfa3e689
connect: add two asserts to clue code analyzers in a little 2020-05-04 11:03:29 +02:00
Daniel Stenberg dae126ff12
http_proxy: ported to use dynbuf instead of a static size buffer
Removes a 16K static buffer from the easy handle. Simplifies the code.
2020-05-04 10:41:06 +02:00
Daniel Stenberg ed35d6590e
dynbuf: introduce internal generic dynamic buffer functions
A common set of functions instead of many separate implementations for
creating buffers that can grow when appending data to them. Existing
functionality has been ported over.

In my early basic testing, the total number of allocations seem at
roughly the same amount as before, possibly a few less.

See docs/DYNBUF.md for a description of the API.

Closes #5300
2020-05-04 10:40:39 +02:00
Daniel Stenberg 00c2e8da9a
runtests: remove sleep calls
Remove many one second sleeps that were done *after* each newly started
test server already has been verified. They should not have any purpose
there.

Closes #5323
2020-05-03 23:19:36 +02:00
Daniel Stenberg 59e351a572
asyn-*: remove support for never-used NULL entry pointers
... and instead convert those to asserts to make sure they are truly
never NULL.

Closes #5324
2020-05-03 22:48:04 +02:00
Emil Engler f7ab488570
doc: Rename VERSIONS to VERSIONS.md as it already has Markdown syntax
Closes #5325
2020-05-02 23:45:09 +02:00
Jay Satiro 153d581b7f asyn-thread: fix cppcheck warning
- Check for NULL entry parameter before attempting to deref entry in
  Curl_resolver_is_resolved, like is already done in asyn-ares.

This is to silence cppcheck which does not seem to understand that
asyn-ares and asyn-thread have separate Curl_resolver_is_resolved
and those units are mutually exclusive. Prior to this change it warned
of a scenario where asyn-thread's Curl_resolver_is_resolved is called
with a NULL entry from asyn-ares, but that couldn't happen.

Reported-by: rl1987@users.noreply.github.com

Fixes https://github.com/curl/curl/issues/5326
2020-05-02 15:03:39 -04:00
Jay Satiro 85eda4e87a select: fix overflow protection in Curl_socket_check
Follow-up to a96c752 which changed the timeout_ms type from time_t to
timediff_t.

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

Closes https://github.com/curl/curl/pull/5286
2020-05-02 15:02:20 -04:00
Marc Hoersken 0e058776c0
sockfilt: make select_ws stop waiting on exit signal event
This makes sure that select_ws behaves similar to real select
which stops waiting on a signal handler being triggered.

This makes it possible to gracefully stop sockfilt.exe on
Windows with taskkill /IM sockfilt.exe (without /F force flag).

Reviewed-by: Jay Satiro
Part of #5260
2020-05-02 17:30:54 +02:00
Marc Hoersken 7dc8a981fa
tests/server/util.[ch]: add exit event to stop waiting on Windows
This commit adds a global exit event to the test servers that
Windows-specific wait routines can use to get triggered if the
program was signaled to be terminated, eg. select_ws in sockfilt.c

The exit event will be managed by the signal handling code and is
set to not reset automatically to support multiple wait routines.

Reviewed-by: Jay Satiro
Closes #5260
2020-05-02 17:29:52 +02:00
Marc Hoersken 551577f357
tests/server/util.c: fix thread handle not being closed
Reviewed-by: Jay Satiro
Part of #5260
2020-05-02 17:05:26 +02:00
Marc Hoersken fe28fcf04c
tests/server/util.c: use raise instead of calling signal handler
Use raise to trigger signal handler instead of calling it
directly and causing potential unexpected control flow.

Reviewed-by: Jay Satiro
Part of #5260
2020-05-02 17:04:55 +02:00
Marc Hoersken 1abb087a9c
tests: add support for SSH server variant specific transfer paths
OpenSSH for Windows requires paths in the format of /C:/
instead of the pseudo-POSIX paths /cygdrive/c/ or just /c/

Reviewed-by: Daniel Stenberg
Closes #5298
2020-05-02 16:56:55 +02:00
Daniel Stenberg a491183cb1
RELEASE-NOTES: synced 2020-05-02 16:43:08 +02:00
Daniel Stenberg df2093d293
libssh2: set the expected total size in SCP upload init
... as otherwise the progress callback gets called without that
information, making the progress meter have less info.

Reported-by: Murugan Balraj
Bug: https://curl.haxx.se/mail/archive-2020-05/0000.html
Closes #5317
2020-05-02 16:38:48 +02:00
Daniel Stenberg 5cb7f893df
runtests: make the logmsg from the ssh server only show in verbose 2020-05-02 15:51:42 +02:00
Daniel Stenberg f9c6febae2
tests: make test 1248 + 1249 use %NOLISTENPORT
... instead of a port of a non-running server so that it works
stand-alone.

Closes #5318
2020-05-02 15:47:34 +02:00
Daniel Stenberg 9d47ff5323
examples: remove asiohiper.cpp
This example has repeatedly been reported to contain bugs, and as users
copy and paste code from this into production, I now deem it better to
not provide the example at all.

Closes #5090
Closes #5322
2020-05-02 12:29:58 +02:00
Emil Engler 6540cbbc75
doc: add missing closing parenthesis in CURLINFO_SSL_VERIFYRESULT.3
Closes #5320
2020-05-02 12:03:20 +02:00
Emil Engler 8cf8b293a1
KNOWN_BUGS: Remove "curl --upload-file . hang if delay in STDIN"
It was fixed in 9a2cbf3

Closes #5319
2020-05-02 12:02:13 +02:00
Daniel Stenberg dce30e2e07
cirrus: disable SFTP and SCP tests
... as we can't seem to start the sshd server on it. Those problems
existed before d1239b50be (running the SSH server on a random port),
but they're more noticable now since there are more failed attempts in
the logs.

Closes #5315
2020-04-30 23:54:44 +02:00
Emil Engler 44f5edd863
runtests: fix typo in the existence of disabled tests checker
Closes #5316
2020-04-30 23:47:53 +02:00
Dan Fandrich 49bbc4f09b test75: Remove precheck test
This has not been needed since commit 9fa42bed and often prevents it
from running at all with dynamic test ports.
2020-04-30 16:56:59 +02:00
Dan Fandrich 5f5a7b478a tests: Stop referring to server ports when they're not used
Several tests referred to specific server ports even when the test
didn't actually use that server or specify that it's needed. In such
cases, the test harness substitutes the text "[not running]" as the port
number which causes many such tests to fail due to the inability to
parse the URL.  These tests are changed to use %NOLISTENPORT which will
always be substituted correctly.
2020-04-30 16:00:31 +02:00
Emil Engler 42d8d9a7e8
GnuTLS: Backend support for CURLINFO_SSL_VERIFYRESULT
Closes #5287
2020-04-30 14:40:54 +02:00
Daniel Stenberg c069027139
conncache: various concept cleanups
More connection cache accesses are protected by locks.

CONNCACHE_* is a beter prefix for the connection cache lock macros.

Curl_attach_connnection: now called as soon as there's a connection
struct available and before the connection is added to the connection
cache.

Curl_disconnect: now assumes that the connection is already removed from
the connection cache.

Ref: #4915
Closes #5009
2020-04-30 14:27:54 +02:00
Daniel Stenberg 9a8fa076bf
tests: tests: run stunnel for HTTPS and FTPS on dynamic ports
As stunnel is an external tool and it has no specific option to export
the actually used port number when asked to listen to 0, runtests
instead iterates over ten randomly picked high number ports and sticks
to the first one stunnel can listen to.

Closes #5267
2020-04-30 14:17:15 +02:00
Daniel Stenberg d1239b50be
tests: pick a random port number for SSH
Since sshd doesn't have such an option by itself, we iterate over a
series of random ports until one works.

Closes #5273
2020-04-30 14:13:59 +02:00
Rikard Falkeborn 06ce166944
libtest/cmake: Remove commented code
These were commented out in e9dd099870 when Makefile.inc was included
instead. 11 years have passed since then and the commented code is of
course very outdated. Remove it to avoid confusion.

Closes #5311
2020-04-30 14:13:07 +02:00
Daniel Stenberg d39b4128d5
schannel: source code reindent
White space edits only. Conform better to standard curl source code
indenting style.

Closes #5305
2020-04-29 14:43:59 +02:00
Kamil Dudka 68774da9ca test1177: look for curl.h in source directory
If we use a separate build directory, there is no copy of the header.

Closes #5310
2020-04-29 13:54:08 +02:00
Kamil Dudka 1066f5f0d4 tests: look for preprocessed tests in build directory
... which is not always the same directory as source directory

Closes #5310
2020-04-29 13:53:12 +02:00
Daniel Stenberg b4799e978e
RELEASE-NOTES: synced
... and bumped curlver.h to 7.70.1
2020-04-29 12:21:09 +02:00
Daniel Stenberg 53cdc2c963
RELEASE-NOTES: 7.70.0 2020-04-29 08:02:33 +02:00
Daniel Stenberg c5d8629553
THANKS: synced with the 7.70.0 release 2020-04-29 08:02:29 +02:00
Daniel Stenberg 6370e43153
headers: copyright range fix 2020-04-28 18:10:46 +02:00
Rikard Falkeborn fc0e29dd57
doh: Constify some input pointers
Closes #5306
2020-04-28 07:56:34 +02:00
Daniel Stenberg cad15b9f92
nss: check for PK11_CreateDigestContext() returning NULL
... to avoid crashes!

Reported-by: Hao Wu
Fixes #5302
Closes #5303
2020-04-27 16:25:59 +02:00
Daniel Stenberg e2b1ccb99b
travis: bump the wolfssl CI build to use 4.4.0
Closes #5301
2020-04-27 11:59:19 +02:00