]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
4 years agohttp: add new files missed from referrer commit
Viktor Szakats [Fri, 19 Feb 2021 16:17:44 +0000 (16:17 +0000)] 
http: add new files missed from referrer commit

Ref: 44872aefc2d54f297caf2b0cc887df321bc9d791
Ref: #6591

4 years agohttp: add support to read and store the referrer header
Viktor Szakats [Fri, 19 Feb 2021 13:57:19 +0000 (13:57 +0000)] 
http: add support to read and store the referrer header

- add CURLINFO_REFERER libcurl option
- add --write-out '%{referer}' command-line option
- extend --xattr command-line option to fill user.xdg.referrer.url extended
  attribute with the referrer (if there was any)

Closes #6591

4 years agourldata: remove the _ORIG suffix from string names
Daniel Stenberg [Thu, 18 Feb 2021 09:13:56 +0000 (10:13 +0100)] 
urldata: remove the _ORIG suffix from string names

It doesn't provide any useful info but only makes the names longer.

Closes #6624

4 years agourl: fix memory leak if OOM in the HSTS handling
Daniel Stenberg [Thu, 18 Feb 2021 22:24:30 +0000 (23:24 +0100)] 
url: fix memory leak if OOM in the HSTS handling

Reported-by: Viktor Szakats
Bug: https://github.com/curl/curl/pull/6627#issuecomment-781626205

Closes #6628

4 years agognutls: assume nettle crypto support
Daniel Stenberg [Thu, 18 Feb 2021 10:42:46 +0000 (11:42 +0100)] 
gnutls: assume nettle crypto support

nettle has been the default crypto library with GnuTLS since 2010. By
dropping support for the previous libcrypto, we simplify code.

Closes #6625

4 years agoasyn-ares: use consistent resolve error message
Daniel Stenberg [Thu, 18 Feb 2021 12:14:55 +0000 (13:14 +0100)] 
asyn-ares: use consistent resolve error message

... with the help of Curl_resolver_error() which now is moved from
asyn-thead.c and is provided globally for this purpose.

Follow-up to 35ca04ce1b77636

Makes test 1188 work for c-ares builds

Closes #6626

4 years agoci: stop building on freebsd-12-1
Viktor Szakats [Thu, 18 Feb 2021 11:18:36 +0000 (11:18 +0000)] 
ci: stop building on freebsd-12-1

An updated freebsd-12-2 image was added a few months ago, and this
older one is consistently failing to go past `pkginstall`:
```
Newer FreeBSD version for package py37-mlt:
To ignore this error set IGNORE_OSVERSION=yes
- package: 1202000
- running kernel: 1201000
Ignore the mismatch and continue? [Y/n]: pkg: repository FreeBSD contains packages for wrong OS version: FreeBSD:12:amd64
```

FreeBSD thread suggests that 12.1 is EOL, and best to avoid.

Ref: https://forums.freebsd.org/threads/78856/

Reviewed-by: Daniel Stenberg
Closes #6622

4 years agotest1188: change error from connect to resolve error
Daniel Stenberg [Thu, 18 Feb 2021 07:30:35 +0000 (08:30 +0100)] 
test1188: change error from connect to resolve error

Using the %NOLISTENPORT to trigger a connection failure is somewhat
"risky" (since it isn't guaranteed to not be listened to) and caused
occasional CI problems. This fix changes the infused error to be a more
reliable one but still verifies the --write-out functionality properly -
which is the purpose of this test.

Reported-by: Jay Satiro
Fixes #6621
Closes #6623

4 years agourl.c: use consistent error message for failed resolve
Daniel Stenberg [Thu, 18 Feb 2021 08:57:30 +0000 (09:57 +0100)] 
url.c: use consistent error message for failed resolve

4 years agoBUGS: language polish
Daniel Stenberg [Thu, 18 Feb 2021 07:47:27 +0000 (08:47 +0100)] 
BUGS: language polish

4 years agowolfssl: don't store a NULL sessionid
Daniel Stenberg [Wed, 17 Feb 2021 13:19:57 +0000 (14:19 +0100)] 
wolfssl: don't store a NULL sessionid

This caused a memory leak as the session id cache entry was still
erroneously stored with a NULL sessionid and that would later be treated
as not needed to get freed.

Reported-by: Gisle Vanem
Fixes #6616
Closes #6617

4 years agoparse_proxy: fix a memory leak in the OOM path
Daniel Stenberg [Wed, 17 Feb 2021 10:53:32 +0000 (11:53 +0100)] 
parse_proxy: fix a memory leak in the OOM path

Reported-by: Jay Satiro
Reviewed-by: Jay Satiro
Reviewed-by: Emil Engler
Closes #6614
Bug: https://github.com/curl/curl/pull/6591#issuecomment-780396541

4 years agourl: fix possible use-after-free in default protocol
Jay Satiro [Tue, 16 Feb 2021 22:13:22 +0000 (17:13 -0500)] 
url: fix possible use-after-free in default protocol

Prior to this change if the user specified a default protocol and a
separately allocated non-absolute URL was used then it was freed
prematurely, before it was then used to make the replacement URL.

Bug: https://github.com/curl/curl/issues/6604#issuecomment-780138219
Reported-by: arvids-kokins-bidstack@users.noreply.github.com
Closes https://github.com/curl/curl/pull/6613

4 years agomulti: rename the multi transfer states
Daniel Stenberg [Tue, 16 Feb 2021 07:19:24 +0000 (08:19 +0100)] 
multi: rename the multi transfer states

While working on documenting the states it dawned on me that step one is
to use more descriptive names on the states. This also changes prefix on
the states to make them shorter in the source.

State names NOT ending with *ing are transitional ones.

Closes #6612

4 years agohttp: do not add a referrer header with empty value
Viktor Szakats [Tue, 16 Feb 2021 10:19:37 +0000 (10:19 +0000)] 
http: do not add a referrer header with empty value

Previously an empty 'Referer:' header was added to the HTTP request when
passing `--referer ';auto'` or `--referer ''` on the command-line. This
patch makes `--referer` work like `--header 'Referer:'` and will only add
the header if it has a non-zero length value.

Reviewed-by: Jay Satiro
Closes #6610

4 years agolib: remove 'conn->data' completely
Daniel Stenberg [Mon, 15 Feb 2021 09:15:46 +0000 (10:15 +0100)] 
lib: remove 'conn->data' completely

The Curl_easy pointer struct entry in connectdata is now gone. Just
before commit 215db086e0 landed on January 8, 2021 there were 919
references to conn->data.

Closes #6608

4 years agoopenldap: pass 'data' to the callbacks instead of 'conn'
Daniel Stenberg [Mon, 15 Feb 2021 08:41:22 +0000 (09:41 +0100)] 
openldap: pass 'data' to the callbacks instead of 'conn'

4 years agodoh: Fix sharing user's resolve list with DOH handles
Jay Satiro [Mon, 15 Feb 2021 05:25:59 +0000 (00:25 -0500)] 
doh: Fix sharing user's resolve list with DOH handles

- Share the shared object from the user's easy handle with the DOH
  handles.

Prior to this change if the user had set a shared object with shared
cached DNS (CURL_LOCK_DATA_DNS) for their easy handle then that wasn't
used by any associated DOH handles, since they used the multi's default
hostcache.

This change means all the handles now use the same hostcache, which is
either the shared hostcache from the user created shared object if it
exists or if not then the multi's default hostcache.

Reported-by: Manuj Bhatia
Fixes https://github.com/curl/curl/issues/6589
Closes https://github.com/curl/curl/pull/6607

4 years agohttp2: remove conn->data use
Daniel Stenberg [Mon, 15 Feb 2021 07:35:32 +0000 (08:35 +0100)] 
http2: remove conn->data use

... but instead use a private alternative that points to the "driving
transfer" from the connection. We set the "user data" associated with
the connection to be the connectdata struct, but when we drive transfers
the code still needs to know the pointer to the transfer. We can change
the user data to become the Curl_easy handle, but with older nghttp2
version we cannot dynamically update that pointer properly when
different transfers are used over the same connection.

Closes #6520

4 years agoopenssl: remove conn->data use
Daniel Stenberg [Mon, 25 Jan 2021 13:18:31 +0000 (14:18 +0100)] 
openssl: remove conn->data use

We still make the trace callback function get the connectdata struct
passed to it, since the callback is anchored on the connection.

Repeatedly updating the callback pointer to set 'data' with
SSL_CTX_set_msg_callback_arg() doesn't seem to work, probably because
there might already be messages in the queue with the old pointer.

This code therefore makes sure to set the "logger" handle before using
OpenSSL calls so that the right easy handle gets used for tracing.

Closes #6522

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 15 Feb 2021 07:31:34 +0000 (08:31 +0100)] 
RELEASE-NOTES: synced

4 years agodoh: add options to disable ssl verification
Jay Satiro [Thu, 11 Feb 2021 22:09:59 +0000 (17:09 -0500)] 
doh: add options to disable ssl verification

- New libcurl options CURLOPT_DOH_SSL_VERIFYHOST,
  CURLOPT_DOH_SSL_VERIFYPEER and CURLOPT_DOH_SSL_VERIFYSTATUS do the
  same as their respective counterparts.

- New curl tool options --doh-insecure and --doh-cert-status do the same
  as their respective counterparts.

Prior to this change DOH SSL certificate verification settings for
verifyhost and verifypeer were supposed to be inherited respectively
from CURLOPT_SSL_VERIFYHOST and CURLOPT_SSL_VERIFYPEER, but due to a bug
were not. As a result DOH verification remained at the default, ie
enabled, and it was not possible to disable. This commit changes
behavior so that the DOH verification settings are independent and not
inherited.

Ref: https://github.com/curl/curl/pull/4579#issuecomment-554723676

Fixes https://github.com/curl/curl/issues/4578
Closes https://github.com/curl/curl/pull/6597

4 years agohostip: fix crash in sync resolver builds that use DOH
Jay Satiro [Sat, 13 Feb 2021 07:45:33 +0000 (02:45 -0500)] 
hostip: fix crash in sync resolver builds that use DOH

- Guard some Curl_async accesses with USE_CURL_ASYNC instead of
  !CURLRES_SYNCH.

This is another follow-up to 8335c64 which moved the async struct from
the connectdata struct into the Curl_easy struct. A previous follow-up
6cd167a fixed building for sync resolver by guarding some async struct
accesses with !CURLRES_SYNCH. The problem is since DOH (DNS-over-HTTPS)
is available as an asynchronous secondary resolver the async struct may
be used even when libcurl is built for the sync resolver. That means
that CURLRES_SYNCH and USE_CURL_ASYNC may be defined at the same time.

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

4 years agoKNOWN_BUGS: cannot enable LDAPS on Windows with cmake
Daniel Stenberg [Sat, 13 Feb 2021 21:49:16 +0000 (22:49 +0100)] 
KNOWN_BUGS: cannot enable LDAPS on Windows with cmake

Reported-by: Jack Boos Yu
Closes #6284

4 years agoKNOWN_BUGS: Excessive HTTP/2 packets with TCP_NODELAY
Daniel Stenberg [Sat, 13 Feb 2021 21:42:58 +0000 (22:42 +0100)] 
KNOWN_BUGS: Excessive HTTP/2 packets with TCP_NODELAY

Reported-by: Alex Xu
Closes #6363

4 years agohttp: use credentials from transfer, not connection
Daniel Stenberg [Fri, 12 Feb 2021 09:27:42 +0000 (10:27 +0100)] 
http: use credentials from transfer, not connection

HTTP auth "accidentally" worked before this cleanup since the code would
always overwrite the connection credentials with the credentials from
the most recent transfer and since HTTP auth is typically done first
thing, this has not been an issue. It was still wrong and subject to
possible race conditions or future breakage if the sequence of functions
would change.

The data.set.str[] strings MUST remain unmodified exactly as set by the
user, and the credentials to use internally are instead set/updated in
state.aptr.*

Added test 675 to verify different credentials used in two requests done
over a reused HTTP connection, which previously behaved wrongly.

Fixes #6542
Closes #6545

4 years agotest433: clear some home dir env variables
Daniel Stenberg [Fri, 12 Feb 2021 07:45:10 +0000 (08:45 +0100)] 
test433: clear some home dir env variables

Follow-up to bd6b54ba1f55b5

... so that XDG_CONFIG_HOME is the only home dir variable set and thus
used correctly in the test!

Fixes #6599
Closes #6600

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 12 Feb 2021 08:55:04 +0000 (09:55 +0100)] 
RELEASE-NOTES: synced

bumped the version to 7.76.0

4 years agotravis: install libgsasl-dev to add that to the builds
Daniel Stenberg [Tue, 9 Feb 2021 22:39:31 +0000 (23:39 +0100)] 
travis: install libgsasl-dev to add that to the builds

Closes #6588

4 years agourldata: don't touch data->set.httpversion at run-time
Daniel Stenberg [Thu, 11 Feb 2021 15:30:32 +0000 (16:30 +0100)] 
urldata: don't touch data->set.httpversion at run-time

Rename it to 'httpwant' and make a cloned field in the state struct as
well for run-time updates.

Also: refuse non-supported HTTP versions. Verified with test 129.

Closes #6585

4 years agotests: disable .curlrc in more environments
Viktor Szakats [Thu, 11 Feb 2021 22:06:02 +0000 (22:06 +0000)] 
tests: disable .curlrc in more environments

by also setting CURL_HOME and XDG_CONFIG_HOME envvars to the local
directory.

Reviewed-by: Daniel Stenberg
Fixes #6595
Closes #6596

4 years agodocs/Makefile.inc: format to be update-friendly
Viktor Szakats [Thu, 11 Feb 2021 16:12:12 +0000 (16:12 +0000)] 
docs/Makefile.inc: format to be update-friendly

- one source file per line
- convert tabs to spaces
- do not align line-continuation backslashes
- sort source files alphabetically

Reviewed-by: Daniel Stenberg
Closes #6593

4 years agocurl: provide libgsasl version and feature info in -V output
Daniel Stenberg [Thu, 11 Feb 2021 07:54:23 +0000 (08:54 +0100)] 
curl: provide libgsasl version and feature info in -V output

Closes #6592

4 years agogsasl: provide CURL_VERSION_GSASL if built-in
Daniel Stenberg [Thu, 11 Feb 2021 07:53:33 +0000 (08:53 +0100)] 
gsasl: provide CURL_VERSION_GSASL if built-in

To let applications know the feature is available.

Closes #6592

4 years agocurl: add --fail-with-body
Daniel Stenberg [Thu, 11 Feb 2021 07:30:39 +0000 (08:30 +0100)] 
curl: add --fail-with-body

Prevent both --fail and --fail-with-body on the same command line.

Verify with test 349, 360 and 361.

Closes #6449

4 years agoTODO: remove HSTS
Daniel Stenberg [Wed, 10 Feb 2021 21:54:33 +0000 (22:54 +0100)] 
TODO: remove HSTS

Provided now since commit 7385610d0c74

4 years agotests: Fix tests failing due to change in curl --help
Jay Satiro [Wed, 10 Feb 2021 20:57:26 +0000 (15:57 -0500)] 
tests: Fix tests failing due to change in curl --help

Follow-up to parent 3183217 which added add missing <mode> argument to
--create-file-mode <mode>.

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

4 years agotool_help: add missing argument for --create-file-mode
Jay Satiro [Wed, 10 Feb 2021 19:10:49 +0000 (14:10 -0500)] 
tool_help: add missing argument for --create-file-mode

Prior to this change the required argument was not shown in curl --help.

before:
     --create-file-mode File mode for created files

after:
     --create-file-mode <mode> File mode (octal) for created files

Reported-by: ZimCodes@users.noreply.github.com
Fixes https://github.com/curl/curl/issues/6590

4 years agocreate-file-mode.d: add missing Arg tag
Jay Satiro [Wed, 10 Feb 2021 18:57:40 +0000 (13:57 -0500)] 
create-file-mode.d: add missing Arg tag

Prior to this change the required argument was not shown.

curl.1 before: --create-file-mode
curl.1 after: --create-file-mode <mode>

Reported-by: ZimCodes@users.noreply.github.com
Fixes https://github.com/curl/curl/issues/6590

4 years agogsasl: fix errors/warnings building against libgsasl
Viktor Szakats [Wed, 10 Feb 2021 18:50:36 +0000 (18:50 +0000)] 
gsasl: fix errors/warnings building against libgsasl

- also fix an indentation
- make Curl_auth_gsasl_token() use CURLcode (by Daniel Stenberg)

Ref: https://github.com/curl/curl/pull/6372#issuecomment-776118711
Ref: https://github.com/curl/curl/pull/6588

Reviewed-by: Jay Satiro
Assisted-by: Daniel Stenberg
Reviewed-by: Simon Josefsson
Closes #6587

4 years agoMakefile.m32: add support for libgsasl dependency
Viktor Szakats [Wed, 10 Feb 2021 18:46:57 +0000 (18:46 +0000)] 
Makefile.m32: add support for libgsasl dependency

Reviewed-by: Marcel Raad
Closes #6586

4 years agongtcp2: clarify calculation precedence
Marcel Raad [Sun, 7 Feb 2021 10:53:56 +0000 (11:53 +0100)] 
ngtcp2: clarify calculation precedence

As suggested by Codacy/cppcheck.

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

4 years agoserver: remove redundant condition
Marcel Raad [Sun, 7 Feb 2021 10:45:16 +0000 (11:45 +0100)] 
server: remove redundant condition

`end` is always non-null here.

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

4 years agolib: remove redundant code
Marcel Raad [Sun, 7 Feb 2021 08:29:59 +0000 (09:29 +0100)] 
lib: remove redundant code

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

4 years agomqttd: remove unused variable
Marcel Raad [Sat, 6 Feb 2021 10:46:22 +0000 (11:46 +0100)] 
mqttd: remove unused variable

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

4 years agotool_paramhlp: reduce variable scope
Marcel Raad [Sat, 6 Feb 2021 10:40:18 +0000 (11:40 +0100)] 
tool_paramhlp: reduce variable scope

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

4 years agotests: reduce variable scopes
Marcel Raad [Sat, 6 Feb 2021 10:30:09 +0000 (11:30 +0100)] 
tests: reduce variable scopes

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

4 years agolib: reduce variable scopes
Marcel Raad [Sat, 6 Feb 2021 10:21:53 +0000 (11:21 +0100)] 
lib: reduce variable scopes

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

4 years agoftp: fix Codacy/cppcheck warning about null pointer arithmetic
Marcel Raad [Sat, 6 Feb 2021 09:26:38 +0000 (10:26 +0100)] 
ftp: fix Codacy/cppcheck warning about null pointer arithmetic

Increment `bytes` only if it is non-null.

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

4 years agongtcp2: adapt to the new recv_datagram callback
Daniel Stenberg [Tue, 9 Feb 2021 22:25:20 +0000 (23:25 +0100)] 
ngtcp2: adapt to the new recv_datagram callback

4 years agoquiche: fix build error: use 'int' for port number
Daniel Stenberg [Tue, 9 Feb 2021 22:21:13 +0000 (23:21 +0100)] 
quiche: fix build error: use 'int' for port number

Follow-up to cb2dc1ba8

4 years agoftp: add 'list_only' to the transfer state struct
Daniel Stenberg [Mon, 8 Feb 2021 15:40:34 +0000 (16:40 +0100)] 
ftp: add 'list_only' to the transfer state struct

and rename it from 'ftp_list_only' since it is also used for SSH and
POP3. The state is updated internally for 'type=D' FTP URLs.

Added test case 1570 to verify.

Closes #6578

4 years agoftp: add 'prefer_ascii' to the transfer state struct
Daniel Stenberg [Mon, 8 Feb 2021 14:56:10 +0000 (15:56 +0100)] 
ftp: add 'prefer_ascii' to the transfer state struct

... and make sure the code never updates 'set.prefer_ascii' as it breaks
handle reuse which should use the setting as the user specified it.

Added test 1569 to verify: it first makes an FTP transfer with ';type=A'
and then another without type on the same handle and the second should
then use binary. Previously, curl failed this.

Closes #6578

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 9 Feb 2021 10:35:47 +0000 (11:35 +0100)] 
RELEASE-NOTES: synced

4 years agovtls: initial implementation of rustls backend
Jacob Hoffman-Andrews [Sun, 13 Dec 2020 07:55:09 +0000 (23:55 -0800)] 
vtls: initial implementation of rustls backend

This adds a new TLS backend, rustls. It uses the C-to-rustls bindings
from https://github.com/abetterinternet/crustls.

Rustls is at https://github.com/ctz/rustls/.

There is still a fair bit to be done, like sending CloseNotify on
connection shutdown, respecting CAPATH, and properly indicating features
like "supports TLS 1.3 ciphersuites." But it works well enough to make
requests and receive responses.

Blog post for context:
https://www.abetterinternet.org/post/memory-safe-curl/

Closes #6350

4 years agosasl: support SCRAM-SHA-1 and SCRAM-SHA-256 via libgsasl
Simon Josefsson [Thu, 24 Dec 2020 18:48:45 +0000 (19:48 +0100)] 
sasl: support SCRAM-SHA-1 and SCRAM-SHA-256 via libgsasl

Closes #6372

4 years agolib: use int type for more port variables
Jay Satiro [Mon, 1 Feb 2021 07:10:07 +0000 (02:10 -0500)] 
lib: use int type for more port variables

This is a follow-up to 764c6bd. Prior to that change port variables
were usually type long.

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

4 years agotool_writeout: refactor write-out and write-out json
Jay Satiro [Thu, 28 Jan 2021 23:56:50 +0000 (18:56 -0500)] 
tool_writeout: refactor write-out and write-out json

- Deduplicate the logic used by write-out and write-out json.

Rather than have separate writeLong, writeString, etc, logic for
each of write-out and write-out json instead have respective shared
functions that can output either format and a 'use_json' parameter to
indicate whether it is json that is output.

This will make it easier to maintain. Rather than have to go through
two sets of logic now we only have to go through one.

- Support write-out %{errormsg} and %{exitcode} in json.

- Clarify in the doc that %{exitcode} is the exit code of the transfer.

Prior to this change it just said "The numerical exitcode" which
implies it's the exit code of the tool, and it's not necessarily that.

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

4 years agolib: drop USE_SOCKETPAIR in favor of CURL_DISABLE_SOCKETPAIR
Jay Satiro [Mon, 25 Jan 2021 06:27:13 +0000 (01:27 -0500)] 
lib: drop USE_SOCKETPAIR in favor of CURL_DISABLE_SOCKETPAIR

.. since the former is undocumented and they both do the same thing.

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

4 years agocurl_multibyte: fall back to local code page stat/access on Windows
Jay Satiro [Sun, 24 Jan 2021 23:22:05 +0000 (18:22 -0500)] 
curl_multibyte: fall back to local code page stat/access on Windows

If libcurl is built with Unicode support for Windows then it is assumed
the filename string is Unicode in UTF-8 encoding and it is converted to
UTF-16 to be passed to the wide character version of the respective
function (eg wstat). However the filename string may actually be in the
local encoding so, even if it successfully converted to UTF-16, if it
could not be stat/accessed then try again using the local code page
version of the function (eg wstat fails try stat).

We already do this with fopen (ie wfopen fails try fopen), so I think it
makes sense to extend it to stat and access functions.

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

4 years agofile: Support unicode urls on windows
Stephan Szabo [Wed, 20 Jan 2021 18:08:49 +0000 (10:08 -0800)] 
file: Support unicode urls on windows

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

4 years agocmake: fix import library name for non-MS compiler on Windows
Vincent Torri [Thu, 19 Nov 2020 18:34:43 +0000 (19:34 +0100)] 
cmake: fix import library name for non-MS compiler on Windows

- Use _imp.lib suffix only for Microsoft's compiler (MSVC).

Prior to this change library suffix _imp.lib was used for the import
library on Windows regardless of compiler.

With this change the other compilers should now use their default
suffix which should be .dll.a.

This change is motivated by the usage of pkg-config on MSYS2.
Indeed, when 'pkg-config --libs libcurl' is used, -lcurl is
passed to ld. The documentation of ld on Windows :

https://sourceware.org/binutils/docs/ld/WIN32.html

lists, in the 'direct linking to a dll' section, the pattern
of the searched import library, and libcurl_imp.lib is not there.

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

4 years agourldata: move 'followlocation' to UrlState
Daniel Stenberg [Mon, 8 Feb 2021 22:00:21 +0000 (23:00 +0100)] 
urldata: move 'followlocation' to UrlState

As this is a state variable it does not belong in UserDefined which is
used to store values set by the user.

Closes #6582

4 years agohttp_proxy: fix typo in http_proxy.c
Ikko Ashimine [Tue, 9 Feb 2021 05:22:09 +0000 (14:22 +0900)] 
http_proxy: fix typo in http_proxy.c

settting -> setting

Closes #6583

4 years agotests/server: Bump MAX_TAG_LEN to 200
Fabian Keil [Wed, 20 Jan 2021 11:32:14 +0000 (12:32 +0100)] 
tests/server: Bump MAX_TAG_LEN to 200

This is useful for tests containing HTML inside of <data> sections.
For <img> tags it's not uncommon to be longer than the previous
limit of 79 bytes.

An example of a previously problem-causing tag is:
<img src="http://config.privoxy.org/send-banner?type=auto" border="0" title="Killed-http://www.privoxy.org/images/privoxy.png-by-size" width="88" height="31">
which is needed for a Privoxy test for the banners-by-size filter.

Previously it caused server failures like:
12:29:05.786961 ====> Client connect
12:29:05.787116 accept_connection 3 returned 4
12:29:05.787194 accept_connection 3 returned 0
12:29:05.787285 Read 119 bytes
12:29:05.787345 Process 119 bytes request
12:29:05.787407 Got request: GET /banners-by-size/9 HTTP/1.1
12:29:05.787464 Requested test number 9 part 0
12:29:05.787686 getpart() failed with error: -2
12:29:05.787744 - request found to be complete (9)
12:29:05.787912 getpart() failed with error: -2
12:29:05.788048 Wrote request (119 bytes) input to log/server.input
12:29:05.788157 Send response test9 section <data>
12:29:05.788443 getpart() failed with error: -2
12:29:05.788498 instructed to close connection after server-reply
12:29:05.788550 ====> Client disconnect 0
12:29:05.871448 exit_signal_handler: 15
12:29:05.871714 signalled to die
12:29:05.872040 ========> IPv4 sws (port 21108 pid: 51758) exits with signal (15)

4 years agotests/badsymbols.pl: when opening '$incdir' fails include it in the error message
Fabian Keil [Fri, 28 Feb 2020 09:46:22 +0000 (10:46 +0100)] 
tests/badsymbols.pl: when opening '$incdir' fails include it in the error message

4 years agoruntests.1: document -o, -P, -L, and -E
Fabian Keil [Mon, 18 Jan 2021 08:21:54 +0000 (09:21 +0100)] 
runtests.1: document -o, -P, -L, and -E

4 years agoruntests.pl: add %TESTNUMBER variable to make copying tests more convenient
Fabian Keil [Mon, 16 Jun 2014 14:03:00 +0000 (16:03 +0200)] 
runtests.pl: add %TESTNUMBER variable to make copying tests more convenient

4 years agoruntests.pl: add an -o option to change internal variables
Fabian Keil [Thu, 9 Oct 2014 13:48:19 +0000 (15:48 +0200)] 
runtests.pl: add an -o option to change internal variables

runtests.pl has lots of internal variables one might want to
change in certain situations, but adding a dedicated option
for every single one of them isn't practical.

Usage:
./runtests.pl -o TESTDIR=$privoxy_curl_test_dir -o HOSTIP=10.0.0.1 ...

4 years agoruntests.pl: cleanups
Fabian Keil [Thu, 15 Nov 2012 14:57:29 +0000 (15:57 +0100)] 
runtests.pl: cleanups

- show the summarized test result in the last line of the report
- do not use $_ after mapping it to a named variable
  Doing that makes the code harder to follow.
- log the restraints sorted by the number of their occurrences
- fix language when logging restraints that only occured once
- let runhttpserver() use $TESTDIR instead of $srcdir
  ... so it works if a non-default $TESTDIR is being used.

4 years agoruntests.pl: add an -E option to specify an exclude file
Fabian Keil [Sat, 17 Nov 2012 11:12:42 +0000 (12:12 +0100)] 
runtests.pl: add an -E option to specify an exclude file

It can contain additional restraints for test numbers,
keywords and tools.

The idea is to let third parties like the Privoxy project
distribute an exclude file with their tarballs that specifies
which curl tests are not expected to work when using Privoxy
as a proxy, without having to fork the whole curl test suite.

The syntax could be changed to be extendable and maybe
more closely reflect the "curl test" syntax. Currently
it's a bunch of lines like these:

test:$TESTNUMBER:Reason why this test with number $TESTNUMBER should be skipped
keyword:$KEYWORD:Reason why tests whose keywords contain the $KEYWORD should be skipped
tool:$TOOL:Reason why tests with tools that contain $TOOL should be skipped

To specify multiple $TESTNUMBERs, $KEYWORDs and $TOOLs
on a single line, split them with commas.

4 years agoruntests.pl: add -L parameter to require additional perl libraries
Fabian Keil [Thu, 5 Jun 2014 10:56:36 +0000 (12:56 +0200)] 
runtests.pl: add -L parameter to require additional perl libraries

This is useful to change the behaviour of the script without
having to modify the file itself, for example to use a custom
compareparts() function that ignores header differences that
are expected to occur when an external proxy is being used.

Such differences are proxy-specific and thus the modifications
should be maintained together with the proxy.

4 years agoruntests.pl: add a -P option to specify an external proxy
Fabian Keil [Sun, 29 Aug 2010 12:12:30 +0000 (14:12 +0200)] 
runtests.pl: add a -P option to specify an external proxy

... that should be used when executing the tests.

The assumption is that the proxy is an HTTP proxy.

This option should be used together with -L to provide
a customized compareparts() version that knows which
proxy-specific header differences should be ignored.

This option doesn't work for all test types yet.

4 years agotests: fixup several tests
Fabian Keil [Fri, 28 Feb 2020 14:00:03 +0000 (15:00 +0100)] 
tests: fixup several tests

missing CRs and modified %hostip

lib556/test556: use a real HTTP version to make test reuse more convenient

make sure the weekday in Date headers matches the date

test61: replace stray "^M" (5e 4d) at the end of a cookie with a '^M' (0d)

Gets the test working with external proxies like Privoxy again.

Closes #6463

4 years agoftp: never set data->set.ftp_append outside setopt
Daniel Stenberg [Mon, 8 Feb 2021 15:21:31 +0000 (16:21 +0100)] 
ftp: never set data->set.ftp_append outside setopt

Since the set value then risks getting used like that when the easy
handle is reused by the application.

Also: renamed the struct field from 'ftp_append' to 'remote_append'
since it is also used for SSH protocols.

Closes #6579

4 years agourldata: remove the 'rtspversion' field
Daniel Stenberg [Mon, 8 Feb 2021 16:04:50 +0000 (17:04 +0100)] 
urldata: remove the 'rtspversion' field

from struct connectdata and the corresponding code in http.c that set
it. It was never used for anything!

Closes #6581

4 years agoCURLOPT_QUOTE.3: clarify that libcurl doesn't parse what's sent
Daniel Stenberg [Mon, 8 Feb 2021 15:51:20 +0000 (16:51 +0100)] 
CURLOPT_QUOTE.3: clarify that libcurl doesn't parse what's sent

... so passed in commands may confuse libcurl's knowledge of state.

Reported-by: Bodo Bergmann
Fixes #6577
Closes #6580

4 years agovtls: factor out Curl_ssl_getsock to field of Curl_ssl
Jacob Hoffman-Andrews [Wed, 3 Feb 2021 01:54:52 +0000 (17:54 -0800)] 
vtls: factor out Curl_ssl_getsock to field of Curl_ssl

Closes #6558

4 years agoRELEASE-PROCEDURE: remove old release dates, add new
Daniel Stenberg [Mon, 8 Feb 2021 13:04:05 +0000 (14:04 +0100)] 
RELEASE-PROCEDURE: remove old release dates, add new

4 years agodocs/SSL-PROBLEMS: enhanced
Daniel Stenberg [Fri, 5 Feb 2021 09:50:51 +0000 (10:50 +0100)] 
docs/SSL-PROBLEMS: enhanced

Elaborate on the intermediate cert issue, and mention that anything
below TLS 1.2 is generally considered insecure these days.

Closes #6572

4 years agoTHANKS: remove a Jon Rumsey dupe
Daniel Stenberg [Fri, 5 Feb 2021 12:23:26 +0000 (13:23 +0100)] 
THANKS: remove a Jon Rumsey dupe

4 years agodocs: fix FILE example url in --metalink documentation
nimaje [Fri, 5 Feb 2021 12:22:35 +0000 (13:22 +0100)] 
docs: fix FILE example url in --metalink documentation

In a url after <scheme>:// follows the possibly empty authority part
till the next /, so that url missed a /.

Closes #6573
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
4 years agohostip: fix build with sync resolver
Daniel Stenberg [Thu, 4 Feb 2021 22:40:54 +0000 (23:40 +0100)] 
hostip: fix build with sync resolver

Reported-by: David Goerger
Follow-up from 8335c6417
Fixes #6566
Closes #6568

4 years agomailmap: Jon Rumsey
Daniel Stenberg [Fri, 5 Feb 2021 07:46:11 +0000 (08:46 +0100)] 
mailmap: Jon Rumsey

4 years agogskit: correct the gskit_send() prototype
Jon Rumsey [Thu, 4 Feb 2021 23:02:18 +0000 (23:02 +0000)] 
gskit: correct the gskit_send() prototype

gskit_send() first paramater is a pointer to Curl_easy not connectdata
struct.

Closes #6570
Fixes #6569

4 years agourldata: fix build without HTTP and MQTT
Daniel Stenberg [Thu, 4 Feb 2021 14:04:18 +0000 (15:04 +0100)] 
urldata: fix build without HTTP and MQTT

Reported-by: Joseph Chen
Fixes #6562
Closes #6563

4 years agoftp: avoid SIZE when asking for a TYPE A file
Daniel Stenberg [Thu, 4 Feb 2021 12:05:03 +0000 (13:05 +0100)] 
ftp: avoid SIZE when asking for a TYPE A file

... as we ignore it anyway because servers don't report the correct size
and proftpd even blatantly returns a 550.

Updates a set of tests accordingly.

Reported-by: awesomenode on github
Fixes #6564
Closes #6565

4 years agopingpong: rename the curl_pp_transfer enum to use PP prefix
Daniel Stenberg [Thu, 4 Feb 2021 12:06:17 +0000 (13:06 +0100)] 
pingpong: rename the curl_pp_transfer enum to use PP prefix

Using an FTP prefix for PP provided functionality was misleading.

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 4 Feb 2021 21:51:26 +0000 (22:51 +0100)] 
RELEASE-NOTES: synced

... and bump pending version to 7.75.1 (for now)

4 years agobuild: fix --disable-http-auth
Jay Satiro [Thu, 4 Feb 2021 19:49:56 +0000 (14:49 -0500)] 
build: fix --disable-http-auth

Broken since 215db08 (precedes 7.75.0).

Reported-by: Benbuck Nason
Fixes https://github.com/curl/curl/issues/6567

4 years agobuild: fix --disable-dateparse
Jay Satiro [Thu, 4 Feb 2021 19:13:00 +0000 (14:13 -0500)] 
build: fix --disable-dateparse

Broken since 215db08 (precedes 7.75.0).

Bug: https://curl.se/mail/lib-2021-02/0008.html
Reported-by: Firefox OS
4 years agoOS400: update for CURLOPT_AWS_SIGV4
jonrumsey [Wed, 3 Feb 2021 20:58:26 +0000 (20:58 +0000)] 
OS400: update for CURLOPT_AWS_SIGV4

chkstrings fails because a new string option that could require codepage
conversion has been added.

Closes #6561
Fixes #6560

4 years agoBUG-BOUNTY: removed the cooperation mention
Daniel Stenberg [Wed, 3 Feb 2021 13:24:09 +0000 (14:24 +0100)] 
BUG-BOUNTY: removed the cooperation mention

4 years agoRELEASE-NOTES: synced curl-7_75_0
Daniel Stenberg [Wed, 3 Feb 2021 07:02:36 +0000 (08:02 +0100)] 
RELEASE-NOTES: synced

4 years agoTHANKS: added contributors from 7.75.0
Daniel Stenberg [Wed, 3 Feb 2021 07:02:36 +0000 (08:02 +0100)] 
THANKS: added contributors from 7.75.0

4 years agocopyright: fix year ranges in need of updates
Daniel Stenberg [Wed, 3 Feb 2021 07:02:36 +0000 (08:02 +0100)] 
copyright: fix year ranges in need of updates

4 years agoTODO: remove items for next SONAME bump etc
Daniel Stenberg [Tue, 2 Feb 2021 07:46:37 +0000 (08:46 +0100)] 
TODO: remove items for next SONAME bump etc

We want to avoid that completely, so we don't plan for things after such
an event.

4 years agongtcp2: Fix build error due to change in ngtcp2_settings
Jay Satiro [Mon, 1 Feb 2021 07:40:42 +0000 (02:40 -0500)] 
ngtcp2: Fix build error due to change in ngtcp2_settings

- Separate ngtcp2_transport_params.

ngtcp2/ngtcp2@05d7adc made ngtcp2_transport_params separate from
ngtcp2_settings.

ngtcp2 master is required to build curl with http3 support.

Closes #6554

4 years agovtls: remove md5sum
Daniel Stenberg [Mon, 1 Feb 2021 22:02:06 +0000 (23:02 +0100)] 
vtls: remove md5sum

As it is not used anymore.

Reported-by: Jacob Hoffman-Andrews
Bug: https://curl.se/mail/lib-2021-02/0000.html

Closes #6557

4 years agoquiche: don't use primary_ip / primary_port
Alessandro Ghedini [Mon, 1 Feb 2021 13:13:37 +0000 (13:13 +0000)] 
quiche: don't use primary_ip / primary_port

Closes #6555