summaryrefslogtreecommitdiff
path: root/lib/curl_setup.h
Commit message (Collapse)AuthorAgeFilesLines
* ngtcp2: adjust config and code checks for ngtcp2 without nghttp3Stefan Eissing2023-03-231-1/+2
| | | | | | | | | | - make configure show on HTTP3 feature that both ngtcp2 and nghttp3 are in play - define ENABLE_QUIC only when USE_NGTCP2 and USE_NGHTTP3 are defined - add USE_NGHTTP3 in the ngtcp2 implementation Fixes #10793 Closes #10821
* misc: remove support for curl_off_t < 8 bytesDaniel Stenberg2023-02-241-2/+2
| | | | Closes #10597
* curl_setup: Suppress OpenSSL 3 deprecation warningsJay Satiro2023-02-181-0/+6
| | | | | | | | | | | - 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
* windows: always use curl's basename() implementationViktor Szakats2023-02-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | The `basename()` [1][2] implementation provided by mingw-w64 [3] makes assumptions about input encoding and may break with non-ASCII strings. `basename()` was auto-detected with CMake, autotools and since 68fa9bf3f5d7b4fcbb57619f70cb4aabb79a51f6 (2022-10-13), also in `Makefile.mk` after syncing its behaviour with the mainline build methods. A similar patch for curl-for-win broke official Windows builds earlier, in release 7.83.1_4 (2022-06-15). This patch forces all Windows builds to use curl's internal `basename()` implementation to avoid such problems. [1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/basename.html [2]: https://www.man7.org/linux/man-pages/man3/basename.3.html [3]: https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-crt/misc/basename.c Reported-by: UnicornZhang on Github Assisted-by: Cherish98 on Github Reviewed-by: Daniel Stenberg Fixes #10261 Closes #10475
* curl_setup: Disable by default recv-before-send in WindowsJay Satiro2023-02-091-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this change a workaround for Windows to recv before every send was enabled by default. The way it works is a recv is called before every send and saves the received data, in case send fails because in Windows apparently that can wipe out the socket's internal received data buffer. This feature has led to several bugs because the way libcurl operates it waits on a socket to read or to write, and may not at all times check for buffered receive data. Two recent significant bugs this workaround caused: - Broken Schannel TLS 1.3 connections (#9431) - HTTP/2 arbitrary hangs (#10253) The actual code remains though it is disabled by default. Though future changes to connection filter buffering could improve the situation IMO it's just not tenable to manage this workaround. Ref: https://github.com/curl/curl/issues/657 Ref: https://github.com/curl/curl/pull/668 Ref: https://github.com/curl/curl/pull/720 Ref: https://github.com/curl/curl/issues/9431 Ref: https://github.com/curl/curl/issues/10253 Closes https://github.com/curl/curl/pull/10409
* copyright: update all copyright lines and remove year rangesDaniel Stenberg2023-01-031-1/+1
| | | | | | | | | | | | - 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
* build: assume assert.h is always availableJay Satiro2022-12-071-2/+0
| | | | | | | | | | | | | - Remove assert.h detection from all build configurations. assert.h is a standard header according to C89. I had proposed this several years ago as part of a larger change that was abandoned. Ref: https://github.com/curl/curl/issues/1237#issuecomment-277500720 Closes https://github.com/curl/curl/pull/9985
* setup: do not require __MRC__ defined for Mac OS 9 buildsRyan Schmidt2022-12-061-1/+1
| | | | | | | | | | | | | | | | Partially reverts "somewhat protect Mac OS X users from using Mac OS 9 config file", commit 62519bfe059251af2914199f284c736553ff0489. Do things that are specific to classic Mac OS (i.e. include config-mac.h in curl_setup.h and rename "main" to "curl_main" in tool_setup.h) when only "macintosh" is defined. Remove the additional condition that "__MRC__" should be defined since that would only be true with the MPW MrC compiler which prevents the use of other reasonable compilers like the MPW SC compiler and especially the Metrowerks CodeWarrior compilers. "macintosh" is only defined by classic Mac OS compilers so this change should not affect users of Mac OS X / OS X / macOS / any other OS. Closes #10037
* Makefile.mk: portable Makefile.m32Viktor Szakats2022-11-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* style: use space after comment start and before comment endDaniel Stenberg2022-10-301-1/+1
| | | | | | | | | | /* like this */ /*not this*/ checksrc is updated accordingly Closes #9828
* 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
* url: rename function due to name-clash in Watt-32Daniel Stenberg2022-09-271-3/+0
| | | | | Follow-up to 2481dbe5f4f58 and applies the change the way it was intended.
* url: rename function due to name-clash in Watt-32Gisle Vanem2022-09-261-0/+3
| | | | | | | Since the commit 764c958c52edb427f39, there was a new function called resolve_ip(). This clashes with an internal function in Watt-32. Closes #9585
* curl_setup: disable use of FLOSS for 64-bit NonStop buildsRandall S. Becker2022-09-231-2/+4
| | | | | | | | | Older 32-bit builds currently need FLOSS. This dependency may be removed in future OS releases. Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca> Closes #9575
* curl_setup: include only system.h instead of curl.hMarcel Raad2022-09-121-1/+1
| | | | | | | As done before commit 9506d01ee50. Ref: https://github.com/curl/curl/pull/9375#discussion_r957010158 Closes https://github.com/curl/curl/pull/9453
* curl_setup: include curl.h after platform setup headersMarcel Raad2022-09-121-3/+3
| | | | | | | | The platform setup headers might set definitions required for the includes in curl.h. Ref: https://github.com/curl/curl/pull/9375#discussion_r956998269 Closes https://github.com/curl/curl/pull/9453
* amigaos: fix threaded resolver on AmigaOS 4.xFutaura2022-08-101-0/+12
| | | | | | | Replace ip4 resolution function on AmigaOS 4.x, as it requires runtime feature detection and extra code to make it thread safe. Closes #9265
* amissl: allow AmiSSL to be used with AmigaOS 4.x buildsFutaura2022-08-081-3/+18
| | | | | | | Enable AmiSSL to be used instead of static OpenSSL link libraries. for AmigaOS 4.x, as it already is in the AmigaOS 3.x build. Closes #9269
* tidy-up: delete unused build configuration macrosViktor Szakats2022-07-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of them feature guards: - `CURL_INCLUDES_SYS_UIO` [1] - `HAVE_ALLOCA_H` [2] - `HAVE_CRYPTO_CLEANUP_ALL_EX_DATA` (unused since de71e68000c8624ea13f90b136f8734dd0fb1bdc) - `HAVE_DLFCN_H` - `HAVE_DLOPEN` - `HAVE_DOPRNT` - `HAVE_FCNTL` - `HAVE_GETHOSTBYNAME` [3] - `HAVE_GETOPT_H` - `HAVE_GETPASS` - `HAVE_GETPROTOBYNAME` - `HAVE_GETSERVBYNAME` - `HAVE_IDN_FREE*` - `HAVE_INET_ADDR` - `HAVE_IOCTL` - `HAVE_KRB4` - `HAVE_KRB_GET_OUR_IP_FOR_REALM` - `HAVE_KRB_H` - `HAVE_LDAPSSL_H` - `HAVE_LDAP_INIT_FD` - `HAVE_LIBDL` - `HAVE_LIBNSL` - `HAVE_LIBRESOLV*` - `HAVE_LIBUCB` - `HAVE_LL` - `HAVE_LOCALTIME_R` - `HAVE_MALLOC_H` - `HAVE_MEMCPY` - `HAVE_MEMORY_H` - `HAVE_NETINET_IF_ETHER_H` - `HAVE_NI_WITHSCOPEID` - `HAVE_OPENSSL_CRYPTO_H` - `HAVE_OPENSSL_ERR_H` - `HAVE_OPENSSL_PEM_H` - `HAVE_OPENSSL_PKCS12_H` - `HAVE_OPENSSL_RAND_H` - `HAVE_OPENSSL_RSA_H` - `HAVE_OPENSSL_SSL_H` - `HAVE_OPENSSL_X509_H` - `HAVE_PEM_H` - `HAVE_POLL` - `HAVE_RAND_SCREEN` - `HAVE_RAND_STATUS` - `HAVE_RECVFROM` - `HAVE_SETSOCKOPT` - `HAVE_SETVBUF` - `HAVE_SIZEOF_LONG_DOUBLE` - `HAVE_SOCKIO_H` - `HAVE_SOCK_OPTS` - `HAVE_STDIO_H` - `HAVE_STRCASESTR` - `HAVE_STRFTIME` - `HAVE_STRLCAT` - `HAVE_STRNCMPI` - `HAVE_STRNICMP` - `HAVE_STRSTR` - `HAVE_STRUCT_IN6_ADDR` - `HAVE_TLD_H` - `HAVE_TLD_STRERROR` - `HAVE_UNAME` - `HAVE_USLEEP` - `HAVE_WINBER_H` - `HAVE_WRITEV` - `HAVE_X509_H` - `LT_OBJDIR` - `NEED_BASENAME_PROTO` - `NOT_NEED_LIBNSL` - `OPENSSL_NO_KRB5` - `RECVFROM_TYPE*` - `SIZEOF_LONG_DOUBLE` - `STRERROR_R_TYPE_ARG3` - `USE_YASSLEMUL` - `_USRDLL` (from CMake) [4] [1] Related parts in `m4/curl-functions.m4` and `configure.ac` might also be deleted. [2] Related comment can possibly be deleted in `packages/vms/generate_config_vms_h_curl.com`. [3] There are more instances of this in autotools, but I did not dare to touch those. Looked like it's used to detect socket support. [4] This is necessary for MFC (Microsoft Foundation Class) DLLs to force linking MFC components statically to the DLL. `libcurl.dll` does not use MFC, so we can delete this define. Ref: https://docs.microsoft.com/cpp/build/regular-dlls-statically-linked-to-mfc Script that can help finding unused settings like above: ```shell autoheader configure.ac # generate lib/curl_config.h.in { grep -o -E 'set\([A-Z][A-Z0-9_]{3,}' CMake/Platforms/WindowsCache.cmake | sed -E 's|set\(||g' grep -o -E -h '#define +[A-Z][A-Z0-9_]{3,}' lib/config-*.h | sed -E 's|#define +||g' grep -o -E '#cmakedefine +[A-Z][A-Z0-9_]{3,}' lib/curl_config.h.cmake | sed -E 's|#cmakedefine +||g' grep -o -E '#undef +[A-Z][A-Z0-9_]{3,}' lib/curl_config.h.in | sed -E 's|#undef +||g' } | sort -u | grep -v -F 'HEADER_CURL_' | while read -r def; do c="$(git grep -w -F "${def}" | grep -v -E -c '(/libcurl\.tmpl|^lib/config-|^lib/curl_config\.h\.cmake|^CMakeLists\.txt|^CMake/Platforms/WindowsCache\.cmake|^packages/vms/config_h\.com|^m4/curl-functions\.m4|^acinclude\.m4|^configure\.ac)')" if [ "${c}" = '0' ]; then echo "${def}" fi done ``` Reviewed-by: Daniel Stenberg Closes #9044
* curl_setup: include _mingw.hJay Satiro2022-06-231-0/+5
| | | | | | | | | Prior to this change _mingw.h needed to be included in each unit before evaluating __MINGW{32,64}_xxx_VERSION macros since it defines them. It is included only in some mingw headers (eg stdio.h) and not others (eg windows.h) so it's better to explicitly include it once. Closes https://github.com/curl/curl/pull/9036
* copyright: make repository REUSE compliantmax.mehl2022-06-131-0/+2
| | | | | | | | | | | 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
* lib: make more protocol specific struct fields #ifdefedDaniel Stenberg2022-06-011-0/+1
| | | | | | | ... so that they don't take up space if the protocols are disabled in the build. Closes #8944
* msh3: add support for QUIC and HTTP/3 using msh3Nick Banks2022-04-101-1/+1
| | | | | | Considered experimental, as the other HTTP/3 backends. Closes #8517
* http: make Curl_compareheader() take string length arguments tooHenrikHolst2022-02-071-0/+5
| | | | | | | | | Also add STRCONST, a macro that returns a string literal and it's length for functions that take "string,len" Removes unnecesary calls to strlen(). Closes #8391
* TPF: drop supportDaniel Stenberg2022-02-041-15/+0
| | | | | | | | | There has been no TPF related changes done since September 2010 (commit 7e1a45e224e57) and since this is a platform that is relatively different than many others (== needs attention), I draw the conclusion that this build is broken since a long time. Closes #8378
* vxworks: drop supportDaniel Stenberg2022-02-011-9/+0
| | | | | | | No changes or fixes in vxworks related code since 2009 leads me to believe that this doesn't work anymore. Closes #8362
* netware: remove supportDaniel Stenberg2022-01-311-8/+0
| | | | | | | 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
* mesalink: remove supportDaniel Stenberg2022-01-101-2/+2
| | | | | | | | | Mesalink has ceased development. We can no longer encourage use of it. It seems to be continued under the name TabbySSL, but no attempts have (yet) been to make curl support it. Fixes #8188 Closes #8191
* connnect: use sysaddr_un fron sys/un.h or custom-defined for windowsJan Mazur2021-09-301-0/+1
| | | | Closes #7737
* lib: remove `HAVE_WINSOCK_H` usageMarcel Raad2021-09-291-1/+0
| | | | | | | WinSock v1 is not supported anymore. Exclusively use `HAVE_WINSOCK2_H` instead. Closes https://github.com/curl/curl/pull/7795
* Revert "build: remove checks for WinSock 1"Daniel Stenberg2021-09-291-0/+1
| | | | | | | | Due to CI issues This reverts commit c2ea04f92b00b6271627cb218647527b5a50f2fc. Closes #7790
* build: remove checks for WinSock 1Marcel Raad2021-09-281-1/+0
| | | | | | It's not supported anymore. Closes https://github.com/curl/curl/pull/7778
* curl_setup.h: sync values for HTTP_ONLYDon2021-08-211-17/+23
| | | | | | | | The values for HTTP_ONLY differed between CMakeLists.txt and curl_setup.h. Sync them and sort the values in curl_setup.h to make it easier to spot differences. Closes #7601
* mbedtls: Remove unnecessary includeMAntoniak2021-07-161-4/+0
| | | | | | | | | | - curl_setup.h: all references to mbedtls_md4* functions and structures are in the md4.c. This file already includes the <mbedtls/md4.h> file along with the file existence control (defined (MBEDTLS_MD4_C)) - curl_ntlm_core.c: unnecessary include - repeated below Closes #7419
* cmake: fix support for UnixSockets feature on Win32Li Xinwei2021-06-211-0/+16
| | | | | | | | | | | | | Move the definition of sockaddr_un struct from config-win32.h to curl_setup.h, so that it could be shared by all build systems. Add ADDRESS_FAMILY typedef for old mingw, now old mingw can also use unix sockets. Also fix the build of tests/server/sws.c on Win32 when USE_UNIX_SOCKETS is defined. Closes #7034
* warnless: simplify type size handlingdmitrykos2021-06-041-0/+9
| | | | | | | By using sizeof(T), existing defines and relying on the compiler to define the required signed/unsigned mask. Closes #7181
* define: re-add CURL_DISABLE_NTLM and corresponding ifdefstheawless2021-06-021-17/+13
| | | | | | | This flag will be further exposed by adding build options. Reverts #6809 Closes #7028
* lib/hostip6.c: make NAT64 address synthesis on macOS workRadek Zajic2021-05-251-0/+4
| | | | Closes #7121
* cmake: detect CURL_SA_FAMILY_TPeng-Yu Chen2021-05-211-2/+9
| | | | | Fixes #7049 Closes #7065
* config: remove now-unused macrosMarc Aldorasi2021-05-191-1/+0
| | | | Closes #7094
* tls: add USE_HTTP2 defineJacob Hoffman-Andrews2021-04-291-0/+4
| | | | | | | | | This abstracts across the two HTTP/2 backends: nghttp2 and Hyper. Add our own define for the "h2" ALPN protocol, so TLS backends can use it without depending on a specific HTTP backend. Closes #6959
* curl_setup: provide the shutdown flags widerDaniel Stenberg2021-04-211-5/+11
| | | | | | | | | | By using #ifdef on the symbol names to work on anything that don't provide them. SCO OpenServer 5.0.7, sys/socket.h does not define either SHUT_RDWR, SHUT_RD, and SHUT_WR. Reported-by: Kevin R. Bulgrien Bug: https://curl.se/mail/lib-2021-04/0073.html Closes #6925
* define: remove CURL_DISABLE_NTLM ifdefsbagder/disable-scan-improvementDaniel Stenberg2021-03-291-1/+1
| | | | | | | It was never defined anywhere. Fixed disable-scan (test 1165) to also scan headers, which found this issue. Closes #6809
* config: fix detection of restricted Windows App environmentMarc Hoersken2021-03-151-11/+10
| | | | | | | | | | Move the detection of the restricted Windows App environment in curl_setup.h before the definition of USE_WIN32_CRYPTO via included config-win32.h in case no build system is used. Reviewed-by: Marcel Raad Part of #6277
* config: remove CURL_SIZEOF_CURL_OFF_T use only SIZEOF_CURL_OFF_TDaniel Stenberg2021-03-111-4/+2
| | | | | | | Make the code consistently use a single name for the size of the "curl_off_t" type. Closes #6702
* vtls: initial implementation of rustls backendJacob Hoffman-Andrews2021-02-091-1/+1
| | | | | | | | | | | | | | | | | This adds a new TLS backend, rustls. It uses the C-to-rustls bindings from https://github.com/abetterinternet/crustls. Rustls is at https://github.com/ctz/rustls/. There is still a fair bit to be done, like sending CloseNotify on connection shutdown, respecting CAPATH, and properly indicating features like "supports TLS 1.3 ciphersuites." But it works well enough to make requests and receive responses. Blog post for context: https://www.abetterinternet.org/post/memory-safe-curl/ Closes #6350
* file: Support unicode urls on windowsStephan Szabo2021-02-091-0/+4
| | | | Closes https://github.com/curl/curl/pull/6501
* curl_setup: USE_RESOLVE_ON_IPS is for Apple native resolver useDaniel Stenberg2020-11-261-1/+1
| | | | ... so don't define it when instructed to use c-ares!
* curl: add compatibility for Amiga and GCC 6.5Oliver Urbann2020-11-201-0/+6
| | | | | | | Changes are mainly reordering and adding of includes required to compile with a more recent version of GCC. Closes #6220
* curl.se: new homeDaniel Stenberg2020-11-041-1/+1
| | | | Closes #6172