Commit Graph

27708 Commits

Author SHA1 Message Date
Marcel Raad
60300291fd config: remove HAVE_WINSOCK_H definition
It's not used anymore.

Closes https://github.com/curl/curl/pull/7795
2021-09-29 15:54:33 +02:00
Marcel Raad
0259e8c35f lib: remove HAVE_WINSOCK_H usage
WinSock v1 is not supported anymore. Exclusively use `HAVE_WINSOCK2_H`
instead.

Closes https://github.com/curl/curl/pull/7795
2021-09-29 15:54:31 +02:00
Daniel Stenberg
f53b89314d
easyoptions: add the two new PRE* options
Follow-up to a517378de5

Also fix optiontable.pl to do the correct remainder on the entry.

Reported-by: Gisle Vanem
Bug: a517378de5 (commitcomment-57224830)
Closes #7791
2021-09-29 14:48:02 +02:00
Daniel Stenberg
180180a44d
Revert "build: remove checks for WinSock 1"
Due to CI issues

This reverts commit c2ea04f92b.

Closes #7790
2021-09-29 10:42:49 +02:00
Daniel Gustafsson
12246eddc5 lib: avoid fallthrough cases in switch statements
Commit b5a434f7f0 inhibits the warning
on implicit fallthrough cases, since the current coding of indicating
fallthrough with comments is falling out of fashion with new compilers.
This attempts to make the issue smaller by rewriting fallthroughs to no
longer fallthrough, via either breaking the cases or turning switch
statements into if statements.

  lib/content_encoding.c: the fallthrough codepath is simply copied
    into the case as it's a single line.
  lib/http_ntlm.c: the fallthrough case skips a state in the state-
    machine and fast-forwards to NTLMSTATE_LAST. Do this before the
    switch statement instead to set up the states that we actually
    want.
  lib/http_proxy.c: the fallthrough is just falling into exiting the
    switch statement which can be done easily enough in the case.
  lib/mime.c: switch statement rewritten as if statement.
  lib/pop3.c: the fallthrough case skips to the next state in the
    statemachine, do this explicitly instead.
  lib/urlapi.c: switch statement rewritten as if statement.
  lib/vssh/wolfssh.c: the fallthrough cases fast-forwards the state
    machine, do this by running another iteration of the switch
    statement instead.
  lib/vtls/gtls.c: switch statement rewritten as if statement.
  lib/vtls/nss.c: the fallthrough codepath is simply copied into the
    case as it's a single line. Also twiddle a comment to not be
    inside a non-brace if statement.

Closes: #7322
See-also: #7295
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2021-09-29 10:00:52 +02:00
Marcel Raad
2b7e56aab3
config-win32ce: enable WinSock 2
WinSock 2.2 is supported by Windows CE .NET 4.1 (from 2002, out of
support since 2013).

Ref: https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ms899586(v=msdn.10)

Closes https://github.com/curl/curl/pull/7778
2021-09-28 19:29:30 +02:00
Marcel Raad
7a0c160473
externalsocket: use WinSock 2.2
That's the only version we support.

Closes https://github.com/curl/curl/pull/7778
2021-09-28 19:29:29 +02:00
Marcel Raad
c2ea04f92b
build: remove checks for WinSock 1
It's not supported anymore.

Closes https://github.com/curl/curl/pull/7778
2021-09-28 19:29:27 +02:00
Daniel Stenberg
acfe94c08f
scripts/copyright: .muse is .lift now
And update 5 files with old copyright year range
2021-09-28 16:42:18 +02:00
Daniel Stenberg
ce6e3e5320
cmdline-opts: made the 'Added:' field mandatory
Since "too old" versions are no longer included in the generated man
page, this field is now mandatory so that it won't be forgotten and then
not included in the documentation.

Closes #7786
2021-09-28 16:20:12 +02:00
Daniel Stenberg
ebf18468c0
curl.1: remove mentions of really old version changes
To make the man page more readable, this change removes all references
to changes in support/versions etc that happened before 7.30.0 from the
curl.1 output file. 7.30.0 was released on Apr 12 2013. This particular
limit is a bit arbitrary but was fairly easy to grep for.

It is handled like this: the 'Added' keyword is only used in output if
it refers to 7.30.0 or later. All occurances of "(Added in $VERSION)" in
description will be stripped out if the mentioned $VERSION is from
before 7.30.0. It is therefore important that the "Added in..."
references are always written exactly like that - and on a single line,
not split over two.

This change removes about 80 version number references from curl.1, down
to 138 from 218.

Closes #7786
2021-09-28 16:19:59 +02:00
Daniel Stenberg
6f19f68e93
RELEASE-NOTES: synced 2021-09-28 08:27:24 +02:00
Daniel Stenberg
74e9c7790f
tool_cb_prg: make resumed upload progress bar show better
This is a regression that was *probably* injected in the larger progress
bar overhaul in 2018.

Reported-by: beslick5 on github
Fixes #7760
Closes #7777
2021-09-27 23:17:44 +02:00
Daniel Stenberg
15910dfd14
gen.pl: insert the current date and version in generated man page
Reported-by: Gisle Vanem
Ref: #7780
Closes #7782
2021-09-27 22:35:48 +02:00
Daniel Stenberg
1ddfa8e480
NTLM: use DES_set_key_unchecked with OpenSSL
... as the previously used function DES_set_key() will in some cases
reject using a key that it deems "weak" which will cause curl to
continue using the unitialized buffer content as key instead.

Assisted-by: Harry Sintonen
Fixes #7779
Closes #7781
2021-09-27 22:34:20 +02:00
Marc Hoersken
02c9802fd1
CI: align make and test flags in various config files
1. Use Makefile target to run tests in autotools builds on AppVeyor.
2. Disable testing of SCP protocol on native Windows environments.
3. Remove redundant parameters -a -p from target test-nonflaky.
4. Don't use -vc parameter which is reserved for debugging.

Replaces #7591
Closes #7690
2021-09-27 20:59:29 +02:00
Daniel Stenberg
31692f17c9
mailmap: unify Max! 2021-09-27 17:22:00 +02:00
Max Dymond
a517378de5
CURLOPT_PREREQFUNCTION: add new callback
Triggered before a request is made but after a connection is set up

Changes:

- callback: Update docs and callback for pre-request callback
- Add documentation for CURLOPT_PREREQDATA and CURLOPT_PREREQFUNCTION,
- Add redirect test and callback failure test
- Note that the function may be called multiple times on a redirection
- Disable new 2086 test due to Windows weirdness

Closes #7477
2021-09-27 17:16:43 +02:00
Daniel Stenberg
06981ba7f6
KNOWN_BUGS: HTTP/2 connections through HTTPS proxy frequently stall
Closes #6936
2021-09-27 10:05:16 +02:00
Daniel Stenberg
c9c1bfb145
TODO: make configure use --cache-file more and better
Closes #7753
2021-09-27 09:50:05 +02:00
Sergey Markelov
4b997626b1
urlapi: support UNC paths in file: URLs on Windows
- file://host.name/path/file.txt is a valid UNC path
  \\host.name\path\files.txt to a non-local file transformed into URI
  (RFC 8089 Appendix E.3)

- UNC paths on other OSs must be smb: URLs

Closes #7366
2021-09-27 08:32:41 +02:00
i-ky
3363eeb262
urlapi: add curl_url_strerror()
Add curl_url_strerror() to convert CURLUcode into readable string and
facilitate easier troubleshooting in programs using URL API.
Extend CURLUcode with CURLU_LAST for iteration in unit tests.
Update man pages with a mention of new function.
Update example code and tests with new functionality where it fits.

Closes #7605
2021-09-27 08:28:46 +02:00
Daniel Stenberg
f0b8d1c5f6
RELEASE-NOTES: synced 2021-09-26 23:44:51 +02:00
Mats Lindestam
d1e7d9197b
libssh2: add SHA256 fingerprint support
Added support for SHA256 fingerprint in command line curl and in
libcurl.

Closes #7646
2021-09-26 23:20:53 +02:00
Daniel Stenberg
1ca62bb5ce
libcurl.rc: switch out the copyright symbol for plain ASCII
Reported-by: Vitaly Varyvdin
Assisted-by: Viktor Szakats
Fixes #7765
Closes #7776
2021-09-26 23:10:03 +02:00
Jun-ya Kato
4a10a99ef0
ngtcp2: fix QUIC transport parameter version
fix inappropriate version setting for QUIC transport parameters.
this patch keeps curl with ngtcp2 uses QUIC draft version (h3-29).

Closes #7771
2021-09-25 16:06:13 +02:00
Daniel Stenberg
5c4e46c724
examples/imap-append: fix end-of-data check
Reported-by: Alexander Chuykov
Fixes #7774
Closes #7775
2021-09-25 14:47:23 +02:00
Michael Kaufmann
60738f398c vtls: Fix a memory leak if an SSL session cannot be added to the cache
On connection shutdown, a new TLS session ticket may arrive after the
SSL session cache has already been destructed. In this case, the new
SSL session cannot be added to the SSL session cache.

The callers of Curl_ssl_addsessionid() need to know whether the SSL
session has been added to the cache. If it has not been added, the
reference counter of the SSL session must not be incremented, or memory
used by the SSL session must be freed. This is now possible with the new
output parameter "added" of Curl_ssl_addsessionid().

Fixes #7683
Closes #7752
2021-09-24 13:23:42 +02:00
Momoka Yamamoto
f4a3ae8ea8
HTTP3.md: use 'autoreconf -fi' instead of buildconf
buildconf is not used since #5853

Closes #7746
2021-09-24 13:16:21 +02:00
Daniel Stenberg
dca60077c9
GIT-INFO: rephrase to adapt to s/buildconf/autoreconf 2021-09-24 13:14:52 +02:00
h1zzz
ecfc96c9bb
llist: remove redundant code, branch will not be executed
Closes #7770
2021-09-24 12:49:53 +02:00
tlahn
01f63ed62a
HTTP-COOKIES.md: remove duplicate 'each'
Closes #7772
2021-09-24 12:47:03 +02:00
Joel Depooter
739de69ee6 libssh2: Get the version at runtime if possible
Previously this code used a compile time constant, meaning that libcurl
always reported the libssh2 version that libcurl was built with. This
could differ from the libssh2 version actually being used. The new code
uses the CURL_LIBSSH2_VERSION macro, which is defined in ssh.h. The
macro calls the libssh2_version function if it is available, otherwise
it falls back to the compile time version.

Closes https://github.com/curl/curl/pull/7768
2021-09-24 01:41:53 -04:00
Joel Depooter
bb72392647 schannel: fix typo
Closes https://github.com/curl/curl/pull/7769
2021-09-24 01:33:11 -04:00
Daniel Stenberg
3455d29d7b
cmake: with OpenSSL, define OPENSSL_SUPPRESS_DEPRECATED
To avoid the "... is deprecated" warnings brought by OpenSSL v3.
(We need to address the underlying code at some point of course.)

Assisted-by: Jakub Zakrzewski
Closes #7767
2021-09-23 23:30:13 +02:00
Daniel Stenberg
7aaf533518
curl-openssl: pass argument to sed single-quoted
... instead of using an escaped double-quote. This is an attempt to make
this work better with ksh that otherwise would insist on a double
escape!

Reported-by: Randall S. Becker
Fixes #7758
Closes #7764
2021-09-23 16:05:28 +02:00
Daniel Stenberg
23ca537aa4
RELEASE-NOTES: synced
Bumped curlver to 7.80.0-dev
2021-09-23 13:10:52 +02:00
a1346054
7cf5e8e70e
misc: fix typos in docs and comments
No user facing output from curl/libcurl is changed by this, just
comments.

Closes #7747
2021-09-23 12:57:55 +02:00
Thomas M. DuBuisson
33363aeb4d
ci: update Lift config to match requirements of curl build
Also renamed Muse -> Lift, the new tool name.

Closes #7761
2021-09-23 12:57:04 +02:00
Rikard Falkeborn
e75be2c4b2
cleanup: constify unmodified static structs
Constify a number of static structs that are never modified. Make them
const to show this.

Closes #7759
2021-09-23 12:54:35 +02:00
Daniel Stenberg
c7aef0a945
RELEASE-NOTES: synced
curl 7.79.1 release
2021-09-22 08:10:23 +02:00
Daniel Stenberg
267b83e07f
THANKS: added names from the 7.79.1 release 2021-09-22 08:10:23 +02:00
Daniel Stenberg
883cf374d8
test897: verify delivery of IMAP post-body header content
The "content" is delivered as "body" by curl, but the envelope continues
after the body and the rest of it should be delivered as header.

The IMAP server can now get 'POSTFETCH' set to include more data to
include after the body and test 897 is done to verify that such "extra"
header data is in fact delivered by curl as header.

Ref: #7284 but fails to reproduce the issue

Closes #7748
2021-09-21 08:18:42 +02:00
Daniel Stenberg
68fb593f0d
KNOWN_BUGS: connection migration doesn't work
Closes #7695
2021-09-19 23:20:42 +02:00
Daniel Stenberg
acc90327db
RELEASE-NOTES: synced 2021-09-19 13:38:04 +02:00
Daniel Stenberg
beb8990d93
http: fix the broken >3 digit response code detection
When the "reason phrase" in the HTTP status line starts with a digit,
that was treated as the forth response code digit and curl would claim
the response to be non-compliant.

Added test 1466 to verify this case.

Regression brought by 5dc594e44f
Reported-by: Glenn de boer
Fixes #7738
Closes #7739
2021-09-17 17:52:00 +02:00
Jay Satiro
b0eda8dc6e strerror: use sys_errlist instead of strerror on Windows
- Change Curl_strerror to use sys_errlist[errnum] instead of strerror to
  retrieve the error message on Windows.

Windows' strerror writes to a static buffer and is not thread-safe.

Follow-up to 2f0bb86 which removed most instances of strerror in favor
of calling Curl_strerror (which calls strerror_r for other platforms).

Ref: https://github.com/curl/curl/pull/7685
Ref: https://github.com/curl/curl/commit/2f0bb86

Closes https://github.com/curl/curl/pull/7735
2021-09-17 03:44:54 -04:00
Daniel Stenberg
4a4617756a
dist: provide lib/.checksrc in the tarball
So that debug builds work (checksrc really)

Reported-by: Marcel Raad
Reported-by: tawmoto on github
Fixes #7733
Closes #7734
2021-09-16 22:55:09 +02:00
Daniel Stenberg
f2f3c8ce07
TODO: Improve documentation about fork safety
Closes #6968
2021-09-16 13:44:06 +02:00
Daniel Stenberg
da2598f823
hsts: CURLSTS_FAIL from hsts read callback should fail transfer
... and have CURLE_ABORTED_BY_CALLBACK returned.

Extended test 1915 to verify.

Reported-by: Jonathan Cardoso
Fixes #7726
Closes #7729
2021-09-16 12:36:12 +02:00