]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 years agourl: fix logic in connection reuse to deny reuse on "unclean" connections
Stefan Eissing [Mon, 6 Mar 2023 11:44:45 +0000 (12:44 +0100)] 
url: fix logic in connection reuse to deny reuse on "unclean" connections

- add parameter to `conn_is_alive()` cfilter method that returns
  if there is input data waiting on the connection
- refrain from re-using connnection from the cache that have
  input pending
- adapt http/2 and http/3 alive checks to digest pending input
  to check the connection state
- remove check_cxn method from openssl as that was just doing
  what the socket filter now does.
- add tests for connection reuse with special server configs

Closes #10690

2 years agox509asn1: use plain %x, not %lx, when the arg is an int
Daniel Stenberg [Mon, 6 Mar 2023 10:32:55 +0000 (11:32 +0100)] 
x509asn1: use plain %x, not %lx, when the arg is an int

Pointed out by Coverity.

Closes #10689

2 years agohttp2: fix handling of RST and GOAWAY to recognize partial transfers
Stefan Eissing [Mon, 6 Mar 2023 16:16:01 +0000 (17:16 +0100)] 
http2: fix handling of RST and GOAWAY to recognize partial transfers

- a reset transfer (HTTP/2 RST) did not always lead to the proper
  error message on receiving its response, leading to wrong reports
  of a successful transfer
- test_05_02 was able to trigger this condition with increased transfer
  count. The simulated response errors did not carry a 'Content-Length'
  so only proper RST handling could detect the abort
- When doing such transfers in parallel, a connection could enter the
  state where
  a) it had been closed (GOAWAY received)
  b) the RST had not been "seen" for the transfer yet
  or c) the GOAWAY announced an error and the last successful
  stream id was not checked against ongoing transfers

Closes #10693

2 years agotests: use dynamic ports numbers in pytest suite
Stefan Eissing [Mon, 6 Mar 2023 15:11:11 +0000 (16:11 +0100)] 
tests: use dynamic ports numbers in pytest suite

- necessary ports are bound at start of test suite and then
  given to server fixtures for use.
- this make parallel use of pytest (in separate directories),
  practically safe for use as OS tend to not reuse such port numbers
  for a while

Closes #10692

2 years agoconnect: fix time_connect and time_appconnect timer statistics
Stefan Eissing [Fri, 3 Mar 2023 16:54:44 +0000 (17:54 +0100)] 
connect: fix time_connect and time_appconnect timer statistics

- time_connect was not updated when the overall connection failed,
  e.g. when SSL verification was unsuccessful, refs #10670
- rework gather those values to interrogate involved filters,
  also from all eyeballing attempts, to report the maximum of
  those values.
- added 3 test cases in test_06 to check reported values on
  successful, partially failed and totally failed connections.

Reported-by: Master Inspire
Fixes #10670
Closes #10671

2 years agotest1905: update output cookie order
Daniel Stenberg [Mon, 6 Mar 2023 07:19:35 +0000 (08:19 +0100)] 
test1905: update output cookie order

After the #10685 update

2 years agotest420: verify expiring cookies
Daniel Stenberg [Sun, 5 Mar 2023 23:19:35 +0000 (00:19 +0100)] 
test420: verify expiring cookies

Cookies that are loaded fine from a jar but then are expired in headers.

2 years agocookie: don't load cookies again when flushing
Daniel Stenberg [Sun, 5 Mar 2023 23:18:41 +0000 (00:18 +0100)] 
cookie: don't load cookies again when flushing

Reported-by: Sergio Mijatovic
Fixes #10677
Closes #10685

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 6 Mar 2023 14:48:54 +0000 (15:48 +0100)] 
RELEASE-NOTES: synced

2 years agodocs: note '--data-urlencode' option
andy5995 [Mon, 6 Mar 2023 07:00:38 +0000 (01:00 -0600)] 
docs: note '--data-urlencode' option

Closes #10687

2 years agoDEPRECATE: the original legacy mingw version 1
Daniel Stenberg [Fri, 3 Mar 2023 13:49:21 +0000 (14:49 +0100)] 
DEPRECATE: the original legacy mingw version 1

Remove completely in September 2023

Closes #10667

2 years agorand: use arc4random as fallback when available
Harry Sintonen [Sat, 4 Mar 2023 07:02:14 +0000 (09:02 +0200)] 
rand: use arc4random as fallback when available

Normally curl uses cryptographically strong random provided by the
selected SSL backend. If compiled without SSL support, a naive built-in
function was used instead.

Generally this was okay, but it will result in some downsides for non-
SSL builds, such as predictable temporary file names.

This change ensures that arc4random will be used instead, if available.

Closes #10672

2 years agotool: dump headers even if file is write-only
Grisha Levit [Sat, 4 Mar 2023 21:32:56 +0000 (16:32 -0500)] 
tool: dump headers even if file is write-only

The fixes in #10079 brought a (seemingly unrelated) change of open mode
from `wb`/`ab` to `wb+`/`ab+` for the headerfile. This makes it no
longer possible to write the header file to e.g. a pipe, like:

    curl -D >(grep ...) file:///dev/null

Which presently results in `Warning: Failed to open /dev/fd/63`

See #10079
Closes #10675

2 years agotests: fix gnutls-serv check
Jay Satiro [Mon, 6 Mar 2023 08:47:16 +0000 (03:47 -0500)] 
tests: fix gnutls-serv check

- If gnutls-serv doesn't exist then don't try to execute it.

Follow-up to 2fdc1d81.

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

2 years agolib1560: fix enumerated type mixed with another type
Daniel Stenberg [Sun, 5 Mar 2023 23:09:19 +0000 (00:09 +0100)] 
lib1560: fix enumerated type mixed with another type

Follow-up to c84c0f9aa3bb006

Closes #10684

2 years agocmake: fix enabling LDAPS on Windows
Viktor Szakats [Sun, 5 Mar 2023 19:55:14 +0000 (19:55 +0000)] 
cmake: fix enabling LDAPS on Windows

Before this patch, enabling LDAPS required a manual C flag:
https://github.com/curl/curl-for-win/blob/c1cfc31cfc04f24f7a4f946564d6f0e1b4d7dd36/curl-cmake.sh#L105

Fix this and enable LDAPS automatically when using `wldap32` (and
when not explicitly disabled). This matches autotools and `Makefile.mk`
behavior. Also remove issue from KNOWN_BUGS.

Add workaround for MSVS 2010 warning triggered by LDAPS now enabled
in more CI tests:
`ldap.c(360): warning C4306: 'type cast' : conversion from 'int' to 'void *' of greater size`
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/46408284/job/v8mwl9yfbmoeqwlr#L312

Reported-by: JackBoosY on github
Reviewed-by: Jay Satiro
Reviewed-by: Marcel Raad
Fixes #6284
Closes #10674

2 years agoMakefile.mk: delete redundant `HAVE_LDAP_SSL` macro [ci skip]
Viktor Szakats [Sun, 5 Mar 2023 19:52:21 +0000 (19:52 +0000)] 
Makefile.mk: delete redundant `HAVE_LDAP_SSL` macro [ci skip]

Since abebb2b8939c6b3e0f951eb2d9ec3729b569aa2c, we set this macro for
all Windows `wldap32` builds using `Makefile.mk`.

For OpenLDAP builds this macro is not enough to enable LDAPS, and
OpenLDAP is not an option in `Makefile.mk`. For Novell LDAP it might
have helped, but it's also not an option anymore in `Makefile.mk`.

The future for LDAPS is that we should enable it by default without
extra build knobs.

Reviewed-by: Marcel Raad
Closes #10681

2 years agocmake: skip CA-path/bundle auto-detection in cross-builds
Viktor Szakats [Sun, 5 Mar 2023 19:51:52 +0000 (19:51 +0000)] 
cmake: skip CA-path/bundle auto-detection in cross-builds

Also remove issue from KNOWN_BUGS.

Reported-by: Cristian Morales Vega
Reviewed-by: Marcel Raad
Fixes #6178
Closes #10676

2 years agoschannel: loop over the algos to pick the selected one
Daniel Stenberg [Wed, 1 Mar 2023 08:59:21 +0000 (09:59 +0100)] 
schannel: loop over the algos to pick the selected one

Avoid using the funny macro and the extra buffer copy.

Closes #10647

2 years agowildcard: remove files and move functions into ftplistparser.c
Daniel Stenberg [Tue, 28 Feb 2023 08:22:46 +0000 (09:22 +0100)] 
wildcard: remove files and move functions into ftplistparser.c

2 years agoftp: allocate the wildcard struct on demand
Daniel Stenberg [Mon, 27 Feb 2023 22:57:23 +0000 (23:57 +0100)] 
ftp: allocate the wildcard struct on demand

The feature is rarely used so this frees up data for the vast majority
of easy handles that don't use it.

Rename "protdata" to "ftpwc" since it is always an FTP wildcard struct
pointer. Made the state struct field an unsigned char to save space.

Closes #10639

2 years agolib1560: test parsing URLs with ridiculously large fields
Daniel Stenberg [Fri, 3 Mar 2023 07:32:45 +0000 (08:32 +0100)] 
lib1560: test parsing URLs with ridiculously large fields

In the order of 120K.

Closes #10665

2 years agourlapi: parse IPv6 literals without ENABLE_IPV6
Brad Spencer [Fri, 17 Feb 2023 20:01:05 +0000 (16:01 -0400)] 
urlapi: parse IPv6 literals without ENABLE_IPV6

This makes the URL parser API stable and working the same way
independently of libcurl supporting IPv6 transfers or not.

Closes #10660

2 years agobuild: drop the use of XC_AMEND_DISTCLEAN
Jan Engelhardt [Thu, 2 Mar 2023 15:08:22 +0000 (16:08 +0100)] 
build: drop the use of XC_AMEND_DISTCLEAN

Because automake used to delete depdirs at once (.deps) and there was an issue
with portability, curl's XC_AMEND_DISTCLEAN greps the Makefiles in an attempt
to build a list of all depfiles and delete them individually instead.

Since commit 08849db866b44510f6b8fd49e313c91a43a3dfd3, automake switched from
deleting directories to individual files. curl's custom logic now finds a lot
more results with the grep (the filtering of these results isn't great), which
causes a massive bloating of the Makefile in the order of O(n^2).

Also remove now-unused XC_AMEND_DISTCLEAN macro group

References: https://github.com/curl/curl/issues/9843
References: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59288

Reported-by: Ilmari Lauhakangas
Fixes #9843
Closes #10661

2 years agotest1470: test socks proxy using unix sockets and connect to https
Balakrishnan Balasubramanian [Thu, 2 Mar 2023 17:16:13 +0000 (12:16 -0500)] 
test1470: test socks proxy using unix sockets and connect to https

Similar to test1468 except using https instead of http

Closes #10662

2 years agotest1960: verify CURL_SOCKOPT_ALREADY_CONNECTED
Daniel Stenberg [Wed, 1 Mar 2023 10:39:17 +0000 (11:39 +0100)] 
test1960: verify CURL_SOCKOPT_ALREADY_CONNECTED

When returned from the CURLOPT_SOCKOPTFUNCTION, like when we have a
custom socket connected in the app, passed in to libcurl.

Verifies the fix in #10648

Closes #10651

2 years agotests: rename tests/tests-httpd to tests/http
Stefan Eissing [Wed, 1 Mar 2023 15:55:31 +0000 (16:55 +0100)] 
tests: rename tests/tests-httpd to tests/http

 - httpd is only one server we test with
 - the suite coveres the HTTP protocol in general where
   the default test cases need a more beefy environment

Closes #10654

2 years agosocket: detect "dead" connections better, e.g. not fit for reuse
Stefan Eissing [Wed, 1 Mar 2023 12:05:09 +0000 (13:05 +0100)] 
socket: detect "dead" connections better, e.g. not fit for reuse

- refs #10646 where reuse was attempted on closed connections in the
  cache, leading to an exhaustion of retries on a transfer
- the mistake was that poll events like POLLHUP, POLLERR, etc
  were regarded as "not dead".
- change cf-socket filter check to regard such events as inidication
  of corpsiness.
- vtls filter checks: fixed interpretation of backend check result
  when inconclusive to interrogate status further down the filter
  chain.

Reported-by: SendSonS on github
Fixes #10646
Closes #10652

2 years agolib: give source files cf-http.* better fitting names
Stefan Eissing [Wed, 1 Mar 2023 15:40:22 +0000 (16:40 +0100)] 
lib: give source files cf-http.* better fitting names

Closes #10656

2 years agohttp2: fix code indent
Stefan Eissing [Wed, 1 Mar 2023 15:18:12 +0000 (16:18 +0100)] 
http2: fix code indent

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

2 years agocf-socket: if socket is already connected, return CURLE_OK
Shankar Jadhavar [Wed, 1 Mar 2023 09:02:08 +0000 (14:32 +0530)] 
cf-socket: if socket is already connected, return CURLE_OK

In 7.87.0, if callback method for CURLOPT_SOCKOPTFUNCTION returns
CURL_SOCKOPT_ALREADY_CONNECTED then curl library used to return
CURLE_OK.  n 7.88.0, now even if callback returns
CURL_SOCKOPT_ALREADY_CONNECTED, curl library still tries to connect to
socket by invoking method do_connect().

This is regression caused by commit
https://github.com/curl/curl/commit/71b7e0161032927cdfb

Fix: Check if we are already connected and return CURLE_OK.

Fixes #10626
Closes #10648

2 years agoDYNBUF.md: note Curl_dyn_add* calls Curl_dyn_free on failure
Jay Satiro [Wed, 1 Mar 2023 03:45:28 +0000 (22:45 -0500)] 
DYNBUF.md: note Curl_dyn_add* calls Curl_dyn_free on failure

This is the existing behavior and it has been widely assumed in the
codebase.

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

2 years agohttp2: fix upload busy loop
Stefan Eissing [Thu, 9 Feb 2023 09:16:50 +0000 (10:16 +0100)] 
http2: fix upload busy loop

- Set KEEP_SEND_PAUSE when exhausting remote HTTP/2 window size of a
  stream.

- Clear KEEP_SEND_PAUSE when receiving HTTP/2 window updates on a paused
  stream.

- Also fix http2 send compiler warnings reported in #10449.

Prior to this change, starting in 71b7e016 which precedes 7.88.0,
libcurl may eat CPU during HTTP/2 upload.

Reported-by: Jay Satiro
Fixes https://github.com/curl/curl/issues/10449
Fixes https://github.com/curl/curl/issues/10618
Closes https://github.com/curl/curl/pull/10627

2 years agosectransp: make read_cert() use a dynbuf when loading
Daniel Stenberg [Mon, 27 Feb 2023 19:36:22 +0000 (20:36 +0100)] 
sectransp: make read_cert() use a dynbuf when loading

Closes #10632

2 years agotransfer: limit Windows SO_SNDBUF updates to once a second
Jay Satiro [Sun, 26 Feb 2023 08:44:38 +0000 (03:44 -0500)] 
transfer: limit Windows SO_SNDBUF updates to once a second

- Change readwrite_upload() to call win_update_buffer_size() no more
  than once a second to update SO_SNDBUF (send buffer limit).

Prior to this change during an upload readwrite_upload() could call
win_update_buffer_size() anywhere from hundreds of times per second to
an extreme test case of 100k per second (which is likely due to a bug,
see #10618). In the latter case WPA profiler showed
win_update_buffer_size was the highest capture count in
readwrite_upload. In any case the calls were excessive and unnecessary.

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

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

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 28 Feb 2023 22:08:14 +0000 (23:08 +0100)] 
RELEASE-NOTES: synced

2 years agohttp2: fix for http2-prior-knowledge when reusing connections
Stefan Eissing [Tue, 28 Feb 2023 10:43:50 +0000 (11:43 +0100)] 
http2: fix for http2-prior-knowledge when reusing connections

- refs #10634 where errors in the HTTP/2 framing layer are observed.
- the bug was that on connection reuse, the code attempted to switch
  in yet another layer of HTTP/2 handling instead of detecting that
  this was already in place.
- added pytest testcase reproducing the issue.

Reported-by: rwmjones on github
Fixes #10634
Closes #10643

2 years agocf-socket: fix handling of remote addr for accepted tcp sockets
Stefan Eissing [Tue, 28 Feb 2023 10:05:06 +0000 (11:05 +0100)] 
cf-socket: fix handling of remote addr for accepted tcp sockets

- do not try to determine the remote address of a listen socket. There
  is none.
- Update remote address of an accepted socket by getpeername() if
  available.

Reported-by: Harry Sintonen
Fixes #10622
Closes #10642

2 years agohttp: fix unix domain socket use in https connects
Stefan Eissing [Tue, 28 Feb 2023 09:07:21 +0000 (10:07 +0100)] 
http: fix unix domain socket use in https connects

- when h2/h3 eyeballing was involved, unix domain socket
  configurations were not honoured
- configuring --unix-socket will disable HTTP/3 as candidate for eyeballing
- combinatino of --unix-socket and --http3-only will fail during initialisation
- adding pytest test_11 to reproduce

Reported-by: Jelle van der Waa
Fixes #10633
Closes #10641

2 years agosetopt: move the CURLOPT_CHUNK_DATA pointer to the set struct
Daniel Stenberg [Mon, 27 Feb 2023 22:44:39 +0000 (23:44 +0100)] 
setopt: move the CURLOPT_CHUNK_DATA pointer to the set struct

To make duphandle work etc

Closes #10635

2 years agoquic/schannel: fix compiler warnings
Viktor Szakats [Mon, 27 Feb 2023 00:19:58 +0000 (00:19 +0000)] 
quic/schannel: fix compiler warnings

Fixes #10603
Closes #10616

2 years agopage-footer: add explanation for three missing exit codes
Daniel Stenberg [Mon, 27 Feb 2023 18:47:28 +0000 (19:47 +0100)] 
page-footer: add explanation for three missing exit codes

Added in 7.73.0, 7.77.0 and 7.84.0

Closes #10630

2 years agorate.c: single URLs make no sense in --rate example
積丹尼 Dan Jacobson [Tue, 28 Feb 2023 01:36:30 +0000 (09:36 +0800)] 
rate.c: single URLs make no sense in --rate example

Here somehow you need to put more than one URL in these examples, else
they will make no sense, as --rate only affects the second and beyond
URLs. The first URL will always finish the same time no matter what
--rate is given.

Closes #10638

2 years agolibcurl-errors.3: add the CURLHcode errors from curl_easy_header.3
Daniel Stenberg [Mon, 27 Feb 2023 18:43:35 +0000 (19:43 +0100)] 
libcurl-errors.3: add the CURLHcode errors from curl_easy_header.3

Closes #10629

2 years agomqtt: on send error, return error
Daniel Stenberg [Mon, 27 Feb 2023 09:02:22 +0000 (10:02 +0100)] 
mqtt: on send error, return error

Reported-by: Maciej Domanski
Closes #10623

2 years agows: keep the socket non-blocking
Daniel Stenberg [Mon, 27 Feb 2023 15:55:57 +0000 (16:55 +0100)] 
ws: keep the socket non-blocking

Reported-by: marski on github
Fixes #10615
Closes #10625

2 years agohostip: avoid sscanf and extra buffer copies
Daniel Stenberg [Fri, 24 Feb 2023 08:20:51 +0000 (09:20 +0100)] 
hostip: avoid sscanf and extra buffer copies

Also made create_hostcache_id() return the id length.

Closes #10601

2 years agoPARALLEL-TRANSFERS.md: not "early days" for this anymore
Daniel Stenberg [Mon, 27 Feb 2023 15:41:36 +0000 (16:41 +0100)] 
PARALLEL-TRANSFERS.md: not "early days" for this anymore

Refresh the language as the support is now over three years old

Closes #10624

2 years agoeasy: remove infof() debug leftover from curl_easy_recv
Daniel Stenberg [Mon, 27 Feb 2023 17:12:07 +0000 (18:12 +0100)] 
easy: remove infof() debug leftover from curl_easy_recv

It said "reached [path]/easy.c:1231"

Closes #10628

2 years agoidn: return error if the conversion ends up with a blank host
Daniel Stenberg [Fri, 24 Feb 2023 17:17:33 +0000 (18:17 +0100)] 
idn: return error if the conversion ends up with a blank host

Some IDN sequences are converted into "" (nothing), which can make this
function end up with a zero length host name and we cannot consider that
a valid host to continue with.

Reported-by: Maciej Domanski
Closes #10617

2 years agoexamples/http3.c: use CURL_HTTP_VERSION_3
Daniel Stenberg [Mon, 27 Feb 2023 09:12:59 +0000 (10:12 +0100)] 
examples/http3.c: use CURL_HTTP_VERSION_3

and update the comment

Closes #10619

2 years agox509asn1.c: use correct format specifier for infof() call
Daniel Stenberg [Sun, 26 Feb 2023 22:03:33 +0000 (23:03 +0100)] 
x509asn1.c: use correct format specifier for infof() call

Detected by Coverity

Closes #10614

2 years agoRevert "GHA: add Microsoft C++ Code Analysis"
Daniel Stenberg [Sun, 26 Feb 2023 16:38:53 +0000 (17:38 +0100)] 
Revert "GHA: add Microsoft C++ Code Analysis"

This reverts commit e0db842b2a082dffad4a9fbe31321e9a75c74041.

This tool seems very restricted in how often it might be used by a
project and thus very quickly start to report fails simply because it
refuses to run when "there are more runs than allowed".

Closes #10613

2 years agotests: test secure mail protocols with explicit SSL requests
Patrick Monnerat [Sat, 25 Feb 2023 10:49:31 +0000 (11:49 +0100)] 
tests: test secure mail protocols with explicit SSL requests

New tests 987, 988 and 989, disabled for rustls (hanging).

Closes #10077

2 years agotests: support for imaps/pop3s/smtps protocols
Patrick Monnerat [Sat, 25 Feb 2023 10:49:31 +0000 (11:49 +0100)] 
tests: support for imaps/pop3s/smtps protocols

Closes #10077

2 years agoruntests: use a hash table for server port numbers
Patrick Monnerat [Sat, 25 Feb 2023 10:49:31 +0000 (11:49 +0100)] 
runtests: use a hash table for server port numbers

Closes #10077

2 years agoINTERNALS.md: grammar
andy5995 [Sat, 25 Feb 2023 07:00:40 +0000 (01:00 -0600)] 
INTERNALS.md: grammar

Closes #10607

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 24 Feb 2023 23:20:06 +0000 (00:20 +0100)] 
RELEASE-NOTES: synced

2 years ago.cirrus.yml: Bump to FreeBSD 13.2
Philip H [Tue, 10 Jan 2023 11:11:23 +0000 (12:11 +0100)] 
.cirrus.yml: Bump to FreeBSD 13.2

Closes #10270

2 years agongtcp2-gnutls.yml: bump to gnutls 3.8.0
Philip H [Tue, 14 Feb 2023 10:27:31 +0000 (11:27 +0100)] 
ngtcp2-gnutls.yml: bump to gnutls 3.8.0

Closes #10507

2 years agoCI: update ngtcp2 and nghttp2 for pytest
Philip H [Tue, 14 Feb 2023 11:40:32 +0000 (12:40 +0100)] 
CI: update ngtcp2 and nghttp2 for pytest

Follow-up: https://github.com/curl/curl/commit/5c9ee8cef4b351a085b440f8178500124647f8e6

Closes #10508

2 years agoGHA: use same flags for Slackbuild as Slack package
andy5995 [Wed, 15 Feb 2023 19:27:51 +0000 (13:27 -0600)] 
GHA: use same flags for Slackbuild as Slack package

Closes #10526

2 years agortsp: avoid sscanf for parsing
Daniel Stenberg [Fri, 24 Feb 2023 16:31:43 +0000 (17:31 +0100)] 
rtsp: avoid sscanf for parsing

Closes #10605

2 years agohttp_proxy: parse the status line without sscanf
Daniel Stenberg [Fri, 24 Feb 2023 11:39:26 +0000 (12:39 +0100)] 
http_proxy: parse the status line without sscanf

Closes #10602

2 years agotelnet: error correctly for WS set to "x[num]"
Daniel Stenberg [Fri, 24 Feb 2023 17:38:32 +0000 (18:38 +0100)] 
telnet: error correctly for WS set to "x[num]"

Follow-up to e4f93be9d587
Reported-by: Harry Sintonen
Closes #10606

2 years agokrb5: avoid sscanf for parsing
Daniel Stenberg [Fri, 24 Feb 2023 07:38:19 +0000 (08:38 +0100)] 
krb5: avoid sscanf for parsing

Closes #10599

2 years agomisc: remove support for curl_off_t < 8 bytes
Daniel Stenberg [Thu, 23 Feb 2023 23:45:16 +0000 (00:45 +0100)] 
misc: remove support for curl_off_t < 8 bytes

Closes #10597

2 years agotelnet: parse NEW_ENVIRON without sscanf
Daniel Stenberg [Thu, 23 Feb 2023 17:26:50 +0000 (18:26 +0100)] 
telnet: parse NEW_ENVIRON without sscanf

Closes #10596

2 years agotelnet: parse the WS= argument without sscanf
Daniel Stenberg [Thu, 23 Feb 2023 17:20:16 +0000 (18:20 +0100)] 
telnet: parse the WS= argument without sscanf

Closes #10596

2 years agotelnet: parse telnet options without sscanf
Daniel Stenberg [Thu, 23 Feb 2023 17:14:35 +0000 (18:14 +0100)] 
telnet: parse telnet options without sscanf

Closes #10596

2 years agoftp: replace sscanf for MDTM 213 response parsing
Daniel Stenberg [Thu, 23 Feb 2023 10:36:04 +0000 (11:36 +0100)] 
ftp: replace sscanf for MDTM 213 response parsing

Closes #10590

2 years agoftp: replace sscanf for PASV parsing
Daniel Stenberg [Thu, 23 Feb 2023 09:52:59 +0000 (10:52 +0100)] 
ftp: replace sscanf for PASV parsing

Closes #10590

2 years agoftp: make the EPSV response parser not use sscanf
Daniel Stenberg [Wed, 22 Feb 2023 23:29:47 +0000 (00:29 +0100)] 
ftp: make the EPSV response parser not use sscanf

Closes #10590

2 years agongtcp2: fix unwanted close of file descriptor 0
Stefan Eissing [Thu, 23 Feb 2023 15:54:02 +0000 (16:54 +0100)] 
ngtcp2: fix unwanted close of file descriptor 0

... causing macOS to hand out 0 as next socket handle and failing on
further operations.

Reported-by: Sergey Fionov
Fixes #10593
Closes #10595

2 years agoselect: stop treating POLLRDBAND as an error
Daniel Stenberg [Thu, 23 Feb 2023 11:19:26 +0000 (12:19 +0100)] 
select: stop treating POLLRDBAND as an error

POLLRDBAND does not seem to be an general error and on Windows the value
for POLLIN is 768 and the value for POLLRDBAND is 512.

Fixes #10501
Reported-by: opensslonzos-github on github
Closes #10592

2 years agotest978: mark file as text mode
Daniel Stenberg [Thu, 23 Feb 2023 13:45:57 +0000 (14:45 +0100)] 
test978: mark file as text mode

Follow-up to 4ea5702980cb

To fix test failures on Windows

Closes #10594

2 years agohttp: rewrite the status line parser without sscanf
Daniel Stenberg [Tue, 21 Feb 2023 22:59:18 +0000 (23:59 +0100)] 
http: rewrite the status line parser without sscanf

Closes #10585

2 years agotest978: verify that --stderr works for -w's stderr as well
Daniel Stenberg [Mon, 20 Feb 2023 23:01:04 +0000 (00:01 +0100)] 
test978: verify that --stderr works for -w's stderr as well

2 years agocurl: make -w's %{stderr} use the file set with --stderr
Jay Satiro [Mon, 20 Feb 2023 13:16:41 +0000 (14:16 +0100)] 
curl: make -w's %{stderr} use the file set with --stderr

Reported-by: u20221022 on github
Fixes #10491
Closes #10569

2 years agowinbuild: fix makefile clean
Jay Satiro [Tue, 21 Feb 2023 08:38:37 +0000 (03:38 -0500)] 
winbuild: fix makefile clean

- Fix and move 'clean' code that removes the output and obj directories
  trees from MakefileBuild.vc to Makefile.vc.

Prior to this change the 'clean' code did not work right because the
variables containing the directory names were not fully initialized and
the rmdir syntax was sometimes incorrect (typos). DIRDIST for example
was set to ..\builds\ and not ..\builds\$(CONFIG_NAME_LIB)\ so it would
remove the former and not the latter. If WITH_PREFIX was set then that
directory was removed instead.

Also, DIRDIST (the output directory) even if initialized should not be
removed by MakefileBuild.vc because by that time it could be set to a
user directory that may contain other files if WITH_PREFIX is set (eg we
don't want rmdir /s /q C:\usr\local). Therefore we remove from
Makefile.vc before any of that happens. I added a comment in both
makefiles explaining this.

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

2 years agosectransp: fix compiler warning c89 mixed code/declaration
Jay Satiro [Tue, 21 Feb 2023 04:28:14 +0000 (23:28 -0500)] 
sectransp: fix compiler warning c89 mixed code/declaration

Since cbf57176 the Cirrus CI 'macOS arm64 SecureTransport http2' has
been failing due to c89 warnings mixed code/declaration. That commit is
not the cause so I assume something has changed in the CI outside of our
configuration. Anyway, we don't mix code/declaration so this is the fix
for that.

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

2 years agoBINDINGS: add Fortran binding
Philipp Engel [Wed, 22 Feb 2023 15:13:35 +0000 (16:13 +0100)] 
BINDINGS: add Fortran binding

Closes #10589

2 years agotest2600: detect when ALARM_TIMEOUT is in use and adjust
Stefan Eissing [Fri, 17 Feb 2023 09:48:34 +0000 (10:48 +0100)] 
test2600: detect when ALARM_TIMEOUT is in use and adjust

- use higher timeout values > 1s
- skip duration checks

Assisted-by: Marcel Raad
Closes #10513

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 22 Feb 2023 14:39:16 +0000 (15:39 +0100)] 
RELEASE-NOTES: synced

2 years agotest686: verify return code for no URL after --next
Daniel Stenberg [Tue, 21 Feb 2023 11:12:06 +0000 (12:12 +0100)] 
test686: verify return code for no URL after --next

2 years agotool_operate: propagate error codes for missing URL after --next
Daniel Stenberg [Tue, 21 Feb 2023 11:09:37 +0000 (12:09 +0100)] 
tool_operate: propagate error codes for missing URL after --next

Fixes #10558
Reported-by: u20221022 on github
Closes #10580

2 years agotest1278: verify that an extra --no-remote-name cause no warning
Daniel Stenberg [Tue, 21 Feb 2023 12:31:59 +0000 (13:31 +0100)] 
test1278: verify that an extra --no-remote-name cause no warning

2 years agotool_getparam: don't add a new node for just --no-remote-name
Daniel Stenberg [Tue, 21 Feb 2023 11:32:48 +0000 (12:32 +0100)] 
tool_getparam: don't add a new node for just --no-remote-name

Unless --remote-name-all is used.

Fixes #10564
Reported-by: u20221022 on github
Closes #10582

2 years agogen.pl: add '%GLOBALS' as a variable for mainpage
Daniel Stenberg [Tue, 21 Feb 2023 16:17:49 +0000 (17:17 +0100)] 
gen.pl: add '%GLOBALS' as a variable for mainpage

And use it in page-header to list all global command line options.

2 years agodocs/cmdline-opts: mark all global options
Daniel Stenberg [Tue, 21 Feb 2023 15:42:26 +0000 (16:42 +0100)] 
docs/cmdline-opts: mark all global options

gen.pl now outputs a generic explanations for them for each option

Fixes #10566
Reported-by: u20221022 on github
Closes #10584

2 years agoGHA: add Microsoft C++ Code Analysis
Daniel Stenberg [Tue, 21 Feb 2023 12:52:30 +0000 (13:52 +0100)] 
GHA: add Microsoft C++ Code Analysis

Closes #10583

2 years agotool_progress: shut off progress meter for --silent in parallel
Daniel Stenberg [Tue, 21 Feb 2023 10:38:03 +0000 (11:38 +0100)] 
tool_progress: shut off progress meter for --silent in parallel

Reported-by: finkjsc on github
Fixes #10573
Closes #10579

2 years agolib1560: add a test using %25 in the userinfo in a URL
Daniel Stenberg [Tue, 21 Feb 2023 09:02:34 +0000 (10:02 +0100)] 
lib1560: add a test using %25 in the userinfo in a URL

Closes #10578

2 years agoCURLOPT_PIPEWAIT: allow waited reuse also for subsequent connections
Stefan Eissing [Thu, 9 Feb 2023 15:07:34 +0000 (16:07 +0100)] 
CURLOPT_PIPEWAIT: allow waited reuse also for subsequent connections

As tested in test_02_07, when firing off 200 urls with --parallel, 199
wait for the first connection to be established. if that is multiuse,
urls are added up to its capacity.

The first url over capacity opens another connection. But subsequent
urls found the same situation and open a connection too. They should
have waited for the second connection to actually connect and make its
capacity known.

This change fixes that by

- setting `connkeep()` early in the HTTP setup handler. as otherwise
  a new connection is marked as closeit by default and not considered
  for multiuse at all
- checking the "connected" status for a candidate always and continuing
  to PIPEWAIT if no alternative is found.

pytest:
- removed "skip" from test_02_07
- added test_02_07b to check that http/1.1 continues to work as before

Closes #10456

2 years agotest419: verify --dump-header to file that cannot be created
Daniel Stenberg [Mon, 20 Feb 2023 22:19:06 +0000 (23:19 +0100)] 
test419: verify --dump-header to file that cannot be created

Closes #10571

2 years agotool_operate: avoid fclose(NULL) on bad header dump file
Daniel Stenberg [Mon, 20 Feb 2023 17:35:13 +0000 (18:35 +0100)] 
tool_operate: avoid fclose(NULL) on bad header dump file

Fixes #10570
Reported-by: Jérémy Rabasco
Closes #10571

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 20 Feb 2023 22:54:13 +0000 (23:54 +0100)] 
RELEASE-NOTES: synced

Starting the journey towards 8.0.0

2 years agocookie: parse without sscanf()
Daniel Stenberg [Mon, 20 Feb 2023 22:49:51 +0000 (23:49 +0100)] 
cookie: parse without sscanf()

Saves us from using 2*4096 bytes buffers on stack, the extra copies and
more.

Closes #10550

2 years agolib517: verify time stamps without leading zeroes plus some more
Daniel Stenberg [Fri, 17 Feb 2023 09:39:36 +0000 (10:39 +0100)] 
lib517: verify time stamps without leading zeroes plus some more

2 years agoparsedate: replace sscanf( for time stamp parsing
Daniel Stenberg [Fri, 17 Feb 2023 10:23:12 +0000 (11:23 +0100)] 
parsedate: replace sscanf( for time stamp parsing

Closes #10547