llist: remove direct struct accesses, use only functions
—
$ git checkout -f ba235ab269080dc66e35835c829f7ac4290dbc1d
Previous HEAD position was d2360b07f6 RELEASE-NOTES: synced
HEAD is now at ba235ab269 llist: remove direct struct accesses, use only functions
$ git clean -fdx
Removing Makefile
Removing Makefile.in
Removing aclocal.m4
Removing autom4te.cache/
Removing compile
Removing config.guess
Removing config.log
Removing config.status
Removing config.sub
Removing configure
Removing curl-config
Removing depcomp
Removing docs/Makefile
Removing docs/Makefile.in
Removing docs/cmdline-opts/Makefile
Removing docs/cmdline-opts/Makefile.in
Removing docs/examples/.deps/
Removing docs/examples/Makefile
Removing docs/examples/Makefile.in
Removing docs/libcurl/Makefile
Removing docs/libcurl/Makefile.in
Removing docs/libcurl/opts/Makefile
Removing docs/libcurl/opts/Makefile.in
Removing include/Makefile
Removing include/Makefile.in
Removing include/curl/Makefile
Removing include/curl/Makefile.in
Removing install-sh
Removing lib/.deps/
Removing lib/.dirstamp
Removing lib/.libs/
Removing lib/Makefile
Removing lib/Makefile.in
Removing lib/base64.o
Removing lib/curl_config.h
Removing lib/curl_config.h.in
Removing lib/curl_multibyte.o
Removing lib/dynbuf.o
Removing lib/libcurl.la
Removing lib/libcurl.vers
Removing lib/libcurl_la-altsvc.lo
Removing lib/libcurl_la-altsvc.o
Removing lib/libcurl_la-amigaos.lo
Removing lib/libcurl_la-amigaos.o
Removing lib/libcurl_la-asyn-ares.lo
Removing lib/libcurl_la-asyn-ares.o
Removing lib/libcurl_la-asyn-thread.lo
Removing lib/libcurl_la-asyn-thread.o
Removing lib/libcurl_la-base64.lo
Removing lib/libcurl_la-base64.o
Removing lib/libcurl_la-bufq.lo
Removing lib/libcurl_la-bufq.o
Removing lib/libcurl_la-bufref.lo
Removing lib/libcurl_la-bufref.o
Removing lib/libcurl_la-c-hyper.lo
Removing lib/libcurl_la-c-hyper.o
Removing lib/libcurl_la-cf-h1-proxy.lo
Removing lib/libcurl_la-cf-h1-proxy.o
Removing lib/libcurl_la-cf-h2-proxy.lo
Removing lib/libcurl_la-cf-h2-proxy.o
Removing lib/libcurl_la-cf-haproxy.lo
Removing lib/libcurl_la-cf-haproxy.o
Removing lib/libcurl_la-cf-https-connect.lo
Removing lib/libcurl_la-cf-https-connect.o
Removing lib/libcurl_la-cf-socket.lo
Removing lib/libcurl_la-cf-socket.o
Removing lib/libcurl_la-cfilters.lo
Removing lib/libcurl_la-cfilters.o
Removing lib/libcurl_la-conncache.lo
Removing lib/libcurl_la-conncache.o
Removing lib/libcurl_la-connect.lo
Removing lib/libcurl_la-connect.o
Removing lib/libcurl_la-content_encoding.lo
Removing lib/libcurl_la-content_encoding.o
Removing lib/libcurl_la-cookie.lo
Removing lib/libcurl_la-cookie.o
Removing lib/libcurl_la-curl_addrinfo.lo
Removing lib/libcurl_la-curl_addrinfo.o
Removing lib/libcurl_la-curl_des.lo
Removing lib/libcurl_la-curl_des.o
Removing lib/libcurl_la-curl_endian.lo
Removing lib/libcurl_la-curl_endian.o
Removing lib/libcurl_la-curl_fnmatch.lo
Removing lib/libcurl_la-curl_fnmatch.o
Removing lib/libcurl_la-curl_get_line.lo
Removing lib/libcurl_la-curl_get_line.o
Removing lib/libcurl_la-curl_gethostname.lo
Removing lib/libcurl_la-curl_gethostname.o
Removing lib/libcurl_la-curl_gssapi.lo
Removing lib/libcurl_la-curl_gssapi.o
Removing lib/libcurl_la-curl_memrchr.lo
Removing lib/libcurl_la-curl_memrchr.o
Removing lib/libcurl_la-curl_multibyte.lo
Removing lib/libcurl_la-curl_multibyte.o
Removing lib/libcurl_la-curl_ntlm_core.lo
Removing lib/libcurl_la-curl_ntlm_core.o
Removing lib/libcurl_la-curl_path.lo
Removing lib/libcurl_la-curl_path.o
Removing lib/libcurl_la-curl_range.lo
Removing lib/libcurl_la-curl_range.o
Removing lib/libcurl_la-curl_rtmp.lo
Removing lib/libcurl_la-curl_rtmp.o
Removing lib/libcurl_la-curl_sasl.lo
Removing lib/libcurl_la-curl_sasl.o
Removing lib/libcurl_la-curl_sha512_256.lo
Removing lib/libcurl_la-curl_sha512_256.o
Removing lib/libcurl_la-curl_sspi.lo
Removing lib/libcurl_la-curl_sspi.o
Removing lib/libcurl_la-curl_threads.lo
Removing lib/libcurl_la-curl_threads.o
Removing lib/libcurl_la-curl_trc.lo
Removing lib/libcurl_la-curl_trc.o
Removing lib/libcurl_la-cw-out.lo
Removing lib/libcurl_la-cw-out.o
Removing lib/libcurl_la-dict.lo
Removing lib/libcurl_la-dict.o
Removing lib/libcurl_la-dllmain.lo
Removing lib/libcurl_la-dllmain.o
Removing lib/libcurl_la-doh.lo
Removing lib/libcurl_la-doh.o
Removing lib/libcurl_la-dynbuf.lo
Removing lib/libcurl_la-dynbuf.o
Removing lib/libcurl_la-dynhds.lo
Removing lib/libcurl_la-dynhds.o
Removing lib/libcurl_la-easy.lo
Removing lib/libcurl_la-easy.o
Removing lib/libcurl_la-easygetopt.lo
Removing lib/libcurl_la-easygetopt.o
Removing lib/libcurl_la-easyoptions.lo
Removing lib/libcurl_la-easyoptions.o
Removing lib/libcurl_la-escape.lo
Removing lib/libcurl_la-escape.o
Removing lib/libcurl_la-file.lo
Removing lib/libcurl_la-file.o
Removing lib/libcurl_la-fileinfo.lo
Removing lib/libcurl_la-fileinfo.o
Removing lib/libcurl_la-fopen.lo
Removing lib/libcurl_la-fopen.o
Removing lib/libcurl_la-formdata.lo
Removing lib/libcurl_la-formdata.o
Removing lib/libcurl_la-ftp.lo
Removing lib/libcurl_la-ftp.o
Removing lib/libcurl_la-ftplistparser.lo
Removing lib/libcurl_la-ftplistparser.o
Removing lib/libcurl_la-getenv.lo
Removing lib/libcurl_la-getenv.o
Removing lib/libcurl_la-getinfo.lo
Removing lib/libcurl_la-getinfo.o
Removing lib/libcurl_la-gopher.lo
Removing lib/libcurl_la-gopher.o
Removing lib/libcurl_la-hash.lo
Removing lib/libcurl_la-hash.o
Removing lib/libcurl_la-headers.lo
Removing lib/libcurl_la-headers.o
Removing lib/libcurl_la-hmac.lo
Removing lib/libcurl_la-hmac.o
Removing lib/libcurl_la-hostasyn.lo
Removing lib/libcurl_la-hostasyn.o
Removing lib/libcurl_la-hostip.lo
Removing lib/libcurl_la-hostip.o
Removing lib/libcurl_la-hostip4.lo
Removing lib/libcurl_la-hostip4.o
Removing lib/libcurl_la-hostip6.lo
Removing lib/libcurl_la-hostip6.o
Removing lib/libcurl_la-hostsyn.lo
Removing lib/libcurl_la-hostsyn.o
Removing lib/libcurl_la-hsts.lo
Removing lib/libcurl_la-hsts.o
Removing lib/libcurl_la-http.lo
Removing lib/libcurl_la-http.o
Removing lib/libcurl_la-http1.lo
Removing lib/libcurl_la-http1.o
Removing lib/libcurl_la-http2.lo
Removing lib/libcurl_la-http2.o
Removing lib/libcurl_la-http_aws_sigv4.lo
Removing lib/libcurl_la-http_aws_sigv4.o
Removing lib/libcurl_la-http_chunks.lo
Removing lib/libcurl_la-http_chunks.o
Removing lib/libcurl_la-http_digest.lo
Removing lib/libcurl_la-http_digest.o
Removing lib/libcurl_la-http_negotiate.lo
Removing lib/libcurl_la-http_negotiate.o
Removing lib/libcurl_la-http_ntlm.lo
Removing lib/libcurl_la-http_ntlm.o
Removing lib/libcurl_la-http_proxy.lo
Removing lib/libcurl_la-http_proxy.o
Removing lib/libcurl_la-idn.lo
Removing lib/libcurl_la-idn.o
Removing lib/libcurl_la-if2ip.lo
Removing lib/libcurl_la-if2ip.o
Removing lib/libcurl_la-imap.lo
Removing lib/libcurl_la-imap.o
Removing lib/libcurl_la-inet_ntop.lo
Removing lib/libcurl_la-inet_ntop.o
Removing lib/libcurl_la-inet_pton.lo
Removing lib/libcurl_la-inet_pton.o
Removing lib/libcurl_la-krb5.lo
Removing lib/libcurl_la-krb5.o
Removing lib/libcurl_la-ldap.lo
Removing lib/libcurl_la-ldap.o
Removing lib/libcurl_la-llist.lo
Removing lib/libcurl_la-llist.o
Removing lib/libcurl_la-macos.lo
Removing lib/libcurl_la-macos.o
Removing lib/libcurl_la-md4.lo
Removing lib/libcurl_la-md4.o
Removing lib/libcurl_la-md5.lo
Removing lib/libcurl_la-md5.o
Removing lib/libcurl_la-memdebug.lo
Removing lib/libcurl_la-memdebug.o
Removing lib/libcurl_la-mime.lo
Removing lib/libcurl_la-mime.o
Removing lib/libcurl_la-mprintf.lo
Removing lib/libcurl_la-mprintf.o
Removing lib/libcurl_la-mqtt.lo
Removing lib/libcurl_la-mqtt.o
Removing lib/libcurl_la-multi.lo
Removing lib/libcurl_la-multi.o
Removing lib/libcurl_la-netrc.lo
Removing lib/libcurl_la-netrc.o
Removing lib/libcurl_la-nonblock.lo
Removing lib/libcurl_la-nonblock.o
Removing lib/libcurl_la-noproxy.lo
Removing lib/libcurl_la-noproxy.o
Removing lib/libcurl_la-openldap.lo
Removing lib/libcurl_la-openldap.o
Removing lib/libcurl_la-parsedate.lo
Removing lib/libcurl_la-parsedate.o
Removing lib/libcurl_la-pingpong.lo
Removing lib/libcurl_la-pingpong.o
Removing lib/libcurl_la-pop3.lo
Removing lib/libcurl_la-pop3.o
Removing lib/libcurl_la-progress.lo
Removing lib/libcurl_la-progress.o
Removing lib/libcurl_la-psl.lo
Removing lib/libcurl_la-psl.o
Removing lib/libcurl_la-rand.lo
Removing lib/libcurl_la-rand.o
Removing lib/libcurl_la-rename.lo
Removing lib/libcurl_la-rename.o
Removing lib/libcurl_la-request.lo
Removing lib/libcurl_la-request.o
Removing lib/libcurl_la-rtsp.lo
Removing lib/libcurl_la-rtsp.o
Removing lib/libcurl_la-select.lo
Removing lib/libcurl_la-select.o
Removing lib/libcurl_la-sendf.lo
Removing lib/libcurl_la-sendf.o
Removing lib/libcurl_la-setopt.lo
Removing lib/libcurl_la-setopt.o
Removing lib/libcurl_la-sha256.lo
Removing lib/libcurl_la-sha256.o
Removing lib/libcurl_la-share.lo
Removing lib/libcurl_la-share.o
Removing lib/libcurl_la-slist.lo
Removing lib/libcurl_la-slist.o
Removing lib/libcurl_la-smb.lo
Removing lib/libcurl_la-smb.o
Removing lib/libcurl_la-smtp.lo
Removing lib/libcurl_la-smtp.o
Removing lib/libcurl_la-socketpair.lo
Removing lib/libcurl_la-socketpair.o
Removing lib/libcurl_la-socks.lo
Removing lib/libcurl_la-socks.o
Removing lib/libcurl_la-socks_gssapi.lo
Removing lib/libcurl_la-socks_gssapi.o
Removing lib/libcurl_la-socks_sspi.lo
Removing lib/libcurl_la-socks_sspi.o
Removing lib/libcurl_la-speedcheck.lo
Removing lib/libcurl_la-speedcheck.o
Removing lib/libcurl_la-splay.lo
Removing lib/libcurl_la-splay.o
Removing lib/libcurl_la-strcase.lo
Removing lib/libcurl_la-strcase.o
Removing lib/libcurl_la-strdup.lo
Removing lib/libcurl_la-strdup.o
Removing lib/libcurl_la-strerror.lo
Removing lib/libcurl_la-strerror.o
Removing lib/libcurl_la-strtok.lo
Removing lib/libcurl_la-strtok.o
Removing lib/libcurl_la-strtoofft.lo
Removing lib/libcurl_la-strtoofft.o
Removing lib/libcurl_la-system_win32.lo
Removing lib/libcurl_la-system_win32.o
Removing lib/libcurl_la-telnet.lo
Removing lib/libcurl_la-telnet.o
Removing lib/libcurl_la-tftp.lo
Removing lib/libcurl_la-tftp.o
Removing lib/libcurl_la-timediff.lo
Removing lib/libcurl_la-timediff.o
Removing lib/libcurl_la-timeval.lo
Removing lib/libcurl_la-timeval.o
Removing lib/libcurl_la-transfer.lo
Removing lib/libcurl_la-transfer.o
Removing lib/libcurl_la-url.lo
Removing lib/libcurl_la-url.o
Removing lib/libcurl_la-urlapi.lo
Removing lib/libcurl_la-urlapi.o
Removing lib/libcurl_la-version.lo
Removing lib/libcurl_la-version.o
Removing lib/libcurl_la-version_win32.lo
Removing lib/libcurl_la-version_win32.o
Removing lib/libcurl_la-warnless.lo
Removing lib/libcurl_la-warnless.o
Removing lib/libcurl_la-ws.lo
Removing lib/libcurl_la-ws.o
Removing lib/nonblock.o
Removing lib/stamp-h1
Removing lib/strtoofft.o
Removing lib/timediff.o
Removing lib/vauth/.deps/
Removing lib/vauth/.dirstamp
Removing lib/vauth/libcurl_la-cleartext.lo
Removing lib/vauth/libcurl_la-cleartext.o
Removing lib/vauth/libcurl_la-cram.lo
Removing lib/vauth/libcurl_la-cram.o
Removing lib/vauth/libcurl_la-digest.lo
Removing lib/vauth/libcurl_la-digest.o
Removing lib/vauth/libcurl_la-digest_sspi.lo
Removing lib/vauth/libcurl_la-digest_sspi.o
Removing lib/vauth/libcurl_la-gsasl.lo
Removing lib/vauth/libcurl_la-gsasl.o
Removing lib/vauth/libcurl_la-krb5_gssapi.lo
Removing lib/vauth/libcurl_la-krb5_gssapi.o
Removing lib/vauth/libcurl_la-krb5_sspi.lo
Removing lib/vauth/libcurl_la-krb5_sspi.o
Removing lib/vauth/libcurl_la-ntlm.lo
Removing lib/vauth/libcurl_la-ntlm.o
Removing lib/vauth/libcurl_la-ntlm_sspi.lo
Removing lib/vauth/libcurl_la-ntlm_sspi.o
Removing lib/vauth/libcurl_la-oauth2.lo
Removing lib/vauth/libcurl_la-oauth2.o
Removing lib/vauth/libcurl_la-spnego_gssapi.lo
Removing lib/vauth/libcurl_la-spnego_gssapi.o
Removing lib/vauth/libcurl_la-spnego_sspi.lo
Removing lib/vauth/libcurl_la-spnego_sspi.o
Removing lib/vauth/libcurl_la-vauth.lo
Removing lib/vauth/libcurl_la-vauth.o
Removing lib/version_win32.o
Removing lib/vquic/.deps/
Removing lib/vquic/.dirstamp
Removing lib/vquic/libcurl_la-curl_msh3.lo
Removing lib/vquic/libcurl_la-curl_msh3.o
Removing lib/vquic/libcurl_la-curl_ngtcp2.lo
Removing lib/vquic/libcurl_la-curl_ngtcp2.o
Removing lib/vquic/libcurl_la-curl_osslq.lo
Removing lib/vquic/libcurl_la-curl_osslq.o
Removing lib/vquic/libcurl_la-curl_quiche.lo
Removing lib/vquic/libcurl_la-curl_quiche.o
Removing lib/vquic/libcurl_la-vquic-tls.lo
Removing lib/vquic/libcurl_la-vquic-tls.o
Removing lib/vquic/libcurl_la-vquic.lo
Removing lib/vquic/libcurl_la-vquic.o
Removing lib/vssh/.deps/
Removing lib/vssh/.dirstamp
Removing lib/vssh/libcurl_la-libssh.lo
Removing lib/vssh/libcurl_la-libssh.o
Removing lib/vssh/libcurl_la-libssh2.lo
Removing lib/vssh/libcurl_la-libssh2.o
Removing lib/vssh/libcurl_la-wolfssh.lo
Removing lib/vssh/libcurl_la-wolfssh.o
Removing lib/vtls/.deps/
Removing lib/vtls/.dirstamp
Removing lib/vtls/libcurl_la-bearssl.lo
Removing lib/vtls/libcurl_la-bearssl.o
Removing lib/vtls/libcurl_la-cipher_suite.lo
Removing lib/vtls/libcurl_la-cipher_suite.o
Removing lib/vtls/libcurl_la-gtls.lo
Removing lib/vtls/libcurl_la-gtls.o
Removing lib/vtls/libcurl_la-hostcheck.lo
Removing lib/vtls/libcurl_la-hostcheck.o
Removing lib/vtls/libcurl_la-keylog.lo
Removing lib/vtls/libcurl_la-keylog.o
Removing lib/vtls/libcurl_la-mbedtls.lo
Removing lib/vtls/libcurl_la-mbedtls.o
Removing lib/vtls/libcurl_la-mbedtls_threadlock.lo
Removing lib/vtls/libcurl_la-mbedtls_threadlock.o
Removing lib/vtls/libcurl_la-openssl.lo
Removing lib/vtls/libcurl_la-openssl.o
Removing lib/vtls/libcurl_la-rustls.lo
Removing lib/vtls/libcurl_la-rustls.o
Removing lib/vtls/libcurl_la-schannel.lo
Removing lib/vtls/libcurl_la-schannel.o
Removing lib/vtls/libcurl_la-schannel_verify.lo
Removing lib/vtls/libcurl_la-schannel_verify.o
Removing lib/vtls/libcurl_la-sectransp.lo
Removing lib/vtls/libcurl_la-sectransp.o
Removing lib/vtls/libcurl_la-vtls.lo
Removing lib/vtls/libcurl_la-vtls.o
Removing lib/vtls/libcurl_la-wolfssl.lo
Removing lib/vtls/libcurl_la-wolfssl.o
Removing lib/vtls/libcurl_la-x509asn1.lo
Removing lib/vtls/libcurl_la-x509asn1.o
Removing lib/warnless.o
Removing libcurl.pc
Removing libtool
Removing ltmain.sh
Removing m4/libtool.m4
Removing m4/ltoptions.m4
Removing m4/ltsugar.m4
Removing m4/ltversion.m4
Removing m4/lt~obsolete.m4
Removing missing
Removing packages/Makefile
Removing packages/Makefile.in
Removing packages/vms/Makefile
Removing packages/vms/Makefile.in
Removing scripts/Makefile
Removing scripts/Makefile.in
Removing src/.deps/
Removing src/.libs/
Removing src/Makefile
Removing src/Makefile.in
Removing src/curl
Removing src/slist_wc.o
Removing src/terminal.o
Removing src/tool_binmode.o
Removing src/tool_bname.o
Removing src/tool_ca_embed.c
Removing src/tool_ca_embed.o
Removing src/tool_cb_dbg.o
Removing src/tool_cb_hdr.o
Removing src/tool_cb_prg.o
Removing src/tool_cb_rea.o
Removing src/tool_cb_see.o
Removing src/tool_cb_soc.o
Removing src/tool_cb_wrt.o
Removing src/tool_cfgable.o
Removing src/tool_dirhie.o
Removing src/tool_doswin.o
Removing src/tool_easysrc.o
Removing src/tool_filetime.o
Removing src/tool_findfile.o
Removing src/tool_formparse.o
Removing src/tool_getparam.o
Removing src/tool_getpass.o
Removing src/tool_help.o
Removing src/tool_helpers.o
Removing src/tool_hugehelp.c
Removing src/tool_hugehelp.o
Removing src/tool_ipfs.o
Removing src/tool_libinfo.o
Removing src/tool_listhelp.o
Removing src/tool_main.o
Removing src/tool_msgs.o
Removing src/tool_operate.o
Removing src/tool_operhlp.o
Removing src/tool_paramhlp.o
Removing src/tool_parsecfg.o
Removing src/tool_progress.o
Removing src/tool_setopt.o
Removing src/tool_sleep.o
Removing src/tool_stderr.o
Removing src/tool_strdup.o
Removing src/tool_urlglob.o
Removing src/tool_util.o
Removing src/tool_vms.o
Removing src/tool_writeout.o
Removing src/tool_writeout_json.o
Removing src/tool_xattr.o
Removing src/var.o
Removing tests/Makefile
Removing tests/Makefile.in
Removing tests/certs/Makefile
Removing tests/certs/Makefile.in
Removing tests/certs/scripts/Makefile
Removing tests/certs/scripts/Makefile.in
Removing tests/config
Removing tests/configurehelp.pm
Removing tests/data/Makefile
Removing tests/data/Makefile.in
Removing tests/http/Makefile
Removing tests/http/Makefile.in
Removing tests/http/clients/.deps/
Removing tests/http/clients/Makefile
Removing tests/http/clients/Makefile.in
Removing tests/http/config.ini
Removing tests/libtest/.deps/
Removing tests/libtest/Makefile
Removing tests/libtest/Makefile.in
Removing tests/server/.deps/
Removing tests/server/Makefile
Removing tests/server/Makefile.in
Removing tests/unit/.deps/
Removing tests/unit/Makefile
Removing tests/unit/Makefile.in
$ autoreconf -fi
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
libtoolize: Remember to add 'LT_INIT' to configure.ac.
configure.ac:125: installing './compile'
configure.ac:437: installing './config.guess'
configure.ac:437: installing './config.sub'
configure.ac:125: installing './install-sh'
configure.ac:131: installing './missing'
docs/examples/Makefile.am: installing './depcomp'
$ bash -c find . -name config.guess -exec cp /usr/share/misc/config.guess {} \;
$ bash -c find . -name config.sub -exec cp /usr/share/misc/config.sub {} \;
$ chmod +x configure
$ ./configure --disable-shared --without-ssl --disable-docs
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking whether to enable debug build options... no
checking whether to enable compiler optimizer... (assumed) yes
checking whether to enable strict compiler warnings... no
checking whether to enable compiler warnings as errors... no
checking whether to enable curl debug memory tracking... no
checking whether to enable hiding of library internal symbols... yes
checking whether to enable c-ares for DNS lookups... no
checking whether to disable dependency on -lrt... (assumed no)
checking whether to enable HTTPSRR support... no
checking whether to enable ECH support... no
checking for path separator... :
checking for sed... /usr/bin/sed
checking for grep... /usr/bin/grep
checking that grep -E works... yes
checking for ar... /usr/bin/ar
checking for a BSD-compatible install... /usr/bin/install -c
checking for gcc... ccache gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether ccache gcc accepts -g... yes
checking for ccache gcc option to enable C11 features... none needed
checking whether ccache gcc understands -c and -o together... yes
checking how to run the C preprocessor... ccache gcc -E
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for stdatomic.h... yes
checking if _Atomic is available... yes
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for code coverage support... no
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of ccache gcc... gcc3
checking curl version... 8.10.0-DEV
checking for httpd... no
checking for apache2... no
checking for apachectl... no
checking for apxs... no
configure: httpd/apache2 not in PATH, http tests disabled
configure: apxs not in PATH, http tests disabled
checking for nghttpx... no
checking for caddy... /usr/bin/caddy
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for grep that handles long lines and -e... (cached) /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking if OS is AIX (to define _ALL_SOURCE)... no
checking if _THREAD_SAFE is already defined... no
checking if _THREAD_SAFE is actually needed... no
checking if _THREAD_SAFE is onwards defined... no
checking if _REENTRANT is already defined... no
checking if _REENTRANT is actually needed... no
checking if _REENTRANT is onwards defined... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by ccache gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from ccache gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if ccache gcc supports -fno-rtti -fno-exceptions... no
checking for ccache gcc option to produce PIC... -fPIC -DPIC
checking if ccache gcc PIC flag -fPIC -DPIC works... yes
checking if ccache gcc static flag -static works... yes
checking if ccache gcc supports -c -o file.o... yes
checking if ccache gcc supports -c -o file.o... (cached) yes
checking whether the ccache gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking whether to build shared libraries with -version-info... yes
checking whether to build shared libraries with -no-undefined... no
checking whether to build shared libraries with -mimpure-text... no
checking whether to build shared libraries with PIC... yes
checking whether to build static libraries with PIC... yes
checking whether to build shared libraries only... no
checking whether to build static libraries only... yes
checking for windres... no
checking if cpp -P is needed... yes
checking if cpp -P works... yes
checking if compiler is DEC/Compaq/HP C... no
checking if compiler is HP-UX C... no
checking if compiler is IBM C... no
checking if compiler is Intel C... no
checking if compiler is clang... no
checking if compiler is GNU C... yes
checking compiler version... gcc '1100' (raw: '11')
checking if compiler is SunPro C... no
checking if compiler is Tiny C... no
checking whether build target is a native Windows one... no
checking if compiler accepts some basic options... yes
configure: compiler options added: -Werror-implicit-function-declaration
checking if compiler optimizer assumed setting might be used... yes
checking if compiler accepts optimizer enabling options... yes
configure: compiler options added: -O2
checking if compiler accepts strict warning options... yes
configure: compiler options added: -Wno-system-headers
checking if compiler halts on compilation errors... yes
checking if compiler halts on negative sized arrays... yes
checking if compiler halts on function prototype mismatch... yes
checking if compiler supports hiding library internal symbols... yes
checking whether build target supports Win32 file API... no
checking whether build target supports Win32 crypto API... no
checking for good-to-use Darwin CFLAGS... no
checking whether to support http... yes
checking whether to support ftp... yes
checking whether to support file... yes
checking whether to support ldap... yes
checking whether to support ldaps... yes
checking whether to support rtsp... yes
checking whether to support proxies... yes
checking whether to support dict... yes
checking whether to support telnet... yes
checking whether to support tftp... yes
checking whether to support pop3... yes
checking whether to support imap... yes
checking whether to support smb... yes
checking whether to support smtp... yes
checking whether to support gopher... yes
checking whether to support mqtt... no
checking whether to provide built-in manual... yes
checking whether to build documentation... no
checking whether to enable generation of C code... yes
checking whether to use libgcc... no
checking if X/Open network library is required... no
checking for gethostbyname... yes
checking whether build target is a native Windows one... (cached) no
checking for proto/bsdsocket.h... no
checking for connect in libraries... yes
checking for sys/types.h... (cached) yes
checking for sys/time.h... yes
checking for monotonic clock_gettime... yes
checking for clock_gettime in libraries... no additional lib required
checking if monotonic clock_gettime works... yes
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for raw monotonic clock_gettime... yes
checking for pkg-config... /usr/bin/pkg-config
checking for zlib options with pkg-config... found
checking for zlib.h... yes
configure: found both libz and libz.h header
checking for BrotliDecoderDecompress in -lbrotlidec... no
checking for brotli/decode.h... no
checking for ZSTD_createDStream in -lzstd... no
checking for zstd.h... no
checking for lber.h... no
checking for ldap.h... no
checking for ldap_ssl.h... no
checking for LDAP libraries... cannot find LDAP libraries
checking whether to enable IPv6... yes
checking if struct sockaddr_in6 has sin6_scope_id member... yes
checking if argv can be written to... yes
checking if GSS-API support is requested... no
checking whether to enable Windows native SSL/TLS... no
checking whether to enable Secure Transport... no
checking whether to enable Amiga native SSL/TLS (AmiSSL v5)... no
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for libpsl options with pkg-config... found
checking for psl_builtin in -lpsl... yes
checking for libpsl.h... yes
checking for library containing gsasl_init... no
checking for RTMP_Init in -lrtmp... no
checking whether versioned symbols are wanted... no
checking whether to enable Windows native IDN (Windows native builds only)... no
checking whether to build with libidn2... (assumed) yes
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for libidn2 options with pkg-config... no
configure: IDN_LIBS: "-lidn2"
configure: IDN_LDFLAGS: ""
configure: IDN_CPPFLAGS: ""
configure: IDN_DIR: ""
checking if idn2_lookup_ul can be linked... no
checking for idn2.h... no
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for libnghttp2 options with pkg-config... no
checking for nghttp2_session_get_stream_local_window_size in -lnghttp2... no
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for sys/select.h... yes
checking for sys/socket.h... yes
checking for sys/ioctl.h... yes
checking for unistd.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for arpa/inet.h... yes
checking for net/if.h... yes
checking for netinet/in.h... yes
checking for netinet/in6.h... no
checking for sys/un.h... yes
checking for linux/tcp.h... yes
checking for netinet/tcp.h... yes
checking for netinet/udp.h... yes
checking for netdb.h... yes
checking for sys/sockio.h... no
checking for sys/stat.h... (cached) yes
checking for sys/param.h... yes
checking for termios.h... yes
checking for termio.h... yes
checking for fcntl.h... yes
checking for io.h... no
checking for pwd.h... yes
checking for utime.h... yes
checking for sys/utime.h... no
checking for sys/poll.h... yes
checking for poll.h... yes
checking for socket.h... no
checking for sys/resource.h... yes
checking for libgen.h... yes
checking for locale.h... yes
checking for stdbool.h... yes
checking for sys/filio.h... no
checking for sys/wait.h... yes
checking for sys/eventfd.h... yes
checking for setjmp.h... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for struct timeval... yes
checking run-time libs availability... fine
checking size of size_t... 8
checking size of long... 8
checking size of int... 4
checking size of time_t... 8
checking size of off_t... 8
checking size of curl_off_t... 8
checking size of curl_socket_t... 4
checking for long long... yes
checking for ssize_t... yes
checking for bool... yes
checking for sa_family_t... yes
checking for suseconds_t... yes
checking if time_t is unsigned... no
checking for in_addr_t... yes
checking for struct sockaddr_storage... yes
checking for sys/select.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for select... yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for recv... yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for send... yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for MSG_NOSIGNAL... yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking if alarm can be linked... yes
checking if alarm is prototyped... yes
checking if alarm is compilable... yes
checking if alarm usage allowed... yes
checking if alarm might be used... yes
checking for sys/types.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for libgen.h... (cached) yes
checking if basename can be linked... yes
checking if basename is prototyped... yes
checking if basename is compilable... yes
checking if basename usage allowed... yes
checking if basename might be used... yes
checking for sys/types.h... (cached) yes
checking for socket.h... (cached) no
checking if closesocket can be linked... no
checking if closesocket might be used... no
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking if CloseSocket can be linked... no
checking if CloseSocket might be used... no
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking for fcntl.h... (cached) yes
checking if fcntl can be linked... yes
checking if fcntl is prototyped... yes
checking if fcntl is compilable... yes
checking if fcntl usage allowed... yes
checking if fcntl might be used... yes
checking if fcntl O_NONBLOCK is compilable... yes
checking if fcntl O_NONBLOCK usage allowed... yes
checking if fcntl O_NONBLOCK might be used... yes
checking whether build target is a native Windows one... (cached) no
checking for sys/types.h... (cached) yes
checking for netdb.h... (cached) yes
checking if freeaddrinfo can be linked... yes
checking if freeaddrinfo is prototyped... yes
checking if freeaddrinfo is compilable... yes
checking if freeaddrinfo usage allowed... yes
checking if freeaddrinfo might be used... yes
checking for sys/types.h... (cached) yes
checking for sys/xattr.h... yes
checking if fsetxattr can be linked... yes
checking if fsetxattr is prototyped... yes
checking if fsetxattr takes 5 args.... yes
checking if fsetxattr is compilable... yes
checking if fsetxattr usage allowed... yes
checking if fsetxattr might be used... yes
checking if ftruncate can be linked... yes
checking if ftruncate is prototyped... yes
checking if ftruncate is compilable... yes
checking if ftruncate usage allowed... yes
checking if ftruncate might be used... yes
checking for sys/types.h... (cached) yes
checking if getaddrinfo can be linked... yes
checking if getaddrinfo is prototyped... yes
checking if getaddrinfo is compilable... yes
checking if getaddrinfo seems to work... yes
checking if getaddrinfo usage allowed... yes
checking if getaddrinfo might be used... yes
checking if getaddrinfo is threadsafe... yes
checking if gethostbyname can be linked... yes
checking if gethostbyname is prototyped... yes
checking if gethostbyname is compilable... yes
checking if gethostbyname usage allowed... yes
checking if gethostbyname might be used... yes
checking if gethostbyname_r can be linked... yes
checking if gethostbyname_r is prototyped... yes
checking if gethostbyname_r takes 3 args.... no
checking if gethostbyname_r takes 5 args.... no
checking if gethostbyname_r takes 6 args.... yes
checking if gethostbyname_r is compilable... yes
checking if gethostbyname_r usage allowed... yes
checking if gethostbyname_r might be used... yes
checking if gethostname can be linked... yes
checking if gethostname is prototyped... yes
checking if gethostname is compilable... yes
checking for gethostname arg 2 data type... size_t
checking if gethostname usage allowed... yes
checking if gethostname might be used... yes
checking if getpeername can be linked... yes
checking if getpeername is prototyped... yes
checking if getpeername is compilable... yes
checking if getpeername usage allowed... yes
checking if getpeername might be used... yes
checking if getsockname can be linked... yes
checking if getsockname is prototyped... yes
checking if getsockname is compilable... yes
checking if getsockname usage allowed... yes
checking if getsockname might be used... yes
checking for net/if.h... (cached) yes
checking if if_nametoindex can be linked... yes
checking if if_nametoindex is prototyped... yes
checking if if_nametoindex is compilable... yes
checking if if_nametoindex usage allowed... yes
checking if if_nametoindex might be used... yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking for ifaddrs.h... yes
checking if getifaddrs can be linked... yes
checking if getifaddrs is prototyped... yes
checking if getifaddrs is compilable... yes
checking if getifaddrs seems to work... yes
checking if getifaddrs usage allowed... yes
checking if getifaddrs might be used... yes
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) yes
checking if gmtime_r can be linked... yes
checking if gmtime_r is prototyped... yes
checking if gmtime_r is compilable... yes
checking if gmtime_r seems to work... yes
checking if gmtime_r usage allowed... yes
checking if gmtime_r might be used... yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking for arpa/inet.h... (cached) yes
checking if inet_ntop can be linked... yes
checking if inet_ntop is prototyped... yes
checking if inet_ntop is compilable... yes
checking if inet_ntop seems to work... yes
checking if inet_ntop usage allowed... yes
checking if inet_ntop might be used... yes
checking if inet_pton can be linked... yes
checking if inet_pton is prototyped... yes
checking if inet_pton is compilable... yes
checking if inet_pton seems to work... yes
checking if inet_pton usage allowed... yes
checking if inet_pton might be used... yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for sys/ioctl.h... (cached) yes
checking for stropts.h... no
checking if ioctl can be linked... yes
checking if ioctl is prototyped... yes
checking if ioctl is compilable... yes
checking if ioctl usage allowed... yes
checking if ioctl might be used... yes
checking if ioctl FIONBIO is compilable... yes
checking if ioctl FIONBIO usage allowed... yes
checking if ioctl FIONBIO might be used... yes
checking if ioctl SIOCGIFADDR is compilable... yes
checking if ioctl SIOCGIFADDR usage allowed... yes
checking if ioctl SIOCGIFADDR might be used... yes
checking if ioctlsocket can be linked... no
checking if ioctlsocket might be used... no
checking if IoctlSocket can be linked... no
checking if IoctlSocket might be used... no
checking if memrchr can be linked... yes
checking if memrchr is prototyped... no
checking if memrchr might be used... no
checking for sys/types.h... (cached) yes
checking for poll.h... (cached) yes
checking for sys/poll.h... (cached) yes
checking if poll can be linked... yes
checking if poll is prototyped... yes
checking if poll is compilable... yes
checking if poll seems to work... yes
checking if poll usage allowed... yes
checking if poll might be used... yes
checking for sys/types.h... (cached) yes
checking if sigaction can be linked... yes
checking if sigaction is prototyped... yes
checking if sigaction is compilable... yes
checking if sigaction usage allowed... yes
checking if sigaction might be used... yes
checking if siginterrupt can be linked... yes
checking if siginterrupt is prototyped... yes
checking if siginterrupt is compilable... yes
checking if siginterrupt usage allowed... yes
checking if siginterrupt might be used... yes
checking if signal can be linked... yes
checking if signal is prototyped... yes
checking if signal is compilable... yes
checking if signal usage allowed... yes
checking if signal might be used... yes
checking for sys/types.h... (cached) yes
checking if sigsetjmp can be linked... no
checking if sigsetjmp seems a macro... yes
checking if sigsetjmp is compilable... yes
checking if sigsetjmp usage allowed... yes
checking if sigsetjmp might be used... yes
checking if socket can be linked... yes
checking if socket is prototyped... yes
checking if socket is compilable... yes
checking if socket usage allowed... yes
checking if socket might be used... yes
checking if socketpair can be linked... yes
checking if socketpair is prototyped... yes
checking if socketpair is compilable... yes
checking if socketpair usage allowed... yes
checking if socketpair might be used... yes
checking if strcasecmp can be linked... yes
checking if strcasecmp is prototyped... yes
checking if strcasecmp is compilable... yes
checking if strcasecmp usage allowed... yes
checking if strcasecmp might be used... yes
checking if strcmpi can be linked... no
checking if strcmpi might be used... no
checking if strdup can be linked... yes
checking if strdup is prototyped... yes
checking if strdup is compilable... yes
checking if strdup usage allowed... yes
checking if strdup might be used... yes
checking if strerror_r can be linked... yes
checking if strerror_r is prototyped... yes
checking if strerror_r is compilable... yes
checking if strerror_r is glibc like... no
checking if strerror_r is POSIX like... yes
checking if strerror_r seems to work... yes
checking if strerror_r usage allowed... yes
checking if strerror_r might be used... yes
checking if stricmp can be linked... no
checking if stricmp might be used... no
checking if strtok_r can be linked... yes
checking if strtok_r is prototyped... yes
checking if strtok_r is compilable... yes
checking if strtok_r usage allowed... yes
checking if strtok_r might be used... yes
checking if strtoll can be linked... yes
checking if strtoll is prototyped... yes
checking if strtoll is compilable... yes
checking if strtoll usage allowed... yes
checking if strtoll might be used... yes
checking for ccache gcc options needed to detect all undeclared functions... none needed
checking whether getpwuid_r is declared... yes
checking for _fseeki64... no
checking for arc4random... no
checking for eventfd... yes
checking for fnmatch... yes
checking for fseeko... yes
checking for geteuid... yes
checking for getpass_r... no
checking for getppid... yes
checking for getpwuid... yes
checking for getpwuid_r... yes
checking for getrlimit... yes
checking for gettimeofday... yes
checking for if_nametoindex... yes
checking for mach_absolute_time... no
checking for pipe... yes
checking for sched_yield... yes
checking for sendmsg... yes
checking for setlocale... yes
checking for setmode... no
checking for setrlimit... yes
checking for snprintf... yes
checking for utime... yes
checking for utimes... yes
checking whether fseeko is declared... yes
checking how to set a socket into non-blocking mode... fcntl O_NONBLOCK
checking whether to enable the threaded resolver... yes
checking whether to link macOS CoreFoundation, CoreServices, and SystemConfiguration frameworks... no
checking whether to use POSIX threads for threaded resolver... auto
checking for pthread.h... yes
checking for pthread_create... yes
checking for dirent.h... yes
checking for opendir... yes
checking convert -I options to -isystem... yes
checking whether to enable verbose strings... yes
checking whether to enable SSPI support (Windows native builds only)... no
checking whether to enable basic authentication method... yes
checking whether to enable bearer authentication method... yes
checking whether to enable digest authentication method... yes
checking whether to enable kerberos authentication method... yes
checking whether to enable negotiate authentication method... yes
checking whether to enable aws sig methods... yes
checking whether to support NTLM... yes
checking whether to enable TLS-SRP authentication... yes
checking whether to enable Unix domain sockets... auto
checking for struct sockaddr_un.sun_path... yes
checking whether to support cookies... yes
checking whether to support socketpair... yes
checking whether to support HTTP authentication... yes
checking whether to support DoH... yes
checking whether to support the MIME API... yes
checking whether to support binding connections locally... yes
checking whether to support the form API... yes
checking whether to support date parsing... yes
checking whether to support netrc parsing... yes
checking whether to support progress-meter... yes
checking whether to support DNS shuffling... yes
checking whether to support curl_easy_option*... yes
checking whether to support alt-svc... yes
checking whether to support headers-api... yes
configure: disables HSTS due to lack of SSL
checking whether to support WebSockets... no
checking whether hiding of library internal symbols will actually happen... yes
checking if this build supports HTTPS-proxy... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating docs/Makefile
config.status: creating docs/examples/Makefile
config.status: creating docs/libcurl/Makefile
config.status: creating docs/libcurl/opts/Makefile
config.status: creating docs/cmdline-opts/Makefile
config.status: creating include/Makefile
config.status: creating include/curl/Makefile
config.status: creating src/Makefile
config.status: creating lib/Makefile
config.status: creating scripts/Makefile
config.status: creating lib/libcurl.vers
config.status: creating tests/Makefile
config.status: creating tests/config
config.status: creating tests/certs/Makefile
config.status: creating tests/certs/scripts/Makefile
config.status: creating tests/data/Makefile
config.status: creating tests/server/Makefile
config.status: creating tests/libtest/Makefile
config.status: creating tests/unit/Makefile
config.status: creating tests/http/config.ini
config.status: creating tests/http/Makefile
config.status: creating tests/http/clients/Makefile
config.status: creating packages/Makefile
config.status: creating packages/vms/Makefile
config.status: creating curl-config
config.status: creating libcurl.pc
config.status: creating lib/curl_config.h
config.status: executing depfiles commands
config.status: executing libtool commands
configure: Configured to build curl/libcurl:
Host setup: x86_64-pc-linux-gnu
Install prefix: /usr/local
Compiler: ccache gcc
CFLAGS: -Werror-implicit-function-declaration -O2 -Wno-system-headers
CFLAGS extras:
CPPFLAGS:
LDFLAGS:
LIBS: -lpsl -lz
curl version: 8.10.0-DEV
SSL: no (--with-{openssl,gnutls,mbedtls,wolfssl,schannel,secure-transport,amissl,bearssl,rustls} )
SSH: no (--with-{libssh,libssh2})
zlib: enabled
brotli: no (--with-brotli)
zstd: no (--with-zstd)
GSS-API: no (--with-gssapi)
GSASL: no (libgsasl not found)
TLS-SRP: no (--enable-tls-srp)
resolver: POSIX threaded
IPv6: enabled
Unix sockets: enabled
IDN: no (--with-{libidn2,winidn})
Build docs: no
Build libcurl: Shared=no, Static=yes
Built-in manual: no (--enable-manual)
--libcurl option: enabled (--disable-libcurl-option)
Verbose errors: enabled (--disable-verbose)
Code coverage: disabled
SSPI: no (--enable-sspi)
ca cert bundle: no
ca cert path:
ca fallback:
LDAP: no (--enable-ldap / --with-ldap-lib / --with-lber-lib)
LDAPS: no (--enable-ldaps)
RTSP: enabled
RTMP: no (--with-librtmp)
PSL: enabled
Alt-svc: enabled (--disable-alt-svc)
Headers API: enabled (--disable-headers-api)
HSTS: no (--enable-hsts)
HTTP1: enabled (internal)
HTTP2: no (--with-nghttp2)
HTTP3: no (--with-ngtcp2 --with-nghttp3, --with-quiche, --with-openssl-quic, --with-msh3)
ECH: no (--enable-ech)
WebSockets: no (--enable-websockets)
Protocols: dict file ftp gopher http imap ipfs ipns mqtt pop3 rtsp smtp telnet tftp
Features: alt-svc AsynchDNS IPv6 Largefile libz PSL threadsafe UnixSockets
configure: WARNING: Cannot find libraries for LDAP support: LDAP disabled
configure: WARNING: libgsasl was not found
configure: WARNING: Cannot find libidn2
$ make -j3
Making all in lib
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/lib'
make all-am
make[2]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/lib'
CC libcurl_la-amigaos.lo
CC libcurl_la-altsvc.lo
CC libcurl_la-asyn-ares.lo
CC libcurl_la-asyn-thread.lo
CC libcurl_la-base64.lo
CC libcurl_la-bufq.lo
CC libcurl_la-bufref.lo
CC libcurl_la-c-hyper.lo
CC libcurl_la-cf-h1-proxy.lo
CC libcurl_la-cf-h2-proxy.lo
CC libcurl_la-cf-haproxy.lo
CC libcurl_la-cf-https-connect.lo
CC libcurl_la-cf-socket.lo
CC libcurl_la-cfilters.lo
CC libcurl_la-conncache.lo
CC libcurl_la-connect.lo
CC libcurl_la-content_encoding.lo
CC libcurl_la-cookie.lo
CC libcurl_la-curl_addrinfo.lo
CC libcurl_la-curl_des.lo
CC libcurl_la-curl_endian.lo
CC libcurl_la-curl_fnmatch.lo
CC libcurl_la-curl_get_line.lo
CC libcurl_la-curl_gethostname.lo
CC libcurl_la-curl_gssapi.lo
CC libcurl_la-curl_memrchr.lo
CC libcurl_la-curl_multibyte.lo
CC libcurl_la-curl_ntlm_core.lo
CC libcurl_la-curl_path.lo
CC libcurl_la-curl_range.lo
CC libcurl_la-curl_rtmp.lo
CC libcurl_la-curl_sasl.lo
CC libcurl_la-curl_sha512_256.lo
CC libcurl_la-curl_sspi.lo
CC libcurl_la-curl_threads.lo
CC libcurl_la-curl_trc.lo
CC libcurl_la-cw-out.lo
CC libcurl_la-dict.lo
CC libcurl_la-dllmain.lo
CC libcurl_la-doh.lo
CC libcurl_la-dynbuf.lo
CC libcurl_la-dynhds.lo
CC libcurl_la-easy.lo
CC libcurl_la-easygetopt.lo
CC libcurl_la-easyoptions.lo
CC libcurl_la-escape.lo
CC libcurl_la-file.lo
CC libcurl_la-fileinfo.lo
CC libcurl_la-fopen.lo
CC libcurl_la-formdata.lo
CC libcurl_la-ftp.lo
CC libcurl_la-ftplistparser.lo
CC libcurl_la-getenv.lo
CC libcurl_la-getinfo.lo
CC libcurl_la-gopher.lo
CC libcurl_la-hash.lo
CC libcurl_la-headers.lo
CC libcurl_la-hmac.lo
CC libcurl_la-hostasyn.lo
CC libcurl_la-hostip.lo
CC libcurl_la-hostip4.lo
CC libcurl_la-hostip6.lo
CC libcurl_la-hostsyn.lo
CC libcurl_la-hsts.lo
CC libcurl_la-http.lo
CC libcurl_la-http1.lo
CC libcurl_la-http2.lo
CC libcurl_la-http_aws_sigv4.lo
CC libcurl_la-http_chunks.lo
CC libcurl_la-http_digest.lo
CC libcurl_la-http_negotiate.lo
CC libcurl_la-http_ntlm.lo
CC libcurl_la-http_proxy.lo
CC libcurl_la-idn.lo
CC libcurl_la-if2ip.lo
CC libcurl_la-imap.lo
CC libcurl_la-inet_ntop.lo
CC libcurl_la-inet_pton.lo
CC libcurl_la-krb5.lo
CC libcurl_la-ldap.lo
CC libcurl_la-llist.lo
CC libcurl_la-macos.lo
CC libcurl_la-md4.lo
CC libcurl_la-md5.lo
CC libcurl_la-memdebug.lo
CC libcurl_la-mime.lo
CC libcurl_la-mprintf.lo
CC libcurl_la-mqtt.lo
CC libcurl_la-multi.lo
CC libcurl_la-netrc.lo
CC libcurl_la-nonblock.lo
CC libcurl_la-noproxy.lo
CC libcurl_la-openldap.lo
CC libcurl_la-parsedate.lo
CC libcurl_la-pingpong.lo
CC libcurl_la-pop3.lo
CC libcurl_la-progress.lo
CC libcurl_la-psl.lo
CC libcurl_la-rand.lo
CC libcurl_la-rename.lo
CC libcurl_la-request.lo
CC libcurl_la-rtsp.lo
CC libcurl_la-select.lo
CC libcurl_la-sendf.lo
CC libcurl_la-setopt.lo
CC libcurl_la-sha256.lo
CC libcurl_la-share.lo
CC libcurl_la-slist.lo
CC libcurl_la-smb.lo
CC libcurl_la-smtp.lo
CC libcurl_la-socketpair.lo
CC libcurl_la-socks.lo
CC libcurl_la-socks_gssapi.lo
CC libcurl_la-socks_sspi.lo
CC libcurl_la-speedcheck.lo
CC libcurl_la-splay.lo
CC libcurl_la-strcase.lo
CC libcurl_la-strdup.lo
CC libcurl_la-strerror.lo
CC libcurl_la-strtok.lo
CC libcurl_la-strtoofft.lo
CC libcurl_la-system_win32.lo
CC libcurl_la-telnet.lo
CC libcurl_la-tftp.lo
CC libcurl_la-timediff.lo
CC libcurl_la-timeval.lo
CC libcurl_la-transfer.lo
CC libcurl_la-url.lo
CC libcurl_la-urlapi.lo
CC libcurl_la-version.lo
CC libcurl_la-version_win32.lo
CC libcurl_la-warnless.lo
CC libcurl_la-ws.lo
CC vauth/libcurl_la-cleartext.lo
CC vauth/libcurl_la-cram.lo
CC vauth/libcurl_la-digest.lo
CC vauth/libcurl_la-digest_sspi.lo
CC vauth/libcurl_la-gsasl.lo
CC vauth/libcurl_la-krb5_gssapi.lo
CC vauth/libcurl_la-krb5_sspi.lo
CC vauth/libcurl_la-ntlm.lo
CC vauth/libcurl_la-ntlm_sspi.lo
CC vauth/libcurl_la-oauth2.lo
CC vauth/libcurl_la-spnego_gssapi.lo
CC vauth/libcurl_la-spnego_sspi.lo
CC vauth/libcurl_la-vauth.lo
CC vtls/libcurl_la-bearssl.lo
CC vtls/libcurl_la-cipher_suite.lo
CC vtls/libcurl_la-gtls.lo
CC vtls/libcurl_la-hostcheck.lo
CC vtls/libcurl_la-keylog.lo
CC vtls/libcurl_la-mbedtls.lo
CC vtls/libcurl_la-mbedtls_threadlock.lo
CC vtls/libcurl_la-openssl.lo
CC vtls/libcurl_la-rustls.lo
CC vtls/libcurl_la-schannel.lo
CC vtls/libcurl_la-schannel_verify.lo
CC vtls/libcurl_la-sectransp.lo
CC vtls/libcurl_la-vtls.lo
CC vtls/libcurl_la-wolfssl.lo
CC vtls/libcurl_la-x509asn1.lo
CC vquic/libcurl_la-curl_msh3.lo
CC vquic/libcurl_la-curl_ngtcp2.lo
CC vquic/libcurl_la-curl_osslq.lo
CC vquic/libcurl_la-curl_quiche.lo
CC vquic/libcurl_la-vquic.lo
CC vquic/libcurl_la-vquic-tls.lo
CC vssh/libcurl_la-libssh.lo
CC vssh/libcurl_la-libssh2.lo
CC vssh/libcurl_la-wolfssh.lo
CCLD libcurl.la
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/lib'
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/lib'
Making all in docs
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
Making all in .
make[2]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
make[2]: Nothing to be done for 'all-am'.
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
Making all in cmdline-opts
make[2]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/cmdline-opts'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/cmdline-opts'
Making all in libcurl
make[2]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl'
Making all in opts
make[3]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl/opts'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl/opts'
make[3]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl'
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl'
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
Making all in src
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/src'
CC slist_wc.o
CC terminal.o
CC tool_binmode.o
CC tool_bname.o
CC tool_cb_dbg.o
CC tool_cb_hdr.o
CC tool_cb_prg.o
CC tool_cb_rea.o
CC tool_cb_see.o
CC tool_cb_soc.o
CC tool_cb_wrt.o
CC tool_cfgable.o
CC tool_dirhie.o
CC tool_doswin.o
CC tool_easysrc.o
CC tool_filetime.o
CC tool_findfile.o
CC tool_formparse.o
CC tool_getpass.o
CC tool_getparam.o
CC tool_help.o
CC tool_helpers.o
echo '#include "tool_hugehelp.h"' >> tool_hugehelp.c
CC tool_ipfs.o
CC tool_main.o
CC tool_listhelp.o
CC tool_libinfo.o
CC tool_msgs.o
CC tool_operate.o
CC tool_operhlp.o
CC tool_paramhlp.o
CC tool_parsecfg.o
CC tool_progress.o
CC tool_setopt.o
CC tool_sleep.o
CC tool_stderr.o
CC tool_strdup.o
CC tool_urlglob.o
CC tool_util.o
CC tool_vms.o
CC tool_writeout.o
CC tool_writeout_json.o
CC tool_xattr.o
CC var.o
echo 'extern const void *curl_ca_embed; const void *curl_ca_embed;' > tool_ca_embed.c
CC tool_hugehelp.o
CC tool_ca_embed.o
CC ../lib/base64.o
CC ../lib/curl_multibyte.o
CC ../lib/dynbuf.o
CC ../lib/nonblock.o
CC ../lib/strtoofft.o
CC ../lib/timediff.o
CC ../lib/version_win32.o
CC ../lib/warnless.o
CCLD curl
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/src'
Making all in scripts
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/scripts'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/scripts'
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0'
make[1]: Nothing to be done for 'all-am'.
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0'
| @@ -0,0 +1,190 @@ | |
| + | <!-- |
| + | Copyright (C) Daniel Stenberg, <[email protected]>, et al. |
| + | |
| + | SPDX-License-Identifier: curl |
| + | --> |
| + | |
| + | # `llist` - linked lists |
| + | |
| + | #include "llist.h" |
| + | |
| + | This is the internal module for linked lists. The API is designed to be |
| + | flexible but also to avoid dynamic memory allocation. |
| + | |
| + | None of the involved structs should be accessed using struct fields (outside |
| + | of `llist.c`). Use the functions. |
| + | |
| + | ## Setup and shutdown |
| + | |
| + | `struct Curl_llist` is the struct holding a single linked list. It needs to be |
| + | initialized with a call to `Curl_llist_init()` before it can be used |
| + | |
| + | To clean up a list, call `Curl_llist_destroy()`. Since the linked lists |
| + | themselves do not allocate memory, it can also be fine to just *not* clean up |
| + | the list. |
| + | |
| + | ## Add a node |
| + | |
| + | There are two functions for adding a node to a linked list: |
| + | |
| + | 1. Add it last in the list with `Curl_llist_append` |
| + | 2. Add it after a specific existing node with `Curl_llist_insert_next` |
| + | |
| + | When a node is added to a list, it stores an associated custom pointer to |
| + | anything you like and you provide a pointer to a `struct Curl_llist_node` |
| + | struct in which it stores and updates pointers. If you intend to add the same |
| + | struct to multiple lists concurrently, you need to have one `struct |
| + | Curl_llist_node` for each list. |
| + | |
| + | Add a node to a list with `Curl_llist_append(list, elem, node)`. Where |
| + | |
| + | - `list`: points to a `struct Curl_llist` |
| + | - `elem`: points to what you want added to the list |
| + | - `node`: is a pointer to a `struct Curl_llist_node`. Data storage for this |
| + | node. |
| + | |
| + | Example: to add a `struct foobar` to a linked list. Add a node struct within |
| + | it: |
| + | |
| + | struct foobar { |
| + | char *random; |
| + | struct Curl_llist_node storage; /* can be anywhere in the struct */ |
| + | char *data; |
| + | }; |
| + | |
| + | struct Curl_llist barlist; /* the list for foobar entries */ |
| + | struct foobar entries[10]; |
| + | |
| + | Curl_llist_init(&barlist, NULL); |
| + | |
| + | /* add the first struct to the list */ |
| + | Curl_llist_append(&barlist, &entries[0], &entries[0].storage); |
| + | |
| + | See also `Curl_llist_insert_next`. |
| + | |
| + | ## Remove a node |
| + | |
| + | Remove a node again from a list by calling `Curl_llist_remove()`. |
| + | |
| + | ## Iterate |
| + | |
| + | To iterate over a list: first get the head entry and then iterate over the |
| + | nodes as long there is a next. Each node has an *element* associated with it, |
| + | the custom pointer you stored there. Usually a struct pointer or similar. |
| + | |
| + | struct Curl_llist_node *iter; |
| + | |
| + | /* get the first entry of the 'barlist' */ |
| + | iter = Curl_llist_head(&barlist); |
| + | |
| + | while(iter) { |
| + | /* extract the element pointer from the node */ |
| + | struct foobar *elem = Curl_node_elem(iter); |
| + | |
| + | /* advance to the next node in the list */ |
| + | iter = Curl_node_next(iter); |
| + | } |
| + | |
| + | # Function overview |
| + | |
| + | ## `Curl_llist_init` |
| + | |
| + | ~~~c |
| + | void Curl_llist_init(struct Curl_llist *list, Curl_llist_dtor dtor); |
| + | ~~~ |
| + | |
| + | Initializes the `list`. The argument `dtor` is NULL or a function pointer that |
| + | gets called when list nodes are removed from this list. |
| + | |
| + | The function is infallible. |
| + | |
| + | ~~~c |
| + | typedef void (*Curl_llist_dtor)(void *user, void *elem); |
| + | ~~~ |
| + | |
| + | `dtor` is called with two arguments: `user` and `elem`. The first being the |
| + | `user` pointer passed in to `Curl_llist_remove()`or `Curl_llist_destroy()` and |
| + | the second is the `elem` pointer associated with removed node. The pointer |
| + | that `Curl_node_elem()` would have returned for that node. |
| + | |
| + | ## `Curl_llist_destroy` |
| + | |
| + | ~~~c |
| + | void Curl_llist_destroy(struct Curl_llist *list, void *user); |
| + | ~~~ |
| + | |
| + | This removes all nodes from the `list`. This leaves the list in a cleared |
| + | state. |
| + | |
| + | The function is infallible. |
| + | |
| + | ## `Curl_llist_append` |
| + | |
| + | ~~~c |
| + | void Curl_llist_append(struct Curl_llist *list, |
| + | const void *elem, struct Curl_llist_node *node); |
| + | ~~~ |
| + | |
| + | Adds `node` last in the `list` with a custom pointer to `elem`. |
| + | |
| + | The function is infallible. |
| + | |
| + | ## `Curl_llist_insert_next` |
| + | |
| + | ~~~c |
| + | void Curl_llist_insert_next(struct Curl_llist *list, |
| + | struct Curl_llist_node *node, |
| + | const void *elem, |
| + | struct Curl_llist_node *node); |
| + | ~~~ |
| + | |
| + | Adds `node` to the `list` with a custom pointer to `elem` immediately after |
| + | the previous list `node`. |
| + | |
| + | The function is infallible. |
| + | |
| + | ## `Curl_llist_head` |
| + | |
| + | ~~~c |
| + | struct Curl_llist_node *Curl_llist_head(struct Curl_llist *list); |
| + | ~~~ |
| + | |
| + | Returns a pointer to the first node of the `list`, or a NULL if empty. |
| + | |
| + | ## `Curl_node_uremove` |
| + | |
| + | ~~~c |
| + | void Curl_node_uremove(struct Curl_llist_node *node, void *user); |
| + | ~~~ |
| + | |
| + | Removes the `node` the list it was previously added to. Passes the `user` |
| + | pointer to the list's destructor function if one was setup. |
| + | |
| + | The function is infallible. |
| + | |
| + | ## `Curl_node_remove` |
| + | |
| + | ~~~c |
| + | void Curl_node_remove(struct Curl_llist_node *node); |
| + | ~~~ |
| + | |
| + | Removes the `node` the list it was previously added to. Passes a NULL pointer |
| + | to the list's destructor function if one was setup. |
| + | |
| + | The function is infallible. |
| + | |
| + | ## `Curl_node_elem` |
| + | |
| + | ~~~c |
| + | void *Curl_node_elem(struct Curl_llist_node *node); |
| + | ~~~ |
| + | |
| + | Given a list node, this function returns the associated element. |
| + | |
| + | ## `Curl_node_next` |
| + | |
| + | ~~~c |
| + | struct Curl_llist_node *Curl_node_next(struct Curl_llist_node *node); |
| + | ~~~ |
| + | |
| + | Given a list node, this function returns the next node in the list. |
| @@ -81,6 +81,7 @@ EXTRA_DIST = \ | |
| INSTALL.md \ | |
| INTERNALS.md \ | |
| IPFS.md \ | |
| + | LLIST.md \ |
| KNOWN_BUGS \ | |
| MAIL-ETIQUETTE.md \ | |
| MANUAL.md \ | |
| @@ -337,13 +337,13 @@ CURLcode Curl_altsvc_ctrl(struct altsvcinfo *asi, const long ctrl) | |
| */ | |
| void Curl_altsvc_cleanup(struct altsvcinfo **altsvcp) | |
| { | |
| - | struct Curl_llist_element *e; |
| - | struct Curl_llist_element *n; |
| if(*altsvcp) { | |
| + | struct Curl_llist_node *e; |
| + | struct Curl_llist_node *n; |
| struct altsvcinfo *altsvc = *altsvcp; | |
| - | for(e = altsvc->list.head; e; e = n) { |
| - | struct altsvc *as = e->ptr; |
| - | n = e->next; |
| + | for(e = Curl_llist_head(&altsvc->list); e; e = n) { |
| + | struct altsvc *as = Curl_node_elem(e); |
| + | n = Curl_node_next(e); |
| altsvc_free(as); | |
| } | |
| free(altsvc->filename); | |
| @@ -358,8 +358,6 @@ void Curl_altsvc_cleanup(struct altsvcinfo **altsvcp) | |
| CURLcode Curl_altsvc_save(struct Curl_easy *data, | |
| struct altsvcinfo *altsvc, const char *file) | |
| { | |
| - | struct Curl_llist_element *e; |
| - | struct Curl_llist_element *n; |
| CURLcode result = CURLE_OK; | |
| FILE *out; | |
| char *tempstore = NULL; | |
| @@ -378,12 +376,14 @@ CURLcode Curl_altsvc_save(struct Curl_easy *data, | |
| result = Curl_fopen(data, file, &out, &tempstore); | |
| if(!result) { | |
| + | struct Curl_llist_node *e; |
| + | struct Curl_llist_node *n; |
| fputs("# Your alt-svc cache. https://curl.se/docs/alt-svc.html\n" | |
| "# This file was generated by libcurl! Edit at your own risk.\n", | |
| out); | |
| - | for(e = altsvc->list.head; e; e = n) { |
| - | struct altsvc *as = e->ptr; |
| - | n = e->next; |
| + | for(e = Curl_llist_head(&altsvc->list); e; e = n) { |
| + | struct altsvc *as = Curl_node_elem(e); |
| + | n = Curl_node_next(e); |
| result = altsvc_out(as, out); | |
| if(result) | |
| break; | |
| @@ -440,15 +440,15 @@ static bool hostcompare(const char *host, const char *check) | |
| static void altsvc_flush(struct altsvcinfo *asi, enum alpnid srcalpnid, | |
| const char *srchost, unsigned short srcport) | |
| { | |
| - | struct Curl_llist_element *e; |
| - | struct Curl_llist_element *n; |
| - | for(e = asi->list.head; e; e = n) { |
| - | struct altsvc *as = e->ptr; |
| - | n = e->next; |
| + | struct Curl_llist_node *e; |
| + | struct Curl_llist_node *n; |
| + | for(e = Curl_llist_head(&asi->list); e; e = n) { |
| + | struct altsvc *as = Curl_node_elem(e); |
| + | n = Curl_node_next(e); |
| if((srcalpnid == as->src.alpnid) && | |
| (srcport == as->src.port) && | |
| hostcompare(srchost, as->src.host)) { | |
| - | Curl_llist_remove(&asi->list, e, NULL); |
| + | Curl_node_remove(e); |
| altsvc_free(as); | |
| } | |
| } | |
| @@ -677,19 +677,19 @@ bool Curl_altsvc_lookup(struct altsvcinfo *asi, | |
| struct altsvc **dstentry, | |
| const int versions) /* one or more bits */ | |
| { | |
| - | struct Curl_llist_element *e; |
| - | struct Curl_llist_element *n; |
| + | struct Curl_llist_node *e; |
| + | struct Curl_llist_node *n; |
| time_t now = time(NULL); | |
| DEBUGASSERT(asi); | |
| DEBUGASSERT(srchost); | |
| DEBUGASSERT(dstentry); | |
| - | for(e = asi->list.head; e; e = n) { |
| - | struct altsvc *as = e->ptr; |
| - | n = e->next; |
| + | for(e = Curl_llist_head(&asi->list); e; e = n) { |
| + | struct altsvc *as = Curl_node_elem(e); |
| + | n = Curl_node_next(e); |
| if(as->expires < now) { | |
| /* an expired entry, remove */ | |
| - | Curl_llist_remove(&asi->list, e, NULL); |
| + | Curl_node_remove(e); |
| altsvc_free(as); | |
| continue; | |
| } | |
| @@ -48,7 +48,7 @@ struct altsvc { | |
| time_t expires; | |
| bool persist; | |
| unsigned int prio; | |
| - | struct Curl_llist_element node; |
| + | struct Curl_llist_node node; |
| }; | |
| struct altsvcinfo { | |
| @@ -99,17 +99,15 @@ static void bundle_add_conn(struct connectbundle *bundle, | |
| static int bundle_remove_conn(struct connectbundle *bundle, | |
| struct connectdata *conn) | |
| { | |
| - | struct Curl_llist_element *curr; |
| - | |
| - | curr = bundle->conn_list.head; |
| + | struct Curl_llist_node *curr = Curl_llist_head(&bundle->conn_list); |
| while(curr) { | |
| - | if(curr->ptr == conn) { |
| - | Curl_llist_remove(&bundle->conn_list, curr, NULL); |
| + | if(Curl_node_elem(curr) == conn) { |
| + | Curl_node_remove(curr); |
| bundle->num_connections--; | |
| conn->bundle = NULL; | |
| return 1; /* we removed a handle */ | |
| } | |
| - | curr = curr->next; |
| + | curr = Curl_node_next(curr); |
| } | |
| DEBUGASSERT(0); | |
| return 0; | |
| @@ -149,7 +147,6 @@ void Curl_conncache_destroy(struct conncache *connc) | |
| if(connc) { | |
| Curl_hash_destroy(&connc->hash); | |
| connc->multi = NULL; | |
| - | DEBUGASSERT(!Curl_llist_count(&connc->shutdowns.conn_list)); |
| } | |
| } | |
| @@ -341,7 +338,6 @@ bool Curl_conncache_foreach(struct Curl_easy *data, | |
| struct connectdata *conn, void *param)) | |
| { | |
| struct Curl_hash_iterator iter; | |
| - | struct Curl_llist_element *curr; |
| struct Curl_hash_element *he; | |
| if(!connc) | |
| @@ -352,17 +348,16 @@ bool Curl_conncache_foreach(struct Curl_easy *data, | |
| he = Curl_hash_next_element(&iter); | |
| while(he) { | |
| - | struct connectbundle *bundle; |
| - | |
| - | bundle = he->ptr; |
| + | struct Curl_llist_node *curr; |
| + | struct connectbundle *bundle = he->ptr; |
| he = Curl_hash_next_element(&iter); | |
| - | curr = bundle->conn_list.head; |
| + | curr = Curl_llist_head(&bundle->conn_list); |
| while(curr) { | |
| /* Yes, we need to update curr before calling func(), because func() | |
| might decide to remove the connection */ | |
| - | struct connectdata *conn = curr->ptr; |
| - | curr = curr->next; |
| + | struct connectdata *conn = Curl_node_elem(curr); |
| + | curr = Curl_node_next(curr); |
| if(1 == func(data, conn, param)) { | |
| CONNCACHE_UNLOCK(data); | |
| @@ -391,12 +386,12 @@ connc_find_first_connection(struct conncache *connc) | |
| he = Curl_hash_next_element(&iter); | |
| while(he) { | |
| - | struct Curl_llist_element *curr; |
| + | struct Curl_llist_node *curr; |
| bundle = he->ptr; | |
| - | curr = bundle->conn_list.head; |
| + | curr = Curl_llist_head(&bundle->conn_list); |
| if(curr) { | |
| - | return curr->ptr; |
| + | return Curl_node_elem(curr); |
| } | |
| he = Curl_hash_next_element(&iter); | |
| @@ -451,7 +446,7 @@ struct connectdata * | |
| Curl_conncache_extract_bundle(struct Curl_easy *data, | |
| struct connectbundle *bundle) | |
| { | |
| - | struct Curl_llist_element *curr; |
| + | struct Curl_llist_node *curr; |
| timediff_t highscore = -1; | |
| timediff_t score; | |
| struct curltime now; | |
| @@ -462,9 +457,9 @@ Curl_conncache_extract_bundle(struct Curl_easy *data, | |
| now = Curl_now(); | |
| - | curr = bundle->conn_list.head; |
| + | curr = Curl_llist_head(&bundle->conn_list); |
| while(curr) { | |
| - | conn = curr->ptr; |
| + | conn = Curl_node_elem(curr); |
| if(!CONN_INUSE(conn)) { | |
| /* Set higher score for the age passed since the connection was used */ | |
| @@ -475,7 +470,7 @@ Curl_conncache_extract_bundle(struct Curl_easy *data, | |
| conn_candidate = conn; | |
| } | |
| } | |
| - | curr = curr->next; |
| + | curr = Curl_node_next(curr); |
| } | |
| if(conn_candidate) { | |
| /* remove it to prevent another thread from nicking it */ | |
| @@ -499,7 +494,7 @@ Curl_conncache_extract_oldest(struct Curl_easy *data) | |
| { | |
| struct conncache *connc = data->state.conn_cache; | |
| struct Curl_hash_iterator iter; | |
| - | struct Curl_llist_element *curr; |
| + | struct Curl_llist_node *curr; |
| struct Curl_hash_element *he; | |
| timediff_t highscore =- 1; | |
| timediff_t score; | |
| @@ -519,9 +514,9 @@ Curl_conncache_extract_oldest(struct Curl_easy *data) | |
| bundle = he->ptr; | |
| - | curr = bundle->conn_list.head; |
| + | curr = Curl_llist_head(&bundle->conn_list); |
| while(curr) { | |
| - | conn = curr->ptr; |
| + | conn = Curl_node_elem(curr); |
| if(!CONN_INUSE(conn) && !conn->bits.close && | |
| !conn->connect_only) { | |
| @@ -534,7 +529,7 @@ Curl_conncache_extract_oldest(struct Curl_easy *data) | |
| bundle_candidate = bundle; | |
| } | |
| } | |
| - | curr = curr->next; |
| + | curr = Curl_node_next(curr); |
| } | |
| he = Curl_hash_next_element(&iter); | |
| @@ -553,7 +548,7 @@ Curl_conncache_extract_oldest(struct Curl_easy *data) | |
| static void connc_shutdown_discard_all(struct conncache *connc) | |
| { | |
| - | struct Curl_llist_element *e = connc->shutdowns.conn_list.head; |
| + | struct Curl_llist_node *e = Curl_llist_head(&connc->shutdowns.conn_list); |
| struct connectdata *conn; | |
| if(!e) | |
| @@ -563,12 +558,12 @@ static void connc_shutdown_discard_all(struct conncache *connc) | |
| DEBUGASSERT(!connc->shutdowns.iter_locked); | |
| connc->shutdowns.iter_locked = TRUE; | |
| while(e) { | |
| - | conn = e->ptr; |
| - | Curl_llist_remove(&connc->shutdowns.conn_list, e, NULL); |
| + | conn = Curl_node_elem(e); |
| + | Curl_node_remove(e); |
| DEBUGF(infof(connc->closure_handle, "discard connection #%" | |
| CURL_FORMAT_CURL_OFF_T, conn->connection_id)); | |
| connc_disconnect(NULL, conn, connc, FALSE); | |
| - | e = connc->shutdowns.conn_list.head; |
| + | e = Curl_llist_head(&connc->shutdowns.conn_list); |
| } | |
| connc->shutdowns.iter_locked = FALSE; | |
| } | |
| @@ -626,18 +621,18 @@ void Curl_conncache_close_all_connections(struct conncache *connc) | |
| static void connc_shutdown_discard_oldest(struct conncache *connc) | |
| { | |
| - | struct Curl_llist_element *e; |
| + | struct Curl_llist_node *e; |
| struct connectdata *conn; | |
| DEBUGASSERT(!connc->shutdowns.iter_locked); | |
| if(connc->shutdowns.iter_locked) | |
| return; | |
| - | e = connc->shutdowns.conn_list.head; |
| + | e = Curl_llist_head(&connc->shutdowns.conn_list); |
| if(e) { | |
| SIGPIPE_VARIABLE(pipe_st); | |
| - | conn = e->ptr; |
| - | Curl_llist_remove(&connc->shutdowns.conn_list, e, NULL); |
| + | conn = Curl_node_elem(e); |
| + | Curl_node_remove(e); |
| sigpipe_init(&pipe_st); | |
| sigpipe_apply(connc->closure_handle, &pipe_st); | |
| connc_disconnect(NULL, conn, connc, FALSE); | |
| @@ -840,13 +835,14 @@ CURLcode Curl_conncache_add_pollfds(struct conncache *connc, | |
| DEBUGASSERT(!connc->shutdowns.iter_locked); | |
| connc->shutdowns.iter_locked = TRUE; | |
| - | if(connc->shutdowns.conn_list.head) { |
| - | struct Curl_llist_element *e; |
| + | if(Curl_llist_head(&connc->shutdowns.conn_list)) { |
| + | struct Curl_llist_node *e; |
| struct easy_pollset ps; | |
| struct connectdata *conn; | |
| - | for(e = connc->shutdowns.conn_list.head; e; e = e->next) { |
| - | conn = e->ptr; |
| + | for(e = Curl_llist_head(&connc->shutdowns.conn_list); e; |
| + | e = Curl_node_next(e)) { |
| + | conn = Curl_node_elem(e); |
| memset(&ps, 0, sizeof(ps)); | |
| Curl_attach_connection(connc->closure_handle, conn); | |
| Curl_conn_adjust_pollset(connc->closure_handle, &ps); | |
| @@ -871,13 +867,14 @@ CURLcode Curl_conncache_add_waitfds(struct conncache *connc, | |
| DEBUGASSERT(!connc->shutdowns.iter_locked); | |
| connc->shutdowns.iter_locked = TRUE; | |
| - | if(connc->shutdowns.conn_list.head) { |
| - | struct Curl_llist_element *e; |
| + | if(Curl_llist_head(&connc->shutdowns.conn_list)) { |
| + | struct Curl_llist_node *e; |
| struct easy_pollset ps; | |
| struct connectdata *conn; | |
| - | for(e = connc->shutdowns.conn_list.head; e; e = e->next) { |
| - | conn = e->ptr; |
| + | for(e = Curl_llist_head(&connc->shutdowns.conn_list); e; |
| + | e = Curl_node_next(e)) { |
| + | conn = Curl_node_elem(e); |
| memset(&ps, 0, sizeof(ps)); | |
| Curl_attach_connection(connc->closure_handle, conn); | |
| Curl_conn_adjust_pollset(connc->closure_handle, &ps); | |
| @@ -896,8 +893,8 @@ out: | |
| static void connc_perform(struct conncache *connc) | |
| { | |
| struct Curl_easy *data = connc->closure_handle; | |
| - | struct Curl_llist_element *e = connc->shutdowns.conn_list.head; |
| - | struct Curl_llist_element *enext; |
| + | struct Curl_llist_node *e = Curl_llist_head(&connc->shutdowns.conn_list); |
| + | struct Curl_llist_node *enext; |
| struct connectdata *conn; | |
| struct curltime *nowp = NULL; | |
| struct curltime now; | |
| @@ -913,15 +910,15 @@ static void connc_perform(struct conncache *connc) | |
| Curl_llist_count(&connc->shutdowns.conn_list))); | |
| connc->shutdowns.iter_locked = TRUE; | |
| while(e) { | |
| - | enext = e->next; |
| - | conn = e->ptr; |
| + | enext = Curl_node_next(e); |
| + | conn = Curl_node_elem(e); |
| Curl_attach_connection(data, conn); | |
| connc_run_conn_shutdown(data, conn, &done); | |
| DEBUGF(infof(data, "[CCACHE] shutdown #%" CURL_FORMAT_CURL_OFF_T | |
| ", done=%d", conn->connection_id, done)); | |
| Curl_detach_connection(data); | |
| if(done) { | |
| - | Curl_llist_remove(&connc->shutdowns.conn_list, e, NULL); |
| + | Curl_node_remove(e); |
| connc_disconnect(NULL, conn, connc, FALSE); | |
| } | |
| else { | |
| @@ -1039,7 +1036,7 @@ void Curl_conncache_multi_socket(struct Curl_multi *multi, | |
| { | |
| struct conncache *connc = &multi->conn_cache; | |
| struct Curl_easy *data = connc->closure_handle; | |
| - | struct Curl_llist_element *e = connc->shutdowns.conn_list.head; |
| + | struct Curl_llist_node *e = Curl_llist_head(&connc->shutdowns.conn_list); |
| struct connectdata *conn; | |
| bool done; | |
| @@ -1050,7 +1047,7 @@ void Curl_conncache_multi_socket(struct Curl_multi *multi, | |
| connc->shutdowns.iter_locked = TRUE; | |
| while(e) { | |
| - | conn = e->ptr; |
| + | conn = Curl_node_elem(e); |
| if(s == conn->sock[FIRSTSOCKET] || s == conn->sock[SECONDARYSOCKET]) { | |
| Curl_attach_connection(data, conn); | |
| connc_run_conn_shutdown(data, conn, &done); | |
| @@ -1058,12 +1055,12 @@ void Curl_conncache_multi_socket(struct Curl_multi *multi, | |
| ", done=%d", conn->connection_id, done)); | |
| Curl_detach_connection(data); | |
| if(done || connc_update_shutdown_ev(multi, data, conn)) { | |
| - | Curl_llist_remove(&connc->shutdowns.conn_list, e, NULL); |
| + | Curl_node_remove(e); |
| connc_disconnect(NULL, conn, connc, FALSE); | |
| } | |
| break; | |
| } | |
| - | e = e->next; |
| + | e = Curl_node_next(e); |
| } | |
| connc->shutdowns.iter_locked = FALSE; | |
| } | |
| @@ -1119,13 +1116,13 @@ static void connc_shutdown_all(struct conncache *connc, int timeout_ms) | |
| } | |
| DEBUGASSERT(!connc->shutdowns.iter_locked); | |
| - | while(connc->shutdowns.conn_list.head) { |
| + | while(Curl_llist_head(&connc->shutdowns.conn_list)) { |
| timediff_t timespent; | |
| int remain_ms; | |
| connc_perform(connc); | |
| - | if(!connc->shutdowns.conn_list.head) { |
| + | if(!Curl_llist_head(&connc->shutdowns.conn_list)) { |
| DEBUGF(infof(data, "conncache shutdown ok")); | |
| break; | |
| } | |
| @@ -1154,7 +1151,7 @@ static void connc_shutdown_all(struct conncache *connc, int timeout_ms) | |
| void Curl_conncache_print(struct conncache *connc) | |
| { | |
| struct Curl_hash_iterator iter; | |
| - | struct Curl_llist_element *curr; |
| + | struct Curl_llist_node *curr; |
| struct Curl_hash_element *he; | |
| if(!connc) | |
| @@ -1172,12 +1169,12 @@ void Curl_conncache_print(struct conncache *connc) | |
| bundle = he->ptr; | |
| fprintf(stderr, "%s -", he->key); | |
| - | curr = bundle->conn_list->head; |
| + | curr = Curl_llist_head(bundle->conn_list); |
| while(curr) { | |
| - | conn = curr->ptr; |
| + | conn = Curl_node_elem(curr); |
| fprintf(stderr, " [%p %d]", (void *)conn, conn->refcount); | |
| - | curr = curr->next; |
| + | curr = Curl_node_next(curr); |
| } | |
| fprintf(stderr, "\n"); | |
| @@ -597,10 +597,10 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev) | |
| } | |
| else { | |
| /* here pollrc is > 0 */ | |
| - | struct Curl_llist_element *e = multi->process.head; |
| + | struct Curl_llist_node *e = Curl_llist_head(&multi->process); |
| struct Curl_easy *data; | |
| DEBUGASSERT(e); | |
| - | data = e->ptr; |
| + | data = Curl_node_elem(e); |
| DEBUGASSERT(data); | |
| /* loop over the monitored sockets to see which ones had activity */ | |
| @@ -1018,7 +1018,9 @@ struct Curl_easy *curl_easy_duphandle(struct Curl_easy *data) | |
| goto fail; | |
| } | |
| #endif /* USE_ARES */ | |
| - | |
| + | #ifndef CURL_DISABLE_HTTP |
| + | Curl_llist_init(&outcurl->state.httphdrs, NULL); |
| + | #endif |
| Curl_initinfo(outcurl); | |
| outcurl->magic = CURLEASY_MAGIC_NUMBER; | |
| @@ -30,7 +30,7 @@ | |
| struct fileinfo { | |
| struct curl_fileinfo info; | |
| - | struct Curl_llist_element list; |
| + | struct Curl_llist_node list; |
| struct dynbuf buf; | |
| }; | |
| @@ -4037,7 +4037,7 @@ static CURLcode wc_statemach(struct Curl_easy *data) | |
| wildcard->state = CURLWC_CLEAN; | |
| continue; | |
| } | |
| - | if(wildcard->filelist.size == 0) { |
| + | if(Curl_llist_count(&wildcard->filelist) == 0) { |
| /* no corresponding file */ | |
| wildcard->state = CURLWC_CLEAN; | |
| return CURLE_REMOTE_FILE_NOT_FOUND; | |
| @@ -4048,7 +4048,8 @@ static CURLcode wc_statemach(struct Curl_easy *data) | |
| case CURLWC_DOWNLOADING: { | |
| /* filelist has at least one file, lets get first one */ | |
| struct ftp_conn *ftpc = &conn->proto.ftpc; | |
| - | struct curl_fileinfo *finfo = wildcard->filelist.head->ptr; |
| + | struct Curl_llist_node *head = Curl_llist_head(&wildcard->filelist); |
| + | struct curl_fileinfo *finfo = Curl_node_elem(head); |
| struct FTP *ftp = data->req.p.ftp; | |
| char *tmp_path = aprintf("%s%s", wildcard->path, finfo->filename); | |
| @@ -4064,7 +4065,8 @@ static CURLcode wc_statemach(struct Curl_easy *data) | |
| long userresponse; | |
| Curl_set_in_callback(data, true); | |
| userresponse = data->set.chunk_bgn( | |
| - | finfo, data->set.wildcardptr, (int)wildcard->filelist.size); |
| + | finfo, data->set.wildcardptr, |
| + | (int)Curl_llist_count(&wildcard->filelist)); |
| Curl_set_in_callback(data, false); | |
| switch(userresponse) { | |
| case CURL_CHUNK_BGN_FUNC_SKIP: | |
| @@ -4090,9 +4092,10 @@ static CURLcode wc_statemach(struct Curl_easy *data) | |
| return result; | |
| /* we do not need the Curl_fileinfo of first file anymore */ | |
| - | Curl_llist_remove(&wildcard->filelist, wildcard->filelist.head, NULL); |
| + | Curl_node_remove(Curl_llist_head(&wildcard->filelist)); |
| - | if(wildcard->filelist.size == 0) { /* remains only one file to down. */ |
| + | if(Curl_llist_count(&wildcard->filelist) == 0) { |
| + | /* remains only one file to down. */ |
| wildcard->state = CURLWC_CLEAN; | |
| /* after that will be ftp_do called once again and no transfer | |
| will be done because of CURLWC_CLEAN state */ | |
| @@ -4107,8 +4110,8 @@ static CURLcode wc_statemach(struct Curl_easy *data) | |
| data->set.chunk_end(data->set.wildcardptr); | |
| Curl_set_in_callback(data, false); | |
| } | |
| - | Curl_llist_remove(&wildcard->filelist, wildcard->filelist.head, NULL); |
| - | wildcard->state = (wildcard->filelist.size == 0) ? |
| + | Curl_node_remove(Curl_llist_head(&wildcard->filelist)); |
| + | wildcard->state = (Curl_llist_count(&wildcard->filelist) == 0) ? |
| CURLWC_CLEAN : CURLWC_DOWNLOADING; | |
| continue; | |
| } | |
| @@ -102,7 +102,7 @@ void *Curl_hash_add2(struct Curl_hash *h, void *key, size_t key_len, void *p, | |
| Curl_hash_elem_dtor dtor) | |
| { | |
| struct Curl_hash_element *he; | |
| - | struct Curl_llist_element *le; |
| + | struct Curl_llist_node *le; |
| struct Curl_llist *l; | |
| DEBUGASSERT(h); | |
| @@ -118,10 +118,10 @@ void *Curl_hash_add2(struct Curl_hash *h, void *key, size_t key_len, void *p, | |
| l = FETCH_LIST(h, key, key_len); | |
| - | for(le = l->head; le; le = le->next) { |
| - | he = (struct Curl_hash_element *) le->ptr; |
| + | for(le = Curl_llist_head(l); le; le = Curl_node_next(le)) { |
| + | he = (struct Curl_hash_element *) Curl_node_elem(le); |
| if(h->comp_func(he->key, he->key_len, key, key_len)) { | |
| - | Curl_llist_remove(l, le, (void *)h); |
| + | Curl_node_uremove(le, (void *)h); |
| --h->size; | |
| break; | |
| } | |
| @@ -158,18 +158,16 @@ Curl_hash_add(struct Curl_hash *h, void *key, size_t key_len, void *p) | |
| */ | |
| int Curl_hash_delete(struct Curl_hash *h, void *key, size_t key_len) | |
| { | |
| - | struct Curl_llist_element *le; |
| - | struct Curl_llist *l; |
| - | |
| DEBUGASSERT(h); | |
| DEBUGASSERT(h->slots); | |
| if(h->table) { | |
| - | l = FETCH_LIST(h, key, key_len); |
| + | struct Curl_llist_node *le; |
| + | struct Curl_llist *l = FETCH_LIST(h, key, key_len); |
| - | for(le = l->head; le; le = le->next) { |
| - | struct Curl_hash_element *he = le->ptr; |
| + | for(le = Curl_llist_head(l); le; le = Curl_node_next(le)) { |
| + | struct Curl_hash_element *he = Curl_node_elem(le); |
| if(h->comp_func(he->key, he->key_len, key, key_len)) { | |
| - | Curl_llist_remove(l, le, (void *) h); |
| + | Curl_node_uremove(le, (void *) h); |
| --h->size; | |
| return 0; | |
| } | |
| @@ -185,15 +183,14 @@ int Curl_hash_delete(struct Curl_hash *h, void *key, size_t key_len) | |
| void * | |
| Curl_hash_pick(struct Curl_hash *h, void *key, size_t key_len) | |
| { | |
| - | struct Curl_llist_element *le; |
| - | struct Curl_llist *l; |
| - | |
| DEBUGASSERT(h); | |
| if(h->table) { | |
| + | struct Curl_llist_node *le; |
| + | struct Curl_llist *l; |
| DEBUGASSERT(h->slots); | |
| l = FETCH_LIST(h, key, key_len); | |
| - | for(le = l->head; le; le = le->next) { |
| - | struct Curl_hash_element *he = le->ptr; |
| + | for(le = Curl_llist_head(l); le; le = Curl_node_next(le)) { |
| + | struct Curl_hash_element *he = Curl_node_elem(le); |
| if(h->comp_func(he->key, he->key_len, key, key_len)) { | |
| return he->ptr; | |
| } | |
| @@ -239,23 +236,21 @@ void | |
| Curl_hash_clean_with_criterium(struct Curl_hash *h, void *user, | |
| int (*comp)(void *, void *)) | |
| { | |
| - | struct Curl_llist_element *le; |
| - | struct Curl_llist_element *lnext; |
| - | struct Curl_llist *list; |
| size_t i; | |
| if(!h || !h->table) | |
| return; | |
| for(i = 0; i < h->slots; ++i) { | |
| - | list = &h->table[i]; |
| - | le = list->head; /* get first list entry */ |
| + | struct Curl_llist *list = &h->table[i]; |
| + | struct Curl_llist_node *le = |
| + | Curl_llist_head(list); /* get first list entry */ |
| while(le) { | |
| - | struct Curl_hash_element *he = le->ptr; |
| - | lnext = le->next; |
| + | struct Curl_hash_element *he = Curl_node_elem(le); |
| + | struct Curl_llist_node *lnext = Curl_node_next(le); |
| /* ask the callback function if we shall remove this entry or not */ | |
| if(!comp || comp(user, he->ptr)) { | |
| - | Curl_llist_remove(list, le, (void *) h); |
| + | Curl_node_uremove(le, (void *) h); |
| --h->size; /* one less entry in the hash now */ | |
| } | |
| le = lnext; | |
| @@ -305,14 +300,14 @@ Curl_hash_next_element(struct Curl_hash_iterator *iter) | |
| /* Get the next element in the current list, if any */ | |
| if(iter->current_element) | |
| - | iter->current_element = iter->current_element->next; |
| + | iter->current_element = Curl_node_next(iter->current_element); |
| /* If we have reached the end of the list, find the next one */ | |
| if(!iter->current_element) { | |
| size_t i; | |
| for(i = iter->slot_index; i < h->slots; i++) { | |
| - | if(h->table[i].head) { |
| - | iter->current_element = h->table[i].head; |
| + | if(Curl_llist_head(&h->table[i])) { |
| + | iter->current_element = Curl_llist_head(&h->table[i]); |
| iter->slot_index = i + 1; | |
| break; | |
| } | |
| @@ -320,7 +315,7 @@ Curl_hash_next_element(struct Curl_hash_iterator *iter) | |
| } | |
| if(iter->current_element) { | |
| - | struct Curl_hash_element *he = iter->current_element->ptr; |
| + | struct Curl_hash_element *he = Curl_node_elem(iter->current_element); |
| return he; | |
| } | |
| return NULL; | |
| @@ -61,7 +61,7 @@ struct Curl_hash { | |
| typedef void (*Curl_hash_elem_dtor)(void *key, size_t key_len, void *p); | |
| struct Curl_hash_element { | |
| - | struct Curl_llist_element list; |
| + | struct Curl_llist_node list; |
| void *ptr; | |
| Curl_hash_elem_dtor dtor; | |
| size_t key_len; | |
| @@ -71,7 +71,7 @@ struct Curl_hash_element { | |
| struct Curl_hash_iterator { | |
| struct Curl_hash *hash; | |
| size_t slot_index; | |
| - | struct Curl_llist_element *current_element; |
| + | struct Curl_llist_node *current_element; |
| }; | |
| void Curl_hash_init(struct Curl_hash *h, | |
| @@ -42,7 +42,7 @@ | |
| static void copy_header_external(struct Curl_header_store *hs, | |
| size_t index, | |
| size_t amount, | |
| - | struct Curl_llist_element *e, |
| + | struct Curl_llist_node *e, |
| struct curl_header *hout) | |
| { | |
| struct curl_header *h = hout; | |
| @@ -66,8 +66,8 @@ CURLHcode curl_easy_header(CURL *easy, | |
| int request, | |
| struct curl_header **hout) | |
| { | |
| - | struct Curl_llist_element *e; |
| - | struct Curl_llist_element *e_pick = NULL; |
| + | struct Curl_llist_node *e; |
| + | struct Curl_llist_node *e_pick = NULL; |
| struct Curl_easy *data = easy; | |
| size_t match = 0; | |
| size_t amount = 0; | |
| @@ -85,8 +85,8 @@ CURLHcode curl_easy_header(CURL *easy, | |
| request = data->state.requests; | |
| /* we need a first round to count amount of this header */ | |
| - | for(e = data->state.httphdrs.head; e; e = e->next) { |
| - | hs = e->ptr; |
| + | for(e = Curl_llist_head(&data->state.httphdrs); e; e = Curl_node_next(e)) { |
| + | hs = Curl_node_elem(e); |
| if(strcasecompare(hs->name, name) && | |
| (hs->type & type) && | |
| (hs->request == request)) { | |
| @@ -104,8 +104,8 @@ CURLHcode curl_easy_header(CURL *easy, | |
| /* if the last or only occurrence is what's asked for, then we know it */ | |
| hs = pick; | |
| else { | |
| - | for(e = data->state.httphdrs.head; e; e = e->next) { |
| - | hs = e->ptr; |
| + | for(e = Curl_llist_head(&data->state.httphdrs); e; e = Curl_node_next(e)) { |
| + | hs = Curl_node_elem(e); |
| if(strcasecompare(hs->name, name) && | |
| (hs->type & type) && | |
| (hs->request == request) && | |
| @@ -131,8 +131,8 @@ struct curl_header *curl_easy_nextheader(CURL *easy, | |
| struct curl_header *prev) | |
| { | |
| struct Curl_easy *data = easy; | |
| - | struct Curl_llist_element *pick; |
| - | struct Curl_llist_element *e; |
| + | struct Curl_llist_node *pick; |
| + | struct Curl_llist_node *e; |
| struct Curl_header_store *hs; | |
| size_t amount = 0; | |
| size_t index = 0; | |
| @@ -147,18 +147,18 @@ struct curl_header *curl_easy_nextheader(CURL *easy, | |
| if(!pick) | |
| /* something is wrong */ | |
| return NULL; | |
| - | pick = pick->next; |
| + | pick = Curl_node_next(pick); |
| } | |
| else | |
| - | pick = data->state.httphdrs.head; |
| + | pick = Curl_llist_head(&data->state.httphdrs); |
| if(pick) { | |
| /* make sure it is the next header of the desired type */ | |
| do { | |
| - | hs = pick->ptr; |
| + | hs = Curl_node_elem(pick); |
| if((hs->type & type) && (hs->request == request)) | |
| break; | |
| - | pick = pick->next; |
| + | pick = Curl_node_next(pick); |
| } while(pick); | |
| } | |
| @@ -166,12 +166,12 @@ struct curl_header *curl_easy_nextheader(CURL *easy, | |
| /* no more headers available */ | |
| return NULL; | |
| - | hs = pick->ptr; |
| + | hs = Curl_node_elem(pick); |
| /* count number of occurrences of this name within the mask and figure out | |
| the index for the currently selected entry */ | |
| - | for(e = data->state.httphdrs.head; e; e = e->next) { |
| - | struct Curl_header_store *check = e->ptr; |
| + | for(e = Curl_llist_head(&data->state.httphdrs); e; e = Curl_node_next(e)) { |
| + | struct Curl_header_store *check = Curl_node_elem(e); |
| if(strcasecompare(hs->name, check->name) && | |
| (check->request == request) && | |
| (check->type & type)) | |
| @@ -247,7 +247,7 @@ static CURLcode unfold_value(struct Curl_easy *data, const char *value, | |
| /* since this header block might move in the realloc below, it needs to | |
| first be unlinked from the list and then re-added again after the | |
| realloc */ | |
| - | Curl_llist_remove(&data->state.httphdrs, &hs->node, NULL); |
| + | Curl_node_remove(&hs->node); |
| /* new size = struct + new value length + old name+value length */ | |
| newhs = Curl_saferealloc(hs, sizeof(*hs) + vlen + oalloc + 1); | |
| @@ -405,12 +405,12 @@ CURLcode Curl_headers_init(struct Curl_easy *data) | |
| */ | |
| CURLcode Curl_headers_cleanup(struct Curl_easy *data) | |
| { | |
| - | struct Curl_llist_element *e; |
| - | struct Curl_llist_element *n; |
| + | struct Curl_llist_node *e; |
| + | struct Curl_llist_node *n; |
| - | for(e = data->state.httphdrs.head; e; e = n) { |
| - | struct Curl_header_store *hs = e->ptr; |
| - | n = e->next; |
| + | for(e = Curl_llist_head(&data->state.httphdrs); e; e = n) { |
| + | struct Curl_header_store *hs = Curl_node_elem(e); |
| + | n = Curl_node_next(e); |
| free(hs); | |
| } | |
| headers_reset(data); | |
| @@ -28,7 +28,7 @@ | |
| #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_HEADERS_API) | |
| struct Curl_header_store { | |
| - | struct Curl_llist_element node; |
| + | struct Curl_llist_node node; |
| char *name; /* points into 'buffer' */ | |
| char *value; /* points into 'buffer */ | |
| int request; /* 0 is the first request, then 1.. 2.. */ | |
| @@ -94,11 +94,11 @@ void Curl_hsts_cleanup(struct hsts **hp) | |
| { | |
| struct hsts *h = *hp; | |
| if(h) { | |
| - | struct Curl_llist_element *e; |
| - | struct Curl_llist_element *n; |
| - | for(e = h->list.head; e; e = n) { |
| - | struct stsentry *sts = e->ptr; |
| - | n = e->next; |
| + | struct Curl_llist_node *e; |
| + | struct Curl_llist_node *n; |
| + | for(e = Curl_llist_head(&h->list); e; e = n) { |
| + | struct stsentry *sts = Curl_node_elem(e); |
| + | n = Curl_node_next(e); |
| hsts_free(sts); | |
| } | |
| free(h->filename); | |
| @@ -215,7 +215,7 @@ CURLcode Curl_hsts_parse(struct hsts *h, const char *hostname, | |
| /* remove the entry if present verbatim (without subdomain match) */ | |
| sts = Curl_hsts(h, hostname, FALSE); | |
| if(sts) { | |
| - | Curl_llist_remove(&h->list, &sts->node, NULL); |
| + | Curl_node_remove(&sts->node); |
| hsts_free(sts); | |
| } | |
| return CURLE_OK; | |
| @@ -253,8 +253,8 @@ struct stsentry *Curl_hsts(struct hsts *h, const char *hostname, | |
| char buffer[MAX_HSTS_HOSTLEN + 1]; | |
| time_t now = time(NULL); | |
| size_t hlen = strlen(hostname); | |
| - | struct Curl_llist_element *e; |
| - | struct Curl_llist_element *n; |
| + | struct Curl_llist_node *e; |
| + | struct Curl_llist_node *n; |
| if((hlen > MAX_HSTS_HOSTLEN) || !hlen) | |
| return NULL; | |
| @@ -265,12 +265,12 @@ struct stsentry *Curl_hsts(struct hsts *h, const char *hostname, | |
| buffer[hlen] = 0; | |
| hostname = buffer; | |
| - | for(e = h->list.head; e; e = n) { |
| - | struct stsentry *sts = e->ptr; |
| - | n = e->next; |
| + | for(e = Curl_llist_head(&h->list); e; e = n) { |
| + | struct stsentry *sts = Curl_node_elem(e); |
| + | n = Curl_node_next(e); |
| if(sts->expires <= now) { | |
| /* remove expired entries */ | |
| - | Curl_llist_remove(&h->list, &sts->node, NULL); |
| + | Curl_node_remove(&sts->node); |
| hsts_free(sts); | |
| continue; | |
| } | |
| @@ -353,8 +353,8 @@ static CURLcode hsts_out(struct stsentry *sts, FILE *fp) | |
| CURLcode Curl_hsts_save(struct Curl_easy *data, struct hsts *h, | |
| const char *file) | |
| { | |
| - | struct Curl_llist_element *e; |
| - | struct Curl_llist_element *n; |
| + | struct Curl_llist_node *e; |
| + | struct Curl_llist_node *n; |
| CURLcode result = CURLE_OK; | |
| FILE *out; | |
| char *tempstore = NULL; | |
| @@ -376,9 +376,9 @@ CURLcode Curl_hsts_save(struct Curl_easy *data, struct hsts *h, | |
| fputs("# Your HSTS cache. https://curl.se/docs/hsts.html\n" | |
| "# This file was generated by libcurl! Edit at your own risk.\n", | |
| out); | |
| - | for(e = h->list.head; e; e = n) { |
| - | struct stsentry *sts = e->ptr; |
| - | n = e->next; |
| + | for(e = Curl_llist_head(&h->list); e; e = n) { |
| + | struct stsentry *sts = Curl_node_elem(e); |
| + | n = Curl_node_next(e); |
| result = hsts_out(sts, out); | |
| if(result) | |
| break; | |
| @@ -395,12 +395,12 @@ skipsave: | |
| if(data->set.hsts_write) { | |
| /* if there is a write callback */ | |
| struct curl_index i; /* count */ | |
| - | i.total = h->list.size; |
| + | i.total = Curl_llist_count(&h->list); |
| i.index = 0; | |
| - | for(e = h->list.head; e; e = n) { |
| - | struct stsentry *sts = e->ptr; |
| + | for(e = Curl_llist_head(&h->list); e; e = n) { |
| + | struct stsentry *sts = Curl_node_elem(e); |
| bool stop; | |
| - | n = e->next; |
| + | n = Curl_node_next(e); |
| result = hsts_push(data, &i, sts, &stop); | |
| if(result || stop) | |
| break; | |
| @@ -34,7 +34,7 @@ extern time_t deltatime; | |
| #endif | |
| struct stsentry { | |
| - | struct Curl_llist_element node; |
| + | struct Curl_llist_node node; |
| const char *host; | |
| bool includeSubDomains; | |
| curl_off_t expires; /* the timestamp of this entry's expiry */ | |
| @@ -3118,7 +3118,7 @@ CURLcode Curl_http_header(struct Curl_easy *data, | |
| #ifdef DEBUGBUILD | |
| else | |
| infof(data, "Parsed STS header fine (%zu entries)", | |
| - | data->hsts->list.size); |
| + | Curl_llist_count(&data->hsts->list)); |
| #endif | |
| } | |
| #endif | |
| @@ -32,16 +32,34 @@ | |
| /* this must be the last include file */ | |
| #include "memdebug.h" | |
| + | #define LLISTINIT 0x100cc001 /* random pattern */ |
| + | #define NODEINIT 0x12344321 /* random pattern */ |
| + | #define NODEREM 0x54321012 /* random pattern */ |
| + | |
| + | |
| + | #ifdef DEBUGBUILD |
| + | #define VERIFYNODE(x) verifynode(x) |
| + | static struct Curl_llist_node *verifynode(struct Curl_llist_node *n) |
| + | { |
| + | DEBUGASSERT(!n || (n->_init == NODEINIT)); |
| + | return n; |
| + | } |
| + | #else |
| + | #define VERIFYNODE(x) x |
| + | #endif |
| /* | |
| * @unittest: 1300 | |
| */ | |
| void | |
| Curl_llist_init(struct Curl_llist *l, Curl_llist_dtor dtor) | |
| { | |
| - | l->size = 0; |
| - | l->dtor = dtor; |
| - | l->head = NULL; |
| - | l->tail = NULL; |
| + | l->_size = 0; |
| + | l->_dtor = dtor; |
| + | l->_head = NULL; |
| + | l->_tail = NULL; |
| + | #ifdef DEBUGBUILD |
| + | l->_init = LLISTINIT; |
| + | #endif |
| } | |
| /* | |
| @@ -56,36 +74,45 @@ Curl_llist_init(struct Curl_llist *l, Curl_llist_dtor dtor) | |
| * @unittest: 1300 | |
| */ | |
| void | |
| - | Curl_llist_insert_next(struct Curl_llist *list, struct Curl_llist_element *e, |
| + | Curl_llist_insert_next(struct Curl_llist *list, |
| + | struct Curl_llist_node *e, /* may be NULL */ |
| const void *p, | |
| - | struct Curl_llist_element *ne) |
| + | struct Curl_llist_node *ne) |
| { | |
| - | ne->ptr = (void *) p; |
| - | if(list->size == 0) { |
| - | list->head = ne; |
| - | list->head->prev = NULL; |
| - | list->head->next = NULL; |
| - | list->tail = ne; |
| + | DEBUGASSERT(list); |
| + | DEBUGASSERT(list->_init == LLISTINIT); |
| + | DEBUGASSERT(ne); |
| + | |
| + | #ifdef DEBUGBUILD |
| + | ne->_init = NODEINIT; |
| + | #endif |
| + | ne->_ptr = (void *) p; |
| + | ne->_list = list; |
| + | if(list->_size == 0) { |
| + | list->_head = ne; |
| + | list->_head->_prev = NULL; |
| + | list->_head->_next = NULL; |
| + | list->_tail = ne; |
| } | |
| else { | |
| /* if 'e' is NULL here, we insert the new element first in the list */ | |
| - | ne->next = e?e->next:list->head; |
| - | ne->prev = e; |
| + | ne->_next = e?e->_next:list->_head; |
| + | ne->_prev = e; |
| if(!e) { | |
| - | list->head->prev = ne; |
| - | list->head = ne; |
| + | list->_head->_prev = ne; |
| + | list->_head = ne; |
| } | |
| - | else if(e->next) { |
| - | e->next->prev = ne; |
| + | else if(e->_next) { |
| + | e->_next->_prev = ne; |
| } | |
| else { | |
| - | list->tail = ne; |
| + | list->_tail = ne; |
| } | |
| if(e) | |
| - | e->next = ne; |
| + | e->_next = ne; |
| } | |
| - | ++list->size; |
| + | ++list->_size; |
| } | |
| /* | |
| @@ -99,64 +126,131 @@ Curl_llist_insert_next(struct Curl_llist *list, struct Curl_llist_element *e, | |
| */ | |
| void | |
| Curl_llist_append(struct Curl_llist *list, const void *p, | |
| - | struct Curl_llist_element *ne) |
| + | struct Curl_llist_node *ne) |
| { | |
| - | Curl_llist_insert_next(list, list->tail, p, ne); |
| + | DEBUGASSERT(list); |
| + | DEBUGASSERT(list->_init == LLISTINIT); |
| + | DEBUGASSERT(ne); |
| + | Curl_llist_insert_next(list, list->_tail, p, ne); |
| } | |
| /* | |
| * @unittest: 1300 | |
| */ | |
| void | |
| - | Curl_llist_remove(struct Curl_llist *list, struct Curl_llist_element *e, |
| - | void *user) |
| + | Curl_node_uremove(struct Curl_llist_node *e, void *user) |
| { | |
| void *ptr; | |
| - | if(!e || list->size == 0) |
| + | struct Curl_llist *list; |
| + | if(!e) |
| return; | |
| - | if(e == list->head) { |
| - | list->head = e->next; |
| + | list = e->_list; |
| + | DEBUGASSERT(list); |
| + | DEBUGASSERT(list->_init == LLISTINIT); |
| + | DEBUGASSERT(list->_size); |
| + | DEBUGASSERT(e->_init == NODEINIT); |
| + | if(e == list->_head) { |
| + | list->_head = e->_next; |
| - | if(!list->head) |
| - | list->tail = NULL; |
| + | if(!list->_head) |
| + | list->_tail = NULL; |
| else | |
| - | e->next->prev = NULL; |
| + | e->_next->_prev = NULL; |
| } | |
| else { | |
| - | if(e->prev) |
| - | e->prev->next = e->next; |
| + | if(e->_prev) |
| + | e->_prev->_next = e->_next; |
| - | if(!e->next) |
| - | list->tail = e->prev; |
| + | if(!e->_next) |
| + | list->_tail = e->_prev; |
| else | |
| - | e->next->prev = e->prev; |
| + | e->_next->_prev = e->_prev; |
| } | |
| - | ptr = e->ptr; |
| + | ptr = e->_ptr; |
| - | e->ptr = NULL; |
| - | e->prev = NULL; |
| - | e->next = NULL; |
| + | e->_ptr = NULL; |
| + | e->_prev = NULL; |
| + | e->_next = NULL; |
| + | #ifdef DEBUGBUILD |
| + | e->_init = NODEREM; /* specific pattern on remove - not zero */ |
| + | #endif |
| - | --list->size; |
| + | --list->_size; |
| /* call the dtor() last for when it actually frees the 'e' memory itself */ | |
| - | if(list->dtor) |
| - | list->dtor(user, ptr); |
| + | if(list->_dtor) |
| + | list->_dtor(user, ptr); |
| + | } |
| + | |
| + | void Curl_node_remove(struct Curl_llist_node *e) |
| + | { |
| + | Curl_node_uremove(e, NULL); |
| } | |
| void | |
| Curl_llist_destroy(struct Curl_llist *list, void *user) | |
| { | |
| if(list) { | |
| - | while(list->size > 0) |
| - | Curl_llist_remove(list, list->tail, user); |
| + | DEBUGASSERT(list->_init == LLISTINIT); |
| + | while(list->_size > 0) |
| + | Curl_node_uremove(list->_tail, user); |
| } | |
| } | |
| - | size_t |
| - | Curl_llist_count(struct Curl_llist *list) |
| + | /* Curl_llist_head() returns the first 'struct Curl_llist_node *', which |
| + | might be NULL */ |
| + | struct Curl_llist_node *Curl_llist_head(struct Curl_llist *list) |
| + | { |
| + | DEBUGASSERT(list); |
| + | DEBUGASSERT(list->_init == LLISTINIT); |
| + | return VERIFYNODE(list->_head); |
| + | } |
| + | |
| + | /* Curl_llist_tail() returns the last 'struct Curl_llist_node *', which |
| + | might be NULL */ |
| + | struct Curl_llist_node *Curl_llist_tail(struct Curl_llist *list) |
| { | |
| - | return list->size; |
| + | DEBUGASSERT(list); |
| + | DEBUGASSERT(list->_init == LLISTINIT); |
| + | return VERIFYNODE(list->_tail); |
| } | |
| + | |
| + | /* Curl_llist_count() returns a size_t the number of nodes in the list */ |
| + | size_t Curl_llist_count(struct Curl_llist *list) |
| + | { |
| + | DEBUGASSERT(list); |
| + | DEBUGASSERT(list->_init == LLISTINIT); |
| + | return list->_size; |
| + | } |
| + | |
| + | /* Curl_node_elem() returns the custom data from a Curl_llist_node */ |
| + | void *Curl_node_elem(struct Curl_llist_node *n) |
| + | { |
| + | DEBUGASSERT(n); |
| + | DEBUGASSERT(n->_init == NODEINIT); |
| + | return n->_ptr; |
| + | } |
| + | |
| + | /* Curl_node_next() returns the next element in a list from a given |
| + | Curl_llist_node */ |
| + | struct Curl_llist_node *Curl_node_next(struct Curl_llist_node *n) |
| + | { |
| + | DEBUGASSERT(n); |
| + | DEBUGASSERT(n->_init == NODEINIT); |
| + | return VERIFYNODE(n->_next); |
| + | } |
| + | |
| + | #ifdef UNITTEST |
| + | |
| + | /* Curl_node_prev() returns the previous element in a list from a given |
| + | Curl_llist_node */ |
| + | struct Curl_llist_node *Curl_node_prev(struct Curl_llist_node *n) |
| + | { |
| + | DEBUGASSERT(n); |
| + | DEBUGASSERT(n->_init == NODEINIT); |
| + | return VERIFYNODE(n->_prev); |
| + | } |
| + | |
| + | #endif |
| @@ -27,28 +27,60 @@ | |
| #include "curl_setup.h" | |
| #include <stddef.h> | |
| - | typedef void (*Curl_llist_dtor)(void *, void *); |
| + | typedef void (*Curl_llist_dtor)(void *user, void *elem); |
| - | struct Curl_llist_element { |
| - | void *ptr; |
| - | struct Curl_llist_element *prev; |
| - | struct Curl_llist_element *next; |
| - | }; |
| + | /* none of these struct members should be referenced directly, use the |
| + | dedicated functions */ |
| struct Curl_llist { | |
| - | struct Curl_llist_element *head; |
| - | struct Curl_llist_element *tail; |
| - | Curl_llist_dtor dtor; |
| - | size_t size; |
| + | struct Curl_llist_node *_head; |
| + | struct Curl_llist_node *_tail; |
| + | Curl_llist_dtor _dtor; |
| + | size_t _size; |
| + | #ifdef DEBUGBUILD |
| + | int _init; /* detect API usage mistakes */ |
| + | #endif |
| + | }; |
| + | |
| + | struct Curl_llist_node { |
| + | struct Curl_llist *_list; /* the list where this belongs */ |
| + | void *_ptr; |
| + | struct Curl_llist_node *_prev; |
| + | struct Curl_llist_node *_next; |
| + | #ifdef DEBUGBUILD |
| + | int _init; /* detect API usage mistakes */ |
| + | #endif |
| }; | |
| void Curl_llist_init(struct Curl_llist *, Curl_llist_dtor); | |
| - | void Curl_llist_insert_next(struct Curl_llist *, struct Curl_llist_element *, |
| - | const void *, struct Curl_llist_element *node); |
| + | void Curl_llist_insert_next(struct Curl_llist *, struct Curl_llist_node *, |
| + | const void *, struct Curl_llist_node *node); |
| void Curl_llist_append(struct Curl_llist *, | |
| - | const void *, struct Curl_llist_element *node); |
| - | void Curl_llist_remove(struct Curl_llist *, struct Curl_llist_element *, |
| - | void *); |
| - | size_t Curl_llist_count(struct Curl_llist *); |
| + | const void *, struct Curl_llist_node *node); |
| + | void Curl_node_uremove(struct Curl_llist_node *, void *); |
| + | void Curl_node_remove(struct Curl_llist_node *); |
| void Curl_llist_destroy(struct Curl_llist *, void *); | |
| + | |
| + | /* Curl_llist_head() returns the first 'struct Curl_llist_node *', which |
| + | might be NULL */ |
| + | struct Curl_llist_node *Curl_llist_head(struct Curl_llist *list); |
| + | |
| + | /* Curl_llist_tail() returns the last 'struct Curl_llist_node *', which |
| + | might be NULL */ |
| + | struct Curl_llist_node *Curl_llist_tail(struct Curl_llist *list); |
| + | |
| + | /* Curl_llist_count() returns a size_t the number of nodes in the list */ |
| + | size_t Curl_llist_count(struct Curl_llist *list); |
| + | |
| + | /* Curl_node_elem() returns the custom data from a Curl_llist_node */ |
| + | void *Curl_node_elem(struct Curl_llist_node *n); |
| + | |
| + | /* Curl_node_next() returns the next element in a list from a given |
| + | Curl_llist_node */ |
| + | struct Curl_llist_node *Curl_node_next(struct Curl_llist_node *n); |
| + | |
| + | /* Curl_node_prev() returns the previous element in a list from a given |
| + | Curl_llist_node */ |
| + | struct Curl_llist_node *Curl_node_prev(struct Curl_llist_node *n); |
| + | |
| #endif /* HEADER_CURL_LLIST_H */ | |
| @@ -467,21 +467,6 @@ static void multi_warn_debug(struct Curl_multi *multi, struct Curl_easy *data) | |
| #define multi_warn_debug(x,y) Curl_nop_stmt | |
| #endif | |
| - | static void link_easy(struct Curl_multi *multi, |
| - | struct Curl_easy *data) |
| - | { |
| - | /* add the easy handle to the process list */ |
| - | Curl_llist_append(&multi->process, data, &data->multi_queue); |
| - | } |
| - | |
| - | /* unlink the given easy handle from the process list */ |
| - | static void unlink_easy(struct Curl_multi *multi, |
| - | struct Curl_easy *data) |
| - | { |
| - | Curl_llist_remove(&multi->process, &data->multi_queue, NULL); |
| - | } |
| - | |
| - | |
| CURLMcode curl_multi_add_handle(struct Curl_multi *multi, | |
| struct Curl_easy *data) | |
| { | |
| @@ -557,8 +542,10 @@ CURLMcode curl_multi_add_handle(struct Curl_multi *multi, | |
| memset(&multi->timer_lastcall, 0, sizeof(multi->timer_lastcall)); | |
| rc = Curl_update_timer(multi); | |
| - | if(rc) |
| + | if(rc) { |
| + | data->multi = NULL; /* not anymore */ |
| return rc; | |
| + | } |
| /* set the easy handle */ | |
| multistate(data, MSTATE_INIT); | |
| @@ -586,7 +573,8 @@ CURLMcode curl_multi_add_handle(struct Curl_multi *multi, | |
| data->psl = &multi->psl; | |
| #endif | |
| - | link_easy(multi, data); |
| + | /* add the easy handle to the process list */ |
| + | Curl_llist_append(&multi->process, data, &data->multi_queue); |
| /* increase the node-counter */ | |
| multi->num_easy++; | |
| @@ -706,7 +694,7 @@ static CURLcode multi_done(struct Curl_easy *data, | |
| CONNCACHE_UNLOCK(data); | |
| DEBUGF(infof(data, "Connection still in use %zu, " | |
| "no more multi_done now!", | |
| - | conn->easyq.size)); |
| + | Curl_llist_count(&conn->easyq))); |
| return CURLE_OK; | |
| } | |
| @@ -804,7 +792,7 @@ CURLMcode curl_multi_remove_handle(struct Curl_multi *multi, | |
| { | |
| struct Curl_easy *easy = data; | |
| bool premature; | |
| - | struct Curl_llist_element *e; |
| + | struct Curl_llist_node *e; |
| CURLMcode rc; | |
| /* First, make some basic checks that the CURLM handle is a good handle */ | |
| @@ -812,7 +800,7 @@ CURLMcode curl_multi_remove_handle(struct Curl_multi *multi, | |
| return CURLM_BAD_HANDLE; | |
| /* Verify that we got a somewhat good easy handle too */ | |
| - | if(!GOOD_EASY_HANDLE(data)) |
| + | if(!GOOD_EASY_HANDLE(data) || !multi->num_easy) |
| return CURLM_BAD_EASY_HANDLE; | |
| /* Prevent users from trying to remove same easy handle more than once */ | |
| @@ -858,15 +846,8 @@ CURLMcode curl_multi_remove_handle(struct Curl_multi *multi, | |
| called. Do it after multi_done() in case that sets another time! */ | |
| Curl_expire_clear(data); | |
| - | if(data->multi_queue.ptr) { |
| - | /* the handle is in a list, remove it from the right one */ |
| - | if(data->mstate == MSTATE_PENDING) |
| - | Curl_llist_remove(&multi->pending, &data->multi_queue, NULL); |
| - | else if(data->mstate == MSTATE_MSGSENT) |
| - | Curl_llist_remove(&multi->msgsent, &data->multi_queue, NULL); |
| - | else |
| - | Curl_llist_remove(&multi->process, &data->multi_queue, NULL); |
| - | } |
| + | /* the handle is in a list, remove it from whichever it is */ |
| + | Curl_node_remove(&data->multi_queue); |
| if(data->dns.hostcachetype == HCACHE_MULTI) { | |
| /* stop using the multi handle's DNS cache, *after* the possible | |
| @@ -927,11 +908,11 @@ CURLMcode curl_multi_remove_handle(struct Curl_multi *multi, | |
| /* make sure there is no pending message in the queue sent from this easy | |
| handle */ | |
| - | for(e = multi->msglist.head; e; e = e->next) { |
| - | struct Curl_message *msg = e->ptr; |
| + | for(e = Curl_llist_head(&multi->msglist); e; e = Curl_node_next(e)) { |
| + | struct Curl_message *msg = Curl_node_elem(e); |
| if(msg->extmsg.easy_handle == easy) { | |
| - | Curl_llist_remove(&multi->msglist, e, NULL); |
| + | Curl_node_remove(e); |
| /* there can only be one from this specific handle */ | |
| break; | |
| } | |
| @@ -966,7 +947,7 @@ void Curl_detach_connection(struct Curl_easy *data) | |
| struct connectdata *conn = data->conn; | |
| if(conn) { | |
| Curl_conn_ev_data_detach(conn, data); | |
| - | Curl_llist_remove(&conn->easyq, &data->conn_queue, NULL); |
| + | Curl_node_remove(&data->conn_queue); |
| } | |
| data->conn = NULL; | |
| } | |
| @@ -1181,7 +1162,7 @@ CURLMcode curl_multi_fdset(struct Curl_multi *multi, | |
| and then we must make sure that is done. */ | |
| int this_max_fd = -1; | |
| struct easy_pollset ps; | |
| - | struct Curl_llist_element *e; |
| + | struct Curl_llist_node *e; |
| (void)exc_fd_set; /* not used */ | |
| if(!GOOD_MULTI_HANDLE(multi)) | |
| @@ -1191,8 +1172,8 @@ CURLMcode curl_multi_fdset(struct Curl_multi *multi, | |
| return CURLM_RECURSIVE_API_CALL; | |
| memset(&ps, 0, sizeof(ps)); | |
| - | for(e = multi->process.head; e; e = e->next) { |
| - | struct Curl_easy *data = e->ptr; |
| + | for(e = Curl_llist_head(&multi->process); e; e = Curl_node_next(e)) { |
| + | struct Curl_easy *data = Curl_node_elem(e); |
| unsigned int i; | |
| multi_getsock(data, &ps); | |
| @@ -1223,7 +1204,7 @@ CURLMcode curl_multi_waitfds(struct Curl_multi *multi, | |
| struct curl_waitfds cwfds; | |
| struct easy_pollset ps; | |
| CURLMcode result = CURLM_OK; | |
| - | struct Curl_llist_element *e; |
| + | struct Curl_llist_node *e; |
| if(!ufds) | |
| return CURLM_BAD_FUNCTION_ARGUMENT; | |
| @@ -1236,8 +1217,8 @@ CURLMcode curl_multi_waitfds(struct Curl_multi *multi, | |
| Curl_waitfds_init(&cwfds, ufds, size); | |
| memset(&ps, 0, sizeof(ps)); | |
| - | for(e = multi->process.head; e; e = e->next) { |
| - | struct Curl_easy *data = e->ptr; |
| + | for(e = Curl_llist_head(&multi->process); e; e = Curl_node_next(e)) { |
| + | struct Curl_easy *data = Curl_node_elem(e); |
| multi_getsock(data, &ps); | |
| if(Curl_waitfds_add_ps(&cwfds, &ps)) { | |
| result = CURLM_OUT_OF_MEMORY; | |
| @@ -1290,7 +1271,7 @@ static CURLMcode multi_wait(struct Curl_multi *multi, | |
| struct curl_pollfds cpfds; | |
| unsigned int curl_nfds = 0; /* how many pfds are for curl transfers */ | |
| CURLMcode result = CURLM_OK; | |
| - | struct Curl_llist_element *e; |
| + | struct Curl_llist_node *e; |
| #ifdef USE_WINSOCK | |
| WSANETWORKEVENTS wsa_events; | |
| @@ -1313,8 +1294,8 @@ static CURLMcode multi_wait(struct Curl_multi *multi, | |
| memset(&ps, 0, sizeof(ps)); | |
| /* Add the curl handles to our pollfds first */ | |
| - | for(e = multi->process.head; e; e = e->next) { |
| - | struct Curl_easy *data = e->ptr; |
| + | for(e = Curl_llist_head(&multi->process); e; e = Curl_node_next(e)) { |
| + | struct Curl_easy *data = Curl_node_elem(e); |
| multi_getsock(data, &ps); | |
| if(Curl_pollfds_add_ps(&cpfds, &ps)) { | |
| @@ -1453,8 +1434,9 @@ static CURLMcode multi_wait(struct Curl_multi *multi, | |
| /* Count up all our own sockets that had activity, | |
| and remove them from the event. */ | |
| if(curl_nfds) { | |
| - | for(e = multi->process.head; e && !result; e = e->next) { |
| - | struct Curl_easy *data = e->ptr; |
| + | for(e = Curl_llist_head(&multi->process); e && !result; |
| + | e = Curl_node_next(e)) { |
| + | struct Curl_easy *data = Curl_node_elem(e); |
| multi_getsock(data, &ps); | |
| for(i = 0; i < ps.num; i++) { | |
| @@ -1948,7 +1930,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, | |
| state and wait for an available connection. */ | |
| multistate(data, MSTATE_PENDING); | |
| /* unlink from process list */ | |
| - | unlink_easy(multi, data); |
| + | Curl_node_remove(&data->multi_queue); |
| /* add handle to pending list */ | |
| Curl_llist_append(&multi->pending, data, &data->multi_queue); | |
| result = CURLE_OK; | |
| @@ -2661,9 +2643,9 @@ statemachine_end: | |
| } | |
| multistate(data, MSTATE_MSGSENT); | |
| - | /* unlink from the main list */ |
| - | unlink_easy(multi, data); |
| - | /* add this handle to the list of msgsent handles */ |
| + | /* unlink from the process list */ |
| + | Curl_node_remove(&data->multi_queue); |
| + | /* add this handle msgsent list */ |
| Curl_llist_append(&multi->msgsent, data, &data->multi_queue); | |
| return CURLM_OK; | |
| } | |
| @@ -2679,8 +2661,8 @@ CURLMcode curl_multi_perform(struct Curl_multi *multi, int *running_handles) | |
| CURLMcode returncode = CURLM_OK; | |
| struct Curl_tree *t; | |
| struct curltime now = Curl_now(); | |
| - | struct Curl_llist_element *e; |
| - | struct Curl_llist_element *n = NULL; |
| + | struct Curl_llist_node *e; |
| + | struct Curl_llist_node *n = NULL; |
| SIGPIPE_VARIABLE(pipe_st); | |
| if(!GOOD_MULTI_HANDLE(multi)) | |
| @@ -2690,15 +2672,15 @@ CURLMcode curl_multi_perform(struct Curl_multi *multi, int *running_handles) | |
| return CURLM_RECURSIVE_API_CALL; | |
| sigpipe_init(&pipe_st); | |
| - | for(e = multi->process.head; e; e = n) { |
| - | struct Curl_easy *data = e->ptr; |
| + | for(e = Curl_llist_head(&multi->process); e; e = n) { |
| + | struct Curl_easy *data = Curl_node_elem(e); |
| CURLMcode result; | |
| /* Do the loop and only alter the signal ignore state if the next handle | |
| has a different NO_SIGNAL state than the previous */ | |
| /* the current node might be unlinked in multi_runsingle(), get the next | |
| pointer now */ | |
| - | n = e->next; |
| + | n = Curl_node_next(e); |
| if(data != multi->conn_cache.closure_handle) { | |
| /* connection cache handle is processed below */ | |
| @@ -2755,14 +2737,14 @@ CURLMcode curl_multi_perform(struct Curl_multi *multi, int *running_handles) | |
| the process list */ | |
| static void unlink_all_msgsent_handles(struct Curl_multi *multi) | |
| { | |
| - | struct Curl_llist_element *e; |
| - | for(e = multi->msgsent.head; e; e = e->next) { |
| - | struct Curl_easy *data = e->ptr; |
| + | struct Curl_llist_node *e; |
| + | for(e = Curl_llist_head(&multi->msgsent); e; e = Curl_node_next(e)) { |
| + | struct Curl_easy *data = Curl_node_elem(e); |
| if(data) { | |
| DEBUGASSERT(data->mstate == MSTATE_MSGSENT); | |
| - | Curl_llist_remove(&multi->msgsent, &data->multi_queue, NULL); |
| + | Curl_node_remove(&data->multi_queue); |
| /* put it into the process list */ | |
| - | link_easy(multi, data); |
| + | Curl_llist_append(&multi->process, data, &data->multi_queue); |
| } | |
| } | |
| } | |
| @@ -2770,8 +2752,8 @@ static void unlink_all_msgsent_handles(struct Curl_multi *multi) | |
| CURLMcode curl_multi_cleanup(struct Curl_multi *multi) | |
| { | |
| if(GOOD_MULTI_HANDLE(multi)) { | |
| - | struct Curl_llist_element *e; |
| - | struct Curl_llist_element *n; |
| + | struct Curl_llist_node *e; |
| + | struct Curl_llist_node *n; |
| if(multi->in_callback) | |
| return CURLM_RECURSIVE_API_CALL; | |
| @@ -2783,13 +2765,13 @@ CURLMcode curl_multi_cleanup(struct Curl_multi *multi) | |
| process_pending_handles(multi); | |
| /* First remove all remaining easy handles */ | |
| - | for(e = multi->process.head; e; e = n) { |
| - | struct Curl_easy *data = e->ptr; |
| + | for(e = Curl_llist_head(&multi->process); e; e = n) { |
| + | struct Curl_easy *data = Curl_node_elem(e); |
| if(!GOOD_EASY_HANDLE(data)) | |
| return CURLM_BAD_HANDLE; | |
| - | n = e->next; |
| + | n = Curl_node_next(e); |
| if(!data->state.done && data->conn) | |
| /* if DONE was never called for this handle */ | |
| (void)multi_done(data, CURLE_OK, TRUE); | |
| @@ -2858,15 +2840,15 @@ CURLMsg *curl_multi_info_read(struct Curl_multi *multi, int *msgs_in_queue) | |
| !multi->in_callback && | |
| Curl_llist_count(&multi->msglist)) { | |
| /* there is one or more messages in the list */ | |
| - | struct Curl_llist_element *e; |
| + | struct Curl_llist_node *e; |
| /* extract the head of the list to return */ | |
| - | e = multi->msglist.head; |
| + | e = Curl_llist_head(&multi->msglist); |
| - | msg = e->ptr; |
| + | msg = Curl_node_elem(e); |
| /* remove the extracted entry */ | |
| - | Curl_llist_remove(&multi->msglist, e, NULL); |
| + | Curl_node_remove(e); |
| *msgs_in_queue = curlx_uztosi(Curl_llist_count(&multi->msglist)); | |
| @@ -3110,26 +3092,24 @@ static CURLMcode add_next_timeout(struct curltime now, | |
| { | |
| struct curltime *tv = &d->state.expiretime; | |
| struct Curl_llist *list = &d->state.timeoutlist; | |
| - | struct Curl_llist_element *e; |
| - | struct time_node *node = NULL; |
| + | struct Curl_llist_node *e; |
| /* move over the timeout list for this specific handle and remove all | |
| timeouts that are now passed tense and store the next pending | |
| timeout in *tv */ | |
| - | for(e = list->head; e;) { |
| - | struct Curl_llist_element *n = e->next; |
| - | timediff_t diff; |
| - | node = (struct time_node *)e->ptr; |
| - | diff = Curl_timediff_us(node->time, now); |
| + | for(e = Curl_llist_head(list); e;) { |
| + | struct Curl_llist_node *n = Curl_node_next(e); |
| + | struct time_node *node = Curl_node_elem(e); |
| + | timediff_t diff = Curl_timediff_us(node->time, now); |
| if(diff <= 0) | |
| /* remove outdated entry */ | |
| - | Curl_llist_remove(list, e, NULL); |
| + | Curl_node_remove(e); |
| else | |
| /* the list is sorted so get out on the first mismatch */ | |
| break; | |
| e = n; | |
| } | |
| - | e = list->head; |
| + | e = Curl_llist_head(list); |
| if(!e) { | |
| /* clear the expire times within the handles that we remove from the | |
| splay tree */ | |
| @@ -3137,6 +3117,7 @@ static CURLMcode add_next_timeout(struct curltime now, | |
| tv->tv_usec = 0; | |
| } | |
| else { | |
| + | struct time_node *node = Curl_node_elem(e); |
| /* copy the first entry to 'tv' */ | |
| memcpy(tv, &node->time, sizeof(*tv)); | |
| @@ -3162,15 +3143,16 @@ static CURLMcode multi_socket(struct Curl_multi *multi, | |
| SIGPIPE_VARIABLE(pipe_st); | |
| if(checkall) { | |
| - | struct Curl_llist_element *e; |
| + | struct Curl_llist_node *e; |
| /* *perform() deals with running_handles on its own */ | |
| result = curl_multi_perform(multi, running_handles); | |
| /* walk through each easy handle and do the socket state change magic | |
| and callbacks */ | |
| if(result != CURLM_BAD_HANDLE) { | |
| - | for(e = multi->process.head; e && !result; e = e->next) { |
| - | result = singlesocket(multi, e->ptr); |
| + | for(e = Curl_llist_head(&multi->process); e && !result; |
| + | e = Curl_node_next(e)) { |
| + | result = singlesocket(multi, Curl_node_elem(e)); |
| } | |
| } | |
| @@ -3499,13 +3481,13 @@ CURLMcode Curl_update_timer(struct Curl_multi *multi) | |
| static void | |
| multi_deltimeout(struct Curl_easy *data, expire_id eid) | |
| { | |
| - | struct Curl_llist_element *e; |
| + | struct Curl_llist_node *e; |
| struct Curl_llist *timeoutlist = &data->state.timeoutlist; | |
| /* find and remove the specific node from the list */ | |
| - | for(e = timeoutlist->head; e; e = e->next) { |
| - | struct time_node *n = (struct time_node *)e->ptr; |
| + | for(e = Curl_llist_head(timeoutlist); e; e = Curl_node_next(e)) { |
| + | struct time_node *n = Curl_node_elem(e); |
| if(n->eid == eid) { | |
| - | Curl_llist_remove(timeoutlist, e, NULL); |
| + | Curl_node_remove(e); |
| return; | |
| } | |
| } | |
| @@ -3523,9 +3505,9 @@ multi_addtimeout(struct Curl_easy *data, | |
| struct curltime *stamp, | |
| expire_id eid) | |
| { | |
| - | struct Curl_llist_element *e; |
| + | struct Curl_llist_node *e; |
| struct time_node *node; | |
| - | struct Curl_llist_element *prev = NULL; |
| + | struct Curl_llist_node *prev = NULL; |
| size_t n; | |
| struct Curl_llist *timeoutlist = &data->state.timeoutlist; | |
| @@ -3538,8 +3520,8 @@ multi_addtimeout(struct Curl_easy *data, | |
| n = Curl_llist_count(timeoutlist); | |
| if(n) { | |
| /* find the correct spot in the list */ | |
| - | for(e = timeoutlist->head; e; e = e->next) { |
| - | struct time_node *check = (struct time_node *)e->ptr; |
| + | for(e = Curl_llist_head(timeoutlist); e; e = Curl_node_next(e)) { |
| + | struct time_node *check = Curl_node_elem(e); |
| timediff_t diff = Curl_timediff(check->time, node->time); | |
| if(diff > 0) | |
| break; | |
| @@ -3661,10 +3643,8 @@ void Curl_expire_clear(struct Curl_easy *data) | |
| if(rc) | |
| infof(data, "Internal error clearing splay node = %d", rc); | |
| - | /* flush the timeout list too */ |
| - | while(list->size > 0) { |
| - | Curl_llist_remove(list, list->tail, NULL); |
| - | } |
| + | /* clear the timeout list too */ |
| + | Curl_llist_destroy(list, NULL); |
| #ifdef DEBUGBUILD | |
| infof(data, "Expire cleared"); | |
| @@ -3726,10 +3706,10 @@ static void move_pending_to_connect(struct Curl_multi *multi, | |
| DEBUGASSERT(data->mstate == MSTATE_PENDING); | |
| /* Remove this node from the pending list */ | |
| - | Curl_llist_remove(&multi->pending, &data->multi_queue, NULL); |
| + | Curl_node_remove(&data->multi_queue); |
| /* put it into the process list */ | |
| - | link_easy(multi, data); |
| + | Curl_llist_append(&multi->process, data, &data->multi_queue); |
| multistate(data, MSTATE_CONNECT); | |
| @@ -3737,7 +3717,7 @@ static void move_pending_to_connect(struct Curl_multi *multi, | |
| Curl_expire(data, 0, EXPIRE_RUN_NOW); | |
| } | |
| - | /* process_pending_handles() moves a handle from PENDING back into the main |
| + | /* process_pending_handles() moves a handle from PENDING back into the process |
| list and change state to CONNECT. | |
| We do not move all transfers because that can be a significant amount. | |
| @@ -3753,9 +3733,9 @@ static void move_pending_to_connect(struct Curl_multi *multi, | |
| */ | |
| static void process_pending_handles(struct Curl_multi *multi) | |
| { | |
| - | struct Curl_llist_element *e = multi->pending.head; |
| + | struct Curl_llist_node *e = Curl_llist_head(&multi->pending); |
| if(e) { | |
| - | struct Curl_easy *data = e->ptr; |
| + | struct Curl_easy *data = Curl_node_elem(e); |
| move_pending_to_connect(multi, data); | |
| } | |
| } | |
| @@ -3783,9 +3763,9 @@ struct Curl_easy **curl_multi_get_handles(struct Curl_multi *multi) | |
| (multi->num_easy + 1)); | |
| if(a) { | |
| unsigned int i = 0; | |
| - | struct Curl_llist_element *e; |
| - | for(e = multi->process.head; e; e = e->next) { |
| - | struct Curl_easy *data = e->ptr; |
| + | struct Curl_llist_node *e; |
| + | for(e = Curl_llist_head(&multi->process); e; e = Curl_node_next(e)) { |
| + | struct Curl_easy *data = Curl_node_elem(e); |
| DEBUGASSERT(i < multi->num_easy); | |
| if(!data->state.internal) | |
| a[i++] = data; | |
| @@ -33,7 +33,7 @@ | |
| struct connectdata; | |
| struct Curl_message { | |
| - | struct Curl_llist_element list; |
| + | struct Curl_llist_node list; |
| /* the 'CURLMsg' is the part that is visible to the external user */ | |
| struct CURLMsg extmsg; | |
| }; | |
| @@ -92,7 +92,7 @@ struct Curl_multi { | |
| struct Curl_llist msglist; /* a list of messages from completed transfers */ | |
| - | /* Each added easy handle is in ONE of these three lists */ |
| + | /* Each added easy handle is added to ONE of these three lists */ |
| struct Curl_llist process; /* not in PENDING or MSGSENT */ | |
| struct Curl_llist pending; /* in PENDING */ | |
| struct Curl_llist msgsent; /* in MSGSENT */ | |
| @@ -539,6 +539,9 @@ CURLcode Curl_open(struct Curl_easy **curl) | |
| data->progress.flags |= PGRS_HIDE; | |
| data->state.current_speed = -1; /* init to negative == impossible */ | |
| + | #ifndef CURL_DISABLE_HTTP |
| + | Curl_llist_init(&data->state.httphdrs, NULL); |
| + | #endif |
| } | |
| if(result) { | |
| @@ -551,7 +554,6 @@ CURLcode Curl_open(struct Curl_easy **curl) | |
| } | |
| else | |
| *curl = data; | |
| - | |
| return result; | |
| } | |
| @@ -895,7 +897,7 @@ ConnectionExists(struct Curl_easy *data, | |
| bool foundPendingCandidate = FALSE; | |
| bool canmultiplex = FALSE; | |
| struct connectbundle *bundle; | |
| - | struct Curl_llist_element *curr; |
| + | struct Curl_llist_node *curr; |
| #ifdef USE_NTLM | |
| bool wantNTLMhttp = ((data->state.authhost.want & CURLAUTH_NTLM) && | |
| @@ -952,12 +954,12 @@ ConnectionExists(struct Curl_easy *data, | |
| } | |
| } | |
| - | curr = bundle->conn_list.head; |
| + | curr = Curl_llist_head(&bundle->conn_list); |
| while(curr) { | |
| - | struct connectdata *check = curr->ptr; |
| + | struct connectdata *check = Curl_node_elem(curr); |
| /* Get next node now. We might remove a dead `check` connection which | |
| * would invalidate `curr` as well. */ | |
| - | curr = curr->next; |
| + | curr = Curl_node_next(curr); |
| /* Note that if we use an HTTP proxy in normal mode (no tunneling), we | |
| * check connections to that proxy and not to the actual remote server. | |
| @@ -987,8 +989,8 @@ ConnectionExists(struct Curl_easy *data, | |
| } | |
| else { | |
| /* Could multiplex, but not when check belongs to another multi */ | |
| - | struct Curl_llist_element *e = check->easyq.head; |
| - | struct Curl_easy *entry = e->ptr; |
| + | struct Curl_llist_node *e = Curl_llist_head(&check->easyq); |
| + | struct Curl_easy *entry = Curl_node_elem(e); |
| if(entry->multi != data->multi) | |
| continue; | |
| } | |
| @@ -797,7 +797,7 @@ struct ldapconninfo; | |
| * unique for an entire connection. | |
| */ | |
| struct connectdata { | |
| - | struct Curl_llist_element bundle_node; /* conncache */ |
| + | struct Curl_llist_node bundle_node; /* conncache */ |
| curl_closesocket_callback fclosesocket; /* function closing the socket(s) */ | |
| void *closesocket_client; | |
| @@ -806,7 +806,7 @@ struct connectdata { | |
| handle is still used by one or more easy handles and can only used by any | |
| other easy handle without careful consideration (== only for | |
| multiplexing) and it cannot be used by another multi handle! */ | |
| - | #define CONN_INUSE(c) ((c)->easyq.size) |
| + | #define CONN_INUSE(c) Curl_llist_count(&(c)->easyq) |
| /**** Fields set when inited and not modified again */ | |
| curl_off_t connection_id; /* Contains a unique number to make it easier to | |
| @@ -1194,7 +1194,7 @@ typedef enum { | |
| * One instance for each timeout an easy handle can set. | |
| */ | |
| struct time_node { | |
| - | struct Curl_llist_element list; |
| + | struct Curl_llist_node list; |
| struct curltime time; | |
| expire_id eid; | |
| }; | |
| @@ -1910,8 +1910,8 @@ struct Curl_easy { | |
| curl_off_t id; | |
| struct connectdata *conn; | |
| - | struct Curl_llist_element multi_queue; /* for multihandle list management */ |
| - | struct Curl_llist_element conn_queue; /* list per connectdata */ |
| + | struct Curl_llist_node multi_queue; /* for multihandle list management */ |
| + | struct Curl_llist_node conn_queue; /* list per connectdata */ |
| CURLMstate mstate; /* the handle's state */ | |
| CURLcode result; /* previous result */ | |
| @@ -274,10 +274,10 @@ static struct Curl_easy *get_stream_easy(struct Curl_cfilter *cf, | |
| return data; | |
| } | |
| else { | |
| - | struct Curl_llist_element *e; |
| + | struct Curl_llist_node *e; |
| DEBUGASSERT(data->multi); | |
| - | for(e = data->multi->process.head; e; e = e->next) { |
| - | struct Curl_easy *sdata = e->ptr; |
| + | for(e = Curl_llist_head(&data->multi->process); e; e = Curl_node_next(e)) { |
| + | struct Curl_easy *sdata = Curl_node_elem(e); |
| if(sdata->conn != data->conn) | |
| continue; | |
| stream = H3_STREAM_CTX(ctx, sdata); | |
| @@ -669,10 +669,10 @@ static struct cf_osslq_stream *cf_osslq_get_qstream(struct Curl_cfilter *cf, | |
| return &ctx->h3.s_qpack_dec; | |
| } | |
| else { | |
| - | struct Curl_llist_element *e; |
| + | struct Curl_llist_node *e; |
| DEBUGASSERT(data->multi); | |
| - | for(e = data->multi->process.head; e; e = e->next) { |
| - | struct Curl_easy *sdata = e->ptr; |
| + | for(e = Curl_llist_head(&data->multi->process); e; e = Curl_node_next(e)) { |
| + | struct Curl_easy *sdata = Curl_node_elem(e); |
| if(sdata->conn != data->conn) | |
| continue; | |
| stream = H3_STREAM_CTX(ctx, sdata); | |
| @@ -1423,12 +1423,12 @@ static CURLcode cf_progress_ingress(struct Curl_cfilter *cf, | |
| } | |
| if(ctx->h3.conn) { | |
| - | struct Curl_llist_element *e; |
| + | struct Curl_llist_node *e; |
| struct h3_stream_ctx *stream; | |
| /* PULL all open streams */ | |
| DEBUGASSERT(data->multi); | |
| - | for(e = data->multi->process.head; e; e = e->next) { |
| - | struct Curl_easy *sdata = e->ptr; |
| + | for(e = Curl_llist_head(&data->multi->process); e; e = Curl_node_next(e)) { |
| + | struct Curl_easy *sdata = Curl_node_elem(e); |
| if(sdata->conn == data->conn && CURL_WANT_RECV(sdata)) { | |
| stream = H3_STREAM_CTX(ctx, sdata); | |
| if(stream && !stream->closed && | |
| @@ -1454,9 +1454,9 @@ static CURLcode cf_osslq_check_and_unblock(struct Curl_cfilter *cf, | |
| struct h3_stream_ctx *stream; | |
| if(ctx->h3.conn) { | |
| - | struct Curl_llist_element *e; |
| - | for(e = data->multi->process.head; e; e = e->next) { |
| - | struct Curl_easy *sdata = e->ptr; |
| + | struct Curl_llist_node *e; |
| + | for(e = Curl_llist_head(&data->multi->process); e; e = Curl_node_next(e)) { |
| + | struct Curl_easy *sdata = Curl_node_elem(e); |
| if(sdata->conn == data->conn) { | |
| stream = H3_STREAM_CTX(ctx, sdata); | |
| if(stream && stream->s.ssl && stream->s.send_blocked && | |
| @@ -177,11 +177,11 @@ static void check_resumes(struct Curl_cfilter *cf, | |
| struct Curl_easy *data) | |
| { | |
| struct cf_quiche_ctx *ctx = cf->ctx; | |
| - | struct Curl_llist_element *e; |
| + | struct Curl_llist_node *e; |
| DEBUGASSERT(data->multi); | |
| - | for(e = data->multi->process.head; e; e = e->next) { |
| - | struct Curl_easy *sdata = e->ptr; |
| + | for(e = Curl_llist_head(&data->multi->process); e; e = Curl_node_next(e)) { |
| + | struct Curl_easy *sdata = Curl_node_elem(e); |
| if(sdata->conn == data->conn) { | |
| struct stream_ctx *stream = H3_STREAM_CTX(ctx, sdata); | |
| if(stream && stream->quic_flow_blocked) { | |
| @@ -277,10 +277,10 @@ static struct Curl_easy *get_stream_easy(struct Curl_cfilter *cf, | |
| return data; | |
| } | |
| else { | |
| - | struct Curl_llist_element *e; |
| + | struct Curl_llist_node *e; |
| DEBUGASSERT(data->multi); | |
| - | for(e = data->multi->process.head; e; e = e->next) { |
| - | struct Curl_easy *sdata = e->ptr; |
| + | for(e = Curl_llist_head(&data->multi->process); e; e = Curl_node_next(e)) { |
| + | struct Curl_easy *sdata = Curl_node_elem(e); |
| if(sdata->conn != data->conn) | |
| continue; | |
| stream = H3_STREAM_CTX(ctx, sdata); | |
| @@ -297,12 +297,12 @@ static struct Curl_easy *get_stream_easy(struct Curl_cfilter *cf, | |
| static void cf_quiche_expire_conn_closed(struct Curl_cfilter *cf, | |
| struct Curl_easy *data) | |
| { | |
| - | struct Curl_llist_element *e; |
| + | struct Curl_llist_node *e; |
| DEBUGASSERT(data->multi); | |
| CURL_TRC_CF(data, cf, "conn closed, expire all transfers"); | |
| - | for(e = data->multi->process.head; e; e = e->next) { |
| - | struct Curl_easy *sdata = e->ptr; |
| + | for(e = Curl_llist_head(&data->multi->process); e; e = Curl_node_next(e)) { |
| + | struct Curl_easy *sdata = Curl_node_elem(e); |
| if(sdata == data || sdata->conn != data->conn) | |
| continue; | |
| CURL_TRC_CF(sdata, cf, "conn closed, expire transfer"); | |
| @@ -52,14 +52,14 @@ UNITTEST_START | |
| int unusedData_case1 = 1; | |
| int unusedData_case2 = 2; | |
| int unusedData_case3 = 3; | |
| - | struct Curl_llist_element case1_list; |
| - | struct Curl_llist_element case2_list; |
| - | struct Curl_llist_element case3_list; |
| - | struct Curl_llist_element case4_list; |
| - | struct Curl_llist_element *head; |
| - | struct Curl_llist_element *element_next; |
| - | struct Curl_llist_element *element_prev; |
| - | struct Curl_llist_element *to_remove; |
| + | struct Curl_llist_node case1_list; |
| + | struct Curl_llist_node case2_list; |
| + | struct Curl_llist_node case3_list; |
| + | struct Curl_llist_node case4_list; |
| + | struct Curl_llist_node *head; |
| + | struct Curl_llist_node *element_next; |
| + | struct Curl_llist_node *element_prev; |
| + | struct Curl_llist_node *to_remove; |
| size_t llist_size = Curl_llist_count(&llist); | |
| /** | |
| @@ -73,11 +73,9 @@ UNITTEST_START | |
| * 4: list dtor will be NULL | |
| */ | |
| - | fail_unless(llist.size == 0, "list initial size should be zero"); |
| - | fail_unless(llist.head == NULL, "list head should initiate to NULL"); |
| - | fail_unless(llist.tail == NULL, "list tail should initiate to NULL"); |
| - | fail_unless(llist.dtor == test_Curl_llist_dtor, |
| - | "list dtor should initiate to test_Curl_llist_dtor"); |
| + | fail_unless(Curl_llist_count(&llist) == 0, "list initial size should be zero"); |
| + | fail_unless(Curl_llist_head(&llist) == NULL, "list head should initiate to NULL"); |
| + | fail_unless(Curl_llist_tail(&llist) == NULL, "list tail should initiate to NULL"); |
| /** | |
| * testing Curl_llist_insert_next | |
| @@ -89,15 +87,15 @@ UNITTEST_START | |
| * 3: list tail will be the same as list head | |
| */ | |
| - | Curl_llist_insert_next(&llist, llist.head, &unusedData_case1, &case1_list); |
| + | Curl_llist_insert_next(&llist, Curl_llist_head(&llist), &unusedData_case1, &case1_list); |
| fail_unless(Curl_llist_count(&llist) == 1, | |
| "List size should be 1 after adding a new element"); | |
| /* test that the list head data holds my unusedData */ | |
| - | fail_unless(llist.head->ptr == &unusedData_case1, |
| + | fail_unless(Curl_node_elem(Curl_llist_head(&llist)) == &unusedData_case1, |
| "head ptr should be first entry"); | |
| /* same goes for the list tail */ | |
| - | fail_unless(llist.tail == llist.head, |
| + | fail_unless(Curl_llist_tail(&llist) == Curl_llist_head(&llist), |
| "tail and head should be the same"); | |
| /** | |
| @@ -109,11 +107,12 @@ UNITTEST_START | |
| * 2: the list tail should be our newly created element | |
| */ | |
| - | Curl_llist_insert_next(&llist, llist.head, |
| + | Curl_llist_insert_next(&llist, Curl_llist_head(&llist), |
| &unusedData_case3, &case3_list); | |
| - | fail_unless(llist.head->next->ptr == &unusedData_case3, |
| + | fail_unless(Curl_node_elem(Curl_node_next(Curl_llist_head(&llist))) == |
| + | &unusedData_case3, |
| "the node next to head is not getting set correctly"); | |
| - | fail_unless(llist.tail->ptr == &unusedData_case3, |
| + | fail_unless(Curl_node_elem(Curl_llist_tail(&llist)) == &unusedData_case3, |
| "the list tail is not getting set correctly"); | |
| /** | |
| @@ -125,15 +124,16 @@ UNITTEST_START | |
| * 2: the list tail should different from newly created element | |
| */ | |
| - | Curl_llist_insert_next(&llist, llist.head, |
| + | Curl_llist_insert_next(&llist, Curl_llist_head(&llist), |
| &unusedData_case2, &case2_list); | |
| - | fail_unless(llist.head->next->ptr == &unusedData_case2, |
| + | fail_unless(Curl_node_elem(Curl_node_next(Curl_llist_head(&llist))) == |
| + | &unusedData_case2, |
| "the node next to head is not getting set correctly"); | |
| /* better safe than sorry, check that the tail isn't corrupted */ | |
| - | fail_unless(llist.tail->ptr != &unusedData_case2, |
| + | fail_unless(Curl_node_elem(Curl_llist_tail(&llist)) != &unusedData_case2, |
| "the list tail is not getting set correctly"); | |
| - | /* unit tests for Curl_llist_remove */ |
| + | /* unit tests for Curl_node_remove */ |
| /** | |
| * case 1: | |
| @@ -144,19 +144,19 @@ UNITTEST_START | |
| * 3: "new" head's previous will be NULL | |
| */ | |
| - | head = llist.head; |
| + | head = Curl_llist_head(&llist); |
| abort_unless(head, "llist.head is NULL"); | |
| - | element_next = head->next; |
| + | element_next = Curl_node_next(head); |
| llist_size = Curl_llist_count(&llist); | |
| - | Curl_llist_remove(&llist, llist.head, NULL); |
| + | Curl_node_remove(Curl_llist_head(&llist)); |
| fail_unless(Curl_llist_count(&llist) == (llist_size-1), | |
| - | "llist size not decremented as expected"); |
| - | fail_unless(llist.head == element_next, |
| - | "llist new head not modified properly"); |
| - | abort_unless(llist.head, "llist.head is NULL"); |
| - | fail_unless(llist.head->prev == NULL, |
| + | "llist size not decremented as expected"); |
| + | fail_unless(Curl_llist_head(&llist) == element_next, |
| + | "llist new head not modified properly"); |
| + | abort_unless(Curl_llist_head(&llist), "llist.head is NULL"); |
| + | fail_unless(Curl_node_prev(Curl_llist_head(&llist)) == NULL, |
| "new head previous not set to null"); | |
| /** | |
| @@ -169,20 +169,20 @@ UNITTEST_START | |
| * 2: element->previous->next will be element->next | |
| * 3: element->next->previous will be element->previous | |
| */ | |
| - | Curl_llist_insert_next(&llist, llist.head, &unusedData_case3, |
| + | Curl_llist_insert_next(&llist, Curl_llist_head(&llist), &unusedData_case3, |
| &case4_list); | |
| llist_size = Curl_llist_count(&llist); | |
| fail_unless(llist_size == 3, "should be 3 list members"); | |
| - | to_remove = llist.head->next; |
| + | to_remove = Curl_node_next(Curl_llist_head(&llist)); |
| abort_unless(to_remove, "to_remove is NULL"); | |
| - | element_next = to_remove->next; |
| - | element_prev = to_remove->prev; |
| - | Curl_llist_remove(&llist, to_remove, NULL); |
| - | fail_unless(element_prev->next == element_next, |
| + | element_next = Curl_node_next(to_remove); |
| + | element_prev = Curl_node_prev(to_remove); |
| + | Curl_node_uremove(to_remove, NULL); |
| + | fail_unless(Curl_node_next(element_prev) == element_next, |
| "element previous->next is not being adjusted"); | |
| abort_unless(element_next, "element_next is NULL"); | |
| - | fail_unless(element_next->prev == element_prev, |
| + | fail_unless(Curl_node_prev(element_next) == element_prev, |
| "element next->previous is not being adjusted"); | |
| /** | |
| @@ -195,10 +195,10 @@ UNITTEST_START | |
| * 4: list->tail will be tail->previous | |
| */ | |
| - | to_remove = llist.tail; |
| - | element_prev = to_remove->prev; |
| - | Curl_llist_remove(&llist, to_remove, NULL); |
| - | fail_unless(llist.tail == element_prev, |
| + | to_remove = Curl_llist_tail(&llist); |
| + | element_prev = Curl_node_prev(to_remove); |
| + | Curl_node_remove(to_remove); |
| + | fail_unless(Curl_llist_tail(&llist) == element_prev, |
| "llist tail is not being adjusted when removing tail"); | |
| /** | |
| @@ -210,11 +210,11 @@ UNITTEST_START | |
| * 3: list tail will be null | |
| */ | |
| - | to_remove = llist.head; |
| - | Curl_llist_remove(&llist, to_remove, NULL); |
| - | fail_unless(llist.head == NULL, |
| + | to_remove = Curl_llist_head(&llist); |
| + | Curl_node_remove(to_remove); |
| + | fail_unless(Curl_llist_head(&llist) == NULL, |
| "llist head is not NULL while the llist is empty"); | |
| - | fail_unless(llist.tail == NULL, |
| + | fail_unless(Curl_llist_tail(&llist) == NULL, |
| "llist tail is not NULL while the llist is empty"); | |
| /** | |
| @@ -229,10 +229,10 @@ UNITTEST_START | |
| fail_unless(Curl_llist_count(&llist) == 1, | |
| "List size should be 1 after appending a new element"); | |
| /* test that the list head data holds my unusedData */ | |
| - | fail_unless(llist.head->ptr == &unusedData_case1, |
| + | fail_unless(Curl_node_elem(Curl_llist_head(&llist)) == &unusedData_case1, |
| "head ptr should be first entry"); | |
| /* same goes for the list tail */ | |
| - | fail_unless(llist.tail == llist.head, |
| + | fail_unless(Curl_llist_tail(&llist) == Curl_llist_head(&llist), |
| "tail and head should be the same"); | |
| /** | |
| @@ -244,9 +244,10 @@ UNITTEST_START | |
| * 2: the list tail should be the newly created element | |
| */ | |
| Curl_llist_append(&llist, &unusedData_case2, &case2_list); | |
| - | fail_unless(llist.head->next->ptr == &unusedData_case2, |
| + | fail_unless(Curl_node_elem(Curl_node_next(Curl_llist_head(&llist))) == |
| + | &unusedData_case2, |
| "the node next to head is not getting set correctly"); | |
| - | fail_unless(llist.tail->ptr == &unusedData_case2, |
| + | fail_unless(Curl_node_elem(Curl_llist_tail(&llist)) == &unusedData_case2, |
| "the list tail is not getting set correctly"); | |
| /** | |
| @@ -258,13 +259,12 @@ UNITTEST_START | |
| * 2: the list tail should be the newly created element | |
| */ | |
| Curl_llist_append(&llist, &unusedData_case3, &case3_list); | |
| - | fail_unless(llist.head->next->ptr == &unusedData_case2, |
| + | fail_unless(Curl_node_elem(Curl_node_next(Curl_llist_head(&llist))) == |
| + | &unusedData_case2, |
| "the node next to head did not stay the same"); | |
| - | fail_unless(llist.tail->ptr == &unusedData_case3, |
| + | fail_unless(Curl_node_elem(Curl_llist_tail(&llist)) == &unusedData_case3, |
| "the list tail is not getting set correctly"); | |
| - | |
| - | |
| Curl_llist_destroy(&llist, NULL); | |
| Curl_llist_destroy(&llist_destination, NULL); | |
| } | |
| @@ -57,51 +57,51 @@ UNITTEST_START | |
| fail_if(!curl, "curl_easy_init"); | |
| goto fail; | |
| } | |
| - | fail_unless(asi->list.size == 4, "wrong number of entries"); |
| + | fail_unless(Curl_llist_count(&asi->list) == 4, "wrong number of entries"); |
| msnprintf(outname, sizeof(outname), "%s-out", arg); | |
| result = Curl_altsvc_parse(curl, asi, "h2=\"example.com:8080\"\r\n", | |
| ALPN_h1, "example.org", 8080); | |
| fail_if(result, "Curl_altsvc_parse() failed!"); | |
| - | fail_unless(asi->list.size == 5, "wrong number of entries"); |
| + | fail_unless(Curl_llist_count(&asi->list) == 5, "wrong number of entries"); |
| result = Curl_altsvc_parse(curl, asi, "h3=\":8080\"\r\n", | |
| ALPN_h1, "2.example.org", 8080); | |
| fail_if(result, "Curl_altsvc_parse(2) failed!"); | |
| - | fail_unless(asi->list.size == 6, "wrong number of entries"); |
| + | fail_unless(Curl_llist_count(&asi->list) == 6, "wrong number of entries"); |
| result = Curl_altsvc_parse(curl, asi, | |
| "h2=\"example.com:8080\", h3=\"yesyes.com\"\r\n", | |
| ALPN_h1, "3.example.org", 8080); | |
| fail_if(result, "Curl_altsvc_parse(3) failed!"); | |
| /* that one should make two entries */ | |
| - | fail_unless(asi->list.size == 8, "wrong number of entries"); |
| + | fail_unless(Curl_llist_count(&asi->list) == 8, "wrong number of entries"); |
| result = Curl_altsvc_parse(curl, asi, | |
| "h2=\"example.com:443\"; ma = 120;\r\n", | |
| ALPN_h2, "example.org", 80); | |
| fail_if(result, "Curl_altsvc_parse(4) failed!"); | |
| - | fail_unless(asi->list.size == 9, "wrong number of entries"); |
| + | fail_unless(Curl_llist_count(&asi->list) == 9, "wrong number of entries"); |
| /* quoted 'ma' value */ | |
| result = Curl_altsvc_parse(curl, asi, | |
| "h2=\"example.net:443\"; ma=\"180\";\r\n", | |
| ALPN_h2, "example.net", 80); | |
| fail_if(result, "Curl_altsvc_parse(4) failed!"); | |
| - | fail_unless(asi->list.size == 10, "wrong number of entries"); |
| + | fail_unless(Curl_llist_count(&asi->list) == 10, "wrong number of entries"); |
| result = | |
| Curl_altsvc_parse(curl, asi, | |
| "h2=\":443\", h3=\":443\"; ma = 120; persist = 1\r\n", | |
| ALPN_h1, "curl.se", 80); | |
| fail_if(result, "Curl_altsvc_parse(5) failed!"); | |
| - | fail_unless(asi->list.size == 12, "wrong number of entries"); |
| + | fail_unless(Curl_llist_count(&asi->list) == 12, "wrong number of entries"); |
| /* clear that one again and decrease the counter */ | |
| result = Curl_altsvc_parse(curl, asi, "clear;\r\n", | |
| ALPN_h1, "curl.se", 80); | |
| fail_if(result, "Curl_altsvc_parse(6) failed!"); | |
| - | fail_unless(asi->list.size == 10, "wrong number of entries"); |
| + | fail_unless(Curl_llist_count(&asi->list) == 10, "wrong number of entries"); |
| Curl_altsvc_save(curl, asi, outname); | |
| @@ -118,6 +118,7 @@ static void showsts(struct stsentry *e, const char *chost) | |
| } | |
| UNITTEST_START | |
| + | { |
| CURLcode result; | |
| struct stsentry *e; | |
| struct hsts *h = Curl_hsts_init(); | |
| @@ -159,7 +160,7 @@ UNITTEST_START | |
| showsts(e, chost); | |
| } | |
| - | printf("Number of entries: %zu\n", h->list.size); |
| + | printf("Number of entries: %zu\n", Curl_llist_count(&h->list)); |
| /* verify that it is exists for 7 seconds */ | |
| chost = "expire.example"; | |
| @@ -174,6 +175,6 @@ UNITTEST_START | |
| Curl_hsts_cleanup(&h); | |
| curl_easy_cleanup(easy); | |
| curl_global_cleanup(); | |
| - | |
| + | } |
| UNITTEST_STOP | |
| #endif | |