]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
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

2 years agoparsedate: parse strings without using sscanf()
Daniel Stenberg [Fri, 17 Feb 2023 09:04:31 +0000 (10:04 +0100)] 
parsedate: parse strings without using sscanf()

- sscanf is slow and complex, avoid it
- give up already if the string is 12 bytes or longer as no valid string
  can be that long
- this can now be done without copy

Closes #10547

2 years agotests: HTTP server fixups
Matt Jolly [Mon, 20 Feb 2023 08:29:03 +0000 (19:29 +1100)] 
tests: HTTP server fixups

- httpserver.pl -> http-server.pl for consistency
- add http3-server.pl to EXTRA_DIST; alphabetise for maintainability
- nghttpx proxy invocation scripts should not use getcwd

Closes #10568

2 years agoRELEASE-NOTES: synced curl-7_88_1
Daniel Stenberg [Mon, 20 Feb 2023 07:23:23 +0000 (08:23 +0100)] 
RELEASE-NOTES: synced

7.88.1 release

2 years agoTHANKS: add contributors from 7.88.1
Daniel Stenberg [Mon, 20 Feb 2023 07:24:31 +0000 (08:24 +0100)] 
THANKS: add contributors from 7.88.1

2 years agosocketpair: allow EWOULDBLOCK when reading the pair check bytes
Daniel Stenberg [Sun, 19 Feb 2023 10:03:21 +0000 (11:03 +0100)] 
socketpair: allow EWOULDBLOCK when reading the pair check bytes

Reported-by: Gunamoi Software
Co-authored-by: Jay Satiro
Fixes #10561
Closes #10562

2 years agotool_operate: fix scanbuild compiler warning
Jay Satiro [Sat, 18 Feb 2023 21:06:11 +0000 (16:06 -0500)] 
tool_operate: fix scanbuild compiler warning

Prior to this change Azure CI scanbuild warned of a potential NULL
pointer string passed to strtol when CURLDEBUG enabled, even though the
way the code was written it wouldn't have happened.

Bug: https://github.com/curl/curl/commit/5479d991#r101159711
Reported-by: Marcel Raad
Closes https://github.com/curl/curl/pull/10559

2 years agocurl_setup: Suppress OpenSSL 3 deprecation warnings
Jay Satiro [Fri, 17 Feb 2023 08:40:05 +0000 (03:40 -0500)] 
curl_setup: Suppress OpenSSL 3 deprecation warnings

- Define OPENSSL_SUPPRESS_DEPRECATED.

OpenSSL 3 has deprecated some of the functions libcurl uses such as
those with DES, MD5 and ENGINE prefix. We don't have replacements for
those functions so the warnings were disabled in autotools and cmake
builds, but still showed in other builds.

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

2 years agobuild-openssl.bat: keep OpenSSL 3 engine binaries
Jay Satiro [Fri, 17 Feb 2023 08:26:07 +0000 (03:26 -0500)] 
build-openssl.bat: keep OpenSSL 3 engine binaries

Prior to this change copying the OpenSSL 3 engine binaries failed
because 'engines-1_1' (OpenSSL 1.1.x folder name) was erroneously used
instead of 'engines-3'. The OpenSSL 3 builds would complete successfully
but without the engine binaries.

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

2 years agocmake: fix Windows check for CryptAcquireContext
ALittleDruid [Sat, 28 Jan 2023 12:23:25 +0000 (20:23 +0800)] 
cmake: fix Windows check for CryptAcquireContext

Check for CryptAcquireContext in windows.h and wincrypt.h only, since
otherwise this check may fail due to third party headers not found.

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

2 years agoremote-header-name.d: mention that filename* is not supported
Daniel Stenberg [Sat, 18 Feb 2023 09:18:57 +0000 (10:18 +0100)] 
remote-header-name.d: mention that filename* is not supported

and that you can use --clobber to allow overwriting.

Ref: #10533
Closes #10555

Co-authored-by: Jay Satiro <raysatiro@yahoo.com>
2 years agoCURLOPT_WS_OPTIONS.3: fix the availability version
Pierrick Charron [Sat, 18 Feb 2023 17:38:36 +0000 (12:38 -0500)] 
CURLOPT_WS_OPTIONS.3: fix the availability version

Closes #10557

2 years agoGHA: update rustls dependency to 0.9.2
Jacob Hoffman-Andrews [Fri, 17 Feb 2023 20:59:44 +0000 (12:59 -0800)] 
GHA: update rustls dependency to 0.9.2

This allows re-enabling test 312 for the rustls backend.

Closes #10553

2 years agoHTTP3.md: update git branches
Philip H [Fri, 17 Feb 2023 21:42:31 +0000 (22:42 +0100)] 
HTTP3.md: update git branches

Closes #10554

2 years agourldata: remove `now` from struct SingleRequest - not needed
Stefan Eissing [Fri, 17 Feb 2023 11:53:13 +0000 (12:53 +0100)] 
urldata: remove `now` from struct SingleRequest - not needed

Closes #10549

2 years agolib1560: add IPv6 canonicalization tests
Daniel Stenberg [Fri, 17 Feb 2023 16:43:25 +0000 (17:43 +0100)] 
lib1560: add IPv6 canonicalization tests

Closes #10552

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 16 Feb 2023 13:53:47 +0000 (14:53 +0100)] 
RELEASE-NOTES: synced

2 years agourlapi: do the port number extraction without using sscanf()
Daniel Stenberg [Thu, 16 Feb 2023 23:16:39 +0000 (00:16 +0100)] 
urlapi: do the port number extraction without using sscanf()

- sscanf() is rather complex and slow, strchr() much simpler

- the port number function does not need to fully verify the IPv6 address
  anyway as it is done later in the hostname_check() function and doing
  it twice is unnecessary.

Closes #10541

2 years agosetopt: allow HTTP3 when HTTP2 is not defined
Stefan Eissing [Fri, 17 Feb 2023 09:17:06 +0000 (10:17 +0100)] 
setopt: allow HTTP3 when HTTP2 is not defined

Reported-by: Karthikdasari0423 on github
Fixes #10538
Closes #10544

2 years agoos400: correct Curl_os400_sendto()
jonrumsey [Thu, 16 Feb 2023 20:46:49 +0000 (20:46 +0000)] 
os400: correct Curl_os400_sendto()

Add const qualifier to 5th argument of Curl_os400_sendto()

Make OS400 wrapper for sendto match the normal prototype of sendto()
with a const qualifier.

Fixes #10539
Closes #10548

2 years agotests-httpd: add proxy tests
Stefan Eissing [Wed, 15 Feb 2023 11:39:46 +0000 (12:39 +0100)] 
tests-httpd: add proxy tests

for direct and tunneling checks on http: and https:

Closes #10519

2 years agocurl: make --silent work stand-alone
Daniel Stenberg [Thu, 16 Feb 2023 15:34:36 +0000 (16:34 +0100)] 
curl: make --silent work stand-alone

- renamed the struct field to 'silent' to match the cmdline option
- make --show-error toggle independently of --silent
- make --silent independent of ->noprogress as well

By doing this, the three options --silent, --no-progress-meter and
--show-error should work independently of each other and also work with
and without '--no-' prefix as documented.

Reported-by: u20221022 on github
Fixes #10535
Closes #10536

2 years agosocks: allow using DoH to resolve host names
Daniel Stenberg [Thu, 16 Feb 2023 22:52:22 +0000 (23:52 +0100)] 
socks: allow using DoH to resolve host names

For SOCKS modes where a local host resolve is done.

It was previously disabled in 12d655d4561, but a few local tests seem to
indicate that it works fine. Works now because of the SOCKS refactor of
4a4b63daaa01ef59 that made it non-blocking.

Reported-by: roughtex on github
Fixes #10537
Closes #10540

2 years agotest: add test for HTTP/2 corruption as reported in #10525
Stefan Eissing [Thu, 16 Feb 2023 13:09:16 +0000 (14:09 +0100)] 
test: add test for HTTP/2 corruption as reported in #10525

- adding test_02_20 for reproducing the situation
- using recently released mod_h2 Apache module
- skipping test if an older version is installed
- adding installation of current mod_h2 to github pytest workflow

This reproduces the error reliable (for me) on the lib/http2.c version
of curl 7.88.0. And passes with the recent curl master.

Closes #10534

2 years agotool_operate: allow debug builds to set buffersize
Daniel Stenberg [Thu, 16 Feb 2023 08:26:55 +0000 (09:26 +0100)] 
tool_operate: allow debug builds to set buffersize

Using the CURL_BUFFERSIZE environment variable.

Closes #10532

2 years agoconnnect: fix timeout handling to use full duration
Stefan Eissing [Wed, 15 Feb 2023 09:31:52 +0000 (10:31 +0100)] 
connnect: fix timeout handling to use full duration

- connect timeout was used at half the configured value, if the
  destination had 1 ip version 4 and other version 6 addresses
  (or the other way around)
- extended test2600 to reproduce these cases

Reported-by: Michael Kaufmann
Fixes #10514
Closes #10517