Commit Graph

1128 Commits

Author SHA1 Message Date
Patrick Monnerat
e2aed00430
typecheck: accept expressions for option/info parameters
As expressions can have side effects, evaluate only once.

To enable deprecation reporting only once, get rid of the __typeof__
use to define the local temporary variable and use the target type
(CURLoption/CURLINFO). This also avoids multiple reports on type
conflicts (if some) by the curlcheck_* macros.

Note that CURLOPT_* and CURLINFO_* symbols may be deprecated, but not
their values: a curl_easy_setopt call with an integer constant as option
will never report a deprecation.

Reported-by: Thomas Klausner
Fixes #10148
Closes #10149
2022-12-26 10:04:55 +01:00
Daniel Stenberg
5d0cad97a6
RELEASE_NOTES: synced
bumped version for new cycle
2022-12-21 15:38:50 +01:00
Daniel Gustafsson
fdafa0ef58 curl.h: reword comment to not use deprecated option
CURLOPT_INFILE was replaced by CURLOPT_READDATA in 7.9.7,  reword the
comment mentioning it to make code grepping easier as well as improve
the documentation.

Closes: #10062
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2022-12-09 09:41:24 +01:00
Ryan Schmidt
ac4554870d
system.h: fix socklen_t, curl_off_t, long long for Classic Mac OS
Change "__MWERKS__" to "macintosh". When this block was originally added
in 3ac6929 it was probably intended to handle classic Mac OS since the
previous classic Mac OS build procedure for curl (which was removed in
bf327a9) used Metrowerks CodeWarrior.

But there are other classic Mac OS compilers, such as the MPW compilers,
that were not handled by this case. For classic Mac OS,
CURL_TYPEOF_CURL_SOCKLEN_T needs to match what's provided by the
third-party GUSI library, which does not vary by compiler.

Meanwhile CodeWarrior works on platforms other than classic Mac OS, and
they may need different definitions. Separate blocks could be added
later for any of those platforms that curl doesn't already support.

Closes #10049
2022-12-09 08:21:15 +01:00
Ryan Schmidt
d502270eb2
curl.h: name all public function parameters
Most public function parameters already have names; this adds those
that were missing.

Closes #10036
2022-12-06 09:29:21 +01:00
Kenneth Myhra
610b96c6b3
curl.h: include <sys/select.h> on SerenityOS
Closes #10006
2022-11-30 15:37:44 +01:00
Daniel Stenberg
dbd74baf78
include/curl/curl.h: bump the deprecated requirements to gcc 6.1
Reported-by: Michael Kaufmann
Fixes #9917
Closes #9987
2022-11-28 13:13:53 +01:00
Alexandre Ferrieux
49798cac83
CURLOPT_QUICK_EXIT: don't wait for DNS thread on exit
Fixes #2975
Closes #9147
2022-11-18 00:17:27 +01:00
Daniel Stenberg
bbb36409de
include/curl/curl.h: bump the deprecated requirements to gcc 5.3
Reported-by: Stephan Guilloux
Fixes #9917
Closes #9918
2022-11-15 23:09:31 +01:00
Patrick Monnerat
6967571bf2
lib: feature deprecation warnings in gcc >= 4.3
Add a deprecated attribute to functions and enum values that should not
be used anymore.
This uses a gcc 4.3 dialect, thus is only available for this version of
gcc and newer. Note that the _Pragma() keyword is introduced by C99, but
is available as part of the gcc dialect even when compiling in C89 mode.

It is still possible to disable deprecation at a calling module compile
time by defining CURL_DISABLE_DEPRECATION.

Gcc type checking macros are made aware of possible deprecations.

Some testing support Perl programs are adapted to the extended
declaration syntax.

Several test and unit test C programs intentionally use deprecated
functions/options and are annotated to not generate a warning.

New test 1222 checks the deprecation status in doc and header files.

Closes #9667
2022-11-15 10:57:29 +01:00
Patrick Monnerat
e780aae77a
version: add a feature names array to curl_version_info_data
Field feature_names contains a null-terminated sorted array of feature
names. Bitmask field features is deprecated.

Documentation is updated. Test 1177 and tests/version-scan.pl updated to
match new documentation format and extended to check feature names too.

Closes #9583
2022-11-14 09:18:53 +01:00
Jay Satiro
6d75115406 lib: add CURL_WRITEFUNC_ERROR to signal write callback error
Prior to this change if the user wanted to signal an error from their
write callbacks they would have to use logic to return a value different
from the number of bytes (nmemb) passed to the callback. Also, the
inclination of some users has been to just return 0 to signal error,
which is incorrect as that may be the number of bytes passed to the
callback.

To remedy this the user can now return CURL_WRITEFUNC_ERROR instead.

Ref: https://github.com/curl/curl/issues/9873

Closes https://github.com/curl/curl/pull/9874
2022-11-10 03:13:58 -05:00
Hirotaka Tagawa
39538fcc4e
headers: add endif comments
Closes #9853
2022-11-09 00:36:33 +01:00
Daniel Stenberg
f96d375a5b
RELEASE-NOTES: synced
Bumped version to 7.87.0
2022-11-08 10:29:17 +01:00
Michael Drake
1fdca35ddd
curl.h: add CURLOPT_CA_CACHE_TIMEOUT option
Adds a new option to control the maximum time that a cached
certificate store may be retained for.

Currently only the OpenSSL backend implements support for
caching certificate stores.

Closes #9620
2022-11-08 10:06:12 +01:00
Daniel Stenberg
52cc4a85fd
style: use space after comment start and before comment end
/* like this */

/*not this*/

checksrc is updated accordingly

Closes #9828
2022-10-30 22:31:29 +01: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
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
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
e3f335148a
websockets: remodeled API to support 63 bit frame sizes
curl_ws_recv() now receives data to fill up the provided buffer, but can
return a partial fragment. The function now also get a pointer to a
curl_ws_frame struct with metadata that also mentions the offset and
total size of the fragment (of which you might be receiving a smaller
piece). This way, large incoming fragments will be "streamed" to the
application. When the curl_ws_frame struct field 'bytesleft' is 0, the
final fragment piece has been delivered.

curl_ws_recv() was also adjusted to work with a buffer size smaller than
the fragment size. (Possibly needless to say as the fragment size can
now be 63 bit large).

curl_ws_send() now supports sending a piece of a fragment, in a
streaming manner, in addition to sending the entire fragment in a single
call if it is small enough. To send a huge fragment, curl_ws_send() can
be used to send it in many small calls by first telling libcurl about
the total expected fragment size, and then send the payload in N number
of separate invokes and libcurl will stream those over the wire.

The struct curl_ws_meta() returns is now called 'curl_ws_frame' and it
has been extended with two new fields: *offset* and *bytesleft*. To help
describe the passed on data chunk when a fragment is delivered in many
smaller pieces.

The documentation has been updated accordingly.

Closes #9636
2022-10-07 12:50:58 +02:00
Daniel Stenberg
7295e62c66
curl.h: fix mention of wrong error code in comment
The same error and comment were also used and is now corrected in
CURLOPT_SSH_KEYFUNCTION.3
2022-09-22 09:43:39 +02:00
Daniel Stenberg
307b7543ea
misc: null-terminate
Make use of this term consistently.

Closes #9527
2022-09-17 23:19:29 +02:00
Daniel Stenberg
f71b79feb5
include/curl/websockets.h: add extern "C" for C++
Reported-by: n0name321 on github
Fixes #9509
Closes #9510
2022-09-15 11:18:37 +02:00
Daniel Stenberg
70c8ce5ad0
curl/websockets.h: remove leftover bad typedef
Just a leftover trace of a development thing that did not stay like
that.

Reported-by: Marc Hörsken
Fixes #9465
Cloes #9466
2022-09-10 23:09:38 +02:00
Daniel Stenberg
eebfa3279d
curl_ws_meta: initial implementation 2022-09-09 15:11:14 +02:00
Daniel Stenberg
07cb887ed3
curl_ws_meta.3: added docs 2022-09-09 15:11:14 +02:00
Daniel Stenberg
664249d095
ws: initial websockets support
Closes #8995
2022-09-09 15:11:14 +02:00
Jay Satiro
9c822a9994 header: define public API functions as extern c
Prior to this change linker errors would occur if curl_easy_header or
curl_easy_nextheader was called from a C++ unit.

Bug: https://github.com/curl/curl/issues/9424#issuecomment-1238818007
Reported-by: Andrew Lambert

Closes https://github.com/curl/curl/pull/9446
2022-09-08 11:54:32 -04:00
Daniel Stenberg
5390c9d77a
RELEASE-NOTES: synced
And bump to 7.86.0 for the pending next release
2022-09-07 14:18:28 +02:00
Daniel Stenberg
e08c82f046
RELEASE-NOTES: synced
and bump the tentative next release version to 7.85.1
2022-09-04 23:13:34 +02:00
Viktor Szakats
c9061f242b
misc: spelling fixes
Found using codespell 2.2.1.

Also delete the redundant protocol designator from an archive.org URL.

Reviewed-by: Daniel Stenberg
Closes #9403
2022-08-31 14:31:01 +00:00
Tobias Nygren
e761a1d1d9
curl.h: include <sys/select.h> on SunOS
It is needed for fd_set to be visible to downstream consumers that use
<curl/multi.h>. Header is known to exist at least as far back as Solaris
2.6.

Closes #9329
2022-08-17 13:25:02 +02:00
Daniel Stenberg
2b2a47eb38
RELEASE-NOTES: synced
Bumped to 7.85.0
2022-07-05 10:39:52 +02:00
Daniel Stenberg
be43dd600a
CURLOPT_SERVER_RESPONSE_TIMEOUT: the new name
Starting now, CURLOPT_FTP_RESPONSE_TIMEOUT is the alias instead of the
other way around.

Since 7.20.0, CURLOPT_SERVER_RESPONSE_TIMEOUT has existed as an alias
but since the option is for more protocols than FTP the more "correct"
version of the option is the "server" one so now we switch.

Closes #9104
2022-07-05 10:16:05 +02:00
Daniel Stenberg
e6f8445ede
setopt: add CURLOPT_PROTOCOLS_STR and CURLOPT_REDIR_PROTOCOLS_STR
... as replacements for deprecated CURLOPT_PROTOCOLS and
CURLOPT_REDIR_PROTOCOLS as these new ones do not risk running into the
32 bit limit the old ones are facing.

CURLINFO_PROTCOOL is now deprecated.

The curl tool is updated to use the new options.

Added test 1597 to verify the libcurl protocol parser.

Closes #8992
2022-07-04 08:35:09 +02:00
Daniel Stenberg
804fb71bed
RELEASE-NOTES: synced
bumped to 7.84.1
2022-07-01 09:53:08 +02:00
Daniel Stenberg
1dda49a1d3
curl.h: CURLE_CONV_FAILED is obsoleted
The last use was removed in 7.82.0. Updated some docs too to reflect the
current error code situation.

Closes #9067
2022-06-29 16:03:02 +02:00
Viktor Szakats
a94d6fe706
version: rename threadsafe-init to threadsafe
Referring to Daniel's article [1], making the init function thread-safe
was the last bit to make libcurl thread-safe as a whole. So the name of
the feature may as well be the more concise 'threadsafe', also telling
the story that libcurl is now fully thread-safe, not just its init
function. Chances are high that libcurl wants to remain so in the
future, so there is little likelihood of ever needing any other distinct
`threadsafe-<name>` feature flags.

For consistency we also shorten `CURL_VERSION_THREADSAFE_INIT` to
`CURL_VERSION_THREADSAFE`, update its description and reference libcurl's
thread safety documentation.

[1]: https://daniel.haxx.se/blog/2022/06/08/making-libcurl-init-more-thread-safe/

Reviewed-by: Daniel Stenberg
Reviewed-by: Jay Satiro
Closes #8989
2022-06-13 18:59:45 +00:00
max.mehl
ad9bc5976d
copyright: make repository REUSE compliant
Add licensing and copyright information for all files in this repository. This
either happens in the file itself as a comment header or in the file
`.reuse/dep5`.

This commit also adds a Github workflow to check pull requests and adapts
copyright.pl to the changes.

Closes #8869
2022-06-13 09:13:00 +02:00
Daniel Stenberg
5912da253b
select: return error from "lethal" poll/select errors
Adds two new error codes: CURLE_UNRECOVERABLE_POLL and
CURLM_UNRECOVERABLE_POLL one each for the easy and the multi interfaces.

Reported-by: Harry Sintonen
Fixes #8921
Closes #8961
2022-06-08 11:07:01 +02:00
Thomas Guillem
2ed1012564
curl_version_info: add CURL_VERSION_THREADSAFE_INIT
This flag can be used to make sure that curl_global_init() is
thread-safe.

This can be useful for libraries that can't control what other
dependencies are doing with Curl.

Closes #8680
2022-06-07 13:34:03 +02:00
michael musset
1544513958
libssh2: add CURLOPT_SSH_HOSTKEYFUNCTION
The callback set by CURLOPT_SSH_HOSTKEYFUNCTION is called to check
wether or not the connection should continue.

The host key is passed in argument with a custom handle for the
application.

It overrides CURLOPT_SSH_KNOWNHOSTS

Closes #7959
2022-06-02 08:34:31 +02:00
Daniel Stenberg
7bc785387d
CURLINFO_CAPATH/CAINFO: get the default CA paths from libcurl
Closes #8888
2022-05-23 08:44:29 +02:00
Daniel Stenberg
d2c31ef3fb
RELEASE-NOTES: synced
bump to 7.84.0
2022-05-19 17:59:45 +02:00
Daniel Stenberg
64a4bb6cc8
RELEASE-NOTES: synced
and bump curlver to 7.83.2 for now (but likely to become 7.84.0 soon)
2022-05-16 09:23:21 +02:00
Daniel Stenberg
3fd1d8df3a
RELEASE-NOTES: synced
bumped curlver to 7.83.1-dev
2022-04-28 09:51:26 +02:00
Daniel Gustafsson
93cfed2b73 misc: fix typos
Fix a few random typos is comments and workflow names.
2022-04-21 09:43:35 +02:00
Daniel Stenberg
4a8f6869db
English: use American spelling consistently
Authorization, Initialization, Organization etc.

Closes #8673
2022-04-05 14:55:47 +02:00
Daniel Stenberg
8e22fc68e7
scripts: move three scripts from lib/ to scripts/
Move checksrc.pl, firefox-db2pem.sh and mk-ca-bundle.pl since they don't
particularly belong in lib/

Also created an EXTRA_DIST= in scripts/Makefile.am instead of specifying
those files in the root Makefile.am

Closes #8625
2022-03-23 15:26:11 +01:00
Daniel Stenberg
ca2c30bcc0
options: remove mistaken space before paren in prototype 2022-03-22 11:09:22 +01:00