Commit Graph

29352 Commits

Author SHA1 Message Date
Patrick Schlangen
b8c302dcba
docs: remove performance note in CURLOPT_SSL_VERIFYPEER
This note became obsolete since PR #7892 (see also discussion in the PR
comments).

Closes #9832
2022-10-30 22:26:24 +01:00
Daniel Stenberg
02186a6605
tests/server: make use of strcasecompare from lib/
... instead of having a second private implementation.

Idea triggered by #9830

Closes #9831
2022-10-30 22:23:58 +01:00
Daniel Stenberg
a55256cfb2
curl: timeout in the read callback
The read callback can timeout if there's nothing to read within the
given maximum period. Example use case is when doing "curl -m 3
telnet://example.com" or anything else that expects input on stdin or
similar that otherwise would "hang" until something happens and then not
respect the timeout.

This fixes KNOWN_BUG 8.1, first filed in July 2009.

Bug: https://sourceforge.net/p/curl/bugs/846/

Closes #9815
2022-10-28 17:57:14 +02:00
Daniel Stenberg
b830f9ba9e
noproxy: fix tail-matching
Also ignore trailing dots in both host name and comparison pattern.

Regression in 7.86.0 (from 1e9a538e05)

Extended test 1614 to verify better.

Reported-by: Henning Schild
Fixes #9821
Closes #9822
2022-10-28 17:54:48 +02:00
Daniel Stenberg
d4fed2a13a
docs: explain the noproxy CIDR notation support
Follow-up to 1e9a538e05

Closes #9818
2022-10-28 09:02:22 +02:00
jonrumsey
a3063fe014
os400: use platform socklen_t in Curl_getnameinfo_a
Curl_getnameinfo_a() is prototyped before including curl.h as an
ASCII'fied wrapper for getnameinfo(), which itself is prototyped with
socklen_t arguments, so this should use the platform socklen_t and not
curl_socklen_t too.

Update setup-os400.h

Fixes #9811
Closes #9812
2022-10-27 23:35:47 +02:00
Daniel Stenberg
efc286b7a6
noproxy: also match with adjacent comma
If the host name is an IP address and the noproxy string contained that
IP address with a following comma, it would erroneously not match.

Extended test 1614 to verify this combo as well.

Reported-by: Henning Schild

Fixes #9813
Closes #9814
2022-10-27 23:31:31 +02:00
Randall S. Becker
fc8d6b2370 build: fix for NonStop
- Include arpa/inet.h in all units where htonl is called.

Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>

Closes https://github.com/curl/curl/pull/9816
2022-10-27 16:57:53 -04:00
Randall S. Becker
1e52285335 system.h: support 64-bit curl_off_t for NonStop 32-bit
- Correctly define curl_off_t on NonStop (ie __TANDEM) ia64 and x86 for
  32-bit builds.

Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca>

Closes https://github.com/curl/curl/pull/9817
2022-10-27 16:55:44 -04:00
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