summaryrefslogtreecommitdiff
path: root/docs/examples
Commit message (Collapse)AuthorAgeFilesLines
* tests/http: more tests with specific clientsStefan Eissing2023-04-261-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Makefile support for building test specific clients in tests/http/clients - auto-make of clients when invoking pytest - added test_09_02 for server PUSH_PROMISEs using clients/h2-serverpush - added test_02_21 for lib based downloads and pausing/unpausing transfers curl url parser: - added internal method `curl_url_set_authority()` for setting the authority part of a url (used for PUSH_PROMISE) http2: - made logging of PUSH_PROMISE handling nicer Placing python test requirements in requirements.txt files - separate files to base test suite and http tests since use and module lists differ - using the files in the gh workflows websocket test cases, fixes for we and bufq - bufq: account for spare chunks in space calculation - bufq: reset chunks that are skipped empty - ws: correctly encode frames with 126 bytes payload - ws: update frame meta information on first call of collect callback that fills user buffer - test client ws-data: some test/reporting improvements Closes #11006
* docs/examples/protofeats.c: Outputs all protocols and featuresDaniel Stenberg2023-04-182-0/+53
| | | | | | | Showing off one way to get to char pointer arrays of info returned by curl_version_info() Closes #10991
* examples/http3.c: use CURL_HTTP_VERSION_3Daniel Stenberg2023-02-271-4/+2
| | | | | | and update the comment Closes #10619
* connections: introduce http/3 happy eyeballsStefan Eissing2023-02-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New cfilter HTTP-CONNECT for h3/h2/http1.1 eyeballing. - filter is installed when `--http3` in the tool is used (or the equivalent CURLOPT_ done in the library) - starts a QUIC/HTTP/3 connect right away. Should that not succeed after 100ms (subject to change), a parallel attempt is started for HTTP/2 and HTTP/1.1 via TCP - both attempts are subject to IPv6/IPv4 eyeballing, same as happens for other connections - tie timeout to the ip-version HAPPY_EYEBALLS_TIMEOUT - use a `soft` timeout at half the value. When the soft timeout expires, the HTTPS-CONNECT filter checks if the QUIC filter has received any data from the server. If not, it will start the HTTP/2 attempt. HTTP/3(ngtcp2) improvements. - setting call_data in all cfilter calls similar to http/2 and vtls filters for use in callback where no stream data is available. - returning CURLE_PARTIAL_FILE for prematurely terminated transfers - enabling pytest test_05 for h3 - shifting functionality to "connect" UDP sockets from ngtcp2 implementation into the udp socket cfilter. Because unconnected UDP sockets are weird. For example they error when adding to a pollset. HTTP/3(quiche) improvements. - fixed upload bug in quiche implementation, now passes 251 and pytest - error codes on stream RESET - improved debug logs - handling of DRAIN during connect - limiting pending event queue HTTP/2 cfilter improvements. - use LOG_CF macros for dynamic logging in debug build - fix CURLcode on RST streams to be CURLE_PARTIAL_FILE - enable pytest test_05 for h2 - fix upload pytests and improve parallel transfer performance. GOAWAY handling for ngtcp2/quiche - during connect, when the remote server refuses to accept new connections and closes immediately (so the local conn goes into DRAIN phase), the connection is torn down and a another attempt is made after a short grace period. This is the behaviour observed with nghttpx when we tell it to shut down gracefully. Tested in pytest test_03_02. TLS improvements - ALPN selection for SSL/SSL-PROXY filters in one vtls set of functions, replaces copy of logic in all tls backends. - standardized the infof logging of offered ALPNs - ALPN negotiated: have common function for all backends that sets alpn proprty and connection related things based on the negotiated protocol (or lack thereof). - new tests/tests-httpd/scorecard.py for testing h3/h2 protocol implementation. Invoke: python3 tests/tests-httpd/scorecard.py --help for usage. Improvements on gathering connect statistics and socket access. - new CF_CTRL_CONN_REPORT_STATS cfilter control for having cfilters report connection statistics. This is triggered when the connection has completely connected. - new void Curl_pgrsTimeWas(..) method to report a timer update with a timestamp of when it happend. This allows for updating timers "later", e.g. a connect statistic after full connectivity has been reached. - in case of HTTP eyeballing, the previous changes will update statistics only from the filter chain that "won" the eyeballing. - new cfilter query CF_QUERY_SOCKET for retrieving the socket used by a filter chain. Added methods Curl_conn_cf_get_socket() and Curl_conn_get_socket() for convenient use of this query. - Change VTLS backend to query their sub-filters for the socket when checks during the handshake are made. HTTP/3 documentation on how https eyeballing works. TLS improvements - ALPN selection for SSL/SSL-PROXY filters in one vtls set of functions, replaces copy of logic in all tls backends. - standardized the infof logging of offered ALPNs - ALPN negotiated: have common function for all backends that sets alpn proprty and connection related things based on the negotiated protocol (or lack thereof). Scorecard with Caddy. - configure can be run with `--with-test-caddy=path` to specify which caddy to use for testing - tests/tests-httpd/scorecard.py now measures download speeds with caddy pytest improvements - adding Makfile to clean gen dir - adding nghttpx rundir creation on start - checking httpd version 2.4.55 for test_05 cases where it is needed. Skipping with message if too old. - catch exception when checking for caddy existance on system. Closes #10349
* copyright: update all copyright lines and remove year rangesDaniel Stenberg2023-01-03120-120/+120
| | | | | | | | | | | | - they are mostly pointless in all major jurisdictions - many big corporations and projects already don't use them - saves us from pointless churn - git keeps history for us - the year range is kept in COPYING checksrc is updated to allow non-year using copyright statements Closes #10205
* examples: remove the curlgtk.c exampleDaniel Stenberg2023-01-022-121/+1
| | | | | | | | | | | - it does not add a lot of value - we do not test-build it to verify because of its dependencies - unclear for what GTK versions it works or not Reported-by: odek86 on github Fixes #10197 Closes #10198
* docs/examples: spell correction ('Retrieve')Andy Alt2022-12-062-2/+2
| | | | Closes #10040
* examples: update descriptionsDaniel Stenberg2022-11-2234-35/+34
| | | | | | | Make them not say "this is an example showing..." and instead just say what the example shows. Closes #9960
* examples/10-at-a-time: fix possible skipped final transfersDaniel Stenberg2022-11-221-7/+11
| | | | | | | | | | | Prior to this change if curl_multi_perform returned 0 running handles and then all remaining transfers were added, then the perform loop would end immediately without performing those transfers. Reported-by: Mikhail Kuznetsov Fixes https://github.com/curl/curl/issues/9953 Closes https://github.com/curl/curl/pull/9954
* Makefile.mk: portable Makefile.m32Viktor Szakats2022-11-223-73/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update bare GNU Make `Makefile.m32` to: - Move objects into a subdirectory. - Add support for MS-DOS. Tested with DJGPP. - Add support for Watt-32 (on MS-DOS). - Add support for AmigaOS. - Rename `Makefile.m32` to `Makefile.mk` - Replace `ARCH` with `TRIPLET`. - Build `tool_hugehelp.c` proper (when tools are available). - Drop MS-DOS compatibility macro `USE_ZLIB` (replaced by `HAVE_LIBZ`) - Add support for `ZLIB_LIBS` to override `-lz`. - Omit object files when building examples. - Default `CC` to `gcc` once again, for convenience. (Caveat: compiler name `cc` cannot be set now.) - Set `-DCURL_NO_OLDIES` for examples, like autotools does. - Delete `makefile.dj` files. Notice the configuration details and defaults are not retained with the new method. - Delete `makefile.amiga` files. A successful build needs a few custom options. We're also not retaining all build details from the existing Amiga make files. - Rename `Makefile.m32` to `Makefile.mk` to reflect that they are not Windows/MinGW32-specific anymore. - Add support for new `CFG` options: `-map`, `-debug`, `-trackmem` - Set `-DNDEBUG` by default. - Allow using `-DOS=...` in all `lib/config-*.h` headers, syncing this with `config-win32.h`. - Look for zlib parts in `ZLIB_PATH/include` and `ZLIB_PATH/lib` instead of bare `ZLIB_PATH`. Note that existing build configurations for MS-DOS and AmigaOS likely become incompatible with this change. Example AmigaOS configuration: ``` export CROSSPREFIX=/opt/amiga/bin/m68k-amigaos- export CC=gcc export CPPFLAGS='-DHAVE_PROTO_BSDSOCKET_H' export CFLAGS='-mcrt=clib2' export LDFLAGS="${CFLAGS}" export LIBS='-lnet -lm' make -C lib -f Makefile.mk make -C src -f Makefile.mk ``` Example MS-DOS configuration: ``` export CROSSPREFIX=/opt/djgpp/bin/i586-pc-msdosdjgpp- export WATT_PATH=/opt/djgpp/net/watt export ZLIB_PATH=/opt/djgpp export OPENSSL_PATH=/opt/djgpp export OPENSSL_LIBS='-lssl -lcrypt' export CFG=-zlib-ssl make -C lib -f Makefile.mk make -C src -f Makefile.mk ``` Closes #9764
* lib: feature deprecation warnings in gcc >= 4.3Patrick Monnerat2022-11-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | 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
* style: use space after comment start and before comment endDaniel Stenberg2022-10-302-8/+8
| | | | | | | | | | /* like this */ /*not this*/ checksrc is updated accordingly Closes #9828
* misc: typo and grammar fixesAyesh Karunaratne2022-10-2711-11/+11
| | | | | | | | | | - 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
* misc: nitpick grammar in comments/docs129322022-10-121-1/+1
| | | | | | | | | | | | because the 'u' in URL is actually a consonant *sound* it is only correct to write "a URL" sorry this is a bit nitpicky :P https://english.stackexchange.com/questions/152/when-should-i-use-a-vs-an https://www.techtarget.com/whatis/feature/Which-is-correct-a-URL-or-an-URL Closes #9699
* docs/examples: avoid deprecated options in examples where possiblePatrick Monnerat2022-10-074-46/+40
| | | | | | | | Example programs targeting a deprecated feature/option are commented with a warning about it. Other examples are adapted to not use deprecated options. Closes #9661
* Makefile.m32: deduplicate build rules [ci skip]Viktor Szakats2022-10-041-145/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After this patch, we reduce the three copies of most `Makefile.m32` logic to one. This now resides in `lib/Makefile.m32`. It makes future updates easier, the code shorter, with a small amount of added complexity. `Makefile.m32` reduction: | | bytes | LOC total | blank | comment | code | |-------------------|-------:|----------:|-------:|---------:|------:| | 7.85.0 | 34772 | 1337 | 79 | 192 | 1066 | | before this patch | 17601 | 625 | 62 | 106 | 457 | | after this patch | 11680 | 392 | 52 | 104 | 236 | Details: - Change rules to create objects for the `v*` subdirs in the `lib` dir. This allows to use a shared compile rule and assumes that filenames are not (and will not be) colliding across these directories. `Makefile.m32` now also stores a list of these subdirs. They are changing rarely though. - Sync as much as possible between the three `Makefile.m32` scripts' rules and their source/target sections. - After this patch `CPPFLAGS` are all applied to the `src` sources once again. This matches the behaviour of cmake/autotools. Only zlib ones are actually required there. - Use `.rc` names from `Makefile.inc` instead of keeping a duplicate. - Change examples to link `libcurl.dll` by default. This makes building trivial, even as a cross-build: `CC=x86_64-w64-mingw32-gcc make -f Makefile.m32` To run them, you need to move/copy or add-to-path `libcurl.dll`. You can select static mode via `CFG=-static`. - List more of the `Makefile.m32` config variables. - Drop `.rc` support from examples. It made it fragile without much benefit. - Include a necessary system lib for the `externalsocket.c` example. - Exclude unnecessary systems libs when building in `-dyn` mode. Closes #9642
* Makefile.m32: major rework [ci skip]Viktor Szakats2022-10-031-276/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch overhauls `Makefile.m32` scripts, fixing a list of quirks, making its behaviour and customization envvars align better with other build systems, aiming for less code, that is easier to read, use and maintain. Details: - Rename customization envvars: `CURL_CC` -> `CC` `CURL_RC` -> `RC` `CURL_AR` -> `AR` `CURL_LDFLAG_EXTRAS_DLL` -> `CURL_LDFLAGS_LIB` `CURL_LDFLAG_EXTRAS_EXE` -> `CURL_LDFLAGS_BIN` - Drop `CURL_STRIP` and `CURL_RANLIB`. These tools are no longer used. - Accept `CFLAGS`, `CPPFLAGS`, `RCFLAGS`, `LDFLAGS` and `LIBS` envvars. - Drop `CURL_CFLAG_EXTRAS`, `CURL_LDFLAG_EXTRAS`, `CURL_RCFLAG_EXTRAS` in favor of the above. - Do not automatically enable `zlib` with `libssh2`. `zlib` is optional with `libssh2`. - Omit unnecessary `CPPFLAGS` options when building `curl.exe` and examples. - Drop support for deprecated `-winssl` `CFG` option. Use `-schannel` instead. - Avoid late evaluation where not necessary (`=` -> `:=`). - Drop support for `CURL_DLL_A_SUFFIX` to override the implib suffix. Instead, use the standard naming scheme by default: `libcurl.dll.a`. The toolchain recognizes the name, and selects it automatically when asking for a `-shared` vs. `-static` build. - Stop applying `strip` to `libcurl.a`. Follow-up from 16a58e9f93c7e89e1f87720199388bcfcfa148a4. There was no debug info to strip since then. - Stop setting `-O3`, `-W`, `-Wall` options. You can add these to `CFLAGS` as desired. - Always enable `-DCURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG` with OpenSSL, to avoid that vulnerability on Windows. - Add `-lbrotlicommon` to `LIBS` when using `brotli`. - Do not enable `-nghttp3` without `-ngtcp2`. - `-ssh2` and `-rtmp` options no longer try to auto-select a TLS-backend. You need to set the backend explicitly. This scales better and avoids issues with certain combinations (e.g. `libssh2` + `wolfssl` with no `schannel`). - Default to OpenSSL TLS-backend with `ngtcp2`. Possible to override via `NGTCP2_LIBS`. - Old, alternate method of enabling components (e.g. `SSH2=1`) no longer supported. - Delete `SPNEGO` references. They were no-ops. - Drop support for Win9x environments. - Allow setting `OPENSSL_LIBS` independently from `OPENSSL_LIBPATH`. - Support autotools/CMake `libssh2` builds by default. - Respect `CURL_DLL_SUFFIX` in `-dyn` mode when building `curl.exe` and examples. - Assume standard directory layout with `LIBCARES_PATH`. (Instead of the long gone embedded one.) - Stop static linking with c-ares by default. Add `CPPFLAGS=-DCARES_STATICLIB` to enable it. - Reorganize internal layout to avoid redundancy and emit clean diffs between src/lib and example make files. - Delete unused variables. - Code cleanups/rework. - Comment and indentation fixes. Closes #9632
* Makefile.m32: delete legacy component bits [ci skip]Viktor Szakats2022-10-021-36/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Drop auto-detection of OpenSSL 1.0.2 and earlier. Now always defaulting to OpenSSL 1.1.0 and later, LibreSSL and BoringSSL. - Drop `Invalid path to OpenSSL package` detection. OpenSSL has been using a standard file layout since 1.1.0, so this seems unnecessary now. - Drop special logic to enable Novell LDAP SDK support. - Drop special logic to enable OpenLDAP LDAP SDK support. This seems to be distinct from native OpenLDAP, with support implemented inside `lib/ldap.c` (vs. `lib/openldap.c`) back when the latter did not exist yet in curl. - Add `-lwldap32` only if there is no other LDAP library (either native OpenLDAP, or SDKs above) present. - Update `doc/INSTALL.md` accordingly. After this patch, it's necessary to make configration changes when using OpenSSL 1.0.2 or earlier, or the two LDAP SDKs. OpenSSL 1.0.2 and earlier: ``` export OPENSSL_INCLUDE = <path-to-openssl>/outinc export OPENSSL_LIBPATH = <path-to-openssl>/out export OPENSSL_LIBS = -lssl32 -leay32 -lgdi32 ``` Novell LDAP SDK, previously enabled via `USE_LDAP_NOVELL=1`: ``` export CURL_CFLAG_EXTRAS = -I<path-to-sdk>/inc -DCURL_HAS_NOVELL_LDAPSDK export CURL_LDFLAG_EXTRAS = -L<path-to-sdk>/lib/mscvc -lldapsdk -lldapssl -lldapx ``` OpenLDAP LDAP SDK, previously enabled via `USE_LDAP_OPENLDAP=1`: ``` export CURL_CFLAG_EXTRAS = -I<path-to-sdk>/include -DCURL_HAS_OPENLDAP_LDAPSDK export CURL_LDFLAG_EXTRAS = -L<path-to-sdk>/lib -lldap -llber ``` I haven't tested these scenarios, and in general we recommend using a recent OpenSSL release. Also, WinLDAP (the Windows default) and OpenLDAP (via `-DUSE_OPENLDAP`) are the LDAP options actively worked on in curl. Closes #9631
* Makefile.m32: cleanups and fixes [ci skip]Viktor Szakats2022-10-011-85/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add `-lcrypt32` once, and add it always for simplicity. - Delete broken link and reference to the pre-Vista WinIDN add-on. MS no longer distribute it. - Delete related `WINIDN_PATH` option. IDN is a system lib since Vista. - Sync `LIBCARES_PATH` default with the rest of dependencies. - Delete version numbers from dependency path defaults. - `libgsasl` package is now called `gsasl`. - Delete `libexpat` and `libxml2` references. No longer used by curl. - Delete `Edit the path below...` comments. We recommend to predefine those envvars instead. - `libcares.a` is not an internal dependency anymore. Stop using it as such. - `windres` `--include-dir` -> `-I`, `-F` -> `--target=` for readability. - Delete `STRIP`, `CURL_STRIP`, `AR` references from `src/Makefile.m32`. They were never used. - Stop to `clean` some objects twice in `src/Makefile.m32`. - Delete cvs-specific leftovers. - Finish resource support in examples make file. - Delete `-I<root>/lib` from examples make file. - Fix copyright start year in examples make file. - Delete duplicate `ftpuploadresume` input in examples make file. - Sync OpenSSL lib order, `SYNC` support, `PROOT` use, dependency path defaults, variables names and other internal bits between the three make files. - `lib/Makefile.m32` accepted custom options via `DLL_LIBS` envvar. This was lib-specific and possibly accidental. Use `CURL_LDFLAG_EXTRAS_DLL` envvar for the same effect. - Fix linking `curl.exe` and examples to wrong static libs with auto-detected OpenSSL 1.0.2 or earlier. - Add `-lgdi32` for OpenSSL 1.0.2 and earlier only. - Add link to Novell LDAP SDK and use a relative default path. Latest version is from 2016, linked to an outdated OpenSSL 1.0.1. - Whitespace and comment cleanups. TODO in a next commit: Delete built-in detection/logic for OpenSSL 1.0.2 and earlier, the Novell LDAP SDK and the other LDAP SDK (which is _not_ OpenLDAP). Write up the necessary custom envvars to configure them. Closes #9616
* docs: spelling nitsViktor Szakats2022-09-291-2/+2
| | | | | | | | | | - MingW -> MinGW (Minimalist GNU for Windows) - f.e. -> e.g. - some whitespace and punctuation. Reviewed-by: Daniel Stenberg Closes #9622
* examples/chkspeed: improve portabilityPatrick Monnerat2022-09-211-41/+48
| | | | | | | The example program chkspeed uses strncasecmp() which is not portable across systems. Replace calls to this function by tests on characters. Closes #9562
* docs: spellfixesDaniel Stenberg2022-09-211-2/+3
| | | | Pointed by the new CI job
* httpput-postfields.c: shorten string for C89 complianceDaniel Stenberg2022-09-211-2/+4
| | | | | | | | httpput-postfields.c:41:3: error: string length ‘522’ is greater than the length ‘509’ ISO C90 compilers are required to support [-Woverlength-strings] 41 | "this chapter."; | ^~~~~~~~~~~~~~~ Closes #9555
* docs: fix proselint complaintsDaniel Stenberg2022-09-191-4/+4
|
* examples/curlx.c: removeDaniel Stenberg2022-08-182-582/+0
| | | | | | | This example is a bit convoluted to use as an example, combined with the special license for it makes it unsuitable. Closes #9330
* Makefile.m32: allow -nghttp3/-ngtcp2 without -ssl [ci skip]Viktor Szakats2022-08-151-12/+14
| | | | | | | | | | | | | | | | | | | | | | Before this patch `-nghttp3`/`-ngtcp2` had an effect only when `-ssl` was also enabled. `-ssl` meaning OpenSSL (and its forks). After 8a13be227eede2601c2b3b1c63e08b3dc9b35dd5 nghttp3/ngtcp2 can also be used together with wolfSSL. This patch adds the ability to enable `-nghttp3`/`-ngtcp2` independently from `-ssl` (OpenSSL), allowing to use it with wolfSSL or other, future TLS backends. Before this patch, it was fine to enable `-nghttp3`/`-ngtcp2` unconditionally. After this patch, this is no longer the case, and now it's the user's responsibility to enable `-nghttp3`/`-ngtcp2` only together with a compatible TLS backend. When using a TLS backend other than OpenSSL, the TLS-specific ngtcp2 library must be configured manually, e.g.: `export CURL_LDFLAG_EXTRAS=-lngtcp2_crypto_wolfssl` (or via `NGTCP2_LIBS`) Closes #9314
* Makefile.m32: add `CURL_RC` and `CURL_STRIP` variables [ci skip]Viktor Szakats2022-07-101-1/+4
| | | | | | | | | | | | | | They allow to override the hardcoded values for the `windres` and `strip` tools, complementing the existing set of `CURL_{CC,AR,RANLIB}` variables. `CURL_RC` comes handy when using LLVM tools with `CROSSPREFIX=llvm-` and `CURL_CC=clang` set on current latest debian:unstable or earlier, where `llvm-windres` is missing, and a `CURL_RC=<triplet>-windres` fixes it. Hopefully this will be fixed in the llvm package. FWIW `llvm-windres` does exist in Homebrew llvm, MSYS2 llvm and llvm-mingw. Reviewed-by: Daniel Stenberg Closes #9132
* Makefile.m32: add `NGTCP2_LIBS` option [ci skip]Viktor Szakats2022-07-061-1/+6
| | | | | | | | Makefile.m32's ngtcp2 has its two libs hardwired for OpenSSL. Add `NGTCP2_LIBS` envvar to override them with a custom list, making it possible to use BoringSSL, or any other backend. Closes #9109
* CURLOPT_SERVER_RESPONSE_TIMEOUT: the new nameDaniel Stenberg2022-07-051-1/+1
| | | | | | | | | | | 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
* makefile.m32: add support for custom ARCH [ci skip]Viktor Szakats2022-07-041-1/+3
| | | | | | | | | | | | | | When building curl for target platform other than x64 and x86, it is now possible to pass `ARCH=custom`, that will omit all hardcoded logic for setting up CFLAGS/LDFLAGS/RCFLAGS for these platforms, and let these be customized via `CURL_CFLAG_EXTRAS`, `CURL_LDFLAG_EXTRAS`, and a newly added one for the resource compiler: `CURL_RCFLAG_EXTRAS`. This makes it possible to use `makefile.m32` to build for ARM64 for example. Reviewed-by: Daniel Stenberg Closes #9092
* windows: improve random sourceViktor Szakats2022-07-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use the Windows API to seed the fallback random generator. This ensures to always have a random seed, even when libcurl is built with a vtls backend lacking a random generator API, such as rustls (experimental), GSKit and certain mbedTLS builds, or, when libcurl is built without a TLS backend. We reuse the Windows-specific random function from the Schannel backend. - Implement support for `BCryptGenRandom()` [1] on Windows, as a replacement for the deprecated `CryptGenRandom()` [2] function. It is used as the secure random generator for Schannel, and also to provide entropy for libcurl's fallback random generator. The new function is supported on Vista and newer via its `bcrypt.dll`. It is used automatically when building for supported versions. It also works in UWP apps (the old function did not). - Clear entropy buffer before calling the Windows random generator. This avoids using arbitrary application memory as entropy (with `CryptGenRandom()`) and makes sure to return in a predictable state when an API call fails. [1] https://docs.microsoft.com/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom [2] https://docs.microsoft.com/windows/win32/api/wincrypt/nf-wincrypt-cryptgenrandom Closes #9027
* Makefile.m32: stop forcing XP target with ipv6 enabled [ci skip]Viktor Szakats2022-06-221-1/+1
| | | | | | | | | | | | | | | | | | | Since this [1] commit in 2011, `_WIN32_WINNT` was set fixed to Windows XP when the `-ipv6` option is selected. Maybe this was added to support pre-XP Windows versions (?). These days libcurl builds fine for both XP and post-XP versions with IPv6 support enabled. The relevance of pre-XP version is also low by now. Other build methods also do not impose such limitation for a similar configuration. So, drop this hard-wired `_WIN32_WINNT` limit from `Makefile.m32`, thus building for the default Windows version set by the compiler. This is Vista for recent MinGW versions. Old behaviour can be restored by setting this envvar: export CURL_CFLAG_EXTRAS=-D_WIN32_WINNT=0x0501 [1] 98a61d8e2e8982786aaf3916cbbcac96838316e7 Closes #9035
* reuse/dep5: adjusted to parse betterDaniel Stenberg2022-06-141-0/+6
| | | | | | ... adjusted a few files to contain copyright and license info. Closes #9006
* copyright: make repository REUSE compliantmax.mehl2022-06-13121-112/+368
| | | | | | | | | | | 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
* examples/crawler.c: use the curl licenseDaniel Stenberg2022-06-021-3/+14
| | | | | | | With permission from Jeroen Ooms URL: https://github.com/curl/curl/pull/8869#issuecomment-1144742731 Closes #8950
* examples: remove fopen.c and rtsp.cDaniel Stenberg2022-06-023-839/+0
| | | | | | | | | | | To simplify the license situation, as they were the only files in the source tree using these specific BSD-3 clause licenses. For an fopen style API, we recommend instead going https://github.com/curl/fcurl Ref: #8869 Closes #8949
* Makefile.m32: delete obsolete options, improve -On [ci skip]Viktor Szakats2022-05-241-6/+4
| | | | | | | | | | | | | | | | - `-D_AMD64_` has not been necessary for mingw-w64 builds for a long time now. - `-fno-strict-aliasing` is mentioned for Intel C compiler in autotools, and I used this with VxWorks in another project, but otherwise this isn't necessary anymore as a default. If a target still needs it, it can be added with `CURL_CFLAG_EXTRAS=-fno-strict-aliasing` - bump up default optimization level to `-O3` (from `-O2`), and also rearrange option order so the default can now be overridden via `CURL_CFLAG_EXTRAS`. - delete `-g` (generate debug info) from `CFLAGS` and `-s` from `LDFLAGS` (strip debug info). They were working against each other. Now, if someone needs debug info, it can be enabled via `CURL_CFLAG_EXTRAS=-g` Closes #8904
* English: use American spelling consistentlyDaniel Stenberg2022-04-055-10/+10
| | | | | | Authorization, Initialization, Organization etc. Closes #8673
* scripts: move three scripts from lib/ to scripts/Daniel Stenberg2022-03-231-1/+1
| | | | | | | | | | 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
* header api: add curl_easy_header and curl_easy_nextheaderDaniel Stenberg2022-03-222-0/+80
| | | | | | Add test 1940 to 1946 to verify. Closes #8593
* misc: update copyright year rangesDaniel Stenberg2022-03-051-1/+1
|
* examples/curlx: support building with OpenSSL 1.1.0+Jay Satiro2022-03-021-4/+9
| | | | | | | | | | | - Access members of X509_STORE_CTX in OpenSSL 1.1.0+ by using API functions. The X509_STORE_CTX struct has been opaque since OpenSSL 1.1.0. Ref: https://curl.se/mail/lib-2022-03/0004.html Closes https://github.com/curl/curl/pull/8529
* lib: remove support for CURL_DOES_CONVERSIONSDaniel Stenberg2022-02-042-114/+1
| | | | | | TPF was the only user and support for that was dropped. Closes #8378
* netware: remove supportDaniel Stenberg2022-01-312-438/+2
| | | | | | | There are no current users and no Netware related changes done in the code for over 13 years is a clear sign this is abandoned. Closes #8358
* examples/multi-app.c: call curl_multi_remove_handle as wellDaniel Stenberg2022-01-071-5/+7
| | | | | | Fixes #8234 Reported-by: Melroy van den Berg Closes #8236
* misc: update copyright year rangeDaniel Stenberg2021-12-304-4/+4
|
* examples/multi-single.c: remove WAITMS()Daniel Stenberg2021-12-301-9/+0
| | | | | | | | As it isn't used. Reported-by: Melroy van den Berg Fixes #8200 Closes #8201
* checksrc: detect more kinds of NULL comparisons we avoidDaniel Stenberg2021-12-272-5/+5
| | | | | Co-authored-by: Jay Satiro Closes #8180
* misc: s/e-mail/emailDaniel Stenberg2021-12-1915-27/+27
| | | | | | Consistency is king. Following the lead in everything curl. Closes #8159
* docs/examples: workaround broken -Wno-pedantic-ms-formatMarc Hoersken2021-12-149-45/+45
| | | | | | | | | | | | Avoid CURL_FORMAT_CURL_OFF_T by using unsigned long instead. Improve size_t to long conversion in imap-append.c example. Ref: https://github.com/curl/curl/issues/6079 Ref: https://github.com/curl/curl/pull/6082 Assisted-by: Jay Satiro Reviewed-by: Daniel Stenberg Preparation of #7922