Commit Graph

29343 Commits

Author SHA1 Message Date
Daniel Stenberg
19bfaca7cc
spellcheck.words: remove 'github' as an accepted word
Prefer the properly cased version: GitHub

Use markdown for links and GitHub in text.

Closes #9810
2022-10-27 15:53:11 +02:00
Ayesh Karunaratne
4484270afc
misc: typo and grammar fixes
- Replace `Github` with `GitHub`.
- Replace `windows` with `Windows`
- Replace `advice` with `advise` where a verb is used.
- A few fixes on removing repeated words.
- Replace `a HTTP` with `an HTTP`

Closes #9802
2022-10-27 10:01:30 +02:00
Viktor Szakats
b7260c4fda
windows: fix linking .rc to shared curl with autotools
`./configure --enable-shared --disable-static` fails when trying to link
a shared `curl.exe`, due to `libtool` magically changing the output
filename of `windres` to one that it doesn't find when linking:

```
/bin/sh ../libtool --tag=RC --mode=compile windres -I../../curl/include -DCURL_EMBED_MANIFEST  -i ../../curl/src/curl.rc -o curl.o
libtool: compile:  windres -I../../curl/include -DCURL_EMBED_MANIFEST -i ../../curl/src/curl.rc  -o .libs/curl.o
[...]
CCLD     curl.exe
clang: error: no such file or directory: 'curl.o'
```

Let's resolve this by skipping `libtool` and calling `windres` directly
when building `src` (aka `curl.exe`). Leave `lib` unchanged, as it does
need the `libtool` magic. This solution is compatible with building
a static `curl.exe`.

This build scenario is not CI-tested.

While here, delete an obsolete comment about a permanent `libtool`
warning that we've resolved earlier.

Regression from 6de7322c03

Reported-by: Christoph Reiter
Fixes #9803
Closes #9805
2022-10-27 06:45:32 +00:00
Viktor Szakats
811c799f2d
cmake: really enable warnings with clang
Even though `PICKY_COMPILER=ON` is the default, warnings were not
enabled when using llvm/clang, because `CMAKE_COMPILER_IS_CLANG` was
always false (in my tests at least).

This is the single use of this variable in curl, and in a different
place we already use `CMAKE_C_COMPILER_ID MATCHES "Clang"`, which works
as expected, so change the condition to use that instead.

Also fix the warnings uncovered by the above:

- lib: add casts to silence clang warnings

- schannel: add casts to silence clang warnings in ALPN code

  Assuming the code is correct, solve the warnings with a cast.
  This particular build case isn't CI tested.

  There is a chance the warning is relevant for some platforms, perhaps
  Windows 32-bit ARM7.

Closes #9783
2022-10-26 09:56:52 +00:00
Joel Depooter
df77eff278
sendf: remove unnecessary if condition
At this point, the psnd->buffer will always exist. We have already
allocated a new buffer if one did not previously exist, and returned
from the function if the allocation failed.

Closes #9801
2022-10-26 11:48:59 +02:00
Viktor Szakats
b51560b9ff
winidn: drop WANT_IDN_PROTOTYPES
`WANT_IDN_PROTOTYPES` was necessary to avoid using a header that came
via an optional package. MS stopped distributing this package some
years ago and the winidn definitions are part of standard headers (via
`windows.h`) since Vista.

Auto-detect Vista inside `lib/idn_win32.c` and enable the manual
definitions if building for an older Windows.

This allows to delete this manual knob from all build-systems.

Also drop the `_SAL_VERSION` sub-case:

Our manual definitions are now only enabled with old systems. We assume
that code analysis is not run on such systems, allowing us to delete the
SAL-friendly flavour of these.

Reviewed-by: Jay Satiro
Closes #9793
2022-10-26 09:45:23 +00:00
Daniel Stenberg
279834dd45
misc: remove duplicated include files
Closes #9796
2022-10-26 11:27:59 +02:00
Daniel Stenberg
3678336b20
scripts/checksrc.pl: detect duplicated include files
After an idea by Dan Fandrich in #9794

Closes #9796
2022-10-26 11:27:29 +02:00
Daniel Stenberg
6092eaa3e6
RELEASE-NOTES: synced
And bumped version to 7.86.1 for now
2022-10-26 11:23:41 +02:00
Daniel Stenberg
716ad5ea49
CURLMOPT_SOCKETFUNCTION.3: clarify CURL_POLL_REMOVE
The removal is brief or long, don't assume.

Reported-by: Luca Niccoli

Fixes #9799
Closes #9800
2022-10-26 11:23:35 +02:00
Daniel Stenberg
cd95ee9f77
RELEASE: synced
The 7.86.0 release
2022-10-26 08:12:46 +02:00
Daniel Stenberg
934ecfae17
THANKS: added from the 7.86.0 release 2022-10-26 08:12:46 +02:00
Viktor Szakats
86c0029047
noproxy: include netinet/in.h for htonl()
Solve the Amiga build warning by including `netinet/in.h`.

`krb5.c` and `socketpair.c` are using `htonl()` too. This header is
already included in those sources.

Regression from 1e9a538e05

Reviewed-by: Daniel Stenberg
Closes #9787
2022-10-25 15:20:45 +00:00
Marc Hoersken
0e6e56930f
CI: fix AppVeyor status failing for starting jobs 2022-10-24 20:50:27 +02:00
Daniel Stenberg
038bfb8522
test445: verifies the protocols-over-http-proxy flaw and fix 2022-10-24 15:30:25 +02:00
Daniel Stenberg
55e1875729
http_proxy: restore the protocol pointer on error
Reported-by: Trail of Bits

Closes #9790
2022-10-24 15:30:25 +02:00
Daniel Stenberg
9d0869d234
multi: remove duplicate include of connect.h
Reported-by: Martin Strunz
Fixes #9794
Closes #9795
2022-10-24 13:49:22 +02:00
Daniel Gustafsson
d4a4d5402f idn: fix typo in test description
s/enabked/enabled/i
2022-10-24 13:38:26 +02:00
Daniel Stenberg
53bcf55b45
url: use IDN decoded names for HSTS checks
Reported-by: Hiroki Kurosawa

Closes #9791
2022-10-24 12:00:54 +02:00
Daniel Stenberg
809c81b9f5
unit1614: fix disabled-proxy build
Follow-up to 1e9a538e05

Closes #9792
2022-10-24 11:58:03 +02:00
Daniel Gustafsson
8f384577b8 cookies: optimize control character check
When checking for invalid octets the strcspn() call will return the
position of the first found invalid char or the first NULL byte.
This means that we can check the indicated position in the search-
string saving a strlen() call.

Closes: #9736
Reviewed-by: Jay Satiro <raysatiro@yahoo.com>
2022-10-24 11:31:08 +02:00
Daniel Stenberg
c97ec984fb
netrc: replace fgets with Curl_get_line
Make the parser only accept complete lines and avoid problems with
overly long lines.

Reported-by: Hiroki Kurosawa

Closes #9789
2022-10-24 11:29:03 +02:00
Daniel Stenberg
84c6b1a02f
RELEASE-NOTES: add "Planned upcoming removals include"
URL: https://curl.se/mail/archive-2022-10/0001.html

Suggested-by: Dan Fandrich
2022-10-23 17:27:17 +02:00
Viktor Szakats
b9a8da4e6e
ci: bump to gcc-11 for macos
Ref: https://github.blog/changelog/2022-10-03-github-actions-jobs-running-on-macos-latest-are-now-running-on-macos-12/
Ref: https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md

Reviewed-by: Max Dymond
Closes #9785
2022-10-23 12:40:26 +00:00
Viktor Szakats
a0d8a1aa91
Makefile.m32: reintroduce CROSSPREFIX and -W -Wall [ci skip]
- Reintroduce `CROSSPREFIX`:

  If set, we add it to the `CC` and `AR` values, and to the _default_
  value of `RC`, which is `windres`. This allows to control each of
  these individidually, while also allowing to simplify configuration
  via `CROSSPREFIX`.

  This variable worked differently earlier. Hopefully this new solution
  hits a better compromise in usefulness/complexity/flexibility.

  Follow-up to: aa970c4c08

- Enable warnings again:

  This time with an option to override it via `CFLAGS`. Warnings are
  also enabled by default in CMake, `makefile.dj` and `makefile.amiga`
  builds (not in autotools though).

  Follow-up to 10fbd8b4e3

Closes #9784
2022-10-22 23:21:03 +00:00
Viktor Szakats
9b63dda16e
noproxy: silence unused variable warnings with no ipv6
Follow-up to 36474f1050

Reviewed-by: Daniel Stenberg
Closes #9782
2022-10-22 23:20:26 +00:00
Daniel Stenberg
f5e5384ec3
test644: verify --xattr (with redirect) 2022-10-22 23:56:38 +02:00
Daniel Stenberg
3ab3c16b2c
tool_xattr: save the original URL, not the final redirected one
Adjusted test 1621 accordingly.

Reported-by: Viktor Szakats
Fixes #9766
Closes #9768
2022-10-22 23:56:23 +02:00
Daniel Stenberg
873cc38e89
docs: make sure libcurl opts examples pass in long arguments
Reported-by: Sergey
Fixes #9779
Closes #9780
2022-10-22 23:24:57 +02:00
Marc Hoersken
c2e9376a89
CI: fix AppVeyor job links only working for most recent build
Ref: https://github.com/curl/curl/pull/9768#issuecomment-1286675916
Reported-by: Daniel Stenberg

Follow up to #9769
2022-10-21 22:54:32 +02:00
Viktor Szakats
36474f1050
noproxy: fix builds without AF_INET6
Regression from 1e9a538e05

Reviewed-by: Daniel Stenberg

Closes #9778
2022-10-21 19:06:25 +00:00
Daniel Stenberg
1e9a538e05
noproxy: support proxies specified using cidr notation
For both IPv4 and IPv6 addresses. Now also checks IPv6 addresses "correctly"
and not with string comparisons.

Split out the noproxy checks and functionality into noproxy.c

Added unit test 1614 to verify checking functions.

Reported-by: Mathieu Carbonneaux

Fixes #9773
Fixes #5745
Closes #9775
2022-10-21 13:39:20 +02:00
Daniel Stenberg
b15ca64bb0
urlapi: remove two variable assigns
To please scan-build:

urlapi.c:1163:9: warning: Value stored to 'qlen' is never read
        qlen = Curl_dyn_len(&enc);
        ^      ~~~~~~~~~~~~~~~~~~
urlapi.c:1164:9: warning: Value stored to 'query' is never read
        query = u->query = Curl_dyn_ptr(&enc);
        ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Follow-up to 7d6cf06f57

Closes #9777
2022-10-21 11:00:18 +02:00
Jeremy Maitin-Shepard
8698825106
cmake: improve usability of CMake build as a sub-project
- Renames `uninstall` -> `curl_uninstall`
- Ensures all export rules are guarded by CURL_ENABLE_EXPORT_TARGET

Closes #9638
2022-10-21 09:29:09 +02:00
Don Olmstead
2e69df0a26
easy_lock: check for HAVE_STDATOMIC_H as well
The check for `HAVE_STDATOMIC_H` looks to see if the `stdatomic.h`
header is present.

Closes #9755
2022-10-21 09:23:02 +02:00
Daniel Stenberg
4a5a270699
RELEASE-NOTES: synced 2022-10-21 09:20:26 +02:00
Brad Harder
6a7c776ee6
CURLMOPT_PIPELINING.3: dedup manpage xref
Closes #9776
2022-10-20 23:17:00 +02:00
Marc Hoersken
9f3d3bfb71
CI: report AppVeyor build status for each job
Also give each job on AppVeyor CI a human-readable name.

This aims to make job and therefore build failures more visible.

Reviewed-by: Marcel Raad
Closes #9769
2022-10-20 20:48:13 +02:00
Viktor Szakats
a20f74a16a
amiga: set SIZEOF_CURL_OFF_T=8 by default [ci skip]
Reviewed-by: Daniel Stenberg

Closes #9771
2022-10-20 09:10:15 +00:00
Viktor Szakats
3dc8f6f255
connect: fix builds without AF_INET6
Regression from 2b309560c1

Reviewed-by: Daniel Stenberg
Reviewed-by: Jay Satiro

Closes #9770
2022-10-20 09:09:36 +00:00
Daniel Stenberg
1943fe14be
test1105: adjust <data> to work with a hyper build
Closes #9767
2022-10-20 08:58:31 +02:00
Daniel Stenberg
7d6cf06f57
urlapi: fix parsing URL without slash with CURLU_URLENCODE
When CURLU_URLENCODE is set, the parser would mistreat the path
component if the URL was specified without a slash like in
http://local.test:80?-123

Extended test 1560 to reproduce and verify the fix.

Reported-by: Trail of Bits

Closes #9763
2022-10-20 08:56:53 +02:00
Marc Hoersken
81094cb492
tests: avoid CreateThread if _beginthreadex is available
CreateThread is not threadsafe if mixed with CRT calls.
_beginthreadex on the other hand can be mixed with CRT.

Reviewed-by: Marcel Raad
Closes #9705
2022-10-19 11:59:00 +02:00
Joel Depooter
3f5a7975a5 schannel: Don't reset recv/send function pointers on renegotiation
These function pointers will have been set when the initial TLS
handshake was completed. If they are unchanged, there is no need to set
them again. If they have been changed, as is the case with HTTP/2, we
don't want to override that change. That would result in the
http22_recv/send functions being completely bypassed.

Prior to this change a connection that uses Schannel with HTTP/2 would
fail on renegotiation with error "Received HTTP/0.9 when not allowed".

Fixes https://github.com/curl/curl/issues/9451
Closes https://github.com/curl/curl/pull/9756
2022-10-19 04:07:06 -04:00
Viktor Szakats
1c567f797b
hostip: guard PF_INET6 use
Some platforms (e.g. Amiga OS) do not have `PF_INET6`. Adjust the code
for these.

```
hostip.c: In function 'fetch_addr':
hostip.c:308:12: error: 'PF_INET6' undeclared (first use in this function)
       pf = PF_INET6;
            ^~~~~~~~
```

Regression from 1902e8fc51

Reviewed-by: Daniel Stenberg

Closes #9760
2022-10-18 18:27:59 +00:00
Viktor Szakats
05d23823d7
amiga: do not hardcode openssl/zlib into the os config [ci skip]
Enable them in `lib/makefile.amiga` and `src/makefile.amiga` instead.

This allows builds without openssl and/or zlib. E.g. with the
<https://github.com/bebbo/amiga-gcc> cross-compiler.

Reviewed-by: Daniel Stenberg

Closes #9762
2022-10-18 18:22:41 +00:00
Viktor Szakats
357649c477
amigaos: add missing curl header [ci skip]
Without it, `CURLcode` and `CURLE_*` are undefined. `lib/hostip.h` and
conditional local code need them.

Reviewed-by: Daniel Stenberg

Closes #9761
2022-10-18 18:22:09 +00:00
Daniel Stenberg
ef305de95c
cmdline/docs: add a required 'multi' keyword for each option
The keyword specifies how option works when specified multiple times:

 - single: the last provided value replaces the earlier ones
 - append: it supports being provided multiple times
 - boolean: on/off values
 - mutex: flag-like option that disable anoter flag

The 'gen.pl' script then outputs the proper and unified language for
each option's multi-use behavior in the generated man page.

The multi: header is requires in each .d file and will cause build error
if missing or set to an unknown value.

Closes #9759
2022-10-18 18:50:25 +02:00
Daniel Stenberg
40f3504401
CURLOPT_AUTOREFERER.3: highlight the privacy leak risk
Closes #9757
2022-10-18 16:04:12 +02:00
Daniel Stenberg
dae84805de
mprintf: reject two kinds of precision for the same argument
An input like "%.*1$.9999d" would first use the precision taken as an
argument *and* then the precision specified in the string, which is
confusing and wrong. pass1 will now instead return error on this double
use.

Adjusted unit test 1398 to verify

Reported-by: Peter Goodman

Closes #9754
2022-10-18 08:43:40 +02:00