Commit Graph

30096 Commits

Author SHA1 Message Date
andy5995
7c3822fe45
docs: note '--data-urlencode' option
Closes #10687
2023-03-06 15:35:48 +01:00
Daniel Stenberg
e4d5685cb5
DEPRECATE: the original legacy mingw version 1
Remove completely in September 2023

Closes #10667
2023-03-06 11:31:33 +01:00
Harry Sintonen
755ddbe901
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
2023-03-06 11:21:38 +01:00
Grisha Levit
1dd929674e
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
2023-03-06 11:14:37 +01:00
Jay Satiro
c12e8bfa89 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
2023-03-06 03:52:46 -05:00
Daniel Stenberg
54605666ed
lib1560: fix enumerated type mixed with another type
Follow-up to c84c0f9aa3

Closes #10684
2023-03-06 08:14:42 +01:00
Viktor Szakats
8cfc936f5c
cmake: fix enabling LDAPS on Windows
Before this patch, enabling LDAPS required a manual C flag:
c1cfc31cfc/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
2023-03-05 19:55:14 +00:00
Viktor Szakats
8d0fa3a70d
Makefile.mk: delete redundant HAVE_LDAP_SSL macro [ci skip]
Since abebb2b893, 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
2023-03-05 19:52:21 +00:00
Viktor Szakats
016c62c4d5
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
2023-03-05 19:51:52 +00:00
Daniel Stenberg
e135bc9d31
schannel: loop over the algos to pick the selected one
Avoid using the funny macro and the extra buffer copy.

Closes #10647
2023-03-03 23:26:41 +01:00
Daniel Stenberg
56d5c07bbb
wildcard: remove files and move functions into ftplistparser.c 2023-03-03 23:25:30 +01:00
Daniel Stenberg
9c188e771c
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
2023-03-03 23:25:23 +01:00
Daniel Stenberg
c84c0f9aa3
lib1560: test parsing URLs with ridiculously large fields
In the order of 120K.

Closes #10665
2023-03-03 23:23:53 +01:00
Brad Spencer
ad4997e5b2
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
2023-03-03 10:05:08 +01:00
Jan Engelhardt
73e9e6d767
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
2023-03-03 09:54:44 +01:00
Balakrishnan Balasubramanian
351ea4ff53
test1470: test socks proxy using unix sockets and connect to https
Similar to test1468 except using https instead of http

Closes #10662
2023-03-03 09:18:21 +01:00
Daniel Stenberg
e4dfe6fc2f
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
2023-03-03 08:36:25 +01:00
Stefan Eissing
e497a96a0e
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
2023-03-02 14:05:19 +01:00
Stefan Eissing
9fd2d5aa72
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
2023-03-02 09:03:06 +01:00
Stefan Eissing
9deebd311b
lib: give source files cf-http.* better fitting names
Closes #10656
2023-03-02 08:48:34 +01:00
Stefan Eissing
8151d7babc http2: fix code indent
Closes https://github.com/curl/curl/pull/10655
2023-03-02 00:09:53 -05:00
Shankar Jadhavar
233810bb5f
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
2023-03-01 11:52:18 +01:00
Jay Satiro
d36c632c86 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
2023-03-01 04:18:15 -05:00
Stefan Eissing
d9ccc75b00 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
2023-03-01 04:13:49 -05:00
Daniel Stenberg
c50a6eee04
sectransp: make read_cert() use a dynbuf when loading
Closes #10632
2023-03-01 09:38:43 +01:00
Jay Satiro
0b84d0cf1b 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
2023-03-01 01:15:28 -05:00
Daniel Stenberg
a496d46a7b
RELEASE-NOTES: synced 2023-02-28 23:08:14 +01:00
Stefan Eissing
cbe9d82c22
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
2023-02-28 23:04:00 +01:00
Stefan Eissing
efa1aba97c
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
2023-02-28 23:03:17 +01:00
Stefan Eissing
a4d015e69f
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
2023-02-28 22:59:19 +01:00
Daniel Stenberg
c9c3ec482b
setopt: move the CURLOPT_CHUNK_DATA pointer to the set struct
To make duphandle work etc

Closes #10635
2023-02-28 08:44:28 +01:00
Viktor Szakats
51211a31a5
quic/schannel: fix compiler warnings
Fixes #10603
Closes #10616
2023-02-28 08:43:16 +01:00
Daniel Stenberg
13afb87268
page-footer: add explanation for three missing exit codes
Added in 7.73.0, 7.77.0 and 7.84.0

Closes #10630
2023-02-28 08:26:36 +01:00
積丹尼 Dan Jacobson
8d708e4cad
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
2023-02-28 08:24:23 +01:00
Daniel Stenberg
26c6d822bc
libcurl-errors.3: add the CURLHcode errors from curl_easy_header.3
Closes #10629
2023-02-28 08:21:34 +01:00
Daniel Stenberg
252fce70b1
mqtt: on send error, return error
Reported-by: Maciej Domanski

Closes #10623
2023-02-28 08:11:55 +01:00
Daniel Stenberg
3b23dbeec1
ws: keep the socket non-blocking
Reported-by: marski on github
Fixes #10615
Closes #10625
2023-02-28 00:38:21 +01:00
Daniel Stenberg
788c6b3864
hostip: avoid sscanf and extra buffer copies
Also made create_hostcache_id() return the id length.

Closes #10601
2023-02-27 20:43:13 +01:00
Daniel Stenberg
c5168365c7
PARALLEL-TRANSFERS.md: not "early days" for this anymore
Refresh the language as the support is now over three years old

Closes #10624
2023-02-27 20:08:54 +01:00
Daniel Stenberg
a26547b2a2
easy: remove infof() debug leftover from curl_easy_recv
It said "reached [path]/easy.c:1231"

Closes #10628
2023-02-27 19:50:25 +01:00
Daniel Stenberg
cf3e6ce92f
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
2023-02-27 15:12:29 +01:00
Daniel Stenberg
49a9f13c39
examples/http3.c: use CURL_HTTP_VERSION_3
and update the comment

Closes #10619
2023-02-27 15:11:13 +01:00
Daniel Stenberg
22eec78027
x509asn1.c: use correct format specifier for infof() call
Detected by Coverity

Closes #10614
2023-02-27 08:26:01 +01:00
Daniel Stenberg
aa31f9a856
Revert "GHA: add Microsoft C++ Code Analysis"
This reverts commit e0db842b2a.

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
2023-02-26 23:05:12 +01:00
Patrick Monnerat
90756d33d8
tests: test secure mail protocols with explicit SSL requests
New tests 987, 988 and 989, disabled for rustls (hanging).

Closes #10077
2023-02-25 11:49:31 +01:00
Patrick Monnerat
5855c478cb
tests: support for imaps/pop3s/smtps protocols
Closes #10077
2023-02-25 11:49:31 +01:00
Patrick Monnerat
8bfa4d66de
runtests: use a hash table for server port numbers
Closes #10077
2023-02-25 11:49:31 +01:00
andy5995
9fcc91006a
INTERNALS.md: grammar
Closes #10607
2023-02-25 10:54:49 +01:00
Daniel Stenberg
0232e160e1
RELEASE-NOTES: synced 2023-02-25 00:20:06 +01:00
Philip H
682854c790
.cirrus.yml: Bump to FreeBSD 13.2
Closes #10270
2023-02-25 00:15:57 +01:00