← Commit list

fbf5d507ce

Daniel Stenberg
Daniel Stenberg
2024-09-19
SUCCESS Duration: 84s

Subject

lib/src: white space edits to comply better with code style

Binary

Download Binary (853 KB)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

$ git checkout -f fbf5d507cef9880d0d3db2ce0231dc31309790ee
Previous HEAD position was e666a678bd checksrc: check for spaces around '?', '>' and '<'
HEAD is now at fbf5d507ce lib/src: white space edits to comply better with code style

$ 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/buildinfo.txt
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.2-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 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 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 for fseeko... 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 the SHA-512/256 hash algorithm... 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.2-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-altsvc.lo
  CC       libcurl_la-amigaos.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_chunks.lo
  CC       libcurl_la-http_aws_sigv4.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_getparam.o
  CC       tool_getpass.o
  CC       tool_help.o
  CC       tool_helpers.o
echo '#include "tool_hugehelp.h"' >> tool_hugehelp.c
  CC       tool_ipfs.o
  CC       tool_libinfo.o
  CC       tool_listhelp.o
  CC       tool_main.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'

Commit Diff GitHub →

docs/examples/chkspeed.c +5 -5docs/examples/debug.c +2 -2docs/examples/ftpgetinfo.c +1 -1docs/examples/ghiper.c +1 -1docs/examples/htmltidy.c +3 -3docs/examples/http2-download.c +2 -2docs/examples/http2-serverpush.c +3 -3docs/examples/http2-upload.c +4 -4docs/examples/multi-app.c +4 -4docs/examples/multi-debugcallback.c +2 -2docs/examples/multi-legacy.c +4 -4docs/examples/multithread.c +2 -2docs/examples/synctime.c +2 -2docs/examples/threaded-ssl.c +2 -2lib/asyn-ares.c +5 -5lib/asyn-thread.c +1 -1lib/bufq.c +3 -3lib/c-hyper.c +2 -2lib/cf-h1-proxy.c +2 -2lib/cf-h2-proxy.c +16 -17lib/cf-haproxy.c +1 -1lib/cf-https-connect.c +6 -6lib/cf-socket.c +10 -10lib/cfilters.c +28 -26lib/conncache.c +3 -3lib/connect.c +6 -6lib/content_encoding.c +6 -6lib/cookie.c +12 -12lib/curl_fnmatch.c +1 -1lib/curl_ntlm_core.c +1 -1lib/curl_trc.c +1 -1lib/cw-out.c +5 -5lib/doh.c +5 -4lib/dynhds.c +2 -2lib/easy.c +8 -8lib/escape.c +3 -3lib/file.c +1 -1lib/formdata.c +22 -20lib/ftp.c +38 -36lib/getenv.c +1 -1lib/getinfo.c +10 -10lib/headers.c +1 -1lib/hostip.c +2 -2lib/http.c +59 -59lib/http1.c +5 -5lib/http2.c +31 -31lib/http_aws_sigv4.c +1 -1lib/http_proxy.c +4 -4lib/llist.c +1 -1lib/mime.c +29 -28lib/mprintf.c +23 -23lib/mqtt.c +3 -3lib/multi.c +6 -6lib/openldap.c +8 -7lib/parsedate.c +6 -6lib/pingpong.c +2 -2lib/progress.c +5 -5lib/psl.c +1 -1lib/request.c +3 -3lib/rtsp.c +4 -4lib/sendf.c +4 -4lib/setopt.c +4 -4lib/share.c +5 -5lib/socks.c +1 -1lib/socks_gssapi.c +5 -3lib/socks_sspi.c +5 -3lib/telnet.c +3 -3lib/tftp.c +9 -9lib/transfer.c +6 -6lib/url.c +1 -1lib/urlapi.c +12 -12lib/vauth/krb5_gssapi.c +1 -1lib/vauth/ntlm.c +7 -7lib/vquic/curl_msh3.c +3 -3lib/vquic/curl_ngtcp2.c +12 -12lib/vquic/curl_osslq.c +10 -10lib/vquic/curl_quiche.c +7 -7lib/vssh/libssh2.c +11 -11lib/vssh/wolfssh.c +6 -6lib/vtls/bearssl.c +6 -7lib/vtls/gtls.c +25 -26lib/vtls/mbedtls.c +14 -15lib/vtls/openssl.c +27 -27lib/vtls/rustls.c +1 -1lib/vtls/schannel.c +8 -8lib/vtls/schannel_verify.c +1 -1lib/vtls/sectransp.c +7 -7lib/vtls/vtls.c +11 -11lib/vtls/wolfssl.c +15 -18lib/vtls/x509asn1.c +3 -3lib/ws.c +7 -7packages/OS400/ccsidcurl.c +6 -6packages/OS400/os400sys.c +2 -2scripts/schemetable.c +1 -1src/tool_cb_prg.c +1 -1src/tool_cb_rea.c +1 -1src/tool_getparam.c +3 -4src/tool_operate.c +29 -27src/tool_urlglob.c +1 -1src/tool_util.c +1 -1src/tool_writeout.c +1 -1src/var.c +1 -1tests/http/clients/h2-pausing.c +7 -7tests/http/clients/h2-serverpush.c +3 -3tests/http/clients/hx-download.c +1 -1tests/http/clients/hx-upload.c +1 -1tests/http/clients/ws-data.c +2 -2tests/http/testenv/mod_curltest/mod_curltest.c +1 -1tests/libtest/first.c +4 -4tests/libtest/lib1156.c +12 -12tests/libtest/lib1560.c +7 -7tests/libtest/lib2302.c +1 -1tests/libtest/lib552.c +2 -2tests/libtest/lib557.c +9 -9tests/libtest/lib670.c +1 -1tests/server/mqttd.c +11 -12tests/server/resolve.c +1 -1tests/server/rtspd.c +8 -8tests/server/sockfilt.c +9 -9tests/server/socksd.c +13 -13tests/server/sws.c +15 -15tests/server/testpart.c +1 -1tests/server/tftpd.c +7 -7tests/server/util.c +18 -7tests/unit/unit1309.c +1 -1tests/unit/unit1399.c +1 -1tests/unit/unit2600.c +3 -3tests/unit/unit2601.c +1 -1
docs/examples/chkspeed.c+5 -5
@@ -180,31 +180,31 @@ int main(int argc, char *argv[])
/* check for bytes downloaded */
res = curl_easy_getinfo(curl_handle, CURLINFO_SIZE_DOWNLOAD_T, &val);
- if((CURLE_OK == res) && (val>0))
+ if((CURLE_OK == res) && (val > 0))
printf("Data downloaded: %lu bytes.\n", (unsigned long)val);
/* check for total download time */
res = curl_easy_getinfo(curl_handle, CURLINFO_TOTAL_TIME_T, &val);
- if((CURLE_OK == res) && (val>0))
+ if((CURLE_OK == res) && (val > 0))
printf("Total download time: %lu.%06lu sec.\n",
(unsigned long)(val / 1000000), (unsigned long)(val % 1000000));
/* check for average download speed */
res = curl_easy_getinfo(curl_handle, CURLINFO_SPEED_DOWNLOAD_T, &val);
- if((CURLE_OK == res) && (val>0))
+ if((CURLE_OK == res) && (val > 0))
printf("Average download speed: %lu kbyte/sec.\n",
(unsigned long)(val / 1024));
if(prtall) {
/* check for name resolution time */
res = curl_easy_getinfo(curl_handle, CURLINFO_NAMELOOKUP_TIME_T, &val);
- if((CURLE_OK == res) && (val>0))
+ if((CURLE_OK == res) && (val > 0))
printf("Name lookup time: %lu.%06lu sec.\n",
(unsigned long)(val / 1000000), (unsigned long)(val % 1000000));
/* check for connect time */
res = curl_easy_getinfo(curl_handle, CURLINFO_CONNECT_TIME_T, &val);
- if((CURLE_OK == res) && (val>0))
+ if((CURLE_OK == res) && (val > 0))
printf("Connect time: %lu.%06lu sec.\n",
(unsigned long)(val / 1000000), (unsigned long)(val % 1000000));
}
docs/examples/debug.c+2 -2
@@ -49,7 +49,7 @@ void dump(const char *text,
fprintf(stream, "%s, %10.10lu bytes (0x%8.8lx)\n",
text, (unsigned long)size, (unsigned long)size);
- for(i = 0; i<size; i += width) {
+ for(i = 0; i < size; i += width) {
fprintf(stream, "%4.4lx: ", (unsigned long)i);
@@ -70,7 +70,7 @@ void dump(const char *text,
break;
}
fprintf(stream, "%c",
- (ptr[i + c] >= 0x20) && (ptr[i + c]<0x80)?ptr[i + c]:'.');
+ (ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
ptr[i + c + 2] == 0x0A) {
docs/examples/ftpgetinfo.c+1 -1
@@ -74,7 +74,7 @@ int main(void)
}
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T,
&filesize);
- if((CURLE_OK == res) && (filesize>0))
+ if((CURLE_OK == res) && (filesize > 0))
printf("filesize %s: %" CURL_FORMAT_CURL_OFF_T " bytes\n",
filename, filesize);
}
docs/examples/ghiper.c+1 -1
@@ -311,7 +311,7 @@ static void new_conn(char *url, GlobalInfo *g)
curl_easy_setopt(conn->easy, CURLOPT_VERBOSE, (long)SHOW_VERBOSE);
curl_easy_setopt(conn->easy, CURLOPT_ERRORBUFFER, conn->error);
curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn);
- curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, SHOW_PROGRESS?0L:1L);
+ curl_easy_setopt(conn->easy, CURLOPT_NOPROGRESS, SHOW_PROGRESS ? 0L : 1L);
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSFUNCTION, prog_cb);
curl_easy_setopt(conn->easy, CURLOPT_PROGRESSDATA, conn);
curl_easy_setopt(conn->easy, CURLOPT_FOLLOWLOCATION, 1L);
docs/examples/htmltidy.c+3 -3
@@ -56,8 +56,8 @@ void dumpNode(TidyDoc doc, TidyNode tnod, int indent)
/* walk the attribute list */
for(attr = tidyAttrFirst(child); attr; attr = tidyAttrNext(attr) ) {
printf("%s", tidyAttrName(attr));
- tidyAttrValue(attr)?printf("=\"%s\" ",
- tidyAttrValue(attr)):printf(" ");
+ tidyAttrValue(attr) ? printf("=\"%s\" ",
+ tidyAttrValue(attr)) : printf(" ");
}
printf(">\n");
}
@@ -66,7 +66,7 @@ void dumpNode(TidyDoc doc, TidyNode tnod, int indent)
TidyBuffer buf;
tidyBufInit(&buf);
tidyNodeGetText(doc, child, &buf);
- printf("%*.*s\n", indent, indent, buf.bp?(char *)buf.bp:"");
+ printf("%*.*s\n", indent, indent, buf.bp ? (char *)buf.bp : "");
tidyBufFree(&buf);
}
dumpNode(doc, child, indent + 4); /* recursive */
docs/examples/http2-download.c+2 -2
@@ -65,7 +65,7 @@ void dump(const char *text, unsigned int num, unsigned char *ptr, size_t size,
fprintf(stderr, "%u %s, %lu bytes (0x%lx)\n",
num, text, (unsigned long)size, (unsigned long)size);
- for(i = 0; i<size; i += width) {
+ for(i = 0; i < size; i += width) {
fprintf(stderr, "%4.4lx: ", (unsigned long)i);
@@ -86,7 +86,7 @@ void dump(const char *text, unsigned int num, unsigned char *ptr, size_t size,
break;
}
fprintf(stderr, "%c",
- (ptr[i + c] >= 0x20) && (ptr[i + c]<0x80)?ptr[i + c]:'.');
+ (ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
ptr[i + c + 2] == 0x0A) {
docs/examples/http2-serverpush.c+3 -3
@@ -52,7 +52,7 @@ void dump(const char *text, unsigned char *ptr, size_t size,
fprintf(stderr, "%s, %lu bytes (0x%lx)\n",
text, (unsigned long)size, (unsigned long)size);
- for(i = 0; i<size; i += width) {
+ for(i = 0; i < size; i += width) {
fprintf(stderr, "%4.4lx: ", (unsigned long)i);
@@ -73,7 +73,7 @@ void dump(const char *text, unsigned char *ptr, size_t size,
break;
}
fprintf(stderr, "%c",
- (ptr[i + c] >= 0x20) && (ptr[i + c]<0x80)?ptr[i + c]:'.');
+ (ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
ptr[i + c + 2] == 0x0A) {
@@ -188,7 +188,7 @@ static int server_push_callback(CURL *parent,
fprintf(stderr, "**** push callback approves stream %u, got %lu headers!\n",
count, (unsigned long)num_headers);
- for(i = 0; i<num_headers; i++) {
+ for(i = 0; i < num_headers; i++) {
headp = curl_pushheader_bynum(headers, i);
fprintf(stderr, "**** header %lu: %s\n", (unsigned long)i, headp);
}
docs/examples/http2-upload.c+4 -4
@@ -93,7 +93,7 @@ void dump(const char *text, int num, unsigned char *ptr, size_t size,
fprintf(stderr, "%d %s, %lu bytes (0x%lx)\n",
num, text, (unsigned long)size, (unsigned long)size);
- for(i = 0; i<size; i += width) {
+ for(i = 0; i < size; i += width) {
fprintf(stderr, "%4.4lx: ", (unsigned long)i);
@@ -114,7 +114,7 @@ void dump(const char *text, int num, unsigned char *ptr, size_t size,
break;
}
fprintf(stderr, "%c",
- (ptr[i + c] >= 0x20) && (ptr[i + c]<0x80)?ptr[i + c]:'.');
+ (ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
ptr[i + c + 2] == 0x0A) {
@@ -290,7 +290,7 @@ int main(int argc, char **argv)
/* init a multi stack */
multi_handle = curl_multi_init();
- for(i = 0; i<num_transfers; i++) {
+ for(i = 0; i < num_transfers; i++) {
setup(&trans[i], i, filename);
/* add the individual transfer */
@@ -316,7 +316,7 @@ int main(int argc, char **argv)
curl_multi_cleanup(multi_handle);
- for(i = 0; i<num_transfers; i++) {
+ for(i = 0; i < num_transfers; i++) {
curl_multi_remove_handle(multi_handle, trans[i].hnd);
curl_easy_cleanup(trans[i].hnd);
}
docs/examples/multi-app.c+4 -4
@@ -53,7 +53,7 @@ int main(void)
int msgs_left; /* how many messages are left */
/* Allocate one CURL handle per transfer */
- for(i = 0; i<HANDLECOUNT; i++)
+ for(i = 0; i < HANDLECOUNT; i++)
handles[i] = curl_easy_init();
/* set the options (I left out a few, you get the point anyway) */
@@ -66,7 +66,7 @@ int main(void)
multi_handle = curl_multi_init();
/* add the individual transfers */
- for(i = 0; i<HANDLECOUNT; i++)
+ for(i = 0; i < HANDLECOUNT; i++)
curl_multi_add_handle(multi_handle, handles[i]);
while(still_running) {
@@ -86,7 +86,7 @@ int main(void)
int idx;
/* Find out which handle this message is about */
- for(idx = 0; idx<HANDLECOUNT; idx++) {
+ for(idx = 0; idx < HANDLECOUNT; idx++) {
int found = (msg->easy_handle == handles[idx]);
if(found)
break;
@@ -104,7 +104,7 @@ int main(void)
}
/* remove the transfers and cleanup the handles */
- for(i = 0; i<HANDLECOUNT; i++) {
+ for(i = 0; i < HANDLECOUNT; i++) {
curl_multi_remove_handle(multi_handle, handles[i]);
curl_easy_cleanup(handles[i]);
}
docs/examples/multi-debugcallback.c+2 -2
@@ -49,7 +49,7 @@ static void dump(const char *text, FILE *stream, unsigned char *ptr,
fprintf(stream, "%s, %10.10lu bytes (0x%8.8lx)\n",
text, (unsigned long)size, (unsigned long)size);
- for(i = 0; i<size; i += width) {
+ for(i = 0; i < size; i += width) {
fprintf(stream, "%4.4lx: ", (unsigned long)i);
@@ -70,7 +70,7 @@ static void dump(const char *text, FILE *stream, unsigned char *ptr,
break;
}
fprintf(stream, "%c",
- (ptr[i + c] >= 0x20) && (ptr[i + c]<0x80)?ptr[i + c]:'.');
+ (ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
ptr[i + c + 2] == 0x0A) {
docs/examples/multi-legacy.c+4 -4
@@ -59,7 +59,7 @@ int main(void)
int msgs_left; /* how many messages are left */
/* Allocate one CURL handle per transfer */
- for(i = 0; i<HANDLECOUNT; i++)
+ for(i = 0; i < HANDLECOUNT; i++)
handles[i] = curl_easy_init();
/* set the options (I left out a few, you get the point anyway) */
@@ -72,7 +72,7 @@ int main(void)
multi_handle = curl_multi_init();
/* add the individual transfers */
- for(i = 0; i<HANDLECOUNT; i++)
+ for(i = 0; i < HANDLECOUNT; i++)
curl_multi_add_handle(multi_handle, handles[i]);
/* we start some action by calling perform right away */
@@ -155,7 +155,7 @@ int main(void)
int idx;
/* Find out which handle this message is about */
- for(idx = 0; idx<HANDLECOUNT; idx++) {
+ for(idx = 0; idx < HANDLECOUNT; idx++) {
int found = (msg->easy_handle == handles[idx]);
if(found)
break;
@@ -175,7 +175,7 @@ int main(void)
curl_multi_cleanup(multi_handle);
/* Free the CURL handles */
- for(i = 0; i<HANDLECOUNT; i++)
+ for(i = 0; i < HANDLECOUNT; i++)
curl_easy_cleanup(handles[i]);
return 0;
docs/examples/multithread.c+2 -2
@@ -75,7 +75,7 @@ int main(int argc, char **argv)
/* Must initialize libcurl before any threads are started */
curl_global_init(CURL_GLOBAL_ALL);
- for(i = 0; i< NUMT; i++) {
+ for(i = 0; i < NUMT; i++) {
int error = pthread_create(&tid[i],
NULL, /* default attributes please */
pull_one_url,
@@ -87,7 +87,7 @@ int main(int argc, char **argv)
}
/* now wait for all threads to terminate */
- for(i = 0; i< NUMT; i++) {
+ for(i = 0; i < NUMT; i++) {
pthread_join(tid[i], NULL);
fprintf(stderr, "Thread %d terminated\n", i);
}
docs/examples/synctime.c+2 -2
@@ -165,7 +165,7 @@ size_t SyncTime_CURL_WriteHeader(void *ptr, size_t size, size_t nmemb,
if(RetVal == 7) {
int i;
SYSTime.wMilliseconds = 500; /* adjust to midpoint, 0.5 sec */
- for(i = 0; i<12; i++) {
+ for(i = 0; i < 12; i++) {
if(strcmp(MthStr[i], TmpStr2) == 0) {
SYSTime.wMonth = i + 1;
break;
@@ -250,7 +250,7 @@ int conf_init(conf_t *conf)
int i;
*conf->http_proxy = 0;
- for(i = 0; i<MAX_STRING1; i++)
+ for(i = 0; i < MAX_STRING1; i++)
conf->proxy_user[i] = 0; /* Clean up password from memory */
*conf->timeserver = 0;
return 1;
docs/examples/threaded-ssl.c+2 -2
@@ -78,7 +78,7 @@ int main(int argc, char **argv)
/* Must initialize libcurl before any threads are started */
curl_global_init(CURL_GLOBAL_ALL);
- for(i = 0; i< NUMT; i++) {
+ for(i = 0; i < NUMT; i++) {
int error = pthread_create(&tid[i],
NULL, /* default attributes please */
pull_one_url,
@@ -90,7 +90,7 @@ int main(int argc, char **argv)
}
/* now wait for all threads to terminate */
- for(i = 0; i< NUMT; i++) {
+ for(i = 0; i < NUMT; i++) {
pthread_join(tid[i], NULL);
fprintf(stderr, "Thread %d terminated\n", i);
}
lib/asyn-ares.c+5 -5
@@ -366,10 +366,10 @@ static int waitperform(struct Curl_easy *data, timediff_t timeout_ms)
/* move through the descriptors and ask for processing on them */
for(i = 0; i < num; i++)
ares_process_fd((ares_channel)data->state.async.resolver,
- (pfd[i].revents & (POLLRDNORM|POLLIN))?
- pfd[i].fd:ARES_SOCKET_BAD,
- (pfd[i].revents & (POLLWRNORM|POLLOUT))?
- pfd[i].fd:ARES_SOCKET_BAD);
+ (pfd[i].revents & (POLLRDNORM|POLLIN)) ?
+ pfd[i].fd : ARES_SOCKET_BAD,
+ (pfd[i].revents & (POLLWRNORM|POLLOUT)) ?
+ pfd[i].fd : ARES_SOCKET_BAD);
}
return nfds;
}
@@ -801,7 +801,7 @@ struct Curl_addrinfo *Curl_resolver_getaddrinfo(struct Curl_easy *data,
}
#endif /* CURLRES_IPV6 */
hints.ai_family = pf;
- hints.ai_socktype = (data->conn->transport == TRNSPRT_TCP)?
+ hints.ai_socktype = (data->conn->transport == TRNSPRT_TCP) ?
SOCK_STREAM : SOCK_DGRAM;
/* Since the service is a numerical one, set the hint flags
* accordingly to save a call to getservbyname in inside C-Ares
lib/asyn-thread.c+1 -1
@@ -728,7 +728,7 @@ struct Curl_addrinfo *Curl_resolver_getaddrinfo(struct Curl_easy *data,
memset(&hints, 0, sizeof(hints));
hints.ai_family = pf;
- hints.ai_socktype = (data->conn->transport == TRNSPRT_TCP)?
+ hints.ai_socktype = (data->conn->transport == TRNSPRT_TCP) ?
SOCK_STREAM : SOCK_DGRAM;
reslv->start = Curl_now();
lib/bufq.c+3 -3
@@ -484,7 +484,7 @@ CURLcode Curl_bufq_cwrite(struct bufq *q,
ssize_t n;
CURLcode result;
n = Curl_bufq_write(q, (const unsigned char *)buf, len, &result);
- *pnwritten = (n < 0)? 0 : (size_t)n;
+ *pnwritten = (n < 0) ? 0 : (size_t)n;
return result;
}
@@ -494,7 +494,7 @@ CURLcode Curl_bufq_unwrite(struct bufq *q, size_t len)
len -= chunk_unwrite(q->head, len);
prune_tail(q);
}
- return len? CURLE_AGAIN : CURLE_OK;
+ return len ? CURLE_AGAIN : CURLE_OK;
}
ssize_t Curl_bufq_read(struct bufq *q, unsigned char *buf, size_t len,
@@ -526,7 +526,7 @@ CURLcode Curl_bufq_cread(struct bufq *q, char *buf, size_t len,
ssize_t n;
CURLcode result;
n = Curl_bufq_read(q, (unsigned char *)buf, len, &result);
- *pnread = (n < 0)? 0 : (size_t)n;
+ *pnread = (n < 0) ? 0 : (size_t)n;
return result;
}
lib/c-hyper.c+2 -2
@@ -274,7 +274,7 @@ static CURLcode status_line(struct Curl_easy *data,
/* We need to set 'httpcodeq' for functions that check the response code in
a single place. */
data->req.httpcode = http_status;
- data->req.httpversion = http_version == HYPER_HTTP_VERSION_1_1? 11 :
+ data->req.httpversion = http_version == HYPER_HTTP_VERSION_1_1 ? 11 :
(http_version == HYPER_HTTP_VERSION_2 ? 20 : 10);
if(data->state.hconnect)
/* CONNECT */
@@ -481,7 +481,7 @@ CURLcode Curl_hyper_stream(struct Curl_easy *data,
goto out;
k->deductheadercount =
- (100 <= http_status && 199 >= http_status)?k->headerbytecount:0;
+ (100 <= http_status && 199 >= http_status) ? k->headerbytecount : 0;
#ifdef USE_WEBSOCKETS
if(k->upgr101 == UPGR101_WS) {
if(http_status == 101) {
lib/cf-h1-proxy.c+2 -2
@@ -547,8 +547,8 @@ static CURLcode CONNECT_host(struct Curl_cfilter *cf,
if(result)
return result;
- authority = aprintf("%s%s%s:%d", ipv6_ip?"[":"", hostname, ipv6_ip?"]":"",
- port);
+ authority = aprintf("%s%s%s:%d", ipv6_ip ? "[":"", hostname,
+ ipv6_ip ? "]" : "", port);
if(!authority)
return CURLE_OUT_OF_MEMORY;
lib/cf-h2-proxy.c+16 -17
@@ -98,7 +98,8 @@ static CURLcode tunnel_stream_init(struct Curl_cfilter *cf,
return result;
ts->authority = /* host:port with IPv6 support */
- aprintf("%s%s%s:%d", ipv6_ip?"[":"", hostname, ipv6_ip?"]":"", port);
+ aprintf("%s%s%s:%d", ipv6_ip ? "[":"", hostname,
+ ipv6_ip ? "]" : "", port);
if(!ts->authority)
return CURLE_OUT_OF_MEMORY;
@@ -429,7 +430,7 @@ static CURLcode proxy_h2_nw_out_flush(struct Curl_cfilter *cf,
return result;
}
CURL_TRC_CF(data, cf, "[0] nw send buffer flushed");
- return Curl_bufq_is_empty(&ctx->outbufq)? CURLE_OK: CURLE_AGAIN;
+ return Curl_bufq_is_empty(&ctx->outbufq) ? CURLE_OK : CURLE_AGAIN;
}
/*
@@ -604,29 +605,27 @@ static int proxy_h2_fr_print(const nghttp2_frame *frame,
return msnprintf(buffer, blen,
"FRAME[SETTINGS, len=%d]", (int)frame->hd.length);
}
- case NGHTTP2_PUSH_PROMISE: {
+ case NGHTTP2_PUSH_PROMISE:
return msnprintf(buffer, blen,
"FRAME[PUSH_PROMISE, len=%d, hend=%d]",
(int)frame->hd.length,
!!(frame->hd.flags & NGHTTP2_FLAG_END_HEADERS));
- }
- case NGHTTP2_PING: {
+ case NGHTTP2_PING:
return msnprintf(buffer, blen,
"FRAME[PING, len=%d, ack=%d]",
(int)frame->hd.length,
- frame->hd.flags&NGHTTP2_FLAG_ACK);
- }
+ frame->hd.flags & NGHTTP2_FLAG_ACK);
case NGHTTP2_GOAWAY: {
char scratch[128];
size_t s_len = sizeof(scratch)/sizeof(scratch[0]);
- size_t len = (frame->goaway.opaque_data_len < s_len)?
- frame->goaway.opaque_data_len : s_len-1;
- if(len)
- memcpy(scratch, frame->goaway.opaque_data, len);
- scratch[len] = '\0';
- return msnprintf(buffer, blen, "FRAME[GOAWAY, error=%d, reason='%s', "
- "last_stream=%d]", frame->goaway.error_code,
- scratch, frame->goaway.last_stream_id);
+ size_t len = (frame->goaway.opaque_data_len < s_len) ?
+ frame->goaway.opaque_data_len : s_len-1;
+ if(len)
+ memcpy(scratch, frame->goaway.opaque_data, len);
+ scratch[len] = '\0';
+ return msnprintf(buffer, blen, "FRAME[GOAWAY, error=%d, reason='%s', "
+ "last_stream=%d]", frame->goaway.error_code,
+ scratch, frame->goaway.last_stream_id);
}
case NGHTTP2_WINDOW_UPDATE: {
return msnprintf(buffer, blen,
@@ -1220,7 +1219,7 @@ static bool cf_h2_proxy_data_pending(struct Curl_cfilter *cf,
(ctx && ctx->tunnel.state == H2_TUNNEL_ESTABLISHED &&
!Curl_bufq_is_empty(&ctx->tunnel.recvbuf)))
return TRUE;
- return cf->next? cf->next->cft->has_data_pending(cf->next, data) : FALSE;
+ return cf->next ? cf->next->cft->has_data_pending(cf->next, data) : FALSE;
}
static void cf_h2_proxy_adjust_pollset(struct Curl_cfilter *cf,
@@ -1586,7 +1585,7 @@ static CURLcode cf_h2_proxy_query(struct Curl_cfilter *cf,
default:
break;
}
- return cf->next?
+ return cf->next ?
cf->next->cft->query(cf->next, data, query, pres1, pres2) :
CURLE_UNKNOWN_OPTION;
}
lib/cf-haproxy.c+1 -1
@@ -93,7 +93,7 @@ static CURLcode cf_haproxy_date_out_set(struct Curl_cfilter*cf,
client_ip = ipquad.local_ip;
result = Curl_dyn_addf(&ctx->data_out, "PROXY %s %s %s %i %i\r\n",
- is_ipv6? "TCP6" : "TCP4",
+ is_ipv6 ? "TCP6" : "TCP4",
client_ip, ipquad.remote_ip,
ipquad.local_port, ipquad.remote_port);
lib/cf-https-connect.c+6 -6
@@ -275,7 +275,7 @@ static CURLcode cf_hc_connect(struct Curl_cfilter *cf,
}
else if(ctx->h21_baller.enabled)
cf_hc_baller_init(&ctx->h21_baller, cf, data, "h21",
- cf->conn->transport);
+ cf->conn->transport);
ctx->state = CF_HC_CONNECT;
FALLTHROUGH();
@@ -306,8 +306,8 @@ static CURLcode cf_hc_connect(struct Curl_cfilter *cf,
(!ctx->h21_baller.enabled || ctx->h21_baller.result)) {
/* both failed or disabled. we give up */
CURL_TRC_CF(data, cf, "connect, all failed");
- result = ctx->result = ctx->h3_baller.enabled?
- ctx->h3_baller.result : ctx->h21_baller.result;
+ result = ctx->result = ctx->h3_baller.enabled ?
+ ctx->h3_baller.result : ctx->h21_baller.result;
ctx->state = CF_HC_FAILURE;
goto out;
}
@@ -420,13 +420,13 @@ static struct curltime cf_get_max_baller_time(struct Curl_cfilter *cf,
memset(&tmax, 0, sizeof(tmax));
memset(&t, 0, sizeof(t));
- cfb = ctx->h21_baller.enabled? ctx->h21_baller.cf : NULL;
+ cfb = ctx->h21_baller.enabled ? ctx->h21_baller.cf : NULL;
if(cfb && !cfb->cft->query(cfb, data, query, NULL, &t)) {
if((t.tv_sec || t.tv_usec) && Curl_timediff_us(t, tmax) > 0)
tmax = t;
}
memset(&t, 0, sizeof(t));
- cfb = ctx->h3_baller.enabled? ctx->h3_baller.cf : NULL;
+ cfb = ctx->h3_baller.enabled ? ctx->h3_baller.cf : NULL;
if(cfb && !cfb->cft->query(cfb, data, query, NULL, &t)) {
if((t.tv_sec || t.tv_usec) && Curl_timediff_us(t, tmax) > 0)
tmax = t;
@@ -464,7 +464,7 @@ static CURLcode cf_hc_query(struct Curl_cfilter *cf,
break;
}
}
- return cf->next?
+ return cf->next ?
cf->next->cft->query(cf->next, data, query, pres1, pres2) :
CURLE_UNKNOWN_OPTION;
}
lib/cf-socket.c+10 -10
@@ -177,7 +177,7 @@ static void
tcpkeepalive(struct Curl_easy *data,
curl_socket_t sockfd)
{
- int optval = data->set.tcp_keepalive?1:0;
+ int optval = data->set.tcp_keepalive ? 1 : 0;
/* only set IDLE and INTVL if setting KEEPALIVE is successful */
if(setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE,
@@ -603,7 +603,7 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn,
memset(&sa, 0, sizeof(struct Curl_sockaddr_storage));
- if(iface && (strlen(iface)<255) ) {
+ if(iface && (strlen(iface) < 255) ) {
char myhost[256] = "";
int done = 0; /* -1 for error, 1 for address found */
if2ip_result_t if2ip_result = IF2IP_NOT_FOUND;
@@ -1642,7 +1642,7 @@ static void cf_socket_active(struct Curl_cfilter *cf, struct Curl_easy *data)
cf->conn->primary = ctx->ip;
cf->conn->remote_addr = &ctx->addr;
#ifdef USE_IPV6
- cf->conn->bits.ipv6 = (ctx->addr.family == AF_INET6)? TRUE : FALSE;
+ cf->conn->bits.ipv6 = (ctx->addr.family == AF_INET6) ? TRUE : FALSE;
#endif
}
else {
@@ -1725,7 +1725,7 @@ static CURLcode cf_socket_query(struct Curl_cfilter *cf,
case CF_QUERY_CONNECT_REPLY_MS:
if(ctx->got_first_byte) {
timediff_t ms = Curl_timediff(ctx->first_byte_at, ctx->started_at);
- *pres1 = (ms < INT_MAX)? (int)ms : INT_MAX;
+ *pres1 = (ms < INT_MAX) ? (int)ms : INT_MAX;
}
else
*pres1 = -1;
@@ -1750,7 +1750,7 @@ static CURLcode cf_socket_query(struct Curl_cfilter *cf,
}
case CF_QUERY_IP_INFO:
#ifdef USE_IPV6
- *pres1 = (ctx->addr.family == AF_INET6)? TRUE : FALSE;
+ *pres1 = (ctx->addr.family == AF_INET6) ? TRUE : FALSE;
#else
*pres1 = FALSE;
#endif
@@ -1759,7 +1759,7 @@ static CURLcode cf_socket_query(struct Curl_cfilter *cf,
default:
break;
}
- return cf->next?
+ return cf->next ?
cf->next->cft->query(cf->next, data, query, pres1, pres2) :
CURLE_UNKNOWN_OPTION;
}
@@ -1806,7 +1806,7 @@ CURLcode Curl_cf_tcp_create(struct Curl_cfilter **pcf,
result = Curl_cf_create(&cf, &Curl_cft_tcp, ctx);
out:
- *pcf = (!result)? cf : NULL;
+ *pcf = (!result) ? cf : NULL;
if(result) {
Curl_safefree(cf);
Curl_safefree(ctx);
@@ -1836,7 +1836,7 @@ static CURLcode cf_udp_setup_quic(struct Curl_cfilter *cf,
set_local_ip(cf, data);
CURL_TRC_CF(data, cf, "%s socket %" FMT_SOCKET_T
" connected: [%s:%d] -> [%s:%d]",
- (ctx->transport == TRNSPRT_QUIC)? "QUIC" : "UDP",
+ (ctx->transport == TRNSPRT_QUIC) ? "QUIC" : "UDP",
ctx->sock, ctx->ip.local_ip, ctx->ip.local_port,
ctx->ip.remote_ip, ctx->ip.remote_port);
@@ -1955,7 +1955,7 @@ CURLcode Curl_cf_udp_create(struct Curl_cfilter **pcf,
result = Curl_cf_create(&cf, &Curl_cft_udp, ctx);
out:
- *pcf = (!result)? cf : NULL;
+ *pcf = (!result) ? cf : NULL;
if(result) {
Curl_safefree(cf);
Curl_safefree(ctx);
@@ -2007,7 +2007,7 @@ CURLcode Curl_cf_unix_create(struct Curl_cfilter **pcf,
result = Curl_cf_create(&cf, &Curl_cft_unix, ctx);
out:
- *pcf = (!result)? cf : NULL;
+ *pcf = (!result) ? cf : NULL;
if(result) {
Curl_safefree(cf);
Curl_safefree(ctx);
lib/cfilters.c+28 -26
@@ -96,7 +96,7 @@ void Curl_cf_def_adjust_pollset(struct Curl_cfilter *cf,
bool Curl_cf_def_data_pending(struct Curl_cfilter *cf,
const struct Curl_easy *data)
{
- return cf->next?
+ return cf->next ?
cf->next->cft->has_data_pending(cf->next, data) : FALSE;
}
@@ -104,7 +104,7 @@ ssize_t Curl_cf_def_send(struct Curl_cfilter *cf, struct Curl_easy *data,
const void *buf, size_t len, bool eos,
CURLcode *err)
{
- return cf->next?
+ return cf->next ?
cf->next->cft->do_send(cf->next, data, buf, len, eos, err) :
CURLE_RECV_ERROR;
}
@@ -112,7 +112,7 @@ ssize_t Curl_cf_def_send(struct Curl_cfilter *cf, struct Curl_easy *data,
ssize_t Curl_cf_def_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
char *buf, size_t len, CURLcode *err)
{
- return cf->next?
+ return cf->next ?
cf->next->cft->do_recv(cf->next, data, buf, len, err) :
CURLE_SEND_ERROR;
}
@@ -121,7 +121,7 @@ bool Curl_cf_def_conn_is_alive(struct Curl_cfilter *cf,
struct Curl_easy *data,
bool *input_pending)
{
- return cf->next?
+ return cf->next ?
cf->next->cft->is_alive(cf->next, data, input_pending) :
FALSE; /* pessimistic in absence of data */
}
@@ -129,7 +129,7 @@ bool Curl_cf_def_conn_is_alive(struct Curl_cfilter *cf,
CURLcode Curl_cf_def_conn_keep_alive(struct Curl_cfilter *cf,
struct Curl_easy *data)
{
- return cf->next?
+ return cf->next ?
cf->next->cft->keep_alive(cf->next, data) :
CURLE_OK;
}
@@ -138,7 +138,7 @@ CURLcode Curl_cf_def_query(struct Curl_cfilter *cf,
struct Curl_easy *data,
int query, int *pres1, void *pres2)
{
- return cf->next?
+ return cf->next ?
cf->next->cft->query(cf->next, data, query, pres1, pres2) :
CURLE_UNKNOWN_OPTION;
}
@@ -204,7 +204,7 @@ CURLcode Curl_conn_shutdown(struct Curl_easy *data, int sockindex, bool *done)
now = Curl_now();
if(!Curl_shutdown_started(data, sockindex)) {
DEBUGF(infof(data, "shutdown start on%s connection",
- sockindex? " secondary" : ""));
+ sockindex ? " secondary" : ""));
Curl_shutdown_start(data, sockindex, &now);
}
else {
@@ -483,12 +483,12 @@ bool Curl_conn_cf_is_ssl(struct Curl_cfilter *cf)
bool Curl_conn_is_ssl(struct connectdata *conn, int sockindex)
{
- return conn? Curl_conn_cf_is_ssl(conn->cfilter[sockindex]) : FALSE;
+ return conn ? Curl_conn_cf_is_ssl(conn->cfilter[sockindex]) : FALSE;
}
bool Curl_conn_is_multiplex(struct connectdata *conn, int sockindex)
{
- struct Curl_cfilter *cf = conn? conn->cfilter[sockindex] : NULL;
+ struct Curl_cfilter *cf = conn ? conn->cfilter[sockindex] : NULL;
for(; cf; cf = cf->next) {
if(cf->cft->flags & CF_TYPE_MULTIPLEX)
@@ -523,9 +523,9 @@ bool Curl_conn_cf_needs_flush(struct Curl_cfilter *cf,
{
CURLcode result;
int pending = FALSE;
- result = cf? cf->cft->query(cf, data, CF_QUERY_NEED_FLUSH,
- &pending, NULL) : CURLE_UNKNOWN_OPTION;
- return (result || pending == FALSE)? FALSE : TRUE;
+ result = cf ? cf->cft->query(cf, data, CF_QUERY_NEED_FLUSH,
+ &pending, NULL) : CURLE_UNKNOWN_OPTION;
+ return (result || pending == FALSE) ? FALSE : TRUE;
}
bool Curl_conn_needs_flush(struct Curl_easy *data, int sockindex)
@@ -672,13 +672,13 @@ curl_socket_t Curl_conn_get_socket(struct Curl_easy *data, int sockindex)
{
struct Curl_cfilter *cf;
- cf = data->conn? data->conn->cfilter[sockindex] : NULL;
+ cf = data->conn ? data->conn->cfilter[sockindex] : NULL;
/* if the top filter has not connected, ask it (and its sub-filters)
* for the socket. Otherwise conn->sock[sockindex] should have it.
*/
if(cf && !cf->connected)
return Curl_conn_cf_get_socket(cf, data);
- return data->conn? data->conn->sock[sockindex] : CURL_SOCKET_BAD;
+ return data->conn ? data->conn->sock[sockindex] : CURL_SOCKET_BAD;
}
void Curl_conn_forget_socket(struct Curl_easy *data, int sockindex)
@@ -807,7 +807,7 @@ CURLcode Curl_conn_keep_alive(struct Curl_easy *data,
int sockindex)
{
struct Curl_cfilter *cf = conn->cfilter[sockindex];
- return cf? cf->cft->keep_alive(cf, data) : CURLE_OK;
+ return cf ? cf->cft->keep_alive(cf, data) : CURLE_OK;
}
size_t Curl_conn_get_max_concurrent(struct Curl_easy *data,
@@ -818,9 +818,9 @@ size_t Curl_conn_get_max_concurrent(struct Curl_easy *data,
int n = 0;
struct Curl_cfilter *cf = conn->cfilter[sockindex];
- result = cf? cf->cft->query(cf, data, CF_QUERY_MAX_CONCURRENT,
- &n, NULL) : CURLE_UNKNOWN_OPTION;
- return (result || n <= 0)? 1 : (size_t)n;
+ result = cf ? cf->cft->query(cf, data, CF_QUERY_MAX_CONCURRENT,
+ &n, NULL) : CURLE_UNKNOWN_OPTION;
+ return (result || n <= 0) ? 1 : (size_t)n;
}
int Curl_conn_get_stream_error(struct Curl_easy *data,
@@ -831,9 +831,9 @@ int Curl_conn_get_stream_error(struct Curl_easy *data,
int n = 0;
struct Curl_cfilter *cf = conn->cfilter[sockindex];
- result = cf? cf->cft->query(cf, data, CF_QUERY_STREAM_ERROR,
- &n, NULL) : CURLE_UNKNOWN_OPTION;
- return (result || n < 0)? 0 : n;
+ result = cf ? cf->cft->query(cf, data, CF_QUERY_STREAM_ERROR,
+ &n, NULL) : CURLE_UNKNOWN_OPTION;
+ return (result || n < 0) ? 0 : n;
}
int Curl_conn_sockindex(struct Curl_easy *data, curl_socket_t sockfd)
@@ -854,7 +854,7 @@ CURLcode Curl_conn_recv(struct Curl_easy *data, int sockindex,
nread = data->conn->recv[sockindex](data, sockindex, buf, blen, &result);
DEBUGASSERT(nread >= 0 || result);
DEBUGASSERT(nread < 0 || !result);
- *n = (nread >= 0)? (size_t)nread : 0;
+ *n = (nread >= 0) ? (size_t)nread : 0;
return result;
}
@@ -889,7 +889,7 @@ CURLcode Curl_conn_send(struct Curl_easy *data, int sockindex,
nwritten = conn->send[sockindex](data, sockindex, buf, write_len, eos,
&result);
DEBUGASSERT((nwritten >= 0) || result);
- *pnwritten = (nwritten < 0)? 0 : (size_t)nwritten;
+ *pnwritten = (nwritten < 0) ? 0 : (size_t)nwritten;
return result;
}
@@ -899,7 +899,7 @@ void Curl_pollset_reset(struct Curl_easy *data,
size_t i;
(void)data;
memset(ps, 0, sizeof(*ps));
- for(i = 0; i< MAX_SOCKSPEREASYHANDLE; i++)
+ for(i = 0; i < MAX_SOCKSPEREASYHANDLE; i++)
ps->sockets[i] = CURL_SOCKET_BAD;
}
@@ -961,8 +961,10 @@ void Curl_pollset_set(struct Curl_easy *data,
bool do_in, bool do_out)
{
Curl_pollset_change(data, ps, sock,
- (do_in?CURL_POLL_IN:0)|(do_out?CURL_POLL_OUT:0),
- (!do_in?CURL_POLL_IN:0)|(!do_out?CURL_POLL_OUT:0));
+ (do_in ? CURL_POLL_IN : 0)|
+ (do_out ? CURL_POLL_OUT : 0),
+ (!do_in ? CURL_POLL_IN : 0)|
+ (!do_out ? CURL_POLL_OUT : 0));
}
static void ps_add(struct Curl_easy *data, struct easy_pollset *ps,
lib/conncache.c+3 -3
@@ -491,7 +491,7 @@ bool Curl_cpool_conn_now_idle(struct Curl_easy *data,
struct connectdata *conn)
{
unsigned int maxconnects = !data->multi->maxconnects ?
- data->multi->num_easy * 4: data->multi->maxconnects;
+ data->multi->num_easy * 4 : data->multi->maxconnects;
struct connectdata *oldest_idle = NULL;
struct cpool *cpool = cpool_get_instance(data);
bool kept = TRUE;
@@ -820,7 +820,7 @@ void Curl_cpool_disconnect(struct Curl_easy *data,
if(data->multi) {
/* Add it to the multi's cpool for shutdown handling */
infof(data, "%s connection #%" FMT_OFF_T,
- aborted? "closing" : "shutting down", conn->connection_id);
+ aborted ? "closing" : "shutting down", conn->connection_id);
cpool_discard_conn(&data->multi->cpool, data, conn, aborted);
}
else {
@@ -1180,7 +1180,7 @@ static void cpool_shutdown_all(struct cpool *cpool,
timespent = Curl_timediff(Curl_now(), started);
if(timespent >= (timediff_t)timeout_ms) {
DEBUGF(infof(data, "cpool shutdown %s",
- (timeout_ms > 0)? "timeout" : "best effort done"));
+ (timeout_ms > 0) ? "timeout" : "best effort done"));
break;
}
lib/connect.c+6 -6
@@ -139,7 +139,7 @@ timediff_t Curl_timeleft(struct Curl_easy *data,
return ctimeleft_ms; /* no general timeout, this is it */
}
/* return minimal time left or max amount already expired */
- return (ctimeleft_ms < timeleft_ms)? ctimeleft_ms : timeleft_ms;
+ return (ctimeleft_ms < timeleft_ms) ? ctimeleft_ms : timeleft_ms;
}
void Curl_shutdown_start(struct Curl_easy *data, int sockindex,
@@ -172,7 +172,7 @@ timediff_t Curl_shutdown_timeleft(struct connectdata *conn, int sockindex,
}
left_ms = conn->shutdown.timeout_ms -
Curl_timediff(*nowp, conn->shutdown.start[sockindex]);
- return left_ms? left_ms : -1;
+ return left_ms ? left_ms : -1;
}
timediff_t Curl_conn_shutdown_timeleft(struct connectdata *conn,
@@ -414,9 +414,9 @@ static CURLcode eyeballer_new(struct eyeballer **pballer,
if(!baller)
return CURLE_OUT_OF_MEMORY;
- baller->name = ((ai_family == AF_INET)? "ipv4" : (
+ baller->name = ((ai_family == AF_INET) ? "ipv4" : (
#ifdef USE_IPV6
- (ai_family == AF_INET6)? "ipv6" :
+ (ai_family == AF_INET6) ? "ipv6" :
#endif
"ip"));
baller->cf_create = cf_create;
@@ -424,7 +424,7 @@ static CURLcode eyeballer_new(struct eyeballer **pballer,
baller->ai_family = ai_family;
baller->primary = primary;
baller->delay_ms = delay_ms;
- baller->timeoutms = addr_next_match(baller->addr, baller->ai_family)?
+ baller->timeoutms = addr_next_match(baller->addr, baller->ai_family) ?
USETIME(timeout_ms) : timeout_ms;
baller->timeout_id = timeout_id;
baller->result = CURLE_COULDNT_CONNECT;
@@ -1089,7 +1089,7 @@ static CURLcode cf_he_query(struct Curl_cfilter *cf,
}
}
- return cf->next?
+ return cf->next ?
cf->next->cft->query(cf->next, data, query, pres1, pres2) :
CURLE_UNKNOWN_OPTION;
}
lib/content_encoding.c+6 -6
@@ -154,7 +154,7 @@ static CURLcode process_trailer(struct Curl_easy *data,
{
z_stream *z = &zp->z;
CURLcode result = CURLE_OK;
- uInt len = z->avail_in < zp->trailerlen? z->avail_in: zp->trailerlen;
+ uInt len = z->avail_in < zp->trailerlen ? z->avail_in : zp->trailerlen;
/* Consume expected trailer bytes. Terminate stream if exhausted.
Issue an error if unexpected bytes follow. */
@@ -654,7 +654,7 @@ static CURLcode brotli_do_init(struct Curl_easy *data,
(void) data;
bp->br = BrotliDecoderCreateInstance(NULL, NULL, NULL);
- return bp->br? CURLE_OK: CURLE_OUT_OF_MEMORY;
+ return bp->br ? CURLE_OK : CURLE_OUT_OF_MEMORY;
}
static CURLcode brotli_do_write(struct Curl_easy *data,
@@ -971,8 +971,8 @@ static const struct Curl_cwtype *find_unencode_writer(const char *name,
CURLcode Curl_build_unencoding_stack(struct Curl_easy *data,
const char *enclist, int is_transfer)
{
- Curl_cwriter_phase phase = is_transfer?
- CURL_CW_TRANSFER_DECODE:CURL_CW_CONTENT_DECODE;
+ Curl_cwriter_phase phase = is_transfer ?
+ CURL_CW_TRANSFER_DECODE : CURL_CW_CONTENT_DECODE;
CURLcode result;
do {
@@ -995,7 +995,7 @@ CURLcode Curl_build_unencoding_stack(struct Curl_easy *data,
struct Curl_cwriter *writer;
CURL_TRC_WRITE(data, "looking for %s decoder: %.*s",
- is_transfer? "transfer" : "content", (int)namelen, name);
+ is_transfer ? "transfer" : "content", (int)namelen, name);
is_chunked = (is_transfer && (namelen == 7) &&
strncasecompare(name, "chunked", 7));
/* if we skip the decoding in this phase, do not look further.
@@ -1046,7 +1046,7 @@ CURLcode Curl_build_unencoding_stack(struct Curl_easy *data,
result = Curl_cwriter_create(&writer, data, cwt, phase);
CURL_TRC_WRITE(data, "added %s decoder %s -> %d",
- is_transfer? "transfer" : "content", cwt->name, result);
+ is_transfer ? "transfer" : "content", cwt->name, result);
if(result)
return result;
lib/cookie.c+12 -12
@@ -245,7 +245,7 @@ static const char *get_top_domain(const char * const domain, size_t *outlen)
if(outlen)
*outlen = len;
- return first? first: domain;
+ return first ? first : domain;
}
/* Avoid C1001, an "internal error" with MSVC14 */
@@ -730,8 +730,8 @@ Curl_cookie_add(struct Curl_easy *data,
*/
CURLofft offt;
const char *maxage = valuep;
- offt = curlx_strtoofft((*maxage == '\"')?
- &maxage[1]:&maxage[0], NULL, 10,
+ offt = curlx_strtoofft((*maxage == '\"') ?
+ &maxage[1] : &maxage[0], NULL, 10,
&co->expires);
switch(offt) {
case CURL_OFFT_FLOW:
@@ -1171,7 +1171,7 @@ Curl_cookie_add(struct Curl_easy *data,
/* Only show this when NOT reading the cookies from a file */
infof(data, "%s cookie %s=\"%s\" for domain %s, path %s, "
"expire %" FMT_OFF_T,
- replace_old?"Replaced":"Added", co->name, co->value,
+ replace_old ? "Replaced":"Added", co->name, co->value,
co->domain, co->path, co->expires);
if(!replace_old) {
@@ -1471,7 +1471,7 @@ struct Cookie *Curl_cookie_getlist(struct Curl_easy *data,
/* remake the linked list order according to the new order */
mainco = array[0]; /* start here */
- for(i = 0; i<matches-1; i++)
+ for(i = 0; i < matches-1; i++)
array[i]->next = array[i + 1];
array[matches-1]->next = NULL; /* terminate the list */
@@ -1592,19 +1592,19 @@ static char *get_netscape_format(const struct Cookie *co)
"%" FMT_OFF_T "\t" /* expires */
"%s\t" /* name */
"%s", /* value */
- co->httponly?"#HttpOnly_":"",
+ co->httponly ? "#HttpOnly_" : "",
/*
* Make sure all domains are prefixed with a dot if they allow
* tailmatching. This is Mozilla-style.
*/
- (co->tailmatch && co->domain && co->domain[0] != '.')? ".":"",
- co->domain?co->domain:"unknown",
- co->tailmatch?"TRUE":"FALSE",
- co->path?co->path:"/",
- co->secure?"TRUE":"FALSE",
+ (co->tailmatch && co->domain && co->domain[0] != '.') ? "." : "",
+ co->domain ? co->domain : "unknown",
+ co->tailmatch ? "TRUE" : "FALSE",
+ co->path ? co->path : "/",
+ co->secure ? "TRUE" : "FALSE",
co->expires,
co->name,
- co->value?co->value:"");
+ co->value ? co->value : "");
}
/*
lib/curl_fnmatch.c+1 -1
@@ -293,7 +293,7 @@ static int loop(const unsigned char *pattern, const unsigned char *string,
p++;
break;
case '\0':
- return *s? CURL_FNMATCH_NOMATCH: CURL_FNMATCH_MATCH;
+ return *s ? CURL_FNMATCH_NOMATCH : CURL_FNMATCH_MATCH;
case '\\':
if(p[1])
p++;
lib/curl_ntlm_core.c+1 -1
@@ -483,7 +483,7 @@ static void time2filetime(struct ms_filetime *ft, time_t t)
134774 days = 11644473600 seconds = 0x2B6109100 */
r = ft->dwLowDateTime;
ft->dwLowDateTime = (ft->dwLowDateTime + 0xB6109100U) & 0xFFFFFFFF;
- ft->dwHighDateTime += ft->dwLowDateTime < r? 0x03: 0x02;
+ ft->dwHighDateTime += ft->dwLowDateTime < r ? 0x03 : 0x02;
/* Convert to tenths of microseconds. */
ft->dwHighDateTime *= 10000000;
lib/curl_trc.c+1 -1
@@ -399,7 +399,7 @@ static CURLcode trc_opt(const char *config)
CURLcode Curl_trc_opt(const char *config)
{
- CURLcode result = config? trc_opt(config) : CURLE_OK;
+ CURLcode result = config ? trc_opt(config) : CURLE_OK;
#ifdef DEBUGBUILD
/* CURL_DEBUG can override anything */
if(!result) {
lib/cw-out.c+5 -5
@@ -177,8 +177,8 @@ static void cw_get_writefunc(struct Curl_easy *data, cw_out_type otype,
*pmin_write = 0;
break;
case CW_OUT_HDS:
- *pwcb = data->set.fwrite_header? data->set.fwrite_header :
- (data->set.writeheader? data->set.fwrite_func : NULL);
+ *pwcb = data->set.fwrite_header ? data->set.fwrite_header :
+ (data->set.writeheader ? data->set.fwrite_func : NULL);
*pwcb_data = data->set.writeheader;
*pmax_write = 0; /* do not chunk-write headers, write them as they are */
*pmin_write = 0;
@@ -218,12 +218,12 @@ static CURLcode cw_out_ptr_flush(struct cw_out_ctx *ctx,
while(blen && !ctx->paused) {
if(!flush_all && blen < min_write)
break;
- wlen = max_write? CURLMIN(blen, max_write) : blen;
+ wlen = max_write ? CURLMIN(blen, max_write) : blen;
Curl_set_in_callback(data, TRUE);
nwritten = wcb((char *)buf, 1, wlen, wcb_data);
Curl_set_in_callback(data, FALSE);
CURL_TRC_WRITE(data, "cw_out, wrote %zu %s bytes -> %zu",
- wlen, (otype == CW_OUT_BODY)? "body" : "header",
+ wlen, (otype == CW_OUT_BODY) ? "body" : "header",
nwritten);
if(CURL_WRITEFUNC_PAUSE == nwritten) {
if(data->conn && data->conn->handler->flags & PROTOPT_NONETWORK) {
@@ -431,7 +431,7 @@ bool Curl_cw_out_is_paused(struct Curl_easy *data)
return FALSE;
ctx = (struct cw_out_ctx *)cw_out;
- CURL_TRC_WRITE(data, "cw-out is%spaused", ctx->paused? "" : " not");
+ CURL_TRC_WRITE(data, "cw-out is%spaused", ctx->paused ? "" : " not");
return ctx->paused;
}
lib/doh.c+5 -4
@@ -165,7 +165,7 @@ UNITTEST DOHcode doh_req_encode(const char *host,
*dnsp++ = 0; /* append zero-length label for root */
/* There are assigned TYPE codes beyond 255: use range [1..65535] */
- *dnsp++ = (unsigned char)(255 & (dnstype>>8)); /* upper 8 bit TYPE */
+ *dnsp++ = (unsigned char)(255 & (dnstype >> 8)); /* upper 8 bit TYPE */
*dnsp++ = (unsigned char)(255 & dnstype); /* lower 8 bit TYPE */
*dnsp++ = '\0'; /* upper 8 bit CLASS */
@@ -855,7 +855,7 @@ static void doh_show(struct Curl_easy *data,
len = sizeof(buffer) - len;
for(j = 0; j < 16; j += 2) {
size_t l;
- msnprintf(ptr, len, "%s%02x%02x", j?":":"", d->addr[i].ip.v6[j],
+ msnprintf(ptr, len, "%s%02x%02x", j ? ":" : "", d->addr[i].ip.v6[j],
d->addr[i].ip.v6[j + 1]);
l = strlen(ptr);
len -= l;
@@ -1305,7 +1305,7 @@ CURLcode Curl_doh_is_resolved(struct Curl_easy *data,
if(dohp->probe[DOH_SLOT_IPV4].easy_mid < 0 &&
dohp->probe[DOH_SLOT_IPV6].easy_mid < 0) {
failf(data, "Could not DoH-resolve: %s", data->state.async.hostname);
- return CONN_IS_PROXIED(data->conn)?CURLE_COULDNT_RESOLVE_PROXY:
+ return CONN_IS_PROXIED(data->conn) ? CURLE_COULDNT_RESOLVE_PROXY :
CURLE_COULDNT_RESOLVE_HOST;
}
else if(!dohp->pending) {
@@ -1415,7 +1415,8 @@ void Curl_doh_close(struct Curl_easy *data)
doh->probe[slot].easy_mid = -1;
/* should have been called before data is removed from multi handle */
DEBUGASSERT(data->multi);
- probe_data = data->multi? Curl_multi_get_handle(data->multi, mid) : NULL;
+ probe_data = data->multi ? Curl_multi_get_handle(data->multi, mid) :
+ NULL;
if(!probe_data) {
DEBUGF(infof(data, "Curl_doh_close: xfer for mid=%"
FMT_OFF_T " not found!",
lib/dynhds.c+2 -2
@@ -141,7 +141,7 @@ void Curl_dynhds_set_opts(struct dynhds *dynhds, int opts)
struct dynhds_entry *Curl_dynhds_getn(struct dynhds *dynhds, size_t n)
{
DEBUGASSERT(dynhds);
- return (n < dynhds->hds_len)? dynhds->hds[n] : NULL;
+ return (n < dynhds->hds_len) ? dynhds->hds[n] : NULL;
}
struct dynhds_entry *Curl_dynhds_get(struct dynhds *dynhds, const char *name,
@@ -272,7 +272,7 @@ CURLcode Curl_dynhds_h1_add_line(struct dynhds *dynhds,
CURLcode Curl_dynhds_h1_cadd_line(struct dynhds *dynhds, const char *line)
{
- return Curl_dynhds_h1_add_line(dynhds, line, line? strlen(line) : 0);
+ return Curl_dynhds_h1_add_line(dynhds, line, line ? strlen(line) : 0);
}
#ifdef UNITTESTS
lib/easy.c+8 -8
@@ -487,8 +487,8 @@ static int events_socket(struct Curl_easy *easy, /* easy handle */
m->socket.events = socketcb2poll(what);
infof(easy, "socket cb: socket %" FMT_SOCKET_T
" UPDATED as %s%s", s,
- (what&CURL_POLL_IN)?"IN":"",
- (what&CURL_POLL_OUT)?"OUT":"");
+ (what&CURL_POLL_IN) ? "IN" : "",
+ (what&CURL_POLL_OUT) ? "OUT" : "");
}
break;
}
@@ -512,8 +512,8 @@ static int events_socket(struct Curl_easy *easy, /* easy handle */
m->socket.revents = 0;
ev->list = m;
infof(easy, "socket cb: socket %" FMT_SOCKET_T " ADDED as %s%s", s,
- (what&CURL_POLL_IN)?"IN":"",
- (what&CURL_POLL_OUT)?"OUT":"");
+ (what&CURL_POLL_IN) ? "IN" : "",
+ (what&CURL_POLL_OUT) ? "OUT" : "");
}
else
return CURLE_OUT_OF_MEMORY;
@@ -617,7 +617,7 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev)
DEBUGASSERT(data);
/* loop over the monitored sockets to see which ones had activity */
- for(i = 0; i< numfds; i++) {
+ for(i = 0; i < numfds; i++) {
if(fds[i].revents) {
/* socket activity, tell libcurl */
int act = poll2cselect(fds[i].revents); /* convert */
@@ -877,7 +877,7 @@ static CURLcode dupset(struct Curl_easy *dst, struct Curl_easy *src)
memset(dst->set.blobs, 0, BLOB_LAST * sizeof(struct curl_blob *));
/* duplicate all strings */
- for(i = (enum dupstring)0; i< STRING_LASTZEROTERMINATED; i++) {
+ for(i = (enum dupstring)0; i < STRING_LASTZEROTERMINATED; i++) {
result = Curl_setstropt(&dst->set.str[i], src->set.str[i]);
if(result)
return result;
@@ -1127,8 +1127,8 @@ CURLcode curl_easy_pause(struct Curl_easy *data, int action)
/* first switch off both pause bits then set the new pause bits */
newstate = (k->keepon &~ (KEEP_RECV_PAUSE| KEEP_SEND_PAUSE)) |
- ((action & CURLPAUSE_RECV)?KEEP_RECV_PAUSE:0) |
- ((action & CURLPAUSE_SEND)?KEEP_SEND_PAUSE:0);
+ ((action & CURLPAUSE_RECV) ? KEEP_RECV_PAUSE : 0) |
+ ((action & CURLPAUSE_SEND) ? KEEP_SEND_PAUSE : 0);
keep_changed = ((newstate & (KEEP_RECV_PAUSE| KEEP_SEND_PAUSE)) != oldstate);
not_all_paused = (newstate & (KEEP_RECV_PAUSE|KEEP_SEND_PAUSE)) !=
lib/escape.c+3 -3
@@ -63,7 +63,7 @@ char *curl_easy_escape(struct Curl_easy *data, const char *string,
if(!string || (inlength < 0))
return NULL;
- length = (inlength?(size_t)inlength:strlen(string));
+ length = (inlength ? (size_t)inlength : strlen(string));
if(!length)
return strdup("");
@@ -82,7 +82,7 @@ char *curl_easy_escape(struct Curl_easy *data, const char *string,
/* encode it */
const char hex[] = "0123456789ABCDEF";
char out[3]={'%'};
- out[1] = hex[in>>4];
+ out[1] = hex[in >> 4];
out[2] = hex[in & 0xf];
if(Curl_dyn_addn(&d, out, 3))
return NULL;
@@ -223,7 +223,7 @@ void Curl_hexencode(const unsigned char *src, size_t len, /* input length */
while(len-- && (olen >= 3)) {
/* clang-tidy warns on this line without this comment: */
/* NOLINTNEXTLINE(clang-analyzer-core.UndefinedBinaryOperatorResult) */
- *out++ = (unsigned char)hex[(*src & 0xF0)>>4];
+ *out++ = (unsigned char)hex[(*src & 0xF0) >> 4];
*out++ = (unsigned char)hex[*src & 0x0F];
++src;
olen -= 2;
lib/file.c+1 -1
@@ -489,7 +489,7 @@ static CURLcode file_do(struct Curl_easy *data, bool *done)
headerlen =
msnprintf(header, sizeof(header),
"Last-Modified: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n",
- Curl_wkday[tm->tm_wday?tm->tm_wday-1:6],
+ Curl_wkday[tm->tm_wday ? tm->tm_wday-1 : 6],
tm->tm_mday,
Curl_month[tm->tm_mon],
tm->tm_year + 1900,
lib/formdata.c+22 -20
@@ -282,8 +282,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
if(current_form->name)
return_value = CURL_FORMADD_OPTION_TWICE;
else {
- char *name = array_state?
- array_value:va_arg(params, char *);
+ char *name = array_state ?
+ array_value : va_arg(params, char *);
if(name)
current_form->name = name; /* store for the moment */
else
@@ -295,7 +295,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
return_value = CURL_FORMADD_OPTION_TWICE;
else
current_form->namelength =
- array_state?(size_t)array_value:(size_t)va_arg(params, long);
+ array_state ? (size_t)array_value : (size_t)va_arg(params, long);
break;
/*
@@ -309,7 +309,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
return_value = CURL_FORMADD_OPTION_TWICE;
else {
char *value =
- array_state?array_value:va_arg(params, char *);
+ array_state ? array_value : va_arg(params, char *);
if(value)
current_form->value = value; /* store for the moment */
else
@@ -318,13 +318,14 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
break;
case CURLFORM_CONTENTSLENGTH:
current_form->contentslength =
- array_state?(size_t)array_value:(size_t)va_arg(params, long);
+ array_state ? (size_t)array_value : (size_t)va_arg(params, long);
break;
case CURLFORM_CONTENTLEN:
current_form->flags |= CURL_HTTPPOST_LARGE;
current_form->contentslength =
- array_state?(curl_off_t)(size_t)array_value:va_arg(params, curl_off_t);
+ array_state ? (curl_off_t)(size_t)array_value :
+ va_arg(params, curl_off_t);
break;
/* Get contents from a given filename */
@@ -332,8 +333,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
if(current_form->flags & (HTTPPOST_PTRCONTENTS|HTTPPOST_READFILE))
return_value = CURL_FORMADD_OPTION_TWICE;
else {
- const char *filename = array_state?
- array_value:va_arg(params, char *);
+ const char *filename = array_state ?
+ array_value : va_arg(params, char *);
if(filename) {
current_form->value = strdup(filename);
if(!current_form->value)
@@ -351,7 +352,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
/* We upload a file */
case CURLFORM_FILE:
{
- const char *filename = array_state?array_value:
+ const char *filename = array_state ? array_value :
va_arg(params, char *);
if(current_form->value) {
@@ -401,7 +402,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
return_value = CURL_FORMADD_OPTION_TWICE;
else {
char *buffer =
- array_state?array_value:va_arg(params, char *);
+ array_state ? array_value : va_arg(params, char *);
if(buffer) {
current_form->buffer = buffer; /* store for the moment */
current_form->value = buffer; /* make it non-NULL to be accepted
@@ -417,7 +418,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
return_value = CURL_FORMADD_OPTION_TWICE;
else
current_form->bufferlength =
- array_state?(size_t)array_value:(size_t)va_arg(params, long);
+ array_state ? (size_t)array_value : (size_t)va_arg(params, long);
break;
case CURLFORM_STREAM:
@@ -426,7 +427,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
return_value = CURL_FORMADD_OPTION_TWICE;
else {
char *userp =
- array_state?array_value:va_arg(params, char *);
+ array_state ? array_value : va_arg(params, char *);
if(userp) {
current_form->userp = userp;
current_form->value = userp; /* this is not strictly true but we
@@ -442,7 +443,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
case CURLFORM_CONTENTTYPE:
{
const char *contenttype =
- array_state?array_value:va_arg(params, char *);
+ array_state ? array_value : va_arg(params, char *);
if(current_form->contenttype) {
if(current_form->flags & HTTPPOST_FILENAME) {
if(contenttype) {
@@ -485,8 +486,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
{
/* this "cast increases required alignment of target type" but
we consider it OK anyway */
- struct curl_slist *list = array_state?
- (struct curl_slist *)(void *)array_value:
+ struct curl_slist *list = array_state ?
+ (struct curl_slist *)(void *)array_value :
va_arg(params, struct curl_slist *);
if(current_form->contentheader)
@@ -499,7 +500,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
case CURLFORM_FILENAME:
case CURLFORM_BUFFER:
{
- const char *filename = array_state?array_value:
+ const char *filename = array_state ? array_value :
va_arg(params, char *);
if(current_form->showfilename)
return_value = CURL_FORMADD_OPTION_TWICE;
@@ -569,7 +570,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
if(((form->flags & HTTPPOST_FILENAME) ||
(form->flags & HTTPPOST_BUFFER)) &&
!form->contenttype) {
- char *f = (form->flags & HTTPPOST_BUFFER)?
+ char *f = (form->flags & HTTPPOST_BUFFER) ?
form->showfilename : form->value;
char const *type;
type = Curl_mime_contenttype(f);
@@ -603,8 +604,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
app passed in a bad combo, so we better check for that first. */
if(form->name) {
/* copy name (without strdup; possibly not null-terminated) */
- form->name = Curl_memdup0(form->name, form->namelength?
- form->namelength:
+ form->name = Curl_memdup0(form->name, form->namelength ?
+ form->namelength :
strlen(form->name));
}
if(!form->name) {
@@ -896,7 +897,8 @@ CURLcode Curl_getformdata(struct Curl_easy *data,
}
else if(post->flags & HTTPPOST_BUFFER)
result = curl_mime_data(part, post->buffer,
- post->bufferlength? post->bufferlength: -1);
+ post->bufferlength ?
+ post->bufferlength : -1);
else if(post->flags & HTTPPOST_CALLBACK) {
/* the contents should be read with the callback and the size is set
with the contentslength */
lib/ftp.c+38 -36
@@ -712,7 +712,7 @@ static CURLcode AllowServerConnect(struct Curl_easy *data, bool *connected)
else {
/* Add timeout to multi handle and break out of the loop */
Curl_expire(data, data->set.accepttimeout ?
- data->set.accepttimeout: DEFAULT_ACCEPT_TIMEOUT,
+ data->set.accepttimeout : DEFAULT_ACCEPT_TIMEOUT,
EXPIRE_FTP_ACCEPT);
}
@@ -864,8 +864,8 @@ CURLcode Curl_GetFTPResponse(struct Curl_easy *data,
*/
}
else if(!Curl_conn_data_pending(data, FIRSTSOCKET)) {
- curl_socket_t wsock = Curl_pp_needs_flush(data, pp)?
- sockfd : CURL_SOCKET_BAD;
+ curl_socket_t wsock = Curl_pp_needs_flush(data, pp) ?
+ sockfd : CURL_SOCKET_BAD;
int ev = Curl_socket_check(sockfd, CURL_SOCKET_BAD, wsock, interval_ms);
if(ev < 0) {
failf(data, "FTP response aborted due to select/poll error: %d",
@@ -914,7 +914,7 @@ static CURLcode ftp_state_user(struct Curl_easy *data,
{
CURLcode result = Curl_pp_sendf(data,
&conn->proto.ftpc.pp, "USER %s",
- conn->user?conn->user:"");
+ conn->user ? conn->user : "");
if(!result) {
struct ftp_conn *ftpc = &conn->proto.ftpc;
ftpc->ftp_trying_alternative = FALSE;
@@ -1343,7 +1343,7 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data,
*/
result = Curl_pp_sendf(data, &ftpc->pp, "%s |%d|%s|%hu|", mode[fcmd],
- sa->sa_family == AF_INET?1:2,
+ sa->sa_family == AF_INET ? 1 : 2,
myhost, port);
if(result) {
failf(data, "Failure sending EPRT command: %s",
@@ -1368,7 +1368,7 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data,
source++;
}
*dest = 0;
- msnprintf(dest, 20, ",%d,%d", (int)(port>>8), (int)(port&0xff));
+ msnprintf(dest, 20, ",%d,%d", (int)(port >> 8), (int)(port & 0xff));
result = Curl_pp_sendf(data, &ftpc->pp, "%s %s", mode[fcmd], target);
if(result) {
@@ -1426,7 +1426,7 @@ static CURLcode ftp_state_use_pasv(struct Curl_easy *data,
conn->bits.ftp_use_epsv = TRUE;
#endif
- modeoff = conn->bits.ftp_use_epsv?0:1;
+ modeoff = conn->bits.ftp_use_epsv ? 0 : 1;
result = Curl_pp_sendf(data, &ftpc->pp, "%s", mode[modeoff]);
if(!result) {
@@ -1470,8 +1470,8 @@ static CURLcode ftp_state_prepare_transfer(struct Curl_easy *data)
if(!conn->proto.ftpc.file)
result = Curl_pp_sendf(data, &ftpc->pp, "PRET %s",
data->set.str[STRING_CUSTOMREQUEST]?
- data->set.str[STRING_CUSTOMREQUEST]:
- (data->state.list_only?"NLST":"LIST"));
+ data->set.str[STRING_CUSTOMREQUEST] :
+ (data->state.list_only ? "NLST" : "LIST"));
else if(data->state.upload)
result = Curl_pp_sendf(data, &ftpc->pp, "PRET STOR %s",
conn->proto.ftpc.file);
@@ -1577,10 +1577,10 @@ static CURLcode ftp_state_list(struct Curl_easy *data)
cmd = aprintf("%s%s%s",
data->set.str[STRING_CUSTOMREQUEST]?
- data->set.str[STRING_CUSTOMREQUEST]:
- (data->state.list_only?"NLST":"LIST"),
- lstArg? " ": "",
- lstArg? lstArg: "");
+ data->set.str[STRING_CUSTOMREQUEST] :
+ (data->state.list_only ? "NLST" : "LIST"),
+ lstArg ? " " : "",
+ lstArg ? lstArg : "");
free(lstArg);
if(!cmd)
@@ -1736,7 +1736,7 @@ static CURLcode ftp_state_ul_setup(struct Curl_easy *data,
} while(passed < data->state.resume_from);
}
/* now, decrease the size of the read */
- if(data->state.infilesize>0) {
+ if(data->state.infilesize > 0) {
data->state.infilesize -= data->state.resume_from;
if(data->state.infilesize <= 0) {
@@ -1756,7 +1756,7 @@ static CURLcode ftp_state_ul_setup(struct Curl_easy *data,
/* we have passed, proceed as normal */
} /* resume_from */
- result = Curl_pp_sendf(data, &ftpc->pp, append?"APPE %s":"STOR %s",
+ result = Curl_pp_sendf(data, &ftpc->pp, append ? "APPE %s" : "STOR %s",
ftpc->file);
if(!result)
ftp_state(data, FTP_STOR);
@@ -1804,7 +1804,7 @@ static CURLcode ftp_state_quote(struct Curl_easy *data,
int i = 0;
/* Skip count1 items in the linked list */
- while((i< ftpc->count1) && item) {
+ while((i < ftpc->count1) && item) {
item = item->next;
i++;
}
@@ -2038,7 +2038,7 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data,
if(!ftpc->newhost)
return CURLE_OUT_OF_MEMORY;
- ftpc->newport = (unsigned short)(((ip[4]<<8) + ip[5]) & 0xffff);
+ ftpc->newport = (unsigned short)(((ip[4] << 8) + ip[5]) & 0xffff);
}
else if(ftpc->count1 == 0) {
/* EPSV failed, move on to PASV */
@@ -2101,7 +2101,7 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data,
}
result = Curl_conn_setup(data, conn, SECONDARYSOCKET, addr,
- conn->bits.ftp_use_data_ssl?
+ conn->bits.ftp_use_data_ssl ?
CURL_CF_SSL_ENABLE : CURL_CF_SSL_DISABLE);
if(result) {
@@ -2267,15 +2267,16 @@ static CURLcode ftp_state_mdtm_resp(struct Curl_easy *data,
return result;
/* format: "Tue, 15 Nov 1994 12:45:26" */
- headerbuflen = msnprintf(headerbuf, sizeof(headerbuf),
- "Last-Modified: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n",
- Curl_wkday[tm->tm_wday?tm->tm_wday-1:6],
- tm->tm_mday,
- Curl_month[tm->tm_mon],
- tm->tm_year + 1900,
- tm->tm_hour,
- tm->tm_min,
- tm->tm_sec);
+ headerbuflen =
+ msnprintf(headerbuf, sizeof(headerbuf),
+ "Last-Modified: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n",
+ Curl_wkday[tm->tm_wday ? tm->tm_wday-1 : 6],
+ tm->tm_mday,
+ Curl_month[tm->tm_mon],
+ tm->tm_year + 1900,
+ tm->tm_hour,
+ tm->tm_min,
+ tm->tm_sec);
result = client_write_header(data, headerbuf, headerbuflen);
if(result)
return result;
@@ -2387,7 +2388,7 @@ static CURLcode ftp_state_retr(struct Curl_easy *data,
else {
/* We got a file size report, so we check that there actually is a
part of the file left to get, or else we go home. */
- if(data->state.resume_from< 0) {
+ if(data->state.resume_from < 0) {
/* We are supposed to download the last abs(from) bytes */
if(filesize < -data->state.resume_from) {
failf(data, "Offset (%" FMT_OFF_T
@@ -2700,8 +2701,8 @@ static CURLcode ftp_state_get_resp(struct Curl_easy *data,
}
else {
failf(data, "RETR response: %03d", ftpcode);
- return instate == FTP_RETR && ftpcode == 550?
- CURLE_REMOTE_FILE_NOT_FOUND:
+ return instate == FTP_RETR && ftpcode == 550 ?
+ CURLE_REMOTE_FILE_NOT_FOUND :
CURLE_FTP_COULDNT_RETR_FILE;
}
}
@@ -2753,7 +2754,7 @@ static CURLcode ftp_state_user_resp(struct Curl_easy *data,
/* 331 Password required for ...
(the server requires to send the user's password too) */
result = Curl_pp_sendf(data, &ftpc->pp, "PASS %s",
- conn->passwd?conn->passwd:"");
+ conn->passwd ? conn->passwd : "");
if(!result)
ftp_state(data, FTP_PASS);
}
@@ -3432,7 +3433,8 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status,
if(data->set.ftp_filemethod == FTPFILE_NOCWD)
pathLen = 0; /* relative path => working directory is FTP home */
else
- pathLen -= ftpc->file?strlen(ftpc->file):0; /* file is url-decoded */
+ /* file is url-decoded */
+ pathLen -= ftpc->file ? strlen(ftpc->file) : 0;
rawPath[pathLen] = '\0';
ftpc->prevpath = rawPath;
@@ -3550,7 +3552,7 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status,
}
else if(!ftpc->dont_check &&
!data->req.bytecount &&
- (data->req.size>0)) {
+ (data->req.size > 0)) {
failf(data, "No data was received");
result = CURLE_FTP_COULDNT_RETR_FILE;
}
@@ -3634,7 +3636,7 @@ CURLcode ftp_sendquote(struct Curl_easy *data,
static int ftp_need_type(struct connectdata *conn,
bool ascii_wanted)
{
- return conn->proto.ftpc.transfertype != (ascii_wanted?'A':'I');
+ return conn->proto.ftpc.transfertype != (ascii_wanted ? 'A' : 'I');
}
/***********************************************************************
@@ -3651,7 +3653,7 @@ static CURLcode ftp_nb_type(struct Curl_easy *data,
{
struct ftp_conn *ftpc = &conn->proto.ftpc;
CURLcode result;
- char want = (char)(ascii?'A':'I');
+ char want = (char)(ascii ? 'A' : 'I');
if(ftpc->transfertype == want) {
ftp_state(data, newstate);
@@ -4406,7 +4408,7 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data)
if(data->set.ftp_filemethod == FTPFILE_NOCWD)
n = 0; /* CWD to entry for relative paths */
else
- n -= ftpc->file?strlen(ftpc->file):0;
+ n -= ftpc->file ? strlen(ftpc->file) : 0;
if((strlen(oldPath) == n) && !strncmp(rawPath, oldPath, n)) {
infof(data, "Request has same path as previous transfer");
lib/getenv.c+1 -1
@@ -70,7 +70,7 @@ static char *GetEnv(const char *variable)
}
#else
char *env = getenv(variable);
- return (env && env[0])?strdup(env):NULL;
+ return (env && env[0]) ? strdup(env) : NULL;
#endif
}
lib/getinfo.c+10 -10
@@ -96,7 +96,7 @@ static CURLcode getinfo_char(struct Curl_easy *data, CURLINFO info,
{
switch(info) {
case CURLINFO_EFFECTIVE_URL:
- *param_charp = data->state.url?data->state.url:(char *)"";
+ *param_charp = data->state.url ? data->state.url : (char *)"";
break;
case CURLINFO_EFFECTIVE_METHOD: {
const char *m = data->set.str[STRING_CUSTOMREQUEST];
@@ -405,12 +405,12 @@ static CURLcode getinfo_offt(struct Curl_easy *data, CURLINFO info,
*param_offt = data->progress.ul.speed;
break;
case CURLINFO_CONTENT_LENGTH_DOWNLOAD_T:
- *param_offt = (data->progress.flags & PGRS_DL_SIZE_KNOWN)?
- data->progress.dl.total_size:-1;
+ *param_offt = (data->progress.flags & PGRS_DL_SIZE_KNOWN) ?
+ data->progress.dl.total_size : -1;
break;
case CURLINFO_CONTENT_LENGTH_UPLOAD_T:
- *param_offt = (data->progress.flags & PGRS_UL_SIZE_KNOWN)?
- data->progress.ul.total_size:-1;
+ *param_offt = (data->progress.flags & PGRS_UL_SIZE_KNOWN) ?
+ data->progress.ul.total_size : -1;
break;
case CURLINFO_TOTAL_TIME_T:
*param_offt = data->progress.timespent;
@@ -446,7 +446,7 @@ static CURLcode getinfo_offt(struct Curl_easy *data, CURLINFO info,
*param_offt = data->id;
break;
case CURLINFO_CONN_ID:
- *param_offt = data->conn?
+ *param_offt = data->conn ?
data->conn->connection_id : data->state.recent_conn_id;
break;
default:
@@ -512,12 +512,12 @@ static CURLcode getinfo_double(struct Curl_easy *data, CURLINFO info,
*param_doublep = (double)data->progress.ul.speed;
break;
case CURLINFO_CONTENT_LENGTH_DOWNLOAD:
- *param_doublep = (data->progress.flags & PGRS_DL_SIZE_KNOWN)?
- (double)data->progress.dl.total_size:-1;
+ *param_doublep = (data->progress.flags & PGRS_DL_SIZE_KNOWN) ?
+ (double)data->progress.dl.total_size : -1;
break;
case CURLINFO_CONTENT_LENGTH_UPLOAD:
- *param_doublep = (data->progress.flags & PGRS_UL_SIZE_KNOWN)?
- (double)data->progress.ul.total_size:-1;
+ *param_doublep = (data->progress.flags & PGRS_UL_SIZE_KNOWN) ?
+ (double)data->progress.ul.total_size : -1;
break;
case CURLINFO_REDIRECT_TIME:
*param_doublep = DOUBLE_SECS(data->progress.t_redirect);
lib/headers.c+1 -1
@@ -54,7 +54,7 @@ static void copy_header_external(struct Curl_header_store *hs,
impossible for applications to do == comparisons, as that would otherwise
be very tempting and then lead to the reserved bits not being reserved
anymore. */
- h->origin = (unsigned int)(hs->type | (1<<27));
+ h->origin = (unsigned int)(hs->type | (1 << 27));
h->anchor = e;
}
lib/hostip.c+2 -2
@@ -630,7 +630,7 @@ bool Curl_ipv6works(struct Curl_easy *data)
ipv6_works = 1;
sclose(s);
}
- return (ipv6_works>0) ? TRUE : FALSE;
+ return (ipv6_works > 0) ? TRUE : FALSE;
}
}
#endif /* USE_IPV6 */
@@ -1068,7 +1068,7 @@ void Curl_resolv_unlink(struct Curl_easy *data, struct Curl_dns_entry **pdns)
static void hostcache_unlink_entry(void *entry)
{
struct Curl_dns_entry *dns = (struct Curl_dns_entry *) entry;
- DEBUGASSERT(dns && (dns->refcount>0));
+ DEBUGASSERT(dns && (dns->refcount > 0));
dns->refcount--;
if(dns->refcount == 0) {
lib/http.c+59 -59
@@ -407,7 +407,7 @@ static CURLcode http_perhapsrewind(struct Curl_easy *data,
{
curl_off_t bytessent = data->req.writebytecount;
curl_off_t expectsend = Curl_creader_total_length(data);
- curl_off_t upload_remain = (expectsend >= 0)? (expectsend - bytessent) : -1;
+ curl_off_t upload_remain = (expectsend >= 0) ? (expectsend - bytessent) : -1;
bool little_upload_remains = (upload_remain >= 0 && upload_remain < 2000);
bool needs_rewind = Curl_creader_needs_rewind(data);
/* By default, we would like to abort the transfer when little or unknown
@@ -463,14 +463,14 @@ static CURLcode http_perhapsrewind(struct Curl_easy *data,
if(abort_upload) {
if(upload_remain >= 0)
infof(data, "%s%sclose instead of sending %" FMT_OFF_T " more bytes",
- ongoing_auth? ongoing_auth : "",
- ongoing_auth? " send, " : "",
+ ongoing_auth ? ongoing_auth : "",
+ ongoing_auth ? " send, " : "",
upload_remain);
else
infof(data, "%s%sclose instead of sending unknown amount "
"of more bytes",
- ongoing_auth? ongoing_auth : "",
- ongoing_auth? " send, " : "");
+ ongoing_auth ? ongoing_auth : "",
+ ongoing_auth ? " send, " : "");
/* We decided to abort the ongoing transfer */
streamclose(conn, "Mid-auth HTTP and much data left to send");
/* FIXME: questionable manipulation here, can we do this differently? */
@@ -502,7 +502,7 @@ CURLcode Curl_http_auth_act(struct Curl_easy *data)
return CURLE_OK;
if(data->state.authproblem)
- return data->set.http_fail_on_error?CURLE_HTTP_RETURNED_ERROR:CURLE_OK;
+ return data->set.http_fail_on_error ? CURLE_HTTP_RETURNED_ERROR : CURLE_OK;
if((data->state.aptr.user || data->set.str[STRING_BEARER]) &&
((data->req.httpcode == 401) ||
@@ -1261,8 +1261,8 @@ CURLcode Curl_dynhds_add_custom(struct Curl_easy *data,
if(is_connect)
proxy = HEADER_CONNECT;
else
- proxy = conn->bits.httpproxy && !conn->bits.tunnel_proxy?
- HEADER_PROXY:HEADER_SERVER;
+ proxy = conn->bits.httpproxy && !conn->bits.tunnel_proxy ?
+ HEADER_PROXY : HEADER_SERVER;
switch(proxy) {
case HEADER_SERVER:
@@ -1408,8 +1408,8 @@ CURLcode Curl_add_custom_headers(struct Curl_easy *data,
if(is_connect)
proxy = HEADER_CONNECT;
else
- proxy = conn->bits.httpproxy && !conn->bits.tunnel_proxy?
- HEADER_PROXY:HEADER_SERVER;
+ proxy = conn->bits.httpproxy && !conn->bits.tunnel_proxy ?
+ HEADER_PROXY : HEADER_SERVER;
switch(proxy) {
case HEADER_SERVER:
@@ -1602,7 +1602,7 @@ CURLcode Curl_add_timecondition(struct Curl_easy *data,
msnprintf(datestr, sizeof(datestr),
"%s: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n",
condp,
- Curl_wkday[tm->tm_wday?tm->tm_wday-1:6],
+ Curl_wkday[tm->tm_wday ? tm->tm_wday-1 : 6],
tm->tm_mday,
Curl_month[tm->tm_mon],
tm->tm_year + 1900,
@@ -1755,11 +1755,12 @@ CURLcode Curl_http_host(struct Curl_easy *data, struct connectdata *conn)
(conn->remote_port == PORT_HTTP)) )
/* if(HTTPS on port 443) OR (HTTP on port 80) then do not include
the port number in the host string */
- aptr->host = aprintf("Host: %s%s%s\r\n", conn->bits.ipv6_ip?"[":"",
- host, conn->bits.ipv6_ip?"]":"");
+ aptr->host = aprintf("Host: %s%s%s\r\n", conn->bits.ipv6_ip ? "[" : "",
+ host, conn->bits.ipv6_ip ? "]" : "");
else
- aptr->host = aprintf("Host: %s%s%s:%d\r\n", conn->bits.ipv6_ip?"[":"",
- host, conn->bits.ipv6_ip?"]":"",
+ aptr->host = aprintf("Host: %s%s%s:%d\r\n",
+ conn->bits.ipv6_ip ? "[" : "",
+ host, conn->bits.ipv6_ip ? "]" : "",
conn->remote_port);
if(!aptr->host)
@@ -1837,7 +1838,7 @@ CURLcode Curl_http_target(struct Curl_easy *data,
/* target or URL */
result = Curl_dyn_add(r, data->set.str[STRING_TARGET]?
- data->set.str[STRING_TARGET]:url);
+ data->set.str[STRING_TARGET] : url);
free(url);
if(result)
return (result);
@@ -2010,7 +2011,7 @@ static CURLcode set_reader(struct Curl_easy *data, Curl_HttpReq httpreq)
chunked = Curl_compareheader(ptr, STRCONST("Transfer-Encoding:"),
STRCONST("chunked"));
}
- result = Curl_creader_set_fread(data, chunked? -1 : postsize);
+ result = Curl_creader_set_fread(data, chunked ? -1 : postsize);
}
return result;
@@ -2285,7 +2286,7 @@ CURLcode Curl_http_cookies(struct Curl_easy *data,
linecap = TRUE;
break;
}
- result = Curl_dyn_addf(r, "%s%s=%s", count?"; ":"",
+ result = Curl_dyn_addf(r, "%s%s=%s", count ? "; " : "",
co->name, co->value);
if(result)
break;
@@ -2300,7 +2301,7 @@ CURLcode Curl_http_cookies(struct Curl_easy *data,
if(!count)
result = Curl_dyn_addn(r, STRCONST("Cookie: "));
if(!result) {
- result = Curl_dyn_addf(r, "%s%s", count?"; ":"", addcookies);
+ result = Curl_dyn_addf(r, "%s%s", count ? "; " : "", addcookies);
count++;
}
}
@@ -2350,7 +2351,7 @@ CURLcode Curl_http_range(struct Curl_easy *data,
/* TODO: not sure if we want to send this header during authentication
* negotiation, but test1084 checks for it. In which case we have a
* "null" client reader installed that gives an unexpected length. */
- curl_off_t total_len = data->req.authneg?
+ curl_off_t total_len = data->req.authneg ?
data->state.infilesize :
(data->state.resume_from + req_clen);
data->state.aptr.rangeline =
@@ -2634,35 +2635,34 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
"%s",/* Alt-Used */
httpstring,
- (data->state.aptr.host?data->state.aptr.host:""),
+ (data->state.aptr.host ? data->state.aptr.host : ""),
#ifndef CURL_DISABLE_PROXY
- data->state.aptr.proxyuserpwd?
- data->state.aptr.proxyuserpwd:"",
+ data->state.aptr.proxyuserpwd ?
+ data->state.aptr.proxyuserpwd : "",
#else
"",
#endif
- data->state.aptr.userpwd?data->state.aptr.userpwd:"",
- (data->state.use_range && data->state.aptr.rangeline)?
- data->state.aptr.rangeline:"",
+ data->state.aptr.userpwd ? data->state.aptr.userpwd : "",
+ (data->state.use_range && data->state.aptr.rangeline) ?
+ data->state.aptr.rangeline : "",
(data->set.str[STRING_USERAGENT] &&
*data->set.str[STRING_USERAGENT] &&
- data->state.aptr.uagent)?
- data->state.aptr.uagent:"",
- p_accept?p_accept:"",
- data->state.aptr.te?data->state.aptr.te:"",
+ data->state.aptr.uagent) ?
+ data->state.aptr.uagent : "",
+ p_accept ? p_accept : "",
+ data->state.aptr.te ? data->state.aptr.te : "",
(data->set.str[STRING_ENCODING] &&
*data->set.str[STRING_ENCODING] &&
- data->state.aptr.accept_encoding)?
- data->state.aptr.accept_encoding:"",
- (data->state.referer && data->state.aptr.ref)?
- data->state.aptr.ref:"" /* Referer: <data> */,
+ data->state.aptr.accept_encoding) ?
+ data->state.aptr.accept_encoding : "",
+ (data->state.referer && data->state.aptr.ref) ?
+ data->state.aptr.ref : "" /* Referer: <data> */,
#ifndef CURL_DISABLE_PROXY
(conn->bits.httpproxy &&
!conn->bits.tunnel_proxy &&
!Curl_checkheaders(data, STRCONST("Proxy-Connection")) &&
- !Curl_checkProxyheaders(data,
- conn,
- STRCONST("Proxy-Connection")))?
+ !Curl_checkProxyheaders(data, conn,
+ STRCONST("Proxy-Connection"))) ?
"Proxy-Connection: Keep-Alive\r\n":"",
#else
"",
@@ -2754,7 +2754,7 @@ checkhttpprefix(struct Curl_easy *data,
{
struct curl_slist *head = data->set.http200aliases;
statusline rc = STATUS_BAD;
- statusline onmatch = len >= 5? STATUS_DONE : STATUS_UNKNOWN;
+ statusline onmatch = len >= 5 ? STATUS_DONE : STATUS_UNKNOWN;
while(head) {
if(checkprefixmax(head->data, s, len)) {
@@ -2776,7 +2776,7 @@ checkrtspprefix(struct Curl_easy *data,
const char *s, size_t len)
{
statusline result = STATUS_BAD;
- statusline onmatch = len >= 5? STATUS_DONE : STATUS_UNKNOWN;
+ statusline onmatch = len >= 5 ? STATUS_DONE : STATUS_UNKNOWN;
(void)data; /* unused */
if(checkprefixmax("RTSP/", s, len))
result = onmatch;
@@ -2837,10 +2837,10 @@ CURLcode Curl_http_header(struct Curl_easy *data,
#else
0
#endif
- ))? HD_VAL(hd, hdlen, "Alt-Svc:") : NULL;
+ )) ? HD_VAL(hd, hdlen, "Alt-Svc:") : NULL;
if(v) {
/* the ALPN of the current request */
- enum alpnid id = (conn->httpversion == 30)? ALPN_h3 :
+ enum alpnid id = (conn->httpversion == 30) ? ALPN_h3 :
(conn->httpversion == 20) ? ALPN_h2 : ALPN_h1;
return Curl_altsvc_parse(data, data->asi, v, id, conn->host.name,
curlx_uitous((unsigned int)conn->remote_port));
@@ -2850,8 +2850,8 @@ CURLcode Curl_http_header(struct Curl_easy *data,
case 'c':
case 'C':
/* Check for Content-Length: header lines to get size */
- v = (!k->http_bodyless && !data->set.ignorecl)?
- HD_VAL(hd, hdlen, "Content-Length:") : NULL;
+ v = (!k->http_bodyless && !data->set.ignorecl) ?
+ HD_VAL(hd, hdlen, "Content-Length:") : NULL;
if(v) {
curl_off_t contentlength;
CURLofft offt = curlx_strtoofft(v, NULL, 10, &contentlength);
@@ -2876,8 +2876,8 @@ CURLcode Curl_http_header(struct Curl_easy *data,
}
return CURLE_OK;
}
- v = (!k->http_bodyless && data->set.str[STRING_ENCODING])?
- HD_VAL(hd, hdlen, "Content-Encoding:") : NULL;
+ v = (!k->http_bodyless && data->set.str[STRING_ENCODING]) ?
+ HD_VAL(hd, hdlen, "Content-Encoding:") : NULL;
if(v) {
/*
* Process Content-Encoding. Look for the values: identity,
@@ -2925,7 +2925,7 @@ CURLcode Curl_http_header(struct Curl_easy *data,
infof(data, "HTTP/1.0 connection set to keep alive");
return CURLE_OK;
}
- v = !k->http_bodyless? HD_VAL(hd, hdlen, "Content-Range:") : NULL;
+ v = !k->http_bodyless ? HD_VAL(hd, hdlen, "Content-Range:") : NULL;
if(v) {
/* Content-Range: bytes [num]-
Content-Range: bytes: [num]-
@@ -2959,7 +2959,7 @@ CURLcode Curl_http_header(struct Curl_easy *data,
case 'l':
case 'L':
v = (!k->http_bodyless &&
- (data->set.timecondition || data->set.get_filetime))?
+ (data->set.timecondition || data->set.get_filetime)) ?
HD_VAL(hd, hdlen, "Last-Modified:") : NULL;
if(v) {
k->timeofdoc = Curl_getdate_capped(v);
@@ -3073,13 +3073,13 @@ CURLcode Curl_http_header(struct Curl_easy *data,
case 's':
case 'S':
#if !defined(CURL_DISABLE_COOKIES)
- v = (data->cookies && data->state.cookie_engine)?
+ v = (data->cookies && data->state.cookie_engine) ?
HD_VAL(hd, hdlen, "Set-Cookie:") : NULL;
if(v) {
/* If there is a custom-set Host: name, use it here, or else use
* real peer hostname. */
- const char *host = data->state.aptr.cookiehost?
- data->state.aptr.cookiehost:conn->host.name;
+ const char *host = data->state.aptr.cookiehost ?
+ data->state.aptr.cookiehost : conn->host.name;
const bool secure_context =
conn->handler->protocol&(CURLPROTO_HTTPS|CURLPROTO_WSS) ||
strcasecompare("localhost", host) ||
@@ -3105,7 +3105,7 @@ CURLcode Curl_http_header(struct Curl_easy *data,
0
#endif
)
- )? HD_VAL(hd, hdlen, "Strict-Transport-Security:") : NULL;
+ ) ? HD_VAL(hd, hdlen, "Strict-Transport-Security:") : NULL;
if(v) {
CURLcode check =
Curl_hsts_parse(data->hsts, conn->host.name, v);
@@ -3133,8 +3133,8 @@ CURLcode Curl_http_header(struct Curl_easy *data,
*/
v = (!k->http_bodyless &&
(data->state.httpreq != HTTPREQ_HEAD) &&
- (k->httpcode != 304))?
- HD_VAL(hd, hdlen, "Transfer-Encoding:") : NULL;
+ (k->httpcode != 304)) ?
+ HD_VAL(hd, hdlen, "Transfer-Encoding:") : NULL;
if(v) {
/* One or more encodings. We check for chunked and/or a compression
algorithm. */
@@ -3372,8 +3372,8 @@ static CURLcode http_write_header(struct Curl_easy *data,
return result;
data->req.deductheadercount = (100 <= data->req.httpcode &&
- 199 >= data->req.httpcode)?
- data->req.headerbytecount:0;
+ 199 >= data->req.httpcode) ?
+ data->req.headerbytecount : 0;
return result;
}
@@ -4052,7 +4052,7 @@ CURLcode Curl_http_decode_status(int *pstatus, const char *s, size_t len)
}
result = CURLE_OK;
out:
- *pstatus = result? -1 : status;
+ *pstatus = result ? -1 : status;
return result;
}
@@ -4319,8 +4319,8 @@ CURLcode Curl_http_req_to_h2(struct dynhds *h2_headers,
infof(data, "set pseudo header %s to %s", HTTP_PSEUDO_SCHEME, scheme);
}
else {
- scheme = (data->conn && data->conn->handler->flags & PROTOPT_SSL)?
- "https" : "http";
+ scheme = (data->conn && data->conn->handler->flags & PROTOPT_SSL) ?
+ "https" : "http";
}
}
@@ -4479,7 +4479,7 @@ static void cr_exp100_done(struct Curl_easy *data,
struct Curl_creader *reader, int premature)
{
struct cr_exp100_ctx *ctx = reader->ctx;
- ctx->state = premature? EXP100_FAILED : EXP100_SEND_DATA;
+ ctx->state = premature ? EXP100_FAILED : EXP100_SEND_DATA;
data->req.keepon &= ~KEEP_SEND_TIMED;
Curl_expire_done(data, EXPIRE_100_TIMEOUT);
}
lib/http1.c+5 -5
@@ -128,7 +128,7 @@ static ssize_t next_line(struct h1_req_parser *parser,
else if(*err == CURLE_AGAIN) {
/* no line end in `buf`, add it to our scratch */
*err = Curl_dyn_addn(&parser->scratch, (const unsigned char *)buf, buflen);
- nread = (*err)? -1 : (ssize_t)buflen;
+ nread = (*err) ? -1 : (ssize_t)buflen;
}
return nread;
}
@@ -325,10 +325,10 @@ CURLcode Curl_h1_req_write_head(struct httpreq *req, int http_minor,
result = Curl_dyn_addf(dbuf, "%s %s%s%s%s HTTP/1.%d\r\n",
req->method,
- req->scheme? req->scheme : "",
- req->scheme? "://" : "",
- req->authority? req->authority : "",
- req->path? req->path : "",
+ req->scheme ? req->scheme : "",
+ req->scheme ? "://" : "",
+ req->authority ? req->authority : "",
+ req->path ? req->path : "",
http_minor);
if(result)
goto out;
lib/http2.c+31 -31
@@ -254,7 +254,7 @@ static struct h2_stream_ctx *h2_stream_ctx_create(struct cf_h2_ctx *ctx)
static void free_push_headers(struct h2_stream_ctx *stream)
{
size_t i;
- for(i = 0; i<stream->push_headers_used; i++)
+ for(i = 0; i < stream->push_headers_used; i++)
free(stream->push_headers[i]);
Curl_safefree(stream->push_headers);
stream->push_headers_used = 0;
@@ -299,7 +299,7 @@ static CURLcode cf_h2_update_local_win(struct Curl_cfilter *cf,
int32_t dwsize;
int rv;
- dwsize = paused? 0 : cf_h2_get_desired_local_win(cf, data);
+ dwsize = paused ? 0 : cf_h2_get_desired_local_win(cf, data);
if(dwsize != stream->local_window_size) {
int32_t wsize = nghttp2_session_get_stream_effective_local_window_size(
ctx->h2, stream->id);
@@ -606,7 +606,7 @@ static CURLcode cf_h2_ctx_open(struct Curl_cfilter *cf,
/* all set, traffic will be send on connect */
result = CURLE_OK;
CURL_TRC_CF(data, cf, "[0] created h2 session%s",
- ctx->via_h1_upgrade? " (via h1 upgrade)" : "");
+ ctx->via_h1_upgrade ? " (via h1 upgrade)" : "");
out:
if(cbs)
@@ -764,7 +764,7 @@ static CURLcode nw_out_flush(struct Curl_cfilter *cf,
}
return result;
}
- return Curl_bufq_is_empty(&ctx->outbufq)? CURLE_OK: CURLE_AGAIN;
+ return Curl_bufq_is_empty(&ctx->outbufq) ? CURLE_OK : CURLE_AGAIN;
}
/*
@@ -852,7 +852,7 @@ char *curl_pushheader_byname(struct curl_pushheaders *h, const char *header)
return NULL;
len = strlen(header);
- for(i = 0; i<stream->push_headers_used; i++) {
+ for(i = 0; i < stream->push_headers_used; i++) {
if(!strncmp(header, stream->push_headers[i], len)) {
/* sub-match, make sure that it is followed by a colon */
if(stream->push_headers[i][len] != ':')
@@ -1235,14 +1235,14 @@ static int fr_print(const nghttp2_frame *frame, char *buffer, size_t blen)
case NGHTTP2_GOAWAY: {
char scratch[128];
size_t s_len = sizeof(scratch)/sizeof(scratch[0]);
- size_t len = (frame->goaway.opaque_data_len < s_len)?
- frame->goaway.opaque_data_len : s_len-1;
- if(len)
- memcpy(scratch, frame->goaway.opaque_data, len);
- scratch[len] = '\0';
- return msnprintf(buffer, blen, "FRAME[GOAWAY, error=%d, reason='%s', "
- "last_stream=%d]", frame->goaway.error_code,
- scratch, frame->goaway.last_stream_id);
+ size_t len = (frame->goaway.opaque_data_len < s_len) ?
+ frame->goaway.opaque_data_len : s_len-1;
+ if(len)
+ memcpy(scratch, frame->goaway.opaque_data, len);
+ scratch[len] = '\0';
+ return msnprintf(buffer, blen, "FRAME[GOAWAY, error=%d, reason='%s', "
+ "last_stream=%d]", frame->goaway.error_code,
+ scratch, frame->goaway.last_stream_id);
}
case NGHTTP2_WINDOW_UPDATE: {
return msnprintf(buffer, blen,
@@ -1350,7 +1350,7 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame,
return 0;
}
- return on_stream_frame(cf, data_s, frame)? NGHTTP2_ERR_CALLBACK_FAILURE : 0;
+ return on_stream_frame(cf, data_s, frame) ? NGHTTP2_ERR_CALLBACK_FAILURE : 0;
}
static int on_data_chunk_recv(nghttp2_session *session, uint8_t flags,
@@ -1402,8 +1402,8 @@ static int on_stream_close(nghttp2_session *session, int32_t stream_id,
DEBUGASSERT(call_data);
/* stream id 0 is the connection, do not look there for streams. */
- data_s = stream_id?
- nghttp2_session_get_stream_user_data(session, stream_id) : NULL;
+ data_s = stream_id ?
+ nghttp2_session_get_stream_user_data(session, stream_id) : NULL;
if(!data_s) {
CURL_TRC_CF(call_data, cf,
"[%d] on_stream_close, no easy set on stream", stream_id);
@@ -1683,7 +1683,7 @@ static ssize_t req_body_read_callback(nghttp2_session *session,
*data_flags = NGHTTP2_DATA_FLAG_EOF;
return nread;
}
- return (nread == 0)? NGHTTP2_ERR_DEFERRED : nread;
+ return (nread == 0) ? NGHTTP2_ERR_DEFERRED : nread;
}
#if !defined(CURL_DISABLE_VERBOSE_STRINGS)
@@ -1773,7 +1773,7 @@ static ssize_t http2_handle_stream_close(struct Curl_cfilter *cf,
}
else if(stream->reset) {
failf(data, "HTTP/2 stream %u was reset", stream->id);
- *err = data->req.bytecount? CURLE_PARTIAL_FILE : CURLE_HTTP2;
+ *err = data->req.bytecount ? CURLE_PARTIAL_FILE : CURLE_HTTP2;
return -1;
}
@@ -1826,14 +1826,14 @@ out:
static int sweight_wanted(const struct Curl_easy *data)
{
/* 0 weight is not set by user and we take the nghttp2 default one */
- return data->set.priority.weight?
+ return data->set.priority.weight ?
data->set.priority.weight : NGHTTP2_DEFAULT_WEIGHT;
}
static int sweight_in_effect(const struct Curl_easy *data)
{
/* 0 weight is not set by user and we take the nghttp2 default one */
- return data->state.priority.weight?
+ return data->state.priority.weight ?
data->state.priority.weight : NGHTTP2_DEFAULT_WEIGHT;
}
@@ -1849,7 +1849,7 @@ static void h2_pri_spec(struct cf_h2_ctx *ctx,
{
struct Curl_data_priority *prio = &data->set.priority;
struct h2_stream_ctx *depstream = H2_STREAM_CTX(ctx, prio->parent);
- int32_t depstream_id = depstream? depstream->id:0;
+ int32_t depstream_id = depstream ? depstream->id : 0;
nghttp2_priority_spec_init(pri_spec, depstream_id,
sweight_wanted(data),
data->set.priority.exclusive);
@@ -1920,7 +1920,7 @@ static ssize_t stream_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
(ctx->conn_closed && Curl_bufq_is_empty(&ctx->inbufq)) ||
(ctx->rcvd_goaway && ctx->remote_max_sid < stream->id)) {
CURL_TRC_CF(data, cf, "[%d] returning ERR", stream->id);
- *err = data->req.bytecount? CURLE_PARTIAL_FILE : CURLE_HTTP2;
+ *err = data->req.bytecount ? CURLE_PARTIAL_FILE : CURLE_HTTP2;
nread = -1;
}
@@ -1978,8 +1978,8 @@ static CURLcode h2_progress_ingress(struct Curl_cfilter *cf,
}
else {
CURL_TRC_CF(data, cf, "[0] ingress: read %zd bytes", nread);
- data_max_bytes = (data_max_bytes > (size_t)nread)?
- (data_max_bytes - (size_t)nread) : 0;
+ data_max_bytes = (data_max_bytes > (size_t)nread) ?
+ (data_max_bytes - (size_t)nread) : 0;
}
if(h2_process_pending_input(cf, data, &result))
@@ -2244,7 +2244,7 @@ static ssize_t h2_submit(struct h2_stream_ctx **pstream,
out:
CURL_TRC_CF(data, cf, "[%d] submit -> %zd, %d",
- stream? stream->id : -1, nwritten, *err);
+ stream ? stream->id : -1, nwritten, *err);
Curl_safefree(nva);
*pstream = stream;
Curl_dynhds_free(&h2_headers);
@@ -2584,7 +2584,7 @@ static CURLcode http2_data_pause(struct Curl_cfilter *cf,
Curl_expire(data, 0, EXPIRE_RUN_NOW);
}
CURL_TRC_CF(data, cf, "[%d] stream now %spaused", stream->id,
- pause? "" : "un");
+ pause ? "" : "un");
}
return CURLE_OK;
}
@@ -2630,7 +2630,7 @@ static bool cf_h2_data_pending(struct Curl_cfilter *cf,
if(ctx && (!Curl_bufq_is_empty(&ctx->inbufq)
|| (stream && !Curl_bufq_is_empty(&stream->sendbuf))))
return TRUE;
- return cf->next? cf->next->cft->has_data_pending(cf->next, data) : FALSE;
+ return cf->next ? cf->next->cft->has_data_pending(cf->next, data) : FALSE;
}
static bool cf_h2_is_alive(struct Curl_cfilter *cf,
@@ -2681,12 +2681,12 @@ static CURLcode cf_h2_query(struct Curl_cfilter *cf,
else {
effective_max = ctx->max_concurrent_streams;
}
- *pres1 = (effective_max > INT_MAX)? INT_MAX : (int)effective_max;
+ *pres1 = (effective_max > INT_MAX) ? INT_MAX : (int)effective_max;
CF_DATA_RESTORE(cf, save);
return CURLE_OK;
case CF_QUERY_STREAM_ERROR: {
struct h2_stream_ctx *stream = H2_STREAM_CTX(ctx, data);
- *pres1 = stream? (int)stream->error : 0;
+ *pres1 = stream ? (int)stream->error : 0;
return CURLE_OK;
}
case CF_QUERY_NEED_FLUSH: {
@@ -2701,7 +2701,7 @@ static CURLcode cf_h2_query(struct Curl_cfilter *cf,
default:
break;
}
- return cf->next?
+ return cf->next ?
cf->next->cft->query(cf->next, data, query, pres1, pres2) :
CURLE_UNKNOWN_OPTION;
}
@@ -2799,7 +2799,7 @@ bool Curl_conn_is_http2(const struct Curl_easy *data,
const struct connectdata *conn,
int sockindex)
{
- return conn? Curl_cf_is_http2(conn->cfilter[sockindex], data) : FALSE;
+ return conn ? Curl_cf_is_http2(conn->cfilter[sockindex], data) : FALSE;
}
bool Curl_http2_may_switch(struct Curl_easy *data,
lib/http_aws_sigv4.c+1 -1
@@ -512,7 +512,7 @@ static CURLcode canon_string(const char *q, size_t len,
}
}
/* URL encode */
- out[1] = hex[((unsigned char)*q)>>4];
+ out[1] = hex[((unsigned char)*q) >> 4];
out[2] = hex[*q & 0xf];
result = Curl_dyn_addn(dq, out, 3);
break;
lib/http_proxy.c+4 -4
@@ -97,8 +97,8 @@ CURLcode Curl_http_proxy_create_CONNECT(struct httpreq **preq,
if(result)
goto out;
- authority = aprintf("%s%s%s:%d", ipv6_ip?"[":"", hostname,
- ipv6_ip?"]":"", port);
+ authority = aprintf("%s%s%s:%d", ipv6_ip ? "[" : "", hostname,
+ ipv6_ip ?"]" : "", port);
if(!authority) {
result = CURLE_OUT_OF_MEMORY;
goto out;
@@ -185,7 +185,7 @@ connect_sub:
*done = FALSE;
if(!ctx->cf_protocol) {
struct Curl_cfilter *cf_protocol = NULL;
- int alpn = Curl_conn_cf_is_ssl(cf->next)?
+ int alpn = Curl_conn_cf_is_ssl(cf->next) ?
cf->conn->proxy_alpn : CURL_HTTP_VERSION_1_1;
/* First time call after the subchain connected */
@@ -195,7 +195,7 @@ connect_sub:
case CURL_HTTP_VERSION_1_1:
CURL_TRC_CF(data, cf, "installing subfilter for HTTP/1.1");
infof(data, "CONNECT tunnel: HTTP/1.%d negotiated",
- (alpn == CURL_HTTP_VERSION_1_0)? 0 : 1);
+ (alpn == CURL_HTTP_VERSION_1_0) ? 0 : 1);
result = Curl_cf_h1_proxy_insert_after(cf, data);
if(result)
goto out;
lib/llist.c+1 -1
@@ -96,7 +96,7 @@ Curl_llist_insert_next(struct Curl_llist *list,
}
else {
/* if 'e' is NULL here, we insert the new element first in the list */
- ne->_next = e?e->_next:list->_head;
+ ne->_next = e ? e->_next : list->_head;
ne->_prev = e;
if(!e) {
list->_head->_prev = ne;
lib/mime.c+29 -28
@@ -259,7 +259,7 @@ static char *Curl_basename(char *path)
s2 = strrchr(path, '\\');
if(s1 && s2) {
- path = (s1 > s2? s1 : s2) + 1;
+ path = (s1 > s2 ? s1 : s2) + 1;
}
else if(s1)
path = s1 + 1;
@@ -424,7 +424,7 @@ static size_t encoder_7bit_read(char *buffer, size_t size, bool ateof,
for(cursize = 0; cursize < size; cursize++) {
*buffer = st->buf[st->bufbeg];
if(*buffer++ & 0x80)
- return cursize? cursize: READ_ERROR;
+ return cursize ? cursize : READ_ERROR;
st->bufbeg++;
}
@@ -538,7 +538,7 @@ static int qp_lookahead_eol(struct mime_encoder_state *st, int ateof, size_t n)
if(n >= st->bufend && ateof)
return 1;
if(n + 2 > st->bufend)
- return ateof? 0: -1;
+ return ateof ? 0 : -1;
if(qp_class[st->buf[n] & 0xFF] == QP_CR &&
qp_class[st->buf[n + 1] & 0xFF] == QP_LF)
return 1;
@@ -651,7 +651,7 @@ static curl_off_t encoder_qp_size(curl_mimepart *part)
{
/* Determining the size can only be done by reading the data: unless the
data size is 0, we return it as unknown (-1). */
- return part->datasize? -1: 0;
+ return part->datasize ? -1 : 0;
}
@@ -711,7 +711,7 @@ static int mime_open_file(curl_mimepart *part)
if(part->fp)
return 0;
part->fp = fopen_read(part->data, "rb");
- return part->fp? 0: -1;
+ return part->fp ? 0 : -1;
}
static size_t mime_file_read(char *buffer, size_t size, size_t nitems,
@@ -738,8 +738,8 @@ static int mime_file_seek(void *instream, curl_off_t offset, int whence)
if(mime_open_file(part))
return CURL_SEEKFUNC_FAIL;
- return fseek(part->fp, (long) offset, whence)?
- CURL_SEEKFUNC_CANTSEEK: CURL_SEEKFUNC_OK;
+ return fseek(part->fp, (long) offset, whence) ?
+ CURL_SEEKFUNC_CANTSEEK : CURL_SEEKFUNC_OK;
}
static void mime_file_free(void *ptr)
@@ -871,7 +871,7 @@ static size_t read_encoded_part_content(curl_mimepart *part, char *buffer,
break;
case READ_ERROR:
case STOP_FILLING:
- return cursize? cursize: sz;
+ return cursize ? cursize : sz;
default:
cursize += sz;
buffer += sz;
@@ -890,7 +890,7 @@ static size_t read_encoded_part_content(curl_mimepart *part, char *buffer,
st->bufend = len;
}
if(st->bufend >= sizeof(st->buf))
- return cursize? cursize: READ_ERROR; /* Buffer full. */
+ return cursize ? cursize : READ_ERROR; /* Buffer full. */
sz = read_part_content(part, st->buf + st->bufend,
sizeof(st->buf) - st->bufend, hasread);
switch(sz) {
@@ -901,7 +901,7 @@ static size_t read_encoded_part_content(curl_mimepart *part, char *buffer,
case CURL_READFUNC_PAUSE:
case READ_ERROR:
case STOP_FILLING:
- return cursize? cursize: sz;
+ return cursize ? cursize : sz;
default:
st->bufend += sz;
break;
@@ -925,8 +925,8 @@ static size_t readback_part(curl_mimepart *part,
switch(part->state.state) {
case MIMESTATE_BEGIN:
mimesetstate(&part->state,
- (part->flags & MIME_BODY_ONLY)?
- MIMESTATE_BODY: MIMESTATE_CURLHEADERS,
+ (part->flags & MIME_BODY_ONLY) ?
+ MIMESTATE_BODY : MIMESTATE_CURLHEADERS,
part->curlheaders);
break;
case MIMESTATE_USERHEADERS:
@@ -977,7 +977,7 @@ static size_t readback_part(curl_mimepart *part,
case CURL_READFUNC_PAUSE:
case READ_ERROR:
case STOP_FILLING:
- return cursize? cursize: sz;
+ return cursize ? cursize : sz;
}
break;
case MIMESTATE_END:
@@ -1043,7 +1043,7 @@ static size_t mime_subparts_read(char *buffer, size_t size, size_t nitems,
case CURL_READFUNC_PAUSE:
case READ_ERROR:
case STOP_FILLING:
- return cursize? cursize: sz;
+ return cursize ? cursize : sz;
case 0:
mimesetstate(&mime->state, MIMESTATE_BOUNDARY1, part->nextpart);
break;
@@ -1228,12 +1228,12 @@ CURLcode Curl_mime_duppart(struct Curl_easy *data,
/* No one knows about the cloned subparts, thus always attach ownership
to the part. */
mime = curl_mime_init(data);
- res = mime? curl_mime_subparts(dst, mime): CURLE_OUT_OF_MEMORY;
+ res = mime ? curl_mime_subparts(dst, mime) : CURLE_OUT_OF_MEMORY;
/* Duplicate subparts. */
for(s = ((curl_mime *) src->arg)->firstpart; !res && s; s = s->nextpart) {
d = curl_mime_addpart(mime);
- res = d? Curl_mime_duppart(data, d, s): CURLE_OUT_OF_MEMORY;
+ res = d ? Curl_mime_duppart(data, d, s) : CURLE_OUT_OF_MEMORY;
}
break;
default: /* Invalid kind: should not occur. */
@@ -1562,7 +1562,8 @@ CURLcode Curl_mime_set_subparts(curl_mimepart *part,
subparts->parent = part;
/* Subparts are processed internally: no read callback. */
part->seekfunc = mime_subparts_seek;
- part->freefunc = take_ownership? mime_subparts_free: mime_subparts_unbind;
+ part->freefunc = take_ownership ? mime_subparts_free :
+ mime_subparts_unbind;
part->arg = subparts;
part->datasize = -1;
part->kind = MIMEKIND_MULTIPART;
@@ -1606,8 +1607,8 @@ size_t Curl_mime_read(char *buffer, size_t size, size_t nitems, void *instream)
/* Rewind mime stream. */
static CURLcode mime_rewind(curl_mimepart *part)
{
- return mime_part_rewind(part) == CURL_SEEKFUNC_OK?
- CURLE_OK: CURLE_SEND_FAIL_REWIND;
+ return mime_part_rewind(part) == CURL_SEEKFUNC_OK ?
+ CURLE_OK : CURLE_SEND_FAIL_REWIND;
}
/* Compute header list size. */
@@ -1691,7 +1692,7 @@ CURLcode Curl_mime_add_header(struct curl_slist **slp, const char *fmt, ...)
free(s);
}
- return hdr? CURLE_OK: CURLE_OUT_OF_MEMORY;
+ return hdr ? CURLE_OK : CURLE_OUT_OF_MEMORY;
}
/* Add a content type header. */
@@ -1699,8 +1700,8 @@ static CURLcode add_content_type(struct curl_slist **slp,
const char *type, const char *boundary)
{
return Curl_mime_add_header(slp, "Content-Type: %s%s%s", type,
- boundary? "; boundary=": "",
- boundary? boundary: "");
+ boundary ? "; boundary=" : "",
+ boundary ? boundary : "");
}
const char *Curl_mime_contenttype(const char *filename)
@@ -1840,12 +1841,12 @@ CURLcode Curl_mime_prepare_headers(struct Curl_easy *data,
ret = Curl_mime_add_header(&part->curlheaders,
"Content-Disposition: %s%s%s%s%s%s%s",
disposition,
- name? "; name=\"": "",
- name? name: "",
- name? "\"": "",
- filename? "; filename=\"": "",
- filename? filename: "",
- filename? "\"": "");
+ name ? "; name=\"" : "",
+ name ? name : "",
+ name ? "\"" : "",
+ filename ? "; filename=\"" : "",
+ filename ? filename : "",
+ filename ? "\"" : "");
Curl_safefree(name);
Curl_safefree(filename);
if(ret)
lib/mprintf.c+23 -23
@@ -101,27 +101,27 @@ typedef enum {
/* conversion and display flags */
enum {
- FLAGS_SPACE = 1<<0,
- FLAGS_SHOWSIGN = 1<<1,
- FLAGS_LEFT = 1<<2,
- FLAGS_ALT = 1<<3,
- FLAGS_SHORT = 1<<4,
- FLAGS_LONG = 1<<5,
- FLAGS_LONGLONG = 1<<6,
- FLAGS_LONGDOUBLE = 1<<7,
- FLAGS_PAD_NIL = 1<<8,
- FLAGS_UNSIGNED = 1<<9,
- FLAGS_OCTAL = 1<<10,
- FLAGS_HEX = 1<<11,
- FLAGS_UPPER = 1<<12,
- FLAGS_WIDTH = 1<<13, /* '*' or '*<num>$' used */
- FLAGS_WIDTHPARAM = 1<<14, /* width PARAMETER was specified */
- FLAGS_PREC = 1<<15, /* precision was specified */
- FLAGS_PRECPARAM = 1<<16, /* precision PARAMETER was specified */
- FLAGS_CHAR = 1<<17, /* %c story */
- FLAGS_FLOATE = 1<<18, /* %e or %E */
- FLAGS_FLOATG = 1<<19, /* %g or %G */
- FLAGS_SUBSTR = 1<<20 /* no input, only substring */
+ FLAGS_SPACE = 1 << 0,
+ FLAGS_SHOWSIGN = 1 << 1,
+ FLAGS_LEFT = 1 << 2,
+ FLAGS_ALT = 1 << 3,
+ FLAGS_SHORT = 1 << 4,
+ FLAGS_LONG = 1 << 5,
+ FLAGS_LONGLONG = 1 << 6,
+ FLAGS_LONGDOUBLE = 1 << 7,
+ FLAGS_PAD_NIL = 1 << 8,
+ FLAGS_UNSIGNED = 1 << 9,
+ FLAGS_OCTAL = 1 << 10,
+ FLAGS_HEX = 1 << 11,
+ FLAGS_UPPER = 1 << 12,
+ FLAGS_WIDTH = 1 << 13, /* '*' or '*<num>$' used */
+ FLAGS_WIDTHPARAM = 1 << 14, /* width PARAMETER was specified */
+ FLAGS_PREC = 1 << 15, /* precision was specified */
+ FLAGS_PRECPARAM = 1 << 16, /* precision PARAMETER was specified */
+ FLAGS_CHAR = 1 << 17, /* %c story */
+ FLAGS_FLOATE = 1 << 18, /* %e or %E */
+ FLAGS_FLOATG = 1 << 19, /* %g or %G */
+ FLAGS_SUBSTR = 1 << 20 /* no input, only substring */
};
enum {
@@ -760,7 +760,7 @@ static int formatf(
}
else if(flags & FLAGS_HEX) {
/* Hexadecimal unsigned integer */
- digits = (flags & FLAGS_UPPER)? upper_digits : lower_digits;
+ digits = (flags & FLAGS_UPPER) ? upper_digits : lower_digits;
base = 16;
is_neg = FALSE;
}
@@ -906,7 +906,7 @@ number:
if(iptr->val.ptr) {
/* If the pointer is not NULL, write it as a %#x spec. */
base = 16;
- digits = (flags & FLAGS_UPPER)? upper_digits : lower_digits;
+ digits = (flags & FLAGS_UPPER) ? upper_digits : lower_digits;
is_alt = TRUE;
num = (size_t) iptr->val.ptr;
is_neg = FALSE;
lib/mqtt.c+3 -3
@@ -156,7 +156,7 @@ static int mqtt_encode_len(char *buf, size_t len)
{
int i;
- for(i = 0; (len > 0) && (i<4); i++) {
+ for(i = 0; (len > 0) && (i < 4); i++) {
unsigned char encoded;
encoded = len % 0x80;
len /= 0x80;
@@ -375,7 +375,7 @@ static CURLcode mqtt_recv_atleast(struct Curl_easy *data, size_t nbytes)
return CURLE_OUT_OF_MEMORY;
rlen = Curl_dyn_len(&mq->recvbuf);
}
- return (rlen >= nbytes)? CURLE_OK : CURLE_AGAIN;
+ return (rlen >= nbytes) ? CURLE_OK : CURLE_AGAIN;
}
static void mqtt_recv_consume(struct Curl_easy *data, size_t nbytes)
@@ -610,7 +610,7 @@ static void mqstate(struct Curl_easy *data,
infof(data, "%s (from %s) (next is %s)",
statenames[state],
statenames[mqtt->state],
- (state == MQTT_FIRST)? statenames[nextstate] : "");
+ (state == MQTT_FIRST) ? statenames[nextstate] : "");
#endif
mqtt->state = state;
if(state == MQTT_FIRST)
lib/multi.c+6 -6
@@ -2230,7 +2230,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
if(!result) {
if(dophase_done) {
/* after DO, go DO_DONE or DO_MORE */
- multistate(data, data->conn->bits.do_more?
+ multistate(data, data->conn->bits.do_more ?
MSTATE_DOING_MORE : MSTATE_DID);
rc = CURLM_CALL_MULTI_PERFORM;
} /* dophase_done */
@@ -2254,7 +2254,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
if(control) {
/* if positive, advance to DO_DONE
if negative, go back to DOING */
- multistate(data, control == 1?
+ multistate(data, control == 1 ?
MSTATE_DID : MSTATE_DOING);
rc = CURLM_CALL_MULTI_PERFORM;
}
@@ -2584,8 +2584,8 @@ statemachine_end:
streamclose(data->conn, "Aborted by callback");
/* if not yet in DONE state, go there, otherwise COMPLETED */
- multistate(data, (data->mstate < MSTATE_DONE)?
- MSTATE_DONE: MSTATE_COMPLETED);
+ multistate(data, (data->mstate < MSTATE_DONE) ?
+ MSTATE_DONE : MSTATE_COMPLETED);
rc = CURLM_CALL_MULTI_PERFORM;
}
}
@@ -2866,7 +2866,7 @@ CURLMcode Curl_multi_pollset_ev(struct Curl_multi *multi,
if(entry) {
/* check if new for this transfer */
unsigned int j;
- for(j = 0; j< last_ps->num; j++) {
+ for(j = 0; j < last_ps->num; j++) {
if(s == last_ps->sockets[j]) {
last_action = last_ps->actions[j];
break;
@@ -3379,7 +3379,7 @@ static CURLMcode multi_timeout(struct Curl_multi *multi,
multi->timetree = Curl_splay(tv_zero, multi->timetree);
/* this will not return NULL from a non-emtpy tree, but some compilers
* are not convinced of that. Analyzers are hard. */
- *expire_time = multi->timetree? multi->timetree->key : tv_zero;
+ *expire_time = multi->timetree ? multi->timetree->key : tv_zero;
/* 'multi->timetree' will be non-NULL here but the compilers sometimes
yell at us if we assume so */
lib/openldap.c+8 -7
@@ -276,7 +276,8 @@ static CURLcode oldap_url_parse(struct Curl_easy *data, LDAPURLDesc **ludp)
if(rc != LDAP_URL_SUCCESS) {
const char *msg = "url parsing problem";
- result = rc == LDAP_URL_ERR_MEM? CURLE_OUT_OF_MEMORY: CURLE_URL_MALFORMAT;
+ result = rc == LDAP_URL_ERR_MEM ? CURLE_OUT_OF_MEMORY :
+ CURLE_URL_MALFORMAT;
rc -= LDAP_URL_SUCCESS;
if((size_t) rc < sizeof(url_errs) / sizeof(url_errs[0]))
msg = url_errs[rc];
@@ -313,7 +314,7 @@ static CURLcode oldap_parse_login_options(struct connectdata *conn)
ptr++;
}
- return result == CURLE_URL_MALFORMAT? CURLE_SETOPT_OPTION_SYNTAX: result;
+ return result == CURLE_URL_MALFORMAT ? CURLE_SETOPT_OPTION_SYNTAX : result;
}
static CURLcode oldap_setup_connection(struct Curl_easy *data,
@@ -430,8 +431,8 @@ static CURLcode oldap_perform_bind(struct Curl_easy *data, ldapstate newstate)
oldap_state(data, newstate);
else
result = oldap_map_error(rc,
- data->state.aptr.user?
- CURLE_LOGIN_DENIED: CURLE_LDAP_CANNOT_BIND);
+ data->state.aptr.user ?
+ CURLE_LOGIN_DENIED : CURLE_LDAP_CANNOT_BIND);
return result;
}
@@ -552,9 +553,9 @@ static CURLcode oldap_connect(struct Curl_easy *data, bool *done)
hosturl = aprintf("%s://%s%s%s:%d",
conn->handler->scheme,
- conn->bits.ipv6_ip? "[": "",
+ conn->bits.ipv6_ip ? "[" : "",
conn->host.name,
- conn->bits.ipv6_ip? "]": "",
+ conn->bits.ipv6_ip ? "]" : "",
conn->remote_port);
if(!hosturl)
return CURLE_OUT_OF_MEMORY;
@@ -1134,7 +1135,7 @@ static ssize_t oldap_recv(struct Curl_easy *data, int sockindex, char *buf,
ldap_msgfree(msg);
*err = result;
- return result? -1: 0;
+ return result ? -1 : 0;
}
#ifdef USE_SSL
lib/parsedate.c+6 -6
@@ -218,7 +218,7 @@ static int checkday(const char *check, size_t len)
what = &Curl_wkday[0];
else
return -1; /* too short */
- for(i = 0; i<7; i++) {
+ for(i = 0; i < 7; i++) {
size_t ilen = strlen(what[0]);
if((ilen == len) &&
strncasecompare(check, what[0], len))
@@ -235,7 +235,7 @@ static int checkmonth(const char *check, size_t len)
if(len != 3)
return -1; /* not a month */
- for(i = 0; i<12; i++) {
+ for(i = 0; i < 12; i++) {
if(strncasecompare(check, what[0], 3))
return i;
what++;
@@ -253,7 +253,7 @@ static int checktz(const char *check, size_t len)
if(len > 4) /* longer than any valid timezone */
return -1;
- for(i = 0; i< sizeof(tz)/sizeof(tz[0]); i++) {
+ for(i = 0; i < sizeof(tz)/sizeof(tz[0]); i++) {
size_t ilen = strlen(what->name);
if((ilen == len) &&
strncasecompare(check, what->name, len))
@@ -441,7 +441,7 @@ static int parsedate(const char *date, time_t *output)
if((tzoff == -1) &&
((end - date) == 4) &&
(val <= 1400) &&
- (indate< date) &&
+ (indate < date) &&
((date[-1] == '+' || date[-1] == '-'))) {
/* four digits and a value less than or equal to 1400 (to take into
account all sorts of funny time zone diffs) and it is preceded
@@ -456,7 +456,7 @@ static int parsedate(const char *date, time_t *output)
/* the + and - prefix indicates the local time compared to GMT,
this we need their reversed math to get what we want */
- tzoff = date[-1]=='+'?-tzoff:tzoff;
+ tzoff = date[-1]=='+' ? -tzoff : tzoff;
}
if(((end - date) == 8) &&
@@ -471,7 +471,7 @@ static int parsedate(const char *date, time_t *output)
}
if(!found && (dignext == DATE_MDAY) && (mdaynum == -1)) {
- if((val > 0) && (val<32)) {
+ if((val > 0) && (val < 32)) {
mdaynum = val;
found = TRUE;
}
lib/pingpong.c+2 -2
@@ -52,8 +52,8 @@ timediff_t Curl_pp_state_timeout(struct Curl_easy *data,
{
struct connectdata *conn = data->conn;
timediff_t timeout_ms; /* in milliseconds */
- timediff_t response_time = (data->set.server_response_timeout)?
- data->set.server_response_timeout: pp->response_time;
+ timediff_t response_time = (data->set.server_response_timeout) ?
+ data->set.server_response_timeout : pp->response_time;
/* if CURLOPT_SERVER_RESPONSE_TIMEOUT is set, use that to determine
remaining time, or use pp->response because SERVER_RESPONSE_TIMEOUT is
lib/progress.c+5 -5
@@ -428,7 +428,7 @@ static bool progress_calc(struct Curl_easy *data, struct curltime now)
array. With N_ENTRIES filled in, we have about N_ENTRIES-1 seconds of
transfer. Imagine, after one second we have filled in two entries,
after two seconds we have filled in three entries etc. */
- countindex = ((p->speeder_c >= CURR_TIME)? CURR_TIME:p->speeder_c) - 1;
+ countindex = ((p->speeder_c >= CURR_TIME) ? CURR_TIME : p->speeder_c) - 1;
/* first of all, we do not do this if there is no counted seconds yet */
if(countindex) {
@@ -439,7 +439,7 @@ static bool progress_calc(struct Curl_easy *data, struct curltime now)
/* Get the index position to compare with the 'nowindex' position.
Get the oldest entry possible. While we have less than CURR_TIME
entries, the first entry will remain the oldest. */
- checkindex = (p->speeder_c >= CURR_TIME)? p->speeder_c%CURR_TIME:0;
+ checkindex = (p->speeder_c >= CURR_TIME) ? p->speeder_c%CURR_TIME : 0;
/* Figure out the exact time for the time span */
span_ms = Curl_timediff(now, p->speeder_time[checkindex]);
@@ -530,14 +530,14 @@ static void progress_meter(struct Curl_easy *data)
/* Since both happen at the same time, total expected duration is max. */
total_estm.secs = CURLMAX(ul_estm.secs, dl_estm.secs);
/* create the three time strings */
- time2str(time_left, total_estm.secs > 0?(total_estm.secs - cur_secs):0);
+ time2str(time_left, total_estm.secs > 0 ? (total_estm.secs - cur_secs) : 0);
time2str(time_total, total_estm.secs);
time2str(time_spent, cur_secs);
/* Get the total amount of data expected to get transferred */
total_expected_size =
- ((p->flags & PGRS_UL_SIZE_KNOWN)? p->ul.total_size:p->ul.cur_size) +
- ((p->flags & PGRS_DL_SIZE_KNOWN)? p->dl.total_size:p->dl.cur_size);
+ ((p->flags & PGRS_UL_SIZE_KNOWN) ? p->ul.total_size : p->ul.cur_size) +
+ ((p->flags & PGRS_DL_SIZE_KNOWN) ? p->dl.total_size : p->dl.cur_size);
/* We have transferred this much so far */
total_cur_size = p->dl.cur_size + p->ul.cur_size;
lib/psl.c+1 -1
@@ -81,7 +81,7 @@ const psl_ctx_t *Curl_psl_use(struct Curl_easy *easy)
psl = psl_latest(NULL);
dynamic = psl != NULL;
/* Take care of possible time computation overflow. */
- expires = now < TIME_T_MAX - PSL_TTL? now + PSL_TTL: TIME_T_MAX;
+ expires = now < TIME_T_MAX - PSL_TTL ? now + PSL_TTL : TIME_T_MAX;
/* Only get the built-in PSL if we do not already have the "latest". */
if(!psl && !pslcache->dynamic)
lib/request.c+3 -3
@@ -283,9 +283,9 @@ CURLcode Curl_req_set_upload_done(struct Curl_easy *data)
data->req.writebytecount);
else if(!data->req.download_done) {
DEBUGASSERT(Curl_bufq_is_empty(&data->req.sendbuf));
- infof(data, Curl_creader_total_length(data)?
- "We are completely uploaded and fine" :
- "Request completely sent off");
+ infof(data, Curl_creader_total_length(data) ?
+ "We are completely uploaded and fine" :
+ "Request completely sent off");
}
return Curl_xfer_send_close(data);
lib/rtsp.c+4 -4
@@ -359,8 +359,8 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done)
/* Accept Headers for DESCRIBE requests */
if(rtspreq == RTSPREQ_DESCRIBE) {
/* Accept Header */
- p_accept = Curl_checkheaders(data, STRCONST("Accept"))?
- NULL:"Accept: application/sdp\r\n";
+ p_accept = Curl_checkheaders(data, STRCONST("Accept")) ?
+ NULL : "Accept: application/sdp\r\n";
/* Accept-Encoding header */
if(!Curl_checkheaders(data, STRCONST("Accept-Encoding")) &&
@@ -615,7 +615,7 @@ static CURLcode rtp_write_body_junk(struct Curl_easy *data,
in_body = (data->req.headerline && !rtspc->in_header) &&
(data->req.size >= 0) &&
(data->req.bytecount < data->req.size);
- body_remain = in_body? (data->req.size - data->req.bytecount) : 0;
+ body_remain = in_body ? (data->req.size - data->req.bytecount) : 0;
DEBUGASSERT(body_remain >= 0);
if(body_remain) {
if((curl_off_t)blen > body_remain)
@@ -858,7 +858,7 @@ static CURLcode rtsp_rtp_write_resp(struct Curl_easy *data,
data->req.size));
if(!result && (is_eos || blen)) {
result = Curl_client_write(data, CLIENTWRITE_BODY|
- (is_eos? CLIENTWRITE_EOS:0),
+ (is_eos ? CLIENTWRITE_EOS : 0),
(char *)buf, blen);
}
lib/sendf.c+4 -4
@@ -575,7 +575,7 @@ bool Curl_creader_def_needs_rewind(struct Curl_easy *data,
curl_off_t Curl_creader_def_total_length(struct Curl_easy *data,
struct Curl_creader *reader)
{
- return reader->next?
+ return reader->next ?
reader->next->crt->total_length(data, reader->next) : -1;
}
@@ -1376,7 +1376,7 @@ out:
curl_off_t Curl_creader_total_length(struct Curl_easy *data)
{
struct Curl_creader *r = data->req.reader_stack;
- return r? r->crt->total_length(data, r) : -1;
+ return r ? r->crt->total_length(data, r) : -1;
}
curl_off_t Curl_creader_client_length(struct Curl_easy *data)
@@ -1384,7 +1384,7 @@ curl_off_t Curl_creader_client_length(struct Curl_easy *data)
struct Curl_creader *r = data->req.reader_stack;
while(r && r->phase != CURL_CR_CLIENT)
r = r->next;
- return r? r->crt->total_length(data, r) : -1;
+ return r ? r->crt->total_length(data, r) : -1;
}
CURLcode Curl_creader_resume_from(struct Curl_easy *data, curl_off_t offset)
@@ -1392,7 +1392,7 @@ CURLcode Curl_creader_resume_from(struct Curl_easy *data, curl_off_t offset)
struct Curl_creader *r = data->req.reader_stack;
while(r && r->phase != CURL_CR_CLIENT)
r = r->next;
- return r? r->crt->resume_from(data, r, offset) : CURLE_READ_ERROR;
+ return r ? r->crt->resume_from(data, r, offset) : CURLE_READ_ERROR;
}
CURLcode Curl_creader_unpause(struct Curl_easy *data)
lib/setopt.c+4 -4
@@ -193,7 +193,7 @@ static CURLcode protocol2num(const char *str, curl_prot_t *val)
size_t tlen;
str = strchr(str, ',');
- tlen = str? (size_t) (str - token): strlen(token);
+ tlen = str ? (size_t) (str - token) : strlen(token);
if(tlen) {
const struct Curl_handler *h = Curl_getn_scheme_handler(token, tlen);
@@ -2319,7 +2319,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
#endif
#ifdef USE_LIBPSL
if(data->psl == &data->share->psl)
- data->psl = data->multi? &data->multi->psl: NULL;
+ data->psl = data->multi ? &data->multi->psl : NULL;
#endif
data->share->dirty--;
@@ -2337,7 +2337,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
data->share->dirty++;
- if(data->share->specifier & (1<< CURL_LOCK_DATA_DNS)) {
+ if(data->share->specifier & (1 << CURL_LOCK_DATA_DNS)) {
/* use shared host cache */
data->dns.hostcache = &data->share->hostcache;
data->dns.hostcachetype = HCACHE_SHARED;
@@ -3236,7 +3236,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
}
#endif
case CURLOPT_QUICK_EXIT:
- data->set.quick_exit = (0 != va_arg(param, long)) ? 1L:0L;
+ data->set.quick_exit = (0 != va_arg(param, long)) ? 1L : 0L;
break;
default:
/* unknown tag and its companion, just ignore: */
lib/share.c+5 -5
@@ -44,7 +44,7 @@ curl_share_init(void)
struct Curl_share *share = calloc(1, sizeof(struct Curl_share));
if(share) {
share->magic = CURL_GOOD_SHARE;
- share->specifier |= (1<<CURL_LOCK_DATA_SHARE);
+ share->specifier |= (1 << CURL_LOCK_DATA_SHARE);
Curl_init_dnscache(&share->hostcache, 23);
}
@@ -139,13 +139,13 @@ curl_share_setopt(struct Curl_share *share, CURLSHoption option, ...)
res = CURLSHE_BAD_OPTION;
}
if(!res)
- share->specifier |= (unsigned int)(1<<type);
+ share->specifier |= (unsigned int)(1 << type);
break;
case CURLSHOPT_UNSHARE:
/* this is a type this share will no longer share */
type = va_arg(param, int);
- share->specifier &= ~(unsigned int)(1<<type);
+ share->specifier &= ~(unsigned int)(1 << type);
switch(type) {
case CURL_LOCK_DATA_DNS:
break;
@@ -271,7 +271,7 @@ Curl_share_lock(struct Curl_easy *data, curl_lock_data type,
if(!share)
return CURLSHE_INVALID;
- if(share->specifier & (unsigned int)(1<<type)) {
+ if(share->specifier & (unsigned int)(1 << type)) {
if(share->lockfunc) /* only call this if set! */
share->lockfunc(data, type, accesstype, share->clientdata);
}
@@ -288,7 +288,7 @@ Curl_share_unlock(struct Curl_easy *data, curl_lock_data type)
if(!share)
return CURLSHE_INVALID;
- if(share->specifier & (unsigned int)(1<<type)) {
+ if(share->specifier & (unsigned int)(1 << type)) {
if(share->unlockfunc) /* only call this if set! */
share->unlockfunc (data, type, share->clientdata);
}
lib/socks.c+1 -1
@@ -512,7 +512,7 @@ CONNECT_REQ_INIT:
/* Result */
switch(socksreq[1]) {
case 90:
- infof(data, "SOCKS4%s request granted.", protocol4a?"a":"");
+ infof(data, "SOCKS4%s request granted.", protocol4a ? "a" : "");
break;
case 91:
failf(data,
lib/socks_gssapi.c+5 -3
@@ -349,7 +349,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf,
gss_enc = 1;
infof(data, "SOCKS5 server supports GSS-API %s data protection.",
- (gss_enc == 0)?"no":((gss_enc==1)?"integrity":"confidentiality"));
+ (gss_enc == 0) ? "no" :
+ ((gss_enc == 1) ? "integrity" : "confidentiality"));
/* force for the moment to no data protection */
gss_enc = 0;
/*
@@ -525,8 +526,9 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf,
(void)curlx_nonblock(sock, TRUE);
infof(data, "SOCKS5 access with%s protection granted.",
- (socksreq[0] == 0)?"out GSS-API data":
- ((socksreq[0] == 1)?" GSS-API integrity":" GSS-API confidentiality"));
+ (socksreq[0] == 0) ? "out GSS-API data":
+ ((socksreq[0] == 1) ? " GSS-API integrity" :
+ " GSS-API confidentiality"));
conn->socks5_gssapi_enctype = socksreq[0];
if(socksreq[0] == 0)
lib/socks_sspi.c+5 -3
@@ -355,7 +355,8 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf,
gss_enc = 1;
infof(data, "SOCKS5 server supports GSS-API %s data protection.",
- (gss_enc == 0)?"no":((gss_enc == 1)?"integrity":"confidentiality") );
+ (gss_enc == 0) ? "no" :
+ ((gss_enc == 1) ? "integrity":"confidentiality") );
/* force to no data protection, avoid encryption/decryption for now */
gss_enc = 0;
/*
@@ -606,8 +607,9 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf,
(void)curlx_nonblock(sock, TRUE);
infof(data, "SOCKS5 access with%s protection granted.",
- (socksreq[0] == 0)?"out GSS-API data":
- ((socksreq[0] == 1)?" GSS-API integrity":" GSS-API confidentiality"));
+ (socksreq[0] == 0) ? "out GSS-API data":
+ ((socksreq[0] == 1) ? " GSS-API integrity" :
+ " GSS-API confidentiality"));
/* For later use if encryption is required
conn->socks5_gssapi_enctype = socksreq[0];
lib/telnet.c+3 -3
@@ -671,7 +671,7 @@ static void printsub(struct Curl_easy *data,
if(data->set.verbose) {
unsigned int i = 0;
if(direction) {
- infof(data, "%s IAC SB ", (direction == '<')? "RCVD":"SENT");
+ infof(data, "%s IAC SB ", (direction == '<') ? "RCVD" : "SENT");
if(length >= 3) {
int j;
@@ -721,8 +721,8 @@ static void printsub(struct Curl_easy *data,
switch(pointer[0]) {
case CURL_TELOPT_NAWS:
if(length > 4)
- infof(data, "Width: %d ; Height: %d", (pointer[1]<<8) | pointer[2],
- (pointer[3]<<8) | pointer[4]);
+ infof(data, "Width: %d ; Height: %d", (pointer[1] << 8) | pointer[2],
+ (pointer[3] << 8) | pointer[4]);
break;
default:
switch(pointer[1]) {
lib/tftp.c+9 -9
@@ -228,15 +228,15 @@ static CURLcode tftp_set_timeouts(struct tftp_state_data *state)
state->retry_max = (int)timeout/5;
/* But bound the total number */
- if(state->retry_max<3)
+ if(state->retry_max < 3)
state->retry_max = 3;
- if(state->retry_max>50)
+ if(state->retry_max > 50)
state->retry_max = 50;
/* Compute the re-ACK interval to suit the timeout */
state->retry_time = (int)(timeout/state->retry_max);
- if(state->retry_time<1)
+ if(state->retry_time < 1)
state->retry_time = 1;
infof(state->data,
@@ -443,7 +443,7 @@ static CURLcode tftp_send_first(struct tftp_state_data *state,
case TFTP_EVENT_TIMEOUT: /* Resend the first packet out */
/* Increment the retry counter, quit if over the limit */
state->retries++;
- if(state->retries>state->retry_max) {
+ if(state->retries > state->retry_max) {
state->error = TFTP_ERR_NORESPONSE;
state->state = TFTP_STATE_FIN;
return result;
@@ -664,7 +664,7 @@ static CURLcode tftp_rx(struct tftp_state_data *state,
4, SEND_4TH_ARG,
(struct sockaddr *)&state->remote_addr,
state->remote_addrlen);
- if(sbytes<0) {
+ if(sbytes < 0) {
failf(data, "%s", Curl_strerror(SOCKERRNO, buffer, sizeof(buffer)));
return CURLE_SEND_ERROR;
}
@@ -729,7 +729,7 @@ static CURLcode tftp_tx(struct tftp_state_data *state, tftp_event_t event)
rblock, state->block);
state->retries++;
/* Bail out if over the maximum */
- if(state->retries>state->retry_max) {
+ if(state->retries > state->retry_max) {
failf(data, "tftp_tx: giving up waiting for block %d ack",
state->block);
result = CURLE_SEND_ERROR;
@@ -741,7 +741,7 @@ static CURLcode tftp_tx(struct tftp_state_data *state, tftp_event_t event)
(struct sockaddr *)&state->remote_addr,
state->remote_addrlen);
/* Check all sbytes were sent */
- if(sbytes<0) {
+ if(sbytes < 0) {
failf(data, "%s", Curl_strerror(SOCKERRNO,
buffer, sizeof(buffer)));
result = CURLE_SEND_ERROR;
@@ -786,7 +786,7 @@ static CURLcode tftp_tx(struct tftp_state_data *state, tftp_event_t event)
(struct sockaddr *)&state->remote_addr,
state->remote_addrlen);
/* Check all sbytes were sent */
- if(sbytes<0) {
+ if(sbytes < 0) {
failf(data, "%s", Curl_strerror(SOCKERRNO, buffer, sizeof(buffer)));
return CURLE_SEND_ERROR;
}
@@ -812,7 +812,7 @@ static CURLcode tftp_tx(struct tftp_state_data *state, tftp_event_t event)
(struct sockaddr *)&state->remote_addr,
state->remote_addrlen);
/* Check all sbytes were sent */
- if(sbytes<0) {
+ if(sbytes < 0) {
failf(data, "%s", Curl_strerror(SOCKERRNO, buffer, sizeof(buffer)));
return CURLE_SEND_ERROR;
}
lib/transfer.c+6 -6
@@ -967,7 +967,7 @@ CURLcode Curl_follow(struct Curl_easy *data,
!(data->set.keep_post & CURL_REDIR_POST_303))) {
data->state.httpreq = HTTPREQ_GET;
infof(data, "Switch to %s",
- data->req.no_body?"HEAD":"GET");
+ data->req.no_body ? "HEAD" : "GET");
}
break;
case 304: /* Not Modified */
@@ -1096,7 +1096,7 @@ static void xfer_setup(
conn->sockfd = sockindex == -1 ?
CURL_SOCKET_BAD : conn->sock[sockindex];
conn->writesockfd = writesockindex == -1 ?
- CURL_SOCKET_BAD:conn->sock[writesockindex];
+ CURL_SOCKET_BAD : conn->sock[writesockindex];
}
k->getheader = getheader;
@@ -1134,8 +1134,8 @@ void Curl_xfer_setup1(struct Curl_easy *data,
curl_off_t recv_size,
bool getheader)
{
- int recv_index = (send_recv & CURL_XFER_RECV)? FIRSTSOCKET : -1;
- int send_index = (send_recv & CURL_XFER_SEND)? FIRSTSOCKET : -1;
+ int recv_index = (send_recv & CURL_XFER_RECV) ? FIRSTSOCKET : -1;
+ int send_index = (send_recv & CURL_XFER_SEND) ? FIRSTSOCKET : -1;
DEBUGASSERT((recv_index >= 0) || (recv_size == -1));
xfer_setup(data, recv_index, recv_size, getheader, send_index, FALSE);
}
@@ -1145,8 +1145,8 @@ void Curl_xfer_setup2(struct Curl_easy *data,
curl_off_t recv_size,
bool shutdown)
{
- int recv_index = (send_recv & CURL_XFER_RECV)? SECONDARYSOCKET : -1;
- int send_index = (send_recv & CURL_XFER_SEND)? SECONDARYSOCKET : -1;
+ int recv_index = (send_recv & CURL_XFER_RECV) ? SECONDARYSOCKET : -1;
+ int send_index = (send_recv & CURL_XFER_SEND) ? SECONDARYSOCKET : -1;
DEBUGASSERT((recv_index >= 0) || (recv_size == -1));
xfer_setup(data, recv_index, recv_size, FALSE, send_index, shutdown);
}
lib/url.c+1 -1
@@ -3529,7 +3529,7 @@ static CURLcode create_conn(struct Curl_easy *data,
#ifndef CURL_DISABLE_PROXY
infof(data, "Re-using existing connection with %s %s",
- conn->bits.proxy?"proxy":"host",
+ conn->bits.proxy ? "proxy" : "host",
conn->socks_proxy.host.name ? conn->socks_proxy.host.dispname :
conn->http_proxy.host.name ? conn->http_proxy.host.dispname :
conn->host.dispname);
lib/urlapi.c+12 -12
@@ -181,7 +181,7 @@ static CURLUcode urlencode_str(struct dynbuf *o, const char *url,
if(urlchar_needs_escaping(*iptr)) {
char out[3]={'%'};
- out[1] = hexdigits[*iptr>>4];
+ out[1] = hexdigits[*iptr >> 4];
out[2] = hexdigits[*iptr & 0xf];
result = Curl_dyn_addn(o, out, 3);
}
@@ -467,7 +467,7 @@ static CURLUcode parse_hostname_login(struct Curl_URL *u,
ccode = Curl_parse_login_details(login, ptr - login - 1,
&userp, &passwdp,
(h && (h->flags & PROTOPT_URLOPTIONS)) ?
- &optionsp:NULL);
+ &optionsp : NULL);
if(ccode) {
result = CURLUE_BAD_LOGIN;
goto out;
@@ -1419,8 +1419,8 @@ CURLUcode curl_url_get(const CURLU *u, CURLUPart what,
const char *ptr;
CURLUcode ifmissing = CURLUE_UNKNOWN_PART;
char portbuf[7];
- bool urldecode = (flags & CURLU_URLDECODE)?1:0;
- bool urlencode = (flags & CURLU_URLENCODE)?1:0;
+ bool urldecode = (flags & CURLU_URLDECODE) ? 1 : 0;
+ bool urlencode = (flags & CURLU_URLENCODE) ? 1 : 0;
bool punycode = FALSE;
bool depunyfy = FALSE;
bool plusdecode = FALSE;
@@ -1454,8 +1454,8 @@ CURLUcode curl_url_get(const CURLU *u, CURLUPart what,
case CURLUPART_HOST:
ptr = u->host;
ifmissing = CURLUE_NO_HOST;
- punycode = (flags & CURLU_PUNYCODE)?1:0;
- depunyfy = (flags & CURLU_PUNY2IDN)?1:0;
+ punycode = (flags & CURLU_PUNYCODE) ? 1 : 0;
+ depunyfy = (flags & CURLU_PUNY2IDN) ? 1 : 0;
break;
case CURLUPART_ZONEID:
ptr = u->zoneid;
@@ -1514,8 +1514,8 @@ CURLUcode curl_url_get(const CURLU *u, CURLUPart what,
bool show_query =
(u->query && u->query[0]) ||
(u->query_present && flags & CURLU_GET_EMPTY);
- punycode = (flags & CURLU_PUNYCODE)?1:0;
- depunyfy = (flags & CURLU_PUNY2IDN)?1:0;
+ punycode = (flags & CURLU_PUNYCODE) ? 1 : 0;
+ depunyfy = (flags & CURLU_PUNY2IDN) ? 1 : 0;
if(u->scheme && strcasecompare("file", u->scheme)) {
url = aprintf("file://%s%s%s",
u->path,
@@ -1617,7 +1617,7 @@ CURLUcode curl_url_get(const CURLU *u, CURLUPart what,
show_query ? "?": "",
u->query ? u->query : "",
show_fragment ? "#": "",
- u->fragment? u->fragment : "");
+ u->fragment ? u->fragment : "");
free(allochost);
}
if(!url)
@@ -1708,7 +1708,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what,
const char *part, unsigned int flags)
{
char **storep = NULL;
- bool urlencode = (flags & CURLU_URLENCODE)? 1 : 0;
+ bool urlencode = (flags & CURLU_URLENCODE) ? 1 : 0;
bool plusencode = FALSE;
bool urlskipslash = FALSE;
bool leadingslash = FALSE;
@@ -1845,7 +1845,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what,
break;
case CURLUPART_QUERY:
plusencode = urlencode;
- appendquery = (flags & CURLU_APPENDQUERY)?1:0;
+ appendquery = (flags & CURLU_APPENDQUERY) ? 1 : 0;
equalsencode = appendquery;
storep = &u->query;
u->query_present = TRUE;
@@ -1927,7 +1927,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what,
}
else {
char out[3]={'%'};
- out[1] = hexdigits[*i>>4];
+ out[1] = hexdigits[*i >> 4];
out[2] = hexdigits[*i & 0xf];
result = Curl_dyn_addn(&enc, out, 3);
if(result)
lib/vauth/krb5_gssapi.c+1 -1
@@ -158,7 +158,7 @@ CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data,
gss_release_buffer(&unused_status, &output_token);
}
else
- Curl_bufref_set(out, mutual_auth? "": NULL, 0, NULL);
+ Curl_bufref_set(out, mutual_auth ? "": NULL, 0, NULL);
return result;
}
lib/vauth/ntlm.c+7 -7
@@ -69,7 +69,7 @@ static void ntlm_print_flags(FILE *handle, unsigned long flags)
fprintf(handle, "NTLMFLAG_NEGOTIATE_OEM ");
if(flags & NTLMFLAG_REQUEST_TARGET)
fprintf(handle, "NTLMFLAG_REQUEST_TARGET ");
- if(flags & (1<<3))
+ if(flags & (1 << 3))
fprintf(handle, "NTLMFLAG_UNKNOWN_3 ");
if(flags & NTLMFLAG_NEGOTIATE_SIGN)
fprintf(handle, "NTLMFLAG_NEGOTIATE_SIGN ");
@@ -81,7 +81,7 @@ static void ntlm_print_flags(FILE *handle, unsigned long flags)
fprintf(handle, "NTLMFLAG_NEGOTIATE_LM_KEY ");
if(flags & NTLMFLAG_NEGOTIATE_NTLM_KEY)
fprintf(handle, "NTLMFLAG_NEGOTIATE_NTLM_KEY ");
- if(flags & (1<<10))
+ if(flags & (1 << 10))
fprintf(handle, "NTLMFLAG_UNKNOWN_10 ");
if(flags & NTLMFLAG_NEGOTIATE_ANONYMOUS)
fprintf(handle, "NTLMFLAG_NEGOTIATE_ANONYMOUS ");
@@ -109,15 +109,15 @@ static void ntlm_print_flags(FILE *handle, unsigned long flags)
fprintf(handle, "NTLMFLAG_REQUEST_NONNT_SESSION_KEY ");
if(flags & NTLMFLAG_NEGOTIATE_TARGET_INFO)
fprintf(handle, "NTLMFLAG_NEGOTIATE_TARGET_INFO ");
- if(flags & (1<<24))
+ if(flags & (1 << 24))
fprintf(handle, "NTLMFLAG_UNKNOWN_24 ");
- if(flags & (1<<25))
+ if(flags & (1 << 25))
fprintf(handle, "NTLMFLAG_UNKNOWN_25 ");
- if(flags & (1<<26))
+ if(flags & (1 << 26))
fprintf(handle, "NTLMFLAG_UNKNOWN_26 ");
- if(flags & (1<<27))
+ if(flags & (1 << 27))
fprintf(handle, "NTLMFLAG_UNKNOWN_27 ");
- if(flags & (1<<28))
+ if(flags & (1 << 28))
fprintf(handle, "NTLMFLAG_UNKNOWN_28 ");
if(flags & NTLMFLAG_NEGOTIATE_128)
fprintf(handle, "NTLMFLAG_NEGOTIATE_128 ");
lib/vquic/curl_msh3.c+3 -3
@@ -1020,7 +1020,7 @@ static CURLcode cf_msh3_query(struct Curl_cfilter *cf,
default:
break;
}
- return cf->next?
+ return cf->next ?
cf->next->cft->query(cf->next, data, query, pres1, pres2) :
CURLE_UNKNOWN_OPTION;
}
@@ -1092,7 +1092,7 @@ CURLcode Curl_cf_msh3_create(struct Curl_cfilter **pcf,
result = Curl_cf_create(&cf, &Curl_cft_http3, ctx);
out:
- *pcf = (!result)? cf : NULL;
+ *pcf = (!result) ? cf : NULL;
if(result) {
Curl_safefree(cf);
cf_msh3_ctx_free(ctx);
@@ -1105,7 +1105,7 @@ bool Curl_conn_is_msh3(const struct Curl_easy *data,
const struct connectdata *conn,
int sockindex)
{
- struct Curl_cfilter *cf = conn? conn->cfilter[sockindex] : NULL;
+ struct Curl_cfilter *cf = conn ? conn->cfilter[sockindex] : NULL;
(void)data;
for(; cf; cf = cf->next) {
lib/vquic/curl_ngtcp2.c+12 -12
@@ -1199,7 +1199,7 @@ static ssize_t recv_closed_stream(struct Curl_cfilter *cf,
(void)cf;
if(stream->reset) {
failf(data, "HTTP/3 stream %" FMT_PRId64 " reset by server", stream->id);
- *err = data->req.bytecount? CURLE_PARTIAL_FILE : CURLE_HTTP3;
+ *err = data->req.bytecount ? CURLE_PARTIAL_FILE : CURLE_HTTP3;
goto out;
}
else if(!stream->resp_hds_complete) {
@@ -1277,7 +1277,7 @@ out:
}
}
CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_recv(blen=%zu) -> %zd, %d",
- stream? stream->id : -1, blen, nread, *err);
+ stream ? stream->id : -1, blen, nread, *err);
CF_DATA_RESTORE(cf, save);
return nread;
}
@@ -1375,7 +1375,7 @@ cb_h3_read_req_body(nghttp3_conn *conn, int64_t stream_id,
CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] read req body -> "
"%d vecs%s with %zu (buffered=%zu, left=%" FMT_OFF_T ")",
stream->id, (int)nvecs,
- *pflags == NGHTTP3_DATA_FLAG_EOF?" EOF":"",
+ *pflags == NGHTTP3_DATA_FLAG_EOF ? " EOF" : "",
nwritten, Curl_bufq_len(&stream->sendbuf),
stream->upload_left);
return (nghttp3_ssize)nvecs;
@@ -1612,7 +1612,7 @@ out:
sent = -1;
}
CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_send(len=%zu) -> %zd, %d",
- stream? stream->id : -1, len, sent, *err);
+ stream ? stream->id : -1, len, sent, *err);
CF_DATA_RESTORE(cf, save);
return sent;
}
@@ -2142,9 +2142,9 @@ static int quic_ossl_new_session_cb(SSL *ssl, SSL_SESSION *ssl_sessionid)
ngtcp2_crypto_conn_ref *cref;
cref = (ngtcp2_crypto_conn_ref *)SSL_get_app_data(ssl);
- cf = cref? cref->user_data : NULL;
- ctx = cf? cf->ctx : NULL;
- data = cf? CF_DATA_CURRENT(cf) : NULL;
+ cf = cref ? cref->user_data : NULL;
+ ctx = cf ? cf->ctx : NULL;
+ data = cf ? CF_DATA_CURRENT(cf) : NULL;
if(cf && data && ctx) {
Curl_ossl_add_session(cf, data, &ctx->peer, ssl_sessionid);
return 1;
@@ -2394,7 +2394,7 @@ static CURLcode cf_ngtcp2_query(struct Curl_cfilter *cf,
if(ctx->max_bidi_streams > ctx->used_bidi_streams)
avail_bidi_streams = ctx->max_bidi_streams - ctx->used_bidi_streams;
max_streams += avail_bidi_streams;
- *pres1 = (max_streams > INT_MAX)? INT_MAX : (int)max_streams;
+ *pres1 = (max_streams > INT_MAX) ? INT_MAX : (int)max_streams;
}
else /* transport params not arrived yet? take our default. */
*pres1 = (int)Curl_multi_max_concurrent_streams(data->multi);
@@ -2407,7 +2407,7 @@ static CURLcode cf_ngtcp2_query(struct Curl_cfilter *cf,
case CF_QUERY_CONNECT_REPLY_MS:
if(ctx->q.got_first_byte) {
timediff_t ms = Curl_timediff(ctx->q.first_byte_at, ctx->started_at);
- *pres1 = (ms < INT_MAX)? (int)ms : INT_MAX;
+ *pres1 = (ms < INT_MAX) ? (int)ms : INT_MAX;
}
else
*pres1 = -1;
@@ -2427,7 +2427,7 @@ static CURLcode cf_ngtcp2_query(struct Curl_cfilter *cf,
default:
break;
}
- return cf->next?
+ return cf->next ?
cf->next->cft->query(cf->next, data, query, pres1, pres2) :
CURLE_UNKNOWN_OPTION;
}
@@ -2534,7 +2534,7 @@ CURLcode Curl_cf_ngtcp2_create(struct Curl_cfilter **pcf,
cf->next = udp_cf;
out:
- *pcf = (!result)? cf : NULL;
+ *pcf = (!result) ? cf : NULL;
if(result) {
if(udp_cf)
Curl_conn_cf_discard_sub(cf, udp_cf, data, TRUE);
@@ -2548,7 +2548,7 @@ bool Curl_conn_is_ngtcp2(const struct Curl_easy *data,
const struct connectdata *conn,
int sockindex)
{
- struct Curl_cfilter *cf = conn? conn->cfilter[sockindex] : NULL;
+ struct Curl_cfilter *cf = conn ? conn->cfilter[sockindex] : NULL;
(void)data;
for(; cf; cf = cf->next) {
lib/vquic/curl_osslq.c+10 -10
@@ -1037,7 +1037,7 @@ cb_h3_read_req_body(nghttp3_conn *conn, int64_t stream_id,
CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] read req body -> "
"%d vecs%s with %zu (buffered=%zu, left=%" FMT_OFF_T ")",
stream->s.id, (int)nvecs,
- *pflags == NGHTTP3_DATA_FLAG_EOF?" EOF":"",
+ *pflags == NGHTTP3_DATA_FLAG_EOF ? " EOF" : "",
nwritten, Curl_bufq_len(&stream->sendbuf),
stream->upload_left);
return (nghttp3_ssize)nvecs;
@@ -1531,7 +1531,7 @@ static CURLcode h3_send_streams(struct Curl_cfilter *cf,
for(i = 0; (i < n) && !blocked; ++i) {
/* Without stream->s.ssl, we closed that already, so
* pretend the write did succeed. */
- uint64_t flags = (eos && ((i + 1) == n))? SSL_WRITE_FLAG_CONCLUDE : 0;
+ uint64_t flags = (eos && ((i + 1) == n)) ? SSL_WRITE_FLAG_CONCLUDE : 0;
written = vec[i].len;
ok = !s->ssl || SSL_write_ex2(s->ssl, vec[i].base, vec[i].len, flags,
&written);
@@ -1985,7 +1985,7 @@ static ssize_t cf_osslq_send(struct Curl_cfilter *cf, struct Curl_easy *data,
out:
result = check_and_set_expiry(cf, data);
CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_send(len=%zu) -> %zd, %d",
- stream? stream->s.id : -1, len, nwritten, *err);
+ stream ? stream->s.id : -1, len, nwritten, *err);
CF_DATA_RESTORE(cf, save);
return nwritten;
}
@@ -2002,7 +2002,7 @@ static ssize_t recv_closed_stream(struct Curl_cfilter *cf,
failf(data,
"HTTP/3 stream %" FMT_PRId64 " reset by server",
stream->s.id);
- *err = data->req.bytecount? CURLE_PARTIAL_FILE : CURLE_HTTP3;
+ *err = data->req.bytecount ? CURLE_PARTIAL_FILE : CURLE_HTTP3;
goto out;
}
else if(!stream->resp_hds_complete) {
@@ -2096,7 +2096,7 @@ out:
}
}
CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] cf_recv(len=%zu) -> %zd, %d",
- stream? stream->s.id : -1, len, nread, *err);
+ stream ? stream->s.id : -1, len, nread, *err);
CF_DATA_RESTORE(cf, save);
return nread;
}
@@ -2266,7 +2266,7 @@ static CURLcode cf_osslq_query(struct Curl_cfilter *cf,
}
/* we report avail + in_use */
v += CONN_INUSE(cf->conn);
- *pres1 = (v > INT_MAX)? INT_MAX : (int)v;
+ *pres1 = (v > INT_MAX) ? INT_MAX : (int)v;
#else
*pres1 = 100;
#endif
@@ -2276,7 +2276,7 @@ static CURLcode cf_osslq_query(struct Curl_cfilter *cf,
case CF_QUERY_CONNECT_REPLY_MS:
if(ctx->got_first_byte) {
timediff_t ms = Curl_timediff(ctx->first_byte_at, ctx->started_at);
- *pres1 = (ms < INT_MAX)? (int)ms : INT_MAX;
+ *pres1 = (ms < INT_MAX) ? (int)ms : INT_MAX;
}
else
*pres1 = -1;
@@ -2296,7 +2296,7 @@ static CURLcode cf_osslq_query(struct Curl_cfilter *cf,
default:
break;
}
- return cf->next?
+ return cf->next ?
cf->next->cft->query(cf->next, data, query, pres1, pres2) :
CURLE_UNKNOWN_OPTION;
}
@@ -2351,7 +2351,7 @@ CURLcode Curl_cf_osslq_create(struct Curl_cfilter **pcf,
cf->next = udp_cf;
out:
- *pcf = (!result)? cf : NULL;
+ *pcf = (!result) ? cf : NULL;
if(result) {
if(udp_cf)
Curl_conn_cf_discard_sub(cf, udp_cf, data, TRUE);
@@ -2365,7 +2365,7 @@ bool Curl_conn_is_osslq(const struct Curl_easy *data,
const struct connectdata *conn,
int sockindex)
{
- struct Curl_cfilter *cf = conn? conn->cfilter[sockindex] : NULL;
+ struct Curl_cfilter *cf = conn ? conn->cfilter[sockindex] : NULL;
(void)data;
for(; cf; cf = cf->next) {
lib/vquic/curl_quiche.c+7 -7
@@ -818,7 +818,7 @@ static ssize_t recv_closed_stream(struct Curl_cfilter *cf,
if(stream->reset) {
failf(data,
"HTTP/3 stream %" FMT_PRIu64 " reset by server", stream->id);
- *err = data->req.bytecount? CURLE_PARTIAL_FILE : CURLE_HTTP3;
+ *err = data->req.bytecount ? CURLE_PARTIAL_FILE : CURLE_HTTP3;
CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] cf_recv, was reset -> %d",
stream->id, *err);
}
@@ -1146,7 +1146,7 @@ out:
nwritten = -1;
}
CURL_TRC_CF(data, cf, "[%" FMT_PRIu64 "] cf_send(len=%zu) -> %zd, %d",
- stream? stream->id : (curl_uint64_t)~0, len, nwritten, *err);
+ stream ? stream->id : (curl_uint64_t)~0, len, nwritten, *err);
return nwritten;
}
@@ -1546,7 +1546,7 @@ static CURLcode cf_quiche_query(struct Curl_cfilter *cf,
if(!ctx->goaway) {
max_streams += quiche_conn_peer_streams_left_bidi(ctx->qconn);
}
- *pres1 = (max_streams > INT_MAX)? INT_MAX : (int)max_streams;
+ *pres1 = (max_streams > INT_MAX) ? INT_MAX : (int)max_streams;
CURL_TRC_CF(data, cf, "query conn[%" FMT_OFF_T "]: "
"MAX_CONCURRENT -> %d (%zu in use)",
cf->conn->connection_id, *pres1, CONN_INUSE(cf->conn));
@@ -1555,7 +1555,7 @@ static CURLcode cf_quiche_query(struct Curl_cfilter *cf,
case CF_QUERY_CONNECT_REPLY_MS:
if(ctx->q.got_first_byte) {
timediff_t ms = Curl_timediff(ctx->q.first_byte_at, ctx->started_at);
- *pres1 = (ms < INT_MAX)? (int)ms : INT_MAX;
+ *pres1 = (ms < INT_MAX) ? (int)ms : INT_MAX;
}
else
*pres1 = -1;
@@ -1575,7 +1575,7 @@ static CURLcode cf_quiche_query(struct Curl_cfilter *cf,
default:
break;
}
- return cf->next?
+ return cf->next ?
cf->next->cft->query(cf->next, data, query, pres1, pres2) :
CURLE_UNKNOWN_OPTION;
}
@@ -1667,7 +1667,7 @@ CURLcode Curl_cf_quiche_create(struct Curl_cfilter **pcf,
cf->next = udp_cf;
out:
- *pcf = (!result)? cf : NULL;
+ *pcf = (!result) ? cf : NULL;
if(result) {
if(udp_cf)
Curl_conn_cf_discard_sub(cf, udp_cf, data, TRUE);
@@ -1682,7 +1682,7 @@ bool Curl_conn_is_quiche(const struct Curl_easy *data,
const struct connectdata *conn,
int sockindex)
{
- struct Curl_cfilter *cf = conn? conn->cfilter[sockindex] : NULL;
+ struct Curl_cfilter *cf = conn ? conn->cfilter[sockindex] : NULL;
(void)data;
for(; cf; cf = cf->next) {
lib/vssh/libssh2.c+11 -11
@@ -397,7 +397,7 @@ static int sshkeycallback(struct Curl_easy *easy,
(void)clientp;
/* we only allow perfect matches, and we reject everything else */
- return (match != CURLKHMATCH_OK)?CURLKHSTAT_REJECT:CURLKHSTAT_FINE;
+ return (match != CURLKHMATCH_OK) ? CURLKHSTAT_REJECT : CURLKHSTAT_FINE;
}
#endif
@@ -534,8 +534,8 @@ static CURLcode ssh_knownhost(struct Curl_easy *data)
#ifdef HAVE_LIBSSH2_KNOWNHOST_CHECKP
keycheck = libssh2_knownhost_checkp(sshc->kh,
conn->host.name,
- (conn->remote_port != PORT_SSH)?
- conn->remote_port:-1,
+ (conn->remote_port != PORT_SSH) ?
+ conn->remote_port : -1,
remotekey, keylen,
LIBSSH2_KNOWNHOST_TYPE_PLAIN|
LIBSSH2_KNOWNHOST_KEYENC_RAW|
@@ -552,8 +552,8 @@ static CURLcode ssh_knownhost(struct Curl_easy *data)
#endif
infof(data, "SSH host check: %d, key: %s", keycheck,
- (keycheck <= LIBSSH2_KNOWNHOST_CHECK_MISMATCH)?
- host->key:"<none>");
+ (keycheck <= LIBSSH2_KNOWNHOST_CHECK_MISMATCH) ?
+ host->key : "<none>");
/* setup 'knownkey' */
if(keycheck <= LIBSSH2_KNOWNHOST_CHECK_MISMATCH) {
@@ -2106,7 +2106,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block)
if(sshc->secondCreateDirs) {
state(data, SSH_SFTP_CLOSE);
sshc->actualcode = sftperr != LIBSSH2_FX_OK ?
- sftp_libssh2_error_to_CURLE(sftperr):CURLE_SSH;
+ sftp_libssh2_error_to_CURLE(sftperr) : CURLE_SSH;
failf(data, "Creating the dir/file failed: %s",
sftp_libssh2_strerror(sftperr));
break;
@@ -2124,7 +2124,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block)
}
state(data, SSH_SFTP_CLOSE);
sshc->actualcode = sftperr != LIBSSH2_FX_OK ?
- sftp_libssh2_error_to_CURLE(sftperr):CURLE_SSH;
+ sftp_libssh2_error_to_CURLE(sftperr) : CURLE_SSH;
if(!sshc->actualcode) {
/* Sometimes, for some reason libssh2_sftp_last_error() returns zero
even though libssh2_sftp_open() failed previously! We need to
@@ -2134,7 +2134,7 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block)
}
failf(data, "Upload failed: %s (%lu/%d)",
sftperr != LIBSSH2_FX_OK ?
- sftp_libssh2_strerror(sftperr):"ssh error",
+ sftp_libssh2_strerror(sftperr) : "ssh error",
sftperr, rc);
break;
}
@@ -3078,8 +3078,8 @@ static void ssh_block2waitfor(struct Curl_easy *data, bool block)
dir = libssh2_session_block_directions(sshc->ssh_session);
if(dir) {
/* translate the libssh2 define bits into our own bit defines */
- conn->waitfor = ((dir&LIBSSH2_SESSION_BLOCK_INBOUND)?KEEP_RECV:0) |
- ((dir&LIBSSH2_SESSION_BLOCK_OUTBOUND)?KEEP_SEND:0);
+ conn->waitfor = ((dir&LIBSSH2_SESSION_BLOCK_INBOUND) ? KEEP_RECV : 0) |
+ ((dir&LIBSSH2_SESSION_BLOCK_OUTBOUND) ? KEEP_SEND : 0);
}
}
if(!dir)
@@ -3156,7 +3156,7 @@ static CURLcode ssh_block_statemach(struct Curl_easy *data,
fd_write = sock;
/* wait for the socket to become ready */
(void)Curl_socket_check(fd_read, CURL_SOCKET_BAD, fd_write,
- left>1000?1000:left);
+ left > 1000 ? 1000 : left);
}
}
lib/vssh/wolfssh.c+6 -6
@@ -256,8 +256,8 @@ static ssize_t wsftp_send(struct Curl_easy *data, int sockindex,
(void)sockindex;
(void)eos;
- offset[0] = (word32)sshc->offset&0xFFFFFFFF;
- offset[1] = (word32)(sshc->offset>>32)&0xFFFFFFFF;
+ offset[0] = (word32)sshc->offset & 0xFFFFFFFF;
+ offset[1] = (word32)(sshc->offset >> 32) & 0xFFFFFFFF;
rc = wolfSSH_SFTP_SendWritePacket(sshc->ssh_session, sshc->handle,
sshc->handleSz,
@@ -300,8 +300,8 @@ static ssize_t wsftp_recv(struct Curl_easy *data, int sockindex,
word32 offset[2];
(void)sockindex;
- offset[0] = (word32)sshc->offset&0xFFFFFFFF;
- offset[1] = (word32)(sshc->offset>>32)&0xFFFFFFFF;
+ offset[0] = (word32)sshc->offset & 0xFFFFFFFF;
+ offset[1] = (word32)(sshc->offset >> 32) & 0xFFFFFFFF;
rc = wolfSSH_SFTP_SendReadPacket(sshc->ssh_session, sshc->handle,
sshc->handleSz,
@@ -763,7 +763,7 @@ static CURLcode wssh_statemach_act(struct Curl_easy *data, bool *block)
return CURLE_SSH;
}
- size = ((curl_off_t)attrs.sz[1] <<32) | attrs.sz[0];
+ size = ((curl_off_t)attrs.sz[1] << 32) | attrs.sz[0];
data->req.size = size;
data->req.maxdownload = size;
@@ -1028,7 +1028,7 @@ static CURLcode wssh_block_statemach(struct Curl_easy *data,
/* wait for the socket to become ready */
(void)Curl_socket_check(fd_read, CURL_SOCKET_BAD, fd_write,
- left>1000?1000:left); /* ignore result */
+ left > 1000 ? 1000 : left); /* ignore result */
}
}
lib/vtls/bearssl.c+6 -7
@@ -821,7 +821,7 @@ static CURLcode bearssl_connect_step3(struct Curl_cfilter *cf,
proto = br_ssl_engine_get_selected_protocol(&backend->ctx.eng);
Curl_alpn_set_negotiated(cf, data, (const unsigned char *)proto,
- proto? strlen(proto) : 0);
+ proto ? strlen(proto) : 0);
}
if(ssl_config->primary.cache_session) {
@@ -941,15 +941,14 @@ static CURLcode bearssl_connect_common(struct Curl_cfilter *cf,
/* if ssl is expecting something, check if it is available. */
if(connssl->io_need) {
-
- curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND)?
- sockfd:CURL_SOCKET_BAD;
- curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV)?
- sockfd:CURL_SOCKET_BAD;
+ curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ?
+ sockfd : CURL_SOCKET_BAD;
+ curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ?
+ sockfd : CURL_SOCKET_BAD;
CURL_TRC_CF(data, cf, "connect_common, check socket");
what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd,
- nonblocking?0:timeout_ms);
+ nonblocking ? 0 : timeout_ms);
CURL_TRC_CF(data, cf, "connect_common, check socket -> %d", what);
if(what < 0) {
/* fatal error */
lib/vtls/gtls.c+25 -26
@@ -108,7 +108,7 @@ static ssize_t gtls_push(void *s, const void *buf, size_t blen)
backend->gtls.io_result = result;
if(nwritten < 0) {
gnutls_transport_set_errno(backend->gtls.session,
- (CURLE_AGAIN == result)? EAGAIN : EINVAL);
+ (CURLE_AGAIN == result) ? EAGAIN : EINVAL);
nwritten = -1;
}
return nwritten;
@@ -140,7 +140,7 @@ static ssize_t gtls_pull(void *s, void *buf, size_t blen)
backend->gtls.io_result = result;
if(nread < 0) {
gnutls_transport_set_errno(backend->gtls.session,
- (CURLE_AGAIN == result)? EAGAIN : EINVAL);
+ (CURLE_AGAIN == result) ? EAGAIN : EINVAL);
nread = -1;
}
else if(nread == 0)
@@ -159,7 +159,7 @@ static int gtls_init(void)
{
int ret = 1;
if(!gtls_inited) {
- ret = gnutls_global_init()?0:1;
+ ret = gnutls_global_init() ? 0 : 1;
#ifdef GTLSDEBUG
gnutls_global_set_log_function(tls_log_func);
gnutls_global_set_log_level(2);
@@ -193,7 +193,7 @@ static void showtime(struct Curl_easy *data,
sizeof(str),
" %s: %s, %02d %s %4d %02d:%02d:%02d GMT",
text,
- Curl_wkday[tm->tm_wday?tm->tm_wday-1:6],
+ Curl_wkday[tm->tm_wday ? tm->tm_wday-1 : 6],
tm->tm_mday,
Curl_month[tm->tm_mon],
tm->tm_year + 1900,
@@ -269,14 +269,14 @@ static CURLcode handshake(struct Curl_cfilter *cf,
/* if ssl is expecting something, check if it is available. */
if(connssl->io_need) {
int what;
- curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND)?
- sockfd:CURL_SOCKET_BAD;
- curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV)?
- sockfd:CURL_SOCKET_BAD;
+ curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ?
+ sockfd : CURL_SOCKET_BAD;
+ curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ?
+ sockfd : CURL_SOCKET_BAD;
what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd,
- nonblocking?0:
- timeout_ms?timeout_ms:1000);
+ nonblocking ? 0 :
+ timeout_ms ? timeout_ms : 1000);
if(what < 0) {
/* fatal error */
failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO);
@@ -308,8 +308,8 @@ static CURLcode handshake(struct Curl_cfilter *cf,
if((rc == GNUTLS_E_AGAIN) || (rc == GNUTLS_E_INTERRUPTED)) {
connssl->io_need =
- gnutls_record_get_direction(session)?
- CURL_SSL_IO_NEED_SEND:CURL_SSL_IO_NEED_RECV;
+ gnutls_record_get_direction(session) ?
+ CURL_SSL_IO_NEED_SEND : CURL_SSL_IO_NEED_RECV;
continue;
}
else if((rc < 0) && !gnutls_error_is_fatal(rc)) {
@@ -770,7 +770,7 @@ static int gtls_handshake_cb(gnutls_session_t session, unsigned int htype,
struct Curl_easy *data = CF_DATA_CURRENT(cf);
if(data) {
CURL_TRC_CF(data, cf, "handshake: %s message type %d",
- incoming? "incoming" : "outgoing", htype);
+ incoming ? "incoming" : "outgoing", htype);
switch(htype) {
case GNUTLS_HANDSHAKE_NEW_SESSION_TICKET: {
gtls_update_session_id(cf, data, session);
@@ -1313,7 +1313,7 @@ Curl_gtls_verifyserver(struct Curl_easy *data,
cause = "attached OCSP status response is invalid";
failf(data, "server verification failed: %s. (CAfile: %s "
"CRLfile: %s)", cause,
- config->CAfile ? config->CAfile: "none",
+ config->CAfile ? config->CAfile : "none",
ssl_config->primary.CRLfile ?
ssl_config->primary.CRLfile : "none");
return CURLE_PEER_FAILED_VERIFICATION;
@@ -1440,12 +1440,12 @@ Curl_gtls_verifyserver(struct Curl_easy *data,
unload_file(issuerp);
if(rc <= 0) {
failf(data, "server certificate issuer check failed (IssuerCert: %s)",
- config->issuercert?config->issuercert:"none");
+ config->issuercert ? config->issuercert : "none");
gnutls_x509_crt_deinit(x509_cert);
return CURLE_SSL_ISSUER_ERROR;
}
infof(data, " server certificate issuer check OK (Issuer Cert: %s)",
- config->issuercert?config->issuercert:"none");
+ config->issuercert ? config->issuercert : "none");
}
size = sizeof(certname);
@@ -1650,8 +1650,8 @@ static CURLcode gtls_verifyserver(struct Curl_cfilter *cf,
struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf);
struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data);
#ifndef CURL_DISABLE_PROXY
- const char *pinned_key = Curl_ssl_cf_is_proxy(cf)?
- data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY]:
+ const char *pinned_key = Curl_ssl_cf_is_proxy(cf) ?
+ data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY] :
data->set.str[STRING_SSL_PINNEDPUBLICKEY];
#else
const char *pinned_key = data->set.str[STRING_SSL_PINNEDPUBLICKEY];
@@ -1800,9 +1800,9 @@ static ssize_t gtls_send(struct Curl_cfilter *cf,
rc = (ssize_t)total_written;
goto out;
}
- *curlcode = (rc == GNUTLS_E_AGAIN)?
+ *curlcode = (rc == GNUTLS_E_AGAIN) ?
CURLE_AGAIN :
- (backend->gtls.io_result? backend->gtls.io_result : CURLE_SEND_ERROR);
+ (backend->gtls.io_result ? backend->gtls.io_result : CURLE_SEND_ERROR);
rc = -1;
goto out;
@@ -1851,7 +1851,7 @@ static CURLcode gtls_shutdown(struct Curl_cfilter *cf,
int ret = gnutls_bye(backend->gtls.session, GNUTLS_SHUT_RDWR);
if((ret == GNUTLS_E_AGAIN) || (ret == GNUTLS_E_INTERRUPTED)) {
CURL_TRC_CF(data, cf, "SSL shutdown, gnutls_bye EAGAIN");
- connssl->io_need = gnutls_record_get_direction(backend->gtls.session)?
+ connssl->io_need = gnutls_record_get_direction(backend->gtls.session) ?
CURL_SSL_IO_NEED_SEND : CURL_SSL_IO_NEED_RECV;
backend->gtls.sent_shutdown = FALSE;
result = CURLE_OK;
@@ -1881,7 +1881,7 @@ static CURLcode gtls_shutdown(struct Curl_cfilter *cf,
*done = TRUE;
}
else if((nread == GNUTLS_E_AGAIN) || (nread == GNUTLS_E_INTERRUPTED)) {
- connssl->io_need = gnutls_record_get_direction(backend->gtls.session)?
+ connssl->io_need = gnutls_record_get_direction(backend->gtls.session) ?
CURL_SSL_IO_NEED_SEND : CURL_SSL_IO_NEED_RECV;
}
else {
@@ -1957,10 +1957,9 @@ static ssize_t gtls_recv(struct Curl_cfilter *cf,
if(ret < 0) {
failf(data, "GnuTLS recv error (%d): %s",
-
(int)ret, gnutls_strerror((int)ret));
- *curlcode = backend->gtls.io_result?
- backend->gtls.io_result : CURLE_RECV_ERROR;
+ *curlcode = backend->gtls.io_result ?
+ backend->gtls.io_result : CURLE_RECV_ERROR;
ret = -1;
goto out;
}
@@ -1981,7 +1980,7 @@ static CURLcode gtls_random(struct Curl_easy *data,
int rc;
(void)data;
rc = gnutls_rnd(GNUTLS_RND_RANDOM, entropy, length);
- return rc?CURLE_FAILED_INIT:CURLE_OK;
+ return rc ? CURLE_FAILED_INIT : CURLE_OK;
}
static CURLcode gtls_sha256sum(const unsigned char *tmp, /* input */
lib/vtls/mbedtls.c+14 -15
@@ -638,7 +638,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
ret = mbedtls_x509_crt_parse(&backend->cacert, newblob,
ca_info_blob->len + 1);
free(newblob);
- if(ret<0) {
+ if(ret < 0) {
mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
failf(data, "Error importing ca cert blob - mbedTLS: (-0x%04X) %s",
-ret, errorbuf);
@@ -650,7 +650,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
#ifdef MBEDTLS_FS_IO
ret = mbedtls_x509_crt_parse_file(&backend->cacert, ssl_cafile);
- if(ret<0) {
+ if(ret < 0) {
mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
failf(data, "Error reading ca cert file %s - mbedTLS: (-0x%04X) %s",
ssl_cafile, -ret, errorbuf);
@@ -666,7 +666,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
#ifdef MBEDTLS_FS_IO
ret = mbedtls_x509_crt_parse_path(&backend->cacert, ssl_capath);
- if(ret<0) {
+ if(ret < 0) {
mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
failf(data, "Error reading ca cert path %s - mbedTLS: (-0x%04X) %s",
ssl_capath, -ret, errorbuf);
@@ -911,7 +911,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
&backend->clicert, &backend->pk);
}
- if(mbedtls_ssl_set_hostname(&backend->ssl, connssl->peer.sni?
+ if(mbedtls_ssl_set_hostname(&backend->ssl, connssl->peer.sni ?
connssl->peer.sni : connssl->peer.hostname)) {
/* mbedtls_ssl_set_hostname() sets the name to use in CN/SAN checks and
the name to set in the SNI extension. So even if curl connects to a
@@ -975,8 +975,8 @@ mbed_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data)
struct mbed_ssl_backend_data *backend =
(struct mbed_ssl_backend_data *)connssl->backend;
#ifndef CURL_DISABLE_PROXY
- const char * const pinnedpubkey = Curl_ssl_cf_is_proxy(cf)?
- data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY]:
+ const char * const pinnedpubkey = Curl_ssl_cf_is_proxy(cf) ?
+ data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY] :
data->set.str[STRING_SSL_PINNEDPUBLICKEY];
#else
const char * const pinnedpubkey = data->set.str[STRING_SSL_PINNEDPUBLICKEY];
@@ -1103,7 +1103,7 @@ pinnedpubkey_error:
const char *proto = mbedtls_ssl_get_alpn_protocol(&backend->ssl);
Curl_alpn_set_negotiated(cf, data, (const unsigned char *)proto,
- proto? strlen(proto) : 0);
+ proto ? strlen(proto) : 0);
}
#endif
@@ -1186,7 +1186,7 @@ static ssize_t mbed_send(struct Curl_cfilter *cf, struct Curl_easy *data,
#ifdef TLS13_SUPPORT
|| (ret == MBEDTLS_ERR_SSL_RECEIVED_NEW_SESSION_TICKET)
#endif
- )? CURLE_AGAIN : CURLE_SEND_ERROR;
+ ) ? CURLE_AGAIN : CURLE_SEND_ERROR;
ret = -1;
}
@@ -1357,8 +1357,8 @@ static size_t mbedtls_version(char *buffer, size_t size)
#ifdef MBEDTLS_VERSION_C
/* if mbedtls_version_get_number() is available it is better */
unsigned int version = mbedtls_version_get_number();
- return msnprintf(buffer, size, "mbedTLS/%u.%u.%u", version>>24,
- (version>>16)&0xff, (version>>8)&0xff);
+ return msnprintf(buffer, size, "mbedTLS/%u.%u.%u", version >> 24,
+ (version >> 16) & 0xff, (version >> 8) & 0xff);
#else
return msnprintf(buffer, size, "mbedTLS/%s", MBEDTLS_VERSION_STRING);
#endif
@@ -1452,11 +1452,10 @@ mbed_connect_common(struct Curl_cfilter *cf, struct Curl_easy *data,
/* if ssl is expecting something, check if it is available. */
if(connssl->io_need) {
-
- curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND)?
- sockfd:CURL_SOCKET_BAD;
- curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV)?
- sockfd:CURL_SOCKET_BAD;
+ curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ?
+ sockfd : CURL_SOCKET_BAD;
+ curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ?
+ sockfd : CURL_SOCKET_BAD;
what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd,
nonblocking ? 0 : timeout_ms);
lib/vtls/openssl.c+27 -27
@@ -1558,7 +1558,8 @@ fail:
SSL_CTX_use_PrivateKey_file(ctx, key_file, file_type);
if(cert_use_result != 1) {
failf(data, "unable to set private key file: '%s' type %s",
- key_file?key_file:"(memory blob)", key_type?key_type:"PEM");
+ key_file ? key_file : "(memory blob)",
+ key_type ? key_type : "PEM");
return 0;
}
break;
@@ -2685,7 +2686,7 @@ static void ossl_trace(int direction, int ssl_ver, int content_type,
txt_len = msnprintf(ssl_buf, sizeof(ssl_buf),
"%s (%s), %s, %s (%d):\n",
- verstr, direction?"OUT":"IN",
+ verstr, direction ? "OUT" : "IN",
tls_rt_name, msg_name, msg_type);
if(0 <= txt_len && (unsigned)txt_len < sizeof(ssl_buf)) {
Curl_debug(data, CURLINFO_TEXT, ssl_buf, (size_t)txt_len);
@@ -2941,8 +2942,8 @@ static int ossl_new_session_cb(SSL *ssl, SSL_SESSION *ssl_sessionid)
struct ssl_connect_data *connssl;
cf = (struct Curl_cfilter*) SSL_get_app_data(ssl);
- connssl = cf? cf->ctx : NULL;
- data = connssl? CF_DATA_CURRENT(cf) : NULL;
+ connssl = cf ? cf->ctx : NULL;
+ data = connssl ? CF_DATA_CURRENT(cf) : NULL;
Curl_ossl_add_session(cf, data, &connssl->peer, ssl_sessionid);
return 0;
}
@@ -3167,7 +3168,7 @@ static CURLcode populate_x509_store(struct Curl_cfilter *cf,
bool imported_ca_info_blob = false;
CURL_TRC_CF(data, cf, "populate_x509_store, path=%s, blob=%d",
- ssl_cafile? ssl_cafile : "none", !!ca_info_blob);
+ ssl_cafile ? ssl_cafile : "none", !!ca_info_blob);
if(!store)
return CURLE_OUT_OF_MEMORY;
@@ -3371,9 +3372,9 @@ static X509_STORE *get_cached_x509_store(struct Curl_cfilter *cf,
X509_STORE *store = NULL;
DEBUGASSERT(multi);
- share = multi? Curl_hash_pick(&multi->proto_hash,
- (void *)MPROTO_OSSL_X509_KEY,
- sizeof(MPROTO_OSSL_X509_KEY)-1) : NULL;
+ share = multi ? Curl_hash_pick(&multi->proto_hash,
+ (void *)MPROTO_OSSL_X509_KEY,
+ sizeof(MPROTO_OSSL_X509_KEY)-1) : NULL;
if(share && share->store &&
!cached_x509_store_expired(data, share) &&
!cached_x509_store_different(cf, share)) {
@@ -4312,7 +4313,7 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf,
infof(data, "SSL connection using %s / %s / %s / %s",
SSL_get_version(octx->ssl),
SSL_get_cipher(octx->ssl),
- negotiated_group_name? negotiated_group_name : "[blank]",
+ negotiated_group_name ? negotiated_group_name : "[blank]",
OBJ_nid2sn(psigtype_nid));
#ifdef USE_ECH
@@ -4356,9 +4357,9 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf,
infof(data, "ECH: unexpected status %d",rv);
}
infof(data, "ECH: result: status is %s, inner is %s, outer is %s",
- (status ? status : "NULL"),
- (inner ? inner : "NULL"),
- (outer ? outer : "NULL"));
+ (status ? status : "NULL"),
+ (inner ? inner : "NULL"),
+ (outer ? outer : "NULL"));
OPENSSL_free(inner);
OPENSSL_free(outer);
if(rv == SSL_ECH_STATUS_GREASE_ECH) {
@@ -4566,11 +4567,11 @@ CURLcode Curl_oss_check_peer_cert(struct Curl_cfilter *cf,
}
infof(data, "%s certificate:",
- Curl_ssl_cf_is_proxy(cf)? "Proxy" : "Server");
+ Curl_ssl_cf_is_proxy(cf) ? "Proxy" : "Server");
rc = x509_name_oneline(X509_get_subject_name(octx->server_cert),
buffer, sizeof(buffer));
- infof(data, " subject: %s", rc?"[NONE]":buffer);
+ infof(data, " subject: %s", rc ? "[NONE]" : buffer);
#ifndef CURL_DISABLE_VERBOSE_STRINGS
{
@@ -4735,8 +4736,8 @@ CURLcode Curl_oss_check_peer_cert(struct Curl_cfilter *cf,
result = CURLE_OK;
#ifndef CURL_DISABLE_PROXY
- ptr = Curl_ssl_cf_is_proxy(cf)?
- data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY]:
+ ptr = Curl_ssl_cf_is_proxy(cf) ?
+ data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY] :
data->set.str[STRING_SSL_PINNEDPUBLICKEY];
#else
ptr = data->set.str[STRING_SSL_PINNEDPUBLICKEY];
@@ -4822,11 +4823,10 @@ static CURLcode ossl_connect_common(struct Curl_cfilter *cf,
/* if ssl is expecting something, check if it is available. */
if(!nonblocking && connssl->io_need) {
-
- curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND)?
- sockfd:CURL_SOCKET_BAD;
- curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV)?
- sockfd:CURL_SOCKET_BAD;
+ curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ?
+ sockfd : CURL_SOCKET_BAD;
+ curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ?
+ sockfd : CURL_SOCKET_BAD;
what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd,
timeout_ms);
@@ -5209,9 +5209,9 @@ static size_t ossl_version(char *buffer, size_t size)
#else
return msnprintf(buffer, size, "%s/%lx.%lx.%lx",
OSSL_PACKAGE,
- (LIBRESSL_VERSION_NUMBER>>28)&0xf,
- (LIBRESSL_VERSION_NUMBER>>20)&0xff,
- (LIBRESSL_VERSION_NUMBER>>12)&0xff);
+ (LIBRESSL_VERSION_NUMBER >> 28) & 0xf,
+ (LIBRESSL_VERSION_NUMBER >> 20) & 0xff,
+ (LIBRESSL_VERSION_NUMBER >> 12) & 0xff);
#endif
#elif defined(OPENSSL_IS_BORINGSSL)
#ifdef CURL_BORINGSSL_VERSION
@@ -5262,9 +5262,9 @@ static size_t ossl_version(char *buffer, size_t size)
#endif
,
OSSL_PACKAGE,
- (ssleay_value>>28)&0xf,
- (ssleay_value>>20)&0xff,
- (ssleay_value>>12)&0xff,
+ (ssleay_value >> 28) & 0xf,
+ (ssleay_value >> 20) & 0xff,
+ (ssleay_value >> 12) & 0xff,
sub);
#endif /* OPENSSL_IS_BORINGSSL */
}
lib/vtls/rustls.c+1 -1
@@ -878,7 +878,7 @@ cr_connect_common(struct Curl_cfilter *cf,
return CURLE_OPERATION_TIMEDOUT;
}
- socket_check_timeout = blocking?timeout_ms:0;
+ socket_check_timeout = blocking ? timeout_ms : 0;
what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd,
socket_check_timeout);
lib/vtls/schannel.c+8 -8
@@ -1153,7 +1153,7 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
/* A hostname associated with the credential is needed by
InitializeSecurityContext for SNI and other reasons. */
- snihost = connssl->peer.sni? connssl->peer.sni : connssl->peer.hostname;
+ snihost = connssl->peer.sni ? connssl->peer.sni : connssl->peer.hostname;
backend->cred->sni_hostname = curlx_convert_UTF8_to_tchar(snihost);
if(!backend->cred->sni_hostname)
return CURLE_OUT_OF_MEMORY;
@@ -1332,7 +1332,7 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data)
DEBUGASSERT(backend);
- doread = (connssl->io_need & CURL_SSL_IO_NEED_SEND)? FALSE : TRUE;
+ doread = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ? FALSE : TRUE;
connssl->io_need = CURL_SSL_IO_NEED_NONE;
DEBUGF(infof(data,
@@ -1571,8 +1571,8 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data)
}
#ifndef CURL_DISABLE_PROXY
- pubkey_ptr = Curl_ssl_cf_is_proxy(cf)?
- data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY]:
+ pubkey_ptr = Curl_ssl_cf_is_proxy(cf) ?
+ data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY] :
data->set.str[STRING_SSL_PINNEDPUBLICKEY];
#else
pubkey_ptr = data->set.str[STRING_SSL_PINNEDPUBLICKEY];
@@ -1863,10 +1863,10 @@ schannel_connect_common(struct Curl_cfilter *cf,
/* if ssl is expecting something, check if it is available. */
if(connssl->io_need) {
- curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND)?
- sockfd : CURL_SOCKET_BAD;
- curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV)?
- sockfd : CURL_SOCKET_BAD;
+ curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ?
+ sockfd : CURL_SOCKET_BAD;
+ curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ?
+ sockfd : CURL_SOCKET_BAD;
what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd,
nonblocking ? 0 : timeout_ms);
lib/vtls/schannel_verify.c+1 -1
@@ -116,7 +116,7 @@ static CURLcode add_certs_data_to_store(HCERTSTORE trust_store,
const char *current_ca_file_ptr = ca_buffer;
const char *ca_buffer_limit = ca_buffer + ca_buffer_size;
- while(more_certs && (current_ca_file_ptr<ca_buffer_limit)) {
+ while(more_certs && (current_ca_file_ptr < ca_buffer_limit)) {
const char *begin_cert_ptr = c_memmem(current_ca_file_ptr,
ca_buffer_limit-current_ca_file_ptr,
BEGIN_CERT,
lib/vtls/sectransp.c+7 -7
@@ -532,7 +532,7 @@ static OSStatus CopyIdentityWithLabel(char *label,
keys_list_count = CFArrayGetCount(keys_list);
*out_cert_and_key = NULL;
status = 1;
- for(i = 0; i<keys_list_count; i++) {
+ for(i = 0; i < keys_list_count; i++) {
OSStatus err = noErr;
SecCertificateRef cert = NULL;
SecIdentityRef identity =
@@ -1285,8 +1285,8 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf,
* Both hostname check and SNI require SSLSetPeerDomainName().
* Also: the verifyhost setting influences SNI usage */
if(conn_config->verifyhost) {
- char *server = connssl->peer.sni?
- connssl->peer.sni : connssl->peer.hostname;
+ char *server = connssl->peer.sni ?
+ connssl->peer.sni : connssl->peer.hostname;
err = SSLSetPeerDomainName(backend->ssl_ctx, server, strlen(server));
if(err != noErr) {
@@ -2328,10 +2328,10 @@ sectransp_connect_common(struct Curl_cfilter *cf, struct Curl_easy *data,
/* if ssl is expecting something, check if it is available. */
if(connssl->io_need) {
- curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND)?
- sockfd:CURL_SOCKET_BAD;
- curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV)?
- sockfd:CURL_SOCKET_BAD;
+ curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ?
+ sockfd : CURL_SOCKET_BAD;
+ curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ?
+ sockfd : CURL_SOCKET_BAD;
what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd,
nonblocking ? 0 : timeout_ms);
lib/vtls/vtls.c+11 -11
@@ -371,8 +371,8 @@ void Curl_ssl_conn_config_update(struct Curl_easy *data, bool for_proxy)
if(data->conn) {
struct ssl_primary_config *src, *dest;
#ifndef CURL_DISABLE_PROXY
- src = for_proxy? &data->set.proxy_ssl.primary : &data->set.ssl.primary;
- dest = for_proxy? &data->conn->proxy_ssl_config : &data->conn->ssl_config;
+ src = for_proxy ? &data->set.proxy_ssl.primary : &data->set.ssl.primary;
+ dest = for_proxy ? &data->conn->proxy_ssl_config : &data->conn->ssl_config;
#else
(void)for_proxy;
src = &data->set.ssl.primary;
@@ -581,7 +581,7 @@ bool Curl_ssl_getsessionid(struct Curl_cfilter *cf,
}
CURL_TRC_CF(data, cf, "%s cached session ID for %s://%s:%d",
- no_match? "No": "Found",
+ no_match ? "No" : "Found",
cf->conn->handler->scheme, peer->hostname, peer->port);
return no_match;
}
@@ -857,7 +857,7 @@ void Curl_ssl_free_certinfo(struct Curl_easy *data)
if(ci->num_of_certs) {
/* free all individual lists used */
int i;
- for(i = 0; i<ci->num_of_certs; i++) {
+ for(i = 0; i < ci->num_of_certs; i++) {
curl_slist_free_all(ci->certinfo[i]);
ci->certinfo[i] = NULL;
}
@@ -1851,7 +1851,7 @@ static CURLcode ssl_cf_query(struct Curl_cfilter *cf,
default:
break;
}
- return cf->next?
+ return cf->next ?
cf->next->cft->query(cf->next, data, query, pres1, pres2) :
CURLE_UNKNOWN_OPTION;
}
@@ -1881,7 +1881,7 @@ static bool cf_ssl_is_alive(struct Curl_cfilter *cf, struct Curl_easy *data,
return FALSE;
}
/* ssl backend does not know */
- return cf->next?
+ return cf->next ?
cf->next->cft->is_alive(cf->next, data, input_pending) :
FALSE; /* pessimistic in absence of data */
}
@@ -2029,7 +2029,7 @@ CURLcode Curl_cf_ssl_proxy_insert_after(struct Curl_cfilter *cf_at,
bool Curl_ssl_supports(struct Curl_easy *data, unsigned int ssl_option)
{
(void)data;
- return (Curl_ssl->supports & ssl_option)? TRUE : FALSE;
+ return (Curl_ssl->supports & ssl_option) ? TRUE : FALSE;
}
static struct Curl_cfilter *get_ssl_filter(struct Curl_cfilter *cf)
@@ -2124,7 +2124,7 @@ CURLcode Curl_ssl_cfilter_remove(struct Curl_easy *data,
struct Curl_cfilter *cf, *head;
CURLcode result = CURLE_OK;
- head = data->conn? data->conn->cfilter[sockindex] : NULL;
+ head = data->conn ? data->conn->cfilter[sockindex] : NULL;
for(cf = head; cf; cf = cf->next) {
if(cf->cft == &Curl_cft_ssl) {
bool done;
@@ -2154,7 +2154,7 @@ Curl_ssl_cf_get_config(struct Curl_cfilter *cf, struct Curl_easy *data)
(void)cf;
return &data->set.ssl;
#else
- return Curl_ssl_cf_is_proxy(cf)? &data->set.proxy_ssl : &data->set.ssl;
+ return Curl_ssl_cf_is_proxy(cf) ? &data->set.proxy_ssl : &data->set.ssl;
#endif
}
@@ -2164,7 +2164,7 @@ Curl_ssl_cf_get_primary_config(struct Curl_cfilter *cf)
#ifdef CURL_DISABLE_PROXY
return &cf->conn->ssl_config;
#else
- return Curl_ssl_cf_is_proxy(cf)?
+ return Curl_ssl_cf_is_proxy(cf) ?
&cf->conn->proxy_ssl_config : &cf->conn->ssl_config;
#endif
}
@@ -2222,7 +2222,7 @@ CURLcode Curl_alpn_set_negotiated(struct Curl_cfilter *cf,
{
unsigned char *palpn =
#ifndef CURL_DISABLE_PROXY
- (cf->conn->bits.tunnel_proxy && Curl_ssl_cf_is_proxy(cf))?
+ (cf->conn->bits.tunnel_proxy && Curl_ssl_cf_is_proxy(cf)) ?
&cf->conn->proxy_alpn : &cf->conn->alpn
#else
&cf->conn->alpn
lib/vtls/wolfssl.c+15 -18
@@ -421,7 +421,7 @@ static CURLcode populate_x509_store(struct Curl_cfilter *cf,
/* load trusted cacert from file if not blob */
CURL_TRC_CF(data, cf, "populate_x509_store, path=%s, blob=%d",
- ssl_cafile? ssl_cafile : "none", !!ca_info_blob);
+ ssl_cafile ? ssl_cafile : "none", !!ca_info_blob);
if(!store)
return CURLE_OUT_OF_MEMORY;
@@ -517,9 +517,9 @@ static X509_STORE *get_cached_x509_store(struct Curl_cfilter *cf,
WOLFSSL_X509_STORE *store = NULL;
DEBUGASSERT(multi);
- share = multi? Curl_hash_pick(&multi->proto_hash,
- (void *)MPROTO_WSSL_X509_KEY,
- sizeof(MPROTO_WSSL_X509_KEY)-1) : NULL;
+ share = multi ? Curl_hash_pick(&multi->proto_hash,
+ (void *)MPROTO_WSSL_X509_KEY,
+ sizeof(MPROTO_WSSL_X509_KEY)-1) : NULL;
if(share && share->store &&
!cached_x509_store_expired(data, share) &&
!cached_x509_store_different(cf, share)) {
@@ -960,7 +960,7 @@ wolfssl_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
* anyway. In the latter case the result of the verification is checked with
* SSL_get_verify_result() below. */
wolfSSL_CTX_set_verify(backend->ctx,
- conn_config->verifypeer?SSL_VERIFY_PEER:
+ conn_config->verifypeer ? SSL_VERIFY_PEER :
SSL_VERIFY_NONE, NULL);
#ifdef HAVE_SNI
@@ -1200,8 +1200,8 @@ wolfssl_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data)
(struct wolfssl_ctx *)connssl->backend;
struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf);
#ifndef CURL_DISABLE_PROXY
- const char * const pinnedpubkey = Curl_ssl_cf_is_proxy(cf)?
- data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY]:
+ const char * const pinnedpubkey = Curl_ssl_cf_is_proxy(cf) ?
+ data->set.str[STRING_SSL_PINNEDPUBLICKEY_PROXY] :
data->set.str[STRING_SSL_PINNEDPUBLICKEY];
#else
const char * const pinnedpubkey = data->set.str[STRING_SSL_PINNEDPUBLICKEY];
@@ -1213,8 +1213,8 @@ wolfssl_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data)
/* Enable RFC2818 checks */
if(conn_config->verifyhost) {
- char *snihost = connssl->peer.sni?
- connssl->peer.sni : connssl->peer.hostname;
+ char *snihost = connssl->peer.sni ?
+ connssl->peer.sni : connssl->peer.hostname;
if(wolfSSL_check_domain_name(backend->handle, snihost) == SSL_FAILURE)
return CURLE_SSL_CONNECT_ERROR;
}
@@ -1762,7 +1762,6 @@ wolfssl_connect_common(struct Curl_cfilter *cf,
CURLcode result;
struct ssl_connect_data *connssl = cf->ctx;
curl_socket_t sockfd = Curl_conn_cf_get_socket(cf, data);
- int what;
/* check if the connection has already been established */
if(ssl_connection_complete == connssl->state) {
@@ -1798,14 +1797,12 @@ wolfssl_connect_common(struct Curl_cfilter *cf,
/* if ssl is expecting something, check if it is available. */
if(connssl->io_need) {
-
- curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND)?
- sockfd:CURL_SOCKET_BAD;
- curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV)?
- sockfd:CURL_SOCKET_BAD;
-
- what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd,
- nonblocking?0:timeout_ms);
+ curl_socket_t writefd = (connssl->io_need & CURL_SSL_IO_NEED_SEND) ?
+ sockfd : CURL_SOCKET_BAD;
+ curl_socket_t readfd = (connssl->io_need & CURL_SSL_IO_NEED_RECV) ?
+ sockfd : CURL_SOCKET_BAD;
+ int what = Curl_socket_check(readfd, CURL_SOCKET_BAD, writefd,
+ nonblocking ? 0 : timeout_ms);
if(what < 0) {
/* fatal error */
failf(data, "select/poll on SSL socket, errno: %d", SOCKERRNO);
lib/vtls/x509asn1.c+3 -3
@@ -270,7 +270,7 @@ static CURLcode bool2str(struct dynbuf *store,
{
if(end - beg != 1)
return CURLE_BAD_FUNCTION_ARGUMENT;
- return Curl_dyn_add(store, *beg? "TRUE": "FALSE");
+ return Curl_dyn_add(store, *beg ? "TRUE": "FALSE");
}
/*
@@ -323,7 +323,7 @@ static CURLcode int2str(struct dynbuf *store,
do
val = (val << 8) | *(const unsigned char *) beg++;
while(beg < end);
- return Curl_dyn_addf(store, "%s%x", val >= 10? "0x": "", val);
+ return Curl_dyn_addf(store, "%s%x", val >= 10 ? "0x" : "", val);
}
/*
@@ -551,7 +551,7 @@ static CURLcode GTime2str(struct dynbuf *store,
"%.4s-%.2s-%.2s %.2s:%.2s:%c%c%s%.*s%s%.*s",
beg, beg + 4, beg + 6,
beg + 8, beg + 10, sec1, sec2,
- fracl? ".": "", (int)fracl, fracp,
+ fracl ? ".": "", (int)fracl, fracp,
sep, (int)tzl, tzp);
}
lib/ws.c+7 -7
@@ -117,20 +117,20 @@ static void ws_dec_info(struct ws_decoder *dec, struct Curl_easy *data,
case 1:
CURL_TRC_WRITE(data, "websocket, decoded %s [%s%s]", msg,
ws_frame_name_of_op(dec->head[0]),
- (dec->head[0] & WSBIT_FIN)? "" : " NON-FINAL");
+ (dec->head[0] & WSBIT_FIN) ? "" : " NON-FINAL");
break;
default:
if(dec->head_len < dec->head_total) {
CURL_TRC_WRITE(data, "websocket, decoded %s [%s%s](%d/%d)", msg,
ws_frame_name_of_op(dec->head[0]),
- (dec->head[0] & WSBIT_FIN)? "" : " NON-FINAL",
+ (dec->head[0] & WSBIT_FIN) ? "" : " NON-FINAL",
dec->head_len, dec->head_total);
}
else {
CURL_TRC_WRITE(data, "websocket, decoded %s [%s%s payload=%"
FMT_OFF_T "/%" FMT_OFF_T "]",
msg, ws_frame_name_of_op(dec->head[0]),
- (dec->head[0] & WSBIT_FIN)? "" : " NON-FINAL",
+ (dec->head[0] & WSBIT_FIN) ? "" : " NON-FINAL",
dec->payload_offset, dec->payload_len);
}
break;
@@ -285,7 +285,7 @@ static CURLcode ws_dec_pass_payload(struct ws_decoder *dec,
FMT_OFF_T " remain", nwritten, remain);
}
- return remain? CURLE_AGAIN : CURLE_OK;
+ return remain ? CURLE_AGAIN : CURLE_OK;
}
static CURLcode ws_dec_pass(struct ws_decoder *dec,
@@ -496,7 +496,7 @@ static void ws_enc_info(struct ws_encoder *enc, struct Curl_easy *data,
msg, ws_frame_name_of_op(enc->firstbyte),
(enc->firstbyte & WSBIT_OPCODE_MASK) == WSBIT_OPCODE_CONT ?
" CONT" : "",
- (enc->firstbyte & WSBIT_FIN)? "" : " NON-FIN",
+ (enc->firstbyte & WSBIT_FIN) ? "" : " NON-FIN",
enc->payload_len - enc->payload_remain, enc->payload_len);
}
@@ -1021,7 +1021,7 @@ static CURLcode ws_flush(struct Curl_easy *data, struct websocket *ws,
while(Curl_bufq_peek(&ws->sendbuf, &out, &outlen)) {
if(blocking) {
result = ws_send_raw_blocking(data, ws, (char *)out, outlen);
- n = result? 0 : outlen;
+ n = result ? 0 : outlen;
}
else if(data->set.connect_only || Curl_is_in_callback(data))
result = Curl_senddata(data, out, outlen, &n);
@@ -1080,7 +1080,7 @@ static CURLcode ws_send_raw_blocking(CURL *data, struct websocket *ws,
if(sock == CURL_SOCKET_BAD)
return CURLE_SEND_ERROR;
ev = Curl_socket_check(CURL_SOCKET_BAD, CURL_SOCKET_BAD, sock,
- left_ms? left_ms : 500);
+ left_ms ? left_ms : 500);
if(ev < 0) {
failf(data, "Error while waiting for socket becoming writable");
return CURLE_SEND_ERROR;
packages/OS400/ccsidcurl.c+6 -6
@@ -127,8 +127,8 @@ convert(char *d, size_t dlen, int dccsid,
dccsid = ASCII_CCSID;
if(sccsid == dccsid) {
- lslen = slen >= 0? slen: strlen(s) + 1;
- i = lslen < dlen? lslen: dlen;
+ lslen = slen >= 0 ? slen: strlen(s) + 1;
+ i = lslen < dlen ? lslen: dlen;
if(s != d && i > 0)
memcpy(d, s, i);
@@ -170,7 +170,7 @@ static char *dynconvert(int dccsid, const char *s, int slen, int sccsid)
/* Like convert, but the destination is allocated and returned. */
- dlen = (size_t) (slen < 0? strlen(s): slen) + 1;
+ dlen = (size_t) (slen < 0 ? strlen(s): slen) + 1;
dlen *= MAX_CONV_EXPANSION; /* Allow some expansion. */
d = malloc(dlen);
@@ -294,7 +294,7 @@ curl_easy_escape_ccsid(CURL *handle, const char *string, int length,
return (char *) NULL;
}
- s = dynconvert(ASCII_CCSID, string, length? length: -1, sccsid);
+ s = dynconvert(ASCII_CCSID, string, length ? length: -1, sccsid);
if(!s)
return (char *) NULL;
@@ -324,7 +324,7 @@ curl_easy_unescape_ccsid(CURL *handle, const char *string, int length,
return (char *) NULL;
}
- s = dynconvert(ASCII_CCSID, string, length? length: -1, sccsid);
+ s = dynconvert(ASCII_CCSID, string, length ? length: -1, sccsid);
if(!s)
return (char *) NULL;
@@ -1046,7 +1046,7 @@ Curl_formget_callback_ccsid(void *arg, const char *buf, size_t len)
ret = (*p->append)(p->arg, b, l);
free(b);
- return ret == l? len: -1;
+ return ret == l ? len: -1;
}
packages/OS400/os400sys.c+2 -2
@@ -640,8 +640,8 @@ Curl_ldap_search_s_a(void *ld, char *base, int scope, char *filter,
}
if(status == LDAP_SUCCESS)
- status = ldap_search_s(ld, ebase? ebase: "", scope,
- efilter? efilter: "(objectclass=*)",
+ status = ldap_search_s(ld, ebase ? ebase: "", scope,
+ efilter ? efilter: "(objectclass=*)",
eattrs, attrsonly, res);
if(eattrs) {
scripts/schemetable.c+1 -1
@@ -128,7 +128,7 @@ static void showtable(int try, int init, int shift)
}
}
if(!match) {
- if(!nulls || (nulls>10)) {
+ if(!nulls || (nulls > 10)) {
printf("\n ");
nulls = 0;
}
src/tool_cb_prg.c+1 -1
@@ -96,7 +96,7 @@ static void fly(struct ProgressData *bar, bool moved)
if(bar->tick >= 200)
bar->tick -= 200;
- bar->bar += (moved?bar->barmove:0);
+ bar->bar += (moved ? bar->barmove : 0);
if(bar->bar >= (bar->width - 6)) {
bar->barmove = -1;
bar->bar = bar->width - 6;
src/tool_cb_rea.c+1 -1
@@ -152,5 +152,5 @@ int tool_readbusy_cb(void *clientp,
tool_go_sleep(25);
}
- return per->noprogress? 0 : CURL_PROGRESSFUNC_CONTINUE;
+ return per->noprogress ? 0 : CURL_PROGRESSFUNC_CONTINUE;
}
src/tool_getparam.c+3 -4
@@ -2242,9 +2242,8 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
case C_HEAD: /* --head */
config->no_body = toggle;
config->show_headers = toggle;
- if(SetHTTPrequest(config,
- (config->no_body)?TOOL_HTTPREQ_HEAD:TOOL_HTTPREQ_GET,
- &config->httpreq))
+ if(SetHTTPrequest(config, (config->no_body) ? TOOL_HTTPREQ_HEAD :
+ TOOL_HTTPREQ_GET, &config->httpreq))
err = PARAM_BAD_USE;
break;
case C_REMOTE_HEADER_NAME: /* --remote-header-name */
@@ -2303,7 +2302,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
config->nobuffer = longopt ? !toggle : TRUE;
break;
case C_REMOTE_NAME_ALL: /* --remote-name-all */
- config->default_node_flags = toggle?GETOUT_USEREMOTE:0;
+ config->default_node_flags = toggle ? GETOUT_USEREMOTE : 0;
break;
case C_OUTPUT_DIR: /* --output-dir */
err = getstr(&config->output_dir, nextarg, DENY_BLANK);
src/tool_operate.c+29 -27
@@ -813,7 +813,7 @@ static CURLcode url_proto(char **url,
curl_url_cleanup(uh);
}
- *scheme = (char *) (proto? proto: "???"); /* Never match if not found. */
+ *scheme = (char *) (proto ? proto : "???"); /* Never match if not found. */
return result;
}
@@ -839,9 +839,8 @@ static CURLcode single_transfer(struct GlobalConfig *global,
/* Use the postfields data for an HTTP get */
httpgetfields = state->httpgetfields = config->postfields;
config->postfields = NULL;
- if(SetHTTPrequest(config,
- (config->no_body?TOOL_HTTPREQ_HEAD:TOOL_HTTPREQ_GET),
- &config->httpreq)) {
+ if(SetHTTPrequest(config, (config->no_body ? TOOL_HTTPREQ_HEAD :
+ TOOL_HTTPREQ_GET), &config->httpreq)) {
result = CURLE_FAILED_INIT;
}
}
@@ -900,8 +899,8 @@ static CURLcode single_transfer(struct GlobalConfig *global,
if(!config->globoff && infiles && !inglob) {
/* Unless explicitly shut off */
result = glob_url(&inglob, infiles, &state->infilenum,
- (!global->silent || global->showerror)?
- tool_stderr:NULL);
+ (!global->silent || global->showerror) ?
+ tool_stderr : NULL);
if(result)
break;
config->state.inglob = inglob;
@@ -936,8 +935,8 @@ static CURLcode single_transfer(struct GlobalConfig *global,
/* Unless explicitly shut off, we expand '{...}' and '[...]'
expressions and return total number of URLs in pattern set */
result = glob_url(&state->urls, urlnode->url, &state->urlnum,
- (!global->silent || global->showerror)?
- tool_stderr:NULL);
+ (!global->silent || global->showerror) ?
+ tool_stderr : NULL);
if(result)
break;
urlnum = state->urlnum;
@@ -1284,7 +1283,7 @@ static CURLcode single_transfer(struct GlobalConfig *global,
* If the user has also selected --anyauth or --proxy-anyauth
* we should warn them.
*/
- if(config->proxyanyauth || (authbits>1)) {
+ if(config->proxyanyauth || (authbits > 1)) {
warnf(global,
"Using --anyauth or --proxy-anyauth with upload from stdin"
" involves a big risk of it not working. Use a temporary"
@@ -1433,7 +1432,7 @@ static CURLcode single_transfer(struct GlobalConfig *global,
my_setopt_str(curl, CURLOPT_URL, per->this_url);
my_setopt(curl, CURLOPT_NOPROGRESS,
- global->noprogress || global->silent?1L:0L);
+ global->noprogress || global->silent ? 1L : 0L);
if(config->no_body)
my_setopt(curl, CURLOPT_NOBODY, 1L);
@@ -1456,7 +1455,8 @@ static CURLcode single_transfer(struct GlobalConfig *global,
my_setopt_str(curl, CURLOPT_PROXYUSERPWD, config->proxyuserpwd);
/* new in libcurl 7.3 */
- my_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, config->proxytunnel?1L:0L);
+ my_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, config->proxytunnel ?
+ 1L : 0L);
/* new in libcurl 7.52.0 */
if(config->preproxy)
@@ -1483,13 +1483,13 @@ static CURLcode single_transfer(struct GlobalConfig *global,
my_setopt_str(curl, CURLOPT_NOPROXY, config->noproxy);
my_setopt(curl, CURLOPT_SUPPRESS_CONNECT_HEADERS,
- config->suppress_connect_headers?1L:0L);
+ config->suppress_connect_headers ? 1L : 0L);
- my_setopt(curl, CURLOPT_FAILONERROR, config->failonerror?1L:0L);
+ my_setopt(curl, CURLOPT_FAILONERROR, config->failonerror ? 1L : 0L);
my_setopt(curl, CURLOPT_REQUEST_TARGET, config->request_target);
- my_setopt(curl, CURLOPT_UPLOAD, per->uploadfile?1L:0L);
- my_setopt(curl, CURLOPT_DIRLISTONLY, config->dirlistonly?1L:0L);
- my_setopt(curl, CURLOPT_APPEND, config->ftp_append?1L:0L);
+ my_setopt(curl, CURLOPT_UPLOAD, per->uploadfile ? 1L : 0L);
+ my_setopt(curl, CURLOPT_DIRLISTONLY, config->dirlistonly ? 1L : 0L);
+ my_setopt(curl, CURLOPT_APPEND, config->ftp_append ? 1L : 0L);
if(config->netrc_opt)
my_setopt_enum(curl, CURLOPT_NETRC, (long)CURL_NETRC_OPTIONAL);
@@ -1501,7 +1501,7 @@ static CURLcode single_transfer(struct GlobalConfig *global,
if(config->netrc_file)
my_setopt_str(curl, CURLOPT_NETRC_FILE, config->netrc_file);
- my_setopt(curl, CURLOPT_TRANSFERTEXT, config->use_ascii?1L:0L);
+ my_setopt(curl, CURLOPT_TRANSFERTEXT, config->use_ascii ? 1L : 0L);
if(config->login_options)
my_setopt_str(curl, CURLOPT_LOGIN_OPTIONS, config->login_options);
my_setopt_str(curl, CURLOPT_USERPWD, config->userpwd);
@@ -1564,11 +1564,11 @@ static CURLcode single_transfer(struct GlobalConfig *global,
long postRedir = 0;
my_setopt(curl, CURLOPT_FOLLOWLOCATION,
- config->followlocation?1L:0L);
+ config->followlocation ? 1L : 0L);
my_setopt(curl, CURLOPT_UNRESTRICTED_AUTH,
- config->unrestricted_auth?1L:0L);
+ config->unrestricted_auth ? 1L : 0L);
my_setopt_str(curl, CURLOPT_AWS_SIGV4, config->aws_sigv4);
- my_setopt(curl, CURLOPT_AUTOREFERER, config->autoreferer?1L:0L);
+ my_setopt(curl, CURLOPT_AUTOREFERER, config->autoreferer ? 1L : 0L);
/* new in libcurl 7.36.0 */
if(config->proxyheaders) {
@@ -1972,7 +1972,7 @@ static CURLcode single_transfer(struct GlobalConfig *global,
my_setopt(curl, CURLOPT_FILETIME, 1L);
}
- my_setopt(curl, CURLOPT_CRLF, config->crlf?1L:0L);
+ my_setopt(curl, CURLOPT_CRLF, config->crlf ? 1L : 0L);
my_setopt_slist(curl, CURLOPT_QUOTE, config->quote);
my_setopt_slist(curl, CURLOPT_POSTQUOTE, config->postquote);
my_setopt_slist(curl, CURLOPT_PREQUOTE, config->prequote);
@@ -2014,7 +2014,8 @@ static CURLcode single_transfer(struct GlobalConfig *global,
my_setopt_str(curl, CURLOPT_COOKIEJAR, config->cookiejar);
/* new in libcurl 7.9.7 */
- my_setopt(curl, CURLOPT_COOKIESESSION, config->cookiesession?1L:0L);
+ my_setopt(curl, CURLOPT_COOKIESESSION, config->cookiesession ?
+ 1L : 0L);
my_setopt_enum(curl, CURLOPT_TIMECONDITION, (long)config->timecond);
my_setopt(curl, CURLOPT_TIMEVALUE_LARGE, config->condtime);
@@ -2118,9 +2119,8 @@ static CURLcode single_transfer(struct GlobalConfig *global,
/* new in curl 7.10.7, extended in 7.19.4. Modified to use
CREATE_DIR_RETRY in 7.49.0 */
my_setopt(curl, CURLOPT_FTP_CREATE_MISSING_DIRS,
- (long)(config->ftp_create_dirs?
- CURLFTP_CREATE_DIR_RETRY:
- CURLFTP_CREATE_DIR_NONE));
+ (long)(config->ftp_create_dirs ?
+ CURLFTP_CREATE_DIR_RETRY : CURLFTP_CREATE_DIR_NONE));
/* new in curl 7.10.8 */
if(config->max_filesize)
@@ -2167,10 +2167,12 @@ static CURLcode single_transfer(struct GlobalConfig *global,
/* curl 7.13.0 */
my_setopt_str(curl, CURLOPT_FTP_ACCOUNT, config->ftp_account);
- my_setopt(curl, CURLOPT_IGNORE_CONTENT_LENGTH, config->ignorecl?1L:0L);
+ my_setopt(curl, CURLOPT_IGNORE_CONTENT_LENGTH, config->ignorecl ?
+ 1L : 0L);
/* curl 7.14.2 */
- my_setopt(curl, CURLOPT_FTP_SKIP_PASV_IP, config->ftp_skip_ip?1L:0L);
+ my_setopt(curl, CURLOPT_FTP_SKIP_PASV_IP, config->ftp_skip_ip ?
+ 1L : 0L);
/* curl 7.15.1 */
if(proto_ftp)
src/tool_urlglob.c+1 -1
@@ -645,7 +645,7 @@ CURLcode glob_match_url(char **result, char *filename, struct URLGlob *glob)
unsigned long i;
num--; /* make it zero based */
/* find the correct glob entry */
- for(i = 0; i<glob->size; i++) {
+ for(i = 0; i < glob->size; i++) {
if(glob->pattern[i].globindex == (int)num) {
pat = &glob->pattern[i];
break;
src/tool_util.c+1 -1
@@ -140,7 +140,7 @@ long tvdiff(struct timeval newer, struct timeval older)
int struplocompare(const char *p1, const char *p2)
{
if(!p1)
- return p2? -1: 0;
+ return p2 ? -1 : 0;
if(!p2)
return 1;
#ifdef HAVE_STRCASECMP
src/tool_writeout.c+1 -1
@@ -652,7 +652,7 @@ void ourWriteOut(struct OperationConfig *config, struct per_transfer *per,
FILE *stream2;
memcpy(fname, ptr, flen);
fname[flen] = 0;
- stream2 = fopen(fname, append? FOPEN_APPENDTEXT :
+ stream2 = fopen(fname, append ? FOPEN_APPENDTEXT :
FOPEN_WRITETEXT);
if(stream2) {
/* only change if the open worked */
src/var.c+1 -1
@@ -361,7 +361,7 @@ static ParameterError addvariable(struct GlobalConfig *global,
if(p) {
memcpy(p->name, name, nlen);
- p->content = contalloc ? content: Memdup(content, clen);
+ p->content = contalloc ? content : Memdup(content, clen);
if(p->content) {
p->clen = clen;
tests/http/clients/h2-pausing.c+7 -7
@@ -273,7 +273,7 @@ int main(int argc, char *argv[])
host, port);
resolve = curl_slist_append(resolve, resolve_buf);
- for(i = 0; i<HANDLECOUNT; i++) {
+ for(i = 0; i < HANDLECOUNT; i++) {
handles[i].idx = i;
handles[i].paused = 0;
handles[i].resumed = 0;
@@ -301,7 +301,7 @@ int main(int argc, char *argv[])
if(!multi_handle)
err();
- for(i = 0; i<HANDLECOUNT; i++) {
+ for(i = 0; i < HANDLECOUNT; i++) {
if(curl_multi_add_handle(multi_handle, handles[i].h) != CURLM_OK)
err();
}
@@ -314,7 +314,7 @@ int main(int argc, char *argv[])
if(!still_running) {
int as_expected = 1;
fprintf(stderr, "INFO: no more handles running\n");
- for(i = 0; i<HANDLECOUNT; i++) {
+ for(i = 0; i < HANDLECOUNT; i++) {
if(!handles[i].paused) {
fprintf(stderr, "ERROR: [%d] NOT PAUSED\n", i);
as_expected = 0;
@@ -348,7 +348,7 @@ int main(int argc, char *argv[])
/* !checksrc! disable EQUALSNULL 1 */
while((msg = curl_multi_info_read(multi_handle, &msgs_left)) != NULL) {
if(msg->msg == CURLMSG_DONE) {
- for(i = 0; i<HANDLECOUNT; i++) {
+ for(i = 0; i < HANDLECOUNT; i++) {
if(msg->easy_handle == handles[i].h) {
if(handles[i].paused != 1 || !handles[i].resumed) {
fprintf(stderr, "ERROR: [%d] done, pauses=%d, resumed=%d, "
@@ -364,7 +364,7 @@ int main(int argc, char *argv[])
/* Successfully paused? */
if(!all_paused) {
- for(i = 0; i<HANDLECOUNT; i++) {
+ for(i = 0; i < HANDLECOUNT; i++) {
if(!handles[i].paused) {
break;
}
@@ -378,7 +378,7 @@ int main(int argc, char *argv[])
}
if(resume_round > 0 && rounds == resume_round) {
/* time to resume */
- for(i = 0; i<HANDLECOUNT; i++) {
+ for(i = 0; i < HANDLECOUNT; i++) {
fprintf(stderr, "INFO: [%d] resumed\n", i);
handles[i].resumed = 1;
curl_easy_pause(handles[i].h, CURLPAUSE_CONT);
@@ -387,7 +387,7 @@ int main(int argc, char *argv[])
}
out:
- for(i = 0; i<HANDLECOUNT; i++) {
+ for(i = 0; i < HANDLECOUNT; i++) {
curl_multi_remove_handle(multi_handle, handles[i].h);
curl_easy_cleanup(handles[i].h);
}
tests/http/clients/h2-serverpush.c+3 -3
@@ -52,7 +52,7 @@ void dump(const char *text, unsigned char *ptr, size_t size,
fprintf(stderr, "%s, %lu bytes (0x%lx)\n",
text, (unsigned long)size, (unsigned long)size);
- for(i = 0; i<size; i += width) {
+ for(i = 0; i < size; i += width) {
fprintf(stderr, "%4.4lx: ", (unsigned long)i);
@@ -73,7 +73,7 @@ void dump(const char *text, unsigned char *ptr, size_t size,
break;
}
fprintf(stderr, "%c",
- (ptr[i + c] >= 0x20) && (ptr[i + c]<0x80)?ptr[i + c]:'.');
+ (ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
ptr[i + c + 2] == 0x0A) {
@@ -183,7 +183,7 @@ static int server_push_callback(CURL *parent,
fprintf(stderr, "**** push callback approves stream %u, got %lu headers!\n",
count, (unsigned long)num_headers);
- for(i = 0; i<num_headers; i++) {
+ for(i = 0; i < num_headers; i++) {
headp = curl_pushheader_bynum(headers, i);
fprintf(stderr, "**** header %lu: %s\n", (unsigned long)i, headp);
}
tests/http/clients/hx-download.c+1 -1
@@ -367,7 +367,7 @@ int main(int argc, char *argv[])
t->pause_at = (curl_off_t)pause_offset;
}
- n = (max_parallel < transfer_count)? max_parallel : transfer_count;
+ n = (max_parallel < transfer_count) ? max_parallel : transfer_count;
for(i = 0; i < n; ++i) {
t = &transfers[i];
t->easy = curl_easy_init();
tests/http/clients/hx-upload.c+1 -1
@@ -446,7 +446,7 @@ int main(int argc, char *argv[])
multi_handle = curl_multi_init();
curl_multi_setopt(multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);
- n = (max_parallel < transfer_count)? max_parallel : transfer_count;
+ n = (max_parallel < transfer_count) ? max_parallel : transfer_count;
for(i = 0; i < n; ++i) {
t = &transfers[i];
t->easy = curl_easy_init();
tests/http/clients/ws-data.c+2 -2
@@ -60,7 +60,7 @@ void dump(const char *text, unsigned char *ptr, size_t size,
fprintf(stderr, "%s, %lu bytes (0x%lx)\n",
text, (unsigned long)size, (unsigned long)size);
- for(i = 0; i<size; i += width) {
+ for(i = 0; i < size; i += width) {
fprintf(stderr, "%4.4lx: ", (unsigned long)i);
@@ -81,7 +81,7 @@ void dump(const char *text, unsigned char *ptr, size_t size,
break;
}
fprintf(stderr, "%c",
- (ptr[i + c] >= 0x20) && (ptr[i + c]<0x80)?ptr[i + c]:'.');
+ (ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
ptr[i + c + 2] == 0x0A) {
tests/http/testenv/mod_curltest/mod_curltest.c+1 -1
@@ -439,7 +439,7 @@ static int curltest_tweak_handler(request_rec *r)
ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "error_handler: processing "
"request, %s", r->args? r->args : "(no args)");
r->status = http_status;
- r->clength = with_cl? (chunks * chunk_size) : -1;
+ r->clength = with_cl ? (chunks * chunk_size) : -1;
r->chunked = (r->proto_num >= HTTP_VERSION(1, 1)) && !with_cl;
apr_table_setn(r->headers_out, "request-id", request_id);
if(r->clength >= 0) {
tests/libtest/first.c+4 -4
@@ -127,7 +127,7 @@ char *hexdump(const unsigned char *buffer, size_t len)
size_t i;
if(len > 200)
return NULL;
- for(i = 0; i<len; i++, p += 3)
+ for(i = 0; i < len; i++, p += 3)
msnprintf(p, 4, "%02x ", buffer[i]);
return dump;
}
@@ -157,7 +157,7 @@ int main(int argc, char **argv)
setlocale(LC_ALL, "");
#endif
- if(argc< 2) {
+ if(argc < 2) {
fprintf(stderr, "Pass URL as argument please\n");
return 1;
}
@@ -165,10 +165,10 @@ int main(int argc, char **argv)
test_argc = argc;
test_argv = argv;
- if(argc>2)
+ if(argc > 2)
libtest_arg2 = argv[2];
- if(argc>3)
+ if(argc > 3)
libtest_arg3 = argv[3];
URL = argv[1]; /* provide this to the rest */
tests/libtest/lib1156.c+12 -12
@@ -90,35 +90,35 @@ static int onetest(CURL *curl, const char *url, const struct testparams *p,
unsigned int replyselector;
char urlbuf[256];
- replyselector = (p->flags & F_CONTENTRANGE)? 1: 0;
+ replyselector = (p->flags & F_CONTENTRANGE) ? 1: 0;
if(p->flags & F_HTTP416)
replyselector += 2;
msnprintf(urlbuf, sizeof(urlbuf), "%s%04u", url, replyselector);
test_setopt(curl, CURLOPT_URL, urlbuf);
test_setopt(curl, CURLOPT_VERBOSE, 1L);
- test_setopt(curl, CURLOPT_RESUME_FROM, (p->flags & F_RESUME)? 3: 0);
- test_setopt(curl, CURLOPT_RANGE, !(p->flags & F_RESUME)?
+ test_setopt(curl, CURLOPT_RESUME_FROM, (p->flags & F_RESUME) ? 3: 0);
+ test_setopt(curl, CURLOPT_RANGE, !(p->flags & F_RESUME) ?
"3-1000000": (char *) NULL);
- test_setopt(curl, CURLOPT_FAILONERROR, (p->flags & F_FAIL)? 1: 0);
+ test_setopt(curl, CURLOPT_FAILONERROR, (p->flags & F_FAIL) ? 1: 0);
hasbody = 0;
res = curl_easy_perform(curl);
if(res != p->result) {
printf("%zd: bad error code (%d): resume=%s, fail=%s, http416=%s, "
"content-range=%s, expected=%d\n", num, res,
- (p->flags & F_RESUME)? "yes": "no",
- (p->flags & F_FAIL)? "yes": "no",
- (p->flags & F_HTTP416)? "yes": "no",
- (p->flags & F_CONTENTRANGE)? "yes": "no",
+ (p->flags & F_RESUME) ? "yes": "no",
+ (p->flags & F_FAIL) ? "yes": "no",
+ (p->flags & F_HTTP416) ? "yes": "no",
+ (p->flags & F_CONTENTRANGE) ? "yes": "no",
p->result);
return 1;
}
if(hasbody && (p->flags & F_IGNOREBODY)) {
printf("body should be ignored and is not: resume=%s, fail=%s, "
"http416=%s, content-range=%s\n",
- (p->flags & F_RESUME)? "yes": "no",
- (p->flags & F_FAIL)? "yes": "no",
- (p->flags & F_HTTP416)? "yes": "no",
- (p->flags & F_CONTENTRANGE)? "yes": "no");
+ (p->flags & F_RESUME) ? "yes": "no",
+ (p->flags & F_FAIL) ? "yes": "no",
+ (p->flags & F_HTTP416) ? "yes": "no",
+ (p->flags & F_CONTENTRANGE) ? "yes": "no");
return 1;
}
return 0;
tests/libtest/lib1560.c+7 -7
@@ -1769,13 +1769,13 @@ static int huge(void)
char *partp;
msnprintf(total, sizeof(total),
"%s://%s:%s@%s/%s?%s#%s",
- (i == 0)? &bigpart[1] : smallpart,
- (i == 1)? &bigpart[1] : smallpart,
- (i == 2)? &bigpart[1] : smallpart,
- (i == 3)? &bigpart[1] : smallpart,
- (i == 4)? &bigpart[1] : smallpart,
- (i == 5)? &bigpart[1] : smallpart,
- (i == 6)? &bigpart[1] : smallpart);
+ (i == 0) ? &bigpart[1] : smallpart,
+ (i == 1) ? &bigpart[1] : smallpart,
+ (i == 2) ? &bigpart[1] : smallpart,
+ (i == 3) ? &bigpart[1] : smallpart,
+ (i == 4) ? &bigpart[1] : smallpart,
+ (i == 5) ? &bigpart[1] : smallpart,
+ (i == 6) ? &bigpart[1] : smallpart);
rc = curl_url_set(urlp, CURLUPART_URL, total, CURLU_NON_SUPPORT_SCHEME);
if((!i && (rc != CURLUE_BAD_SCHEME)) ||
(i && rc)) {
tests/libtest/lib2302.c+1 -1
@@ -63,7 +63,7 @@ static size_t add_data(struct ws_data *wd, const char *buf, size_t blen,
if(wd->nwrites > 0)
flush_data(wd);
wd->has_meta = (meta != NULL);
- wd->meta_flags = meta? meta->flags : 0;
+ wd->meta_flags = meta ? meta->flags : 0;
}
if(wd->blen + blen > sizeof(wd->buf)) {
tests/libtest/lib552.c+2 -2
@@ -50,7 +50,7 @@ void dump(const char *text,
fprintf(stream, "%s, %zu bytes (0x%zx)\n", text, size, size);
- for(i = 0; i<size; i += width) {
+ for(i = 0; i < size; i += width) {
fprintf(stream, "%04zx: ", i);
@@ -71,7 +71,7 @@ void dump(const char *text,
break;
}
fprintf(stream, "%c",
- (ptr[i + c] >= 0x20) && (ptr[i + c]<0x80)? ptr[i + c] : '.');
+ (ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.');
/* check again for 0D0A, to avoid an extra \n if it's at width */
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
ptr[i + c + 2] == 0x0A) {
tests/libtest/lib557.c+9 -9
@@ -150,7 +150,7 @@ static int test_unsigned_short_formatting(void)
for(i = 1; i <= num_ushort_tests; i++) {
- for(j = 0; j<BUFSZ; j++)
+ for(j = 0; j < BUFSZ; j++)
us_test[i].result[j] = 'X';
us_test[i].result[BUFSZ-1] = '\0';
@@ -224,7 +224,7 @@ static int test_signed_short_formatting(void)
for(i = 1; i <= num_sshort_tests; i++) {
- for(j = 0; j<BUFSZ; j++)
+ for(j = 0; j < BUFSZ; j++)
ss_test[i].result[j] = 'X';
ss_test[i].result[BUFSZ-1] = '\0';
@@ -374,7 +374,7 @@ static int test_unsigned_int_formatting(void)
for(i = 1; i <= num_uint_tests; i++) {
- for(j = 0; j<BUFSZ; j++)
+ for(j = 0; j < BUFSZ; j++)
ui_test[i].result[j] = 'X';
ui_test[i].result[BUFSZ-1] = '\0';
@@ -602,7 +602,7 @@ static int test_signed_int_formatting(void)
for(i = 1; i <= num_sint_tests; i++) {
- for(j = 0; j<BUFSZ; j++)
+ for(j = 0; j < BUFSZ; j++)
si_test[i].result[j] = 'X';
si_test[i].result[BUFSZ-1] = '\0';
@@ -751,7 +751,7 @@ static int test_unsigned_long_formatting(void)
for(i = 1; i <= num_ulong_tests; i++) {
- for(j = 0; j<BUFSZ; j++)
+ for(j = 0; j < BUFSZ; j++)
ul_test[i].result[j] = 'X';
ul_test[i].result[BUFSZ-1] = '\0';
@@ -979,7 +979,7 @@ static int test_signed_long_formatting(void)
for(i = 1; i <= num_slong_tests; i++) {
- for(j = 0; j<BUFSZ; j++)
+ for(j = 0; j < BUFSZ; j++)
sl_test[i].result[j] = 'X';
sl_test[i].result[BUFSZ-1] = '\0';
@@ -1093,7 +1093,7 @@ static int test_curl_off_t_formatting(void)
for(i = 1; i <= num_cofft_tests; i++) {
- for(j = 0; j<BUFSZ; j++)
+ for(j = 0; j < BUFSZ; j++)
co_test[i].result[j] = 'X';
co_test[i].result[BUFSZ-1] = '\0';
@@ -1389,7 +1389,7 @@ static int test_float_formatting(void)
/* very large precisions easily turn into system specific outputs so we only
check the output buffer length here as we know the internal limit */
- curl_msnprintf(buf, sizeof(buf), "%.*f", (1<<30), 9.2987654);
+ curl_msnprintf(buf, sizeof(buf), "%.*f", (1 << 30), 9.2987654);
errors += strlen_check(buf, 325);
curl_msnprintf(buf, sizeof(buf), "%10000.10000f", 9.2987654);
@@ -1406,7 +1406,7 @@ static int test_float_formatting(void)
/* curl_msnprintf() limits a single float output to 325 bytes maximum
width */
- curl_msnprintf(buf, sizeof(buf), "%*f", (1<<30), 9.1);
+ curl_msnprintf(buf, sizeof(buf), "%*f", (1 << 30), 9.1);
errors += string_check(buf, " 9.100000");
curl_msnprintf(buf, sizeof(buf), "%100000f", 9.1);
errors += string_check(buf, " 9.100000");
tests/libtest/lib670.c+1 -1
@@ -61,7 +61,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp)
return CURL_READFUNC_PAUSE;
case 2:
delta = time(NULL) - pooh->origin;
- *ptr = delta >= PAUSE_TIME? '\x42': '\x41'; /* ASCII A or B. */
+ *ptr = delta >= PAUSE_TIME ? '\x42': '\x41'; /* ASCII A or B. */
return 1;
case 3:
return 0;
tests/server/mqttd.c+11 -12
@@ -192,7 +192,7 @@ static void loghex(unsigned char *buffer, ssize_t len)
ssize_t width = 0;
int left = sizeof(data);
- for(i = 0; i<len && (left >= 0); i++) {
+ for(i = 0; i < len && (left >= 0); i++) {
msnprintf(optr, left, "%02x", ptr[i]);
width += 2;
optr += 2;
@@ -218,15 +218,14 @@ static void logprotocol(mqttdir dir,
char *optr = data;
int left = sizeof(data);
- for(i = 0; i<len && (left >= 0); i++) {
+ for(i = 0; i < len && (left >= 0); i++) {
msnprintf(optr, left, "%02x", ptr[i]);
optr += 2;
left -= 2;
}
fprintf(output, "%s %s %zx %s\n",
- dir == FROM_CLIENT? "client": "server",
- prefix, remlen,
- data);
+ dir == FROM_CLIENT ? "client" : "server",
+ prefix, remlen, data);
}
@@ -931,7 +930,7 @@ int main(int argc, char *argv[])
int error;
int arg = 1;
- while(argc>arg) {
+ while(argc > arg) {
if(!strcmp("--version", argv[arg])) {
printf("mqttd IPv4%s\n",
#ifdef USE_IPV6
@@ -944,27 +943,27 @@ int main(int argc, char *argv[])
}
else if(!strcmp("--pidfile", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
pidname = argv[arg++];
}
else if(!strcmp("--portfile", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
portname = argv[arg++];
}
else if(!strcmp("--config", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
configfile = argv[arg++];
}
else if(!strcmp("--logfile", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
serverlogfile = argv[arg++];
}
else if(!strcmp("--logdir", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
logdir = argv[arg++];
}
else if(!strcmp("--ipv6", argv[arg])) {
@@ -984,7 +983,7 @@ int main(int argc, char *argv[])
}
else if(!strcmp("--port", argv[arg])) {
arg++;
- if(argc>arg) {
+ if(argc > arg) {
char *endptr;
unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
if((endptr != argv[arg] + strlen(argv[arg])) ||
tests/server/resolve.c+1 -1
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
const char *host = NULL;
int rc = 0;
- while(argc>arg) {
+ while(argc > arg) {
if(!strcmp("--version", argv[arg])) {
printf("resolve IPv4%s\n",
#if defined(CURLRES_IPV6)
tests/server/rtspd.c+8 -8
@@ -953,7 +953,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
count -= written;
buffer += written;
- } while(count>0);
+ } while(count > 0);
/* Send out any RTP data */
if(req->rtp_buffer) {
@@ -1066,7 +1066,7 @@ int main(int argc, char *argv[])
memset(&req, 0, sizeof(req));
- while(argc>arg) {
+ while(argc > arg) {
if(!strcmp("--version", argv[arg])) {
printf("rtspd IPv4%s"
"\n"
@@ -1081,22 +1081,22 @@ int main(int argc, char *argv[])
}
else if(!strcmp("--pidfile", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
pidname = argv[arg++];
}
else if(!strcmp("--portfile", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
portname = argv[arg++];
}
else if(!strcmp("--logfile", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
serverlogfile = argv[arg++];
}
else if(!strcmp("--logdir", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
logdir = argv[arg++];
}
else if(!strcmp("--ipv4", argv[arg])) {
@@ -1115,7 +1115,7 @@ int main(int argc, char *argv[])
}
else if(!strcmp("--port", argv[arg])) {
arg++;
- if(argc>arg) {
+ if(argc > arg) {
char *endptr;
unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
port = curlx_ultous(ulnum);
@@ -1124,7 +1124,7 @@ int main(int argc, char *argv[])
}
else if(!strcmp("--srcdir", argv[arg])) {
arg++;
- if(argc>arg) {
+ if(argc > arg) {
path = argv[arg];
arg++;
}
tests/server/sockfilt.c+9 -9
@@ -362,7 +362,7 @@ static void lograw(unsigned char *buffer, ssize_t len)
ssize_t width = 0;
int left = sizeof(data);
- for(i = 0; i<len; i++) {
+ for(i = 0; i < len; i++) {
switch(ptr[i]) {
case '\n':
msnprintf(optr, left, "\\n");
@@ -378,14 +378,14 @@ static void lograw(unsigned char *buffer, ssize_t len)
break;
default:
msnprintf(optr, left, "%c", (ISGRAPH(ptr[i]) ||
- ptr[i] == 0x20) ?ptr[i]:'.');
+ ptr[i] == 0x20) ? ptr[i] : '.');
width++;
optr++;
left--;
break;
}
- if(width>60) {
+ if(width > 60) {
logmsg("'%s'", data);
width = 0;
optr = data;
@@ -1366,7 +1366,7 @@ int main(int argc, char *argv[])
enum sockmode mode = PASSIVE_LISTEN; /* default */
const char *addr = NULL;
- while(argc>arg) {
+ while(argc > arg) {
if(!strcmp("--version", argv[arg])) {
printf("sockfilt IPv4%s\n",
#ifdef USE_IPV6
@@ -1383,7 +1383,7 @@ int main(int argc, char *argv[])
}
else if(!strcmp("--pidfile", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
pidname = argv[arg++];
}
else if(!strcmp("--portfile", argv[arg])) {
@@ -1393,7 +1393,7 @@ int main(int argc, char *argv[])
}
else if(!strcmp("--logfile", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
serverlogfile = argv[arg++];
}
else if(!strcmp("--ipv6", argv[arg])) {
@@ -1417,7 +1417,7 @@ int main(int argc, char *argv[])
}
else if(!strcmp("--port", argv[arg])) {
arg++;
- if(argc>arg) {
+ if(argc > arg) {
char *endptr;
unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
port = curlx_ultous(ulnum);
@@ -1428,7 +1428,7 @@ int main(int argc, char *argv[])
/* Asked to actively connect to the specified local port instead of
doing a passive server-style listening. */
arg++;
- if(argc>arg) {
+ if(argc > arg) {
char *endptr;
unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
if((endptr != argv[arg] + strlen(argv[arg])) ||
@@ -1444,7 +1444,7 @@ int main(int argc, char *argv[])
else if(!strcmp("--addr", argv[arg])) {
/* Set an IP address to use with --connect; otherwise use localhost */
arg++;
- if(argc>arg) {
+ if(argc > arg) {
addr = argv[arg];
arg++;
}
tests/server/socksd.c+13 -13
@@ -248,7 +248,7 @@ static void loghex(unsigned char *buffer, ssize_t len)
ssize_t width = 0;
int left = sizeof(data);
- for(i = 0; i<len && (left >= 0); i++) {
+ for(i = 0; i < len && (left >= 0); i++) {
msnprintf(optr, left, "%02x", ptr[i]);
width += 2;
optr += 2;
@@ -324,7 +324,7 @@ static curl_socket_t socks4(curl_socket_t fd,
return CURL_SOCKET_BAD;
}
if(!config.port)
- s4port = (unsigned short)((buffer[SOCKS4_DSTPORT]<<8) |
+ s4port = (unsigned short)((buffer[SOCKS4_DSTPORT] << 8) |
(buffer[SOCKS4_DSTPORT + 1]));
else
s4port = config.port;
@@ -572,7 +572,7 @@ static curl_socket_t sockit(curl_socket_t fd)
if(!config.port) {
unsigned char *portp = &buffer[SOCKS5_DSTADDR + len];
- s5port = (unsigned short)((portp[0]<<8) | (portp[1]));
+ s5port = (unsigned short)((portp[0] << 8) | (portp[1]));
}
else
s5port = config.port;
@@ -968,7 +968,7 @@ int main(int argc, char *argv[])
bool unlink_socket = false;
#endif
- while(argc>arg) {
+ while(argc > arg) {
if(!strcmp("--version", argv[arg])) {
printf("socksd IPv4%s\n",
#ifdef USE_IPV6
@@ -981,37 +981,37 @@ int main(int argc, char *argv[])
}
else if(!strcmp("--pidfile", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
pidname = argv[arg++];
}
else if(!strcmp("--portfile", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
portname = argv[arg++];
}
else if(!strcmp("--config", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
configfile = argv[arg++];
}
else if(!strcmp("--backend", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
backendaddr = argv[arg++];
}
else if(!strcmp("--backendport", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
backendport = (unsigned short)atoi(argv[arg++]);
}
else if(!strcmp("--logfile", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
serverlogfile = argv[arg++];
}
else if(!strcmp("--reqfile", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
reqlogfile = argv[arg++];
}
else if(!strcmp("--ipv6", argv[arg])) {
@@ -1030,7 +1030,7 @@ int main(int argc, char *argv[])
}
else if(!strcmp("--unix-socket", argv[arg])) {
arg++;
- if(argc>arg) {
+ if(argc > arg) {
#ifdef USE_UNIX_SOCKETS
struct sockaddr_un sau;
unix_socket = argv[arg];
@@ -1048,7 +1048,7 @@ int main(int argc, char *argv[])
}
else if(!strcmp("--port", argv[arg])) {
arg++;
- if(argc>arg) {
+ if(argc > arg) {
char *endptr;
unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
port = curlx_ultous(ulnum);
tests/server/sws.c+15 -15
@@ -372,7 +372,7 @@ static int ProcessRequest(struct httprequest *req)
req->callcount++;
logmsg("Process %zu bytes request%s", req->offset,
- req->callcount > 1?" [CONTINUED]":"");
+ req->callcount > 1 ? " [CONTINUED]" : "");
/* try to figure out the request characteristics as soon as possible, but
only once! */
@@ -792,7 +792,7 @@ static void storerequest(const char *reqbuf, size_t totalsize)
char dumpfile[256];
msnprintf(dumpfile, sizeof(dumpfile), "%s/%s",
- logdir, is_proxy?REQUEST_PROXY_DUMP:REQUEST_DUMP);
+ logdir, is_proxy ? REQUEST_PROXY_DUMP : REQUEST_DUMP);
if(!reqbuf)
return;
@@ -1021,7 +1021,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
char responsedump[256];
msnprintf(responsedump, sizeof(responsedump), "%s/%s",
- logdir, is_proxy?RESPONSE_PROXY_DUMP:RESPONSE_DUMP);
+ logdir, is_proxy ? RESPONSE_PROXY_DUMP:RESPONSE_DUMP);
switch(req->rcmd) {
default:
@@ -1084,7 +1084,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
/* select the <data> tag for "normal" requests and the <connect> one
for CONNECT requests (within the <reply> section) */
- const char *section = req->connect_request?"connect":"data";
+ const char *section = req->connect_request ? "connect" : "data";
if(req->partno)
msnprintf(partbuf, sizeof(partbuf), "%s%ld", section, req->partno);
@@ -2017,7 +2017,7 @@ int main(int argc, char *argv[])
/* a default CONNECT port is basically pointless but still ... */
size_t socket_idx;
- while(argc>arg) {
+ while(argc > arg) {
if(!strcmp("--version", argv[arg])) {
puts("sws IPv4"
#ifdef USE_IPV6
@@ -2031,27 +2031,27 @@ int main(int argc, char *argv[])
}
else if(!strcmp("--pidfile", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
pidname = argv[arg++];
}
else if(!strcmp("--portfile", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
portname = argv[arg++];
}
else if(!strcmp("--logfile", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
serverlogfile = argv[arg++];
}
else if(!strcmp("--logdir", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
logdir = argv[arg++];
}
else if(!strcmp("--cmdfile", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
cmdfile = argv[arg++];
}
else if(!strcmp("--gopher", argv[arg])) {
@@ -2076,7 +2076,7 @@ int main(int argc, char *argv[])
}
else if(!strcmp("--unix-socket", argv[arg])) {
arg++;
- if(argc>arg) {
+ if(argc > arg) {
#ifdef USE_UNIX_SOCKETS
unix_socket = argv[arg];
if(strlen(unix_socket) >= sizeof(me.sau.sun_path)) {
@@ -2094,7 +2094,7 @@ int main(int argc, char *argv[])
}
else if(!strcmp("--port", argv[arg])) {
arg++;
- if(argc>arg) {
+ if(argc > arg) {
char *endptr;
unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
if((endptr != argv[arg] + strlen(argv[arg])) ||
@@ -2109,14 +2109,14 @@ int main(int argc, char *argv[])
}
else if(!strcmp("--srcdir", argv[arg])) {
arg++;
- if(argc>arg) {
+ if(argc > arg) {
path = argv[arg];
arg++;
}
}
else if(!strcmp("--keepalive", argv[arg])) {
arg++;
- if(argc>arg) {
+ if(argc > arg) {
char *endptr;
unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
if((endptr != argv[arg] + strlen(argv[arg])) ||
@@ -2134,7 +2134,7 @@ int main(int argc, char *argv[])
what the client asks for, but also use this as a hint that we run as
a proxy and do a few different internal choices */
arg++;
- if(argc>arg) {
+ if(argc > arg) {
connecthost = argv[arg];
arg++;
is_proxy = TRUE;
tests/server/testpart.c+1 -1
@@ -35,7 +35,7 @@ int main(int argc, char **argv)
char *part;
size_t partlen;
- if(argc< 3) {
+ if(argc < 3) {
printf("./testpart main sub\n");
}
else {
tests/server/tftpd.c+7 -7
@@ -564,7 +564,7 @@ int main(int argc, char **argv)
memset(&test, 0, sizeof(test));
- while(argc>arg) {
+ while(argc > arg) {
if(!strcmp("--version", argv[arg])) {
printf("tftpd IPv4%s\n",
#ifdef USE_IPV6
@@ -577,22 +577,22 @@ int main(int argc, char **argv)
}
else if(!strcmp("--pidfile", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
pidname = argv[arg++];
}
else if(!strcmp("--portfile", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
portname = argv[arg++];
}
else if(!strcmp("--logfile", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
serverlogfile = argv[arg++];
}
else if(!strcmp("--logdir", argv[arg])) {
arg++;
- if(argc>arg)
+ if(argc > arg)
logdir = argv[arg++];
}
else if(!strcmp("--ipv4", argv[arg])) {
@@ -611,7 +611,7 @@ int main(int argc, char **argv)
}
else if(!strcmp("--port", argv[arg])) {
arg++;
- if(argc>arg) {
+ if(argc > arg) {
char *endptr;
unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
port = curlx_ultous(ulnum);
@@ -620,7 +620,7 @@ int main(int argc, char **argv)
}
else if(!strcmp("--srcdir", argv[arg])) {
arg++;
- if(argc>arg) {
+ if(argc > arg) {
path = argv[arg];
arg++;
}
tests/server/util.c+18 -7
@@ -562,15 +562,22 @@ static BOOL WINAPI ctrl_event_handler(DWORD dwCtrlType)
logmsg("ctrl_event_handler: %lu", dwCtrlType);
switch(dwCtrlType) {
#ifdef SIGINT
- case CTRL_C_EVENT: signum = SIGINT; break;
+ case CTRL_C_EVENT:
+ signum = SIGINT;
+ break;
#endif
#ifdef SIGTERM
- case CTRL_CLOSE_EVENT: signum = SIGTERM; break;
+ case CTRL_CLOSE_EVENT:
+ signum = SIGTERM;
+ break;
#endif
#ifdef SIGBREAK
- case CTRL_BREAK_EVENT: signum = SIGBREAK; break;
+ case CTRL_BREAK_EVENT:
+ signum = SIGBREAK;
+ break;
#endif
- default: return FALSE;
+ default:
+ return FALSE;
}
if(signum) {
logmsg("ctrl_event_handler: %lu -> %d", dwCtrlType, signum);
@@ -595,9 +602,13 @@ static LRESULT CALLBACK main_window_proc(HWND hwnd, UINT uMsg,
if(hwnd == hidden_main_window) {
switch(uMsg) {
#ifdef SIGTERM
- case WM_CLOSE: signum = SIGTERM; break;
+ case WM_CLOSE:
+ signum = SIGTERM;
+ break;
#endif
- case WM_DESTROY: PostQuitMessage(0); break;
+ case WM_DESTROY:
+ PostQuitMessage(0);
+ break;
}
if(signum) {
logmsg("main_window_proc: %d -> %d", uMsg, signum);
@@ -671,7 +682,7 @@ static SIGHANDLER_T set_signal(int signum, SIGHANDLER_T handler,
sa.sa_handler = handler;
sigemptyset(&sa.sa_mask);
sigaddset(&sa.sa_mask, signum);
- sa.sa_flags = restartable? SA_RESTART: 0;
+ sa.sa_flags = restartable ? SA_RESTART : 0;
if(sigaction(signum, &sa, &oldsa))
return SIG_ERR;
tests/unit/unit1309.c+1 -1
@@ -46,7 +46,7 @@ static void splayprint(struct Curl_tree *t, int d, char output)
return;
splayprint(t->larger, d + 1, output);
- for(i = 0; i<d; i++)
+ for(i = 0; i < d; i++)
if(output)
printf(" ");
tests/unit/unit1399.c+1 -1
@@ -58,7 +58,7 @@ static bool usec_matches_seconds(timediff_t time_usec, int expected_seconds)
bool same = (time_sec == expected_seconds);
fprintf(stderr, "is %d us same as %d seconds? %s\n",
(int)time_usec, expected_seconds,
- same?"Yes":"No");
+ same ? "Yes" : "No");
return same;
}
tests/unit/unit2600.c+3 -3
@@ -234,7 +234,7 @@ static CURLcode cf_test_create(struct Curl_cfilter **pcf,
Curl_expire(data, ctx->fail_delay_ms, EXPIRE_RUN_NOW);
out:
- *pcf = (!result)? cf : NULL;
+ *pcf = (!result) ? cf : NULL;
if(result) {
free(cf);
free(ctx);
@@ -284,9 +284,9 @@ static void check_result(struct test_case *tc,
if(tr->cf6.creations && tr->cf4.creations && tc->pref_family) {
/* did ipv4 and ipv6 both, expect the preferred family to start right arway
* with the other being delayed by the happy_eyeball_timeout */
- struct ai_family_stats *stats1 = !strcmp(tc->pref_family, "v6")?
+ struct ai_family_stats *stats1 = !strcmp(tc->pref_family, "v6") ?
&tr->cf6 : &tr->cf4;
- struct ai_family_stats *stats2 = !strcmp(tc->pref_family, "v6")?
+ struct ai_family_stats *stats2 = !strcmp(tc->pref_family, "v6") ?
&tr->cf4 : &tr->cf6;
if(stats1->first_created > 100) {
tests/unit/unit2601.c+1 -1
@@ -42,7 +42,7 @@ static const char *tail_err(struct bufq *q)
struct buf_chunk *chunk;
if(!q->tail) {
- return q->head? "tail is NULL, but head is not" : NULL;
+ return q->head ? "tail is NULL, but head is not" : NULL;
}
chunk = q->head;