curlx: move into to curlx/
—
$ git checkout -f 255aac56f9773d7c138816bfe0390293f7da33a5
Previous HEAD position was cf38e0067c metahash: add asserts to help analyzers
HEAD is now at 255aac56f9 curlx: move into to curlx/
$ git clean -fdx
Removing Makefile
Removing Makefile.in
Removing aclocal.m4
Removing autom4te.cache/
Removing buildinfo.txt
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/curl-curl_multibyte.o
Removing lib/curl-nonblock.o
Removing lib/curl-strcase.o
Removing lib/curl-version_win32.o
Removing lib/curl_config.h
Removing lib/curl_config.h.in
Removing lib/curlx/.deps/
Removing lib/curlx/.dirstamp
Removing lib/curlx/curl-base64.o
Removing lib/curlx/curl-dynbuf.o
Removing lib/curlx/curl-strparse.o
Removing lib/curlx/curl-timediff.o
Removing lib/curlx/curl-timeval.o
Removing lib/curlx/curl-warnless.o
Removing lib/curlx/libcurl_la-base64.lo
Removing lib/curlx/libcurl_la-base64.o
Removing lib/curlx/libcurl_la-dynbuf.lo
Removing lib/curlx/libcurl_la-dynbuf.o
Removing lib/curlx/libcurl_la-strparse.lo
Removing lib/curlx/libcurl_la-strparse.o
Removing lib/curlx/libcurl_la-timediff.lo
Removing lib/curlx/libcurl_la-timediff.o
Removing lib/curlx/libcurl_la-timeval.lo
Removing lib/curlx/libcurl_la-timeval.o
Removing lib/curlx/libcurl_la-warnless.lo
Removing lib/curlx/libcurl_la-warnless.o
Removing lib/curlx/libcurltool_la-base64.lo
Removing lib/curlx/libcurltool_la-base64.o
Removing lib/curlx/libcurltool_la-dynbuf.lo
Removing lib/curlx/libcurltool_la-dynbuf.o
Removing lib/curlx/libcurltool_la-strparse.lo
Removing lib/curlx/libcurltool_la-strparse.o
Removing lib/curlx/libcurltool_la-timediff.lo
Removing lib/curlx/libcurltool_la-timediff.o
Removing lib/curlx/libcurltool_la-timeval.lo
Removing lib/curlx/libcurltool_la-timeval.o
Removing lib/curlx/libcurltool_la-warnless.lo
Removing lib/curlx/libcurltool_la-warnless.o
Removing lib/curlx/libcurlu_la-base64.lo
Removing lib/curlx/libcurlu_la-base64.o
Removing lib/curlx/libcurlu_la-dynbuf.lo
Removing lib/curlx/libcurlu_la-dynbuf.o
Removing lib/curlx/libcurlu_la-strparse.lo
Removing lib/curlx/libcurlu_la-strparse.o
Removing lib/curlx/libcurlu_la-timediff.lo
Removing lib/curlx/libcurlu_la-timediff.o
Removing lib/curlx/libcurlu_la-timeval.lo
Removing lib/curlx/libcurlu_la-timeval.o
Removing lib/curlx/libcurlu_la-warnless.lo
Removing lib/curlx/libcurlu_la-warnless.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-base.lo
Removing lib/libcurl_la-asyn-base.o
Removing lib/libcurl_la-asyn-thrdd.lo
Removing lib/libcurl_la-asyn-thrdd.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-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-cshutdn.lo
Removing lib/libcurl_la-cshutdn.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_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-cw-pause.lo
Removing lib/libcurl_la-cw-pause.o
Removing lib/libcurl_la-dict.lo
Removing lib/libcurl_la-dict.o
Removing lib/libcurl_la-doh.lo
Removing lib/libcurl_la-doh.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-fake_addrinfo.lo
Removing lib/libcurl_la-fake_addrinfo.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-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-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-httpsrr.lo
Removing lib/libcurl_la-httpsrr.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-multi_ev.lo
Removing lib/libcurl_la-multi_ev.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-strequal.lo
Removing lib/libcurl_la-strequal.o
Removing lib/libcurl_la-strerror.lo
Removing lib/libcurl_la-strerror.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-transfer.lo
Removing lib/libcurl_la-transfer.o
Removing lib/libcurl_la-uint-bset.lo
Removing lib/libcurl_la-uint-bset.o
Removing lib/libcurl_la-uint-hash.lo
Removing lib/libcurl_la-uint-hash.o
Removing lib/libcurl_la-uint-spbset.lo
Removing lib/libcurl_la-uint-spbset.o
Removing lib/libcurl_la-uint-table.lo
Removing lib/libcurl_la-uint-table.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-ws.lo
Removing lib/libcurl_la-ws.o
Removing lib/libcurltool_la-curl_multibyte.lo
Removing lib/libcurltool_la-curl_multibyte.o
Removing lib/libcurltool_la-nonblock.lo
Removing lib/libcurltool_la-nonblock.o
Removing lib/libcurltool_la-strcase.lo
Removing lib/libcurltool_la-strcase.o
Removing lib/libcurltool_la-version_win32.lo
Removing lib/libcurltool_la-version_win32.o
Removing lib/libcurlu.la
Removing lib/libcurlu_la-altsvc.lo
Removing lib/libcurlu_la-altsvc.o
Removing lib/libcurlu_la-amigaos.lo
Removing lib/libcurlu_la-amigaos.o
Removing lib/libcurlu_la-asyn-ares.lo
Removing lib/libcurlu_la-asyn-ares.o
Removing lib/libcurlu_la-asyn-base.lo
Removing lib/libcurlu_la-asyn-base.o
Removing lib/libcurlu_la-asyn-thrdd.lo
Removing lib/libcurlu_la-asyn-thrdd.o
Removing lib/libcurlu_la-bufq.lo
Removing lib/libcurlu_la-bufq.o
Removing lib/libcurlu_la-bufref.lo
Removing lib/libcurlu_la-bufref.o
Removing lib/libcurlu_la-cf-h1-proxy.lo
Removing lib/libcurlu_la-cf-h1-proxy.o
Removing lib/libcurlu_la-cf-h2-proxy.lo
Removing lib/libcurlu_la-cf-h2-proxy.o
Removing lib/libcurlu_la-cf-haproxy.lo
Removing lib/libcurlu_la-cf-haproxy.o
Removing lib/libcurlu_la-cf-https-connect.lo
Removing lib/libcurlu_la-cf-https-connect.o
Removing lib/libcurlu_la-cf-socket.lo
Removing lib/libcurlu_la-cf-socket.o
Removing lib/libcurlu_la-cfilters.lo
Removing lib/libcurlu_la-cfilters.o
Removing lib/libcurlu_la-conncache.lo
Removing lib/libcurlu_la-conncache.o
Removing lib/libcurlu_la-connect.lo
Removing lib/libcurlu_la-connect.o
Removing lib/libcurlu_la-content_encoding.lo
Removing lib/libcurlu_la-content_encoding.o
Removing lib/libcurlu_la-cookie.lo
Removing lib/libcurlu_la-cookie.o
Removing lib/libcurlu_la-cshutdn.lo
Removing lib/libcurlu_la-cshutdn.o
Removing lib/libcurlu_la-curl_addrinfo.lo
Removing lib/libcurlu_la-curl_addrinfo.o
Removing lib/libcurlu_la-curl_des.lo
Removing lib/libcurlu_la-curl_des.o
Removing lib/libcurlu_la-curl_endian.lo
Removing lib/libcurlu_la-curl_endian.o
Removing lib/libcurlu_la-curl_fnmatch.lo
Removing lib/libcurlu_la-curl_fnmatch.o
Removing lib/libcurlu_la-curl_get_line.lo
Removing lib/libcurlu_la-curl_get_line.o
Removing lib/libcurlu_la-curl_gethostname.lo
Removing lib/libcurlu_la-curl_gethostname.o
Removing lib/libcurlu_la-curl_gssapi.lo
Removing lib/libcurlu_la-curl_gssapi.o
Removing lib/libcurlu_la-curl_memrchr.lo
Removing lib/libcurlu_la-curl_memrchr.o
Removing lib/libcurlu_la-curl_multibyte.lo
Removing lib/libcurlu_la-curl_multibyte.o
Removing lib/libcurlu_la-curl_ntlm_core.lo
Removing lib/libcurlu_la-curl_ntlm_core.o
Removing lib/libcurlu_la-curl_range.lo
Removing lib/libcurlu_la-curl_range.o
Removing lib/libcurlu_la-curl_rtmp.lo
Removing lib/libcurlu_la-curl_rtmp.o
Removing lib/libcurlu_la-curl_sasl.lo
Removing lib/libcurlu_la-curl_sasl.o
Removing lib/libcurlu_la-curl_sha512_256.lo
Removing lib/libcurlu_la-curl_sha512_256.o
Removing lib/libcurlu_la-curl_sspi.lo
Removing lib/libcurlu_la-curl_sspi.o
Removing lib/libcurlu_la-curl_threads.lo
Removing lib/libcurlu_la-curl_threads.o
Removing lib/libcurlu_la-curl_trc.lo
Removing lib/libcurlu_la-curl_trc.o
Removing lib/libcurlu_la-cw-out.lo
Removing lib/libcurlu_la-cw-out.o
Removing lib/libcurlu_la-cw-pause.lo
Removing lib/libcurlu_la-cw-pause.o
Removing lib/libcurlu_la-dict.lo
Removing lib/libcurlu_la-dict.o
Removing lib/libcurlu_la-doh.lo
Removing lib/libcurlu_la-doh.o
Removing lib/libcurlu_la-dynhds.lo
Removing lib/libcurlu_la-dynhds.o
Removing lib/libcurlu_la-easy.lo
Removing lib/libcurlu_la-easy.o
Removing lib/libcurlu_la-easygetopt.lo
Removing lib/libcurlu_la-easygetopt.o
Removing lib/libcurlu_la-easyoptions.lo
Removing lib/libcurlu_la-easyoptions.o
Removing lib/libcurlu_la-escape.lo
Removing lib/libcurlu_la-escape.o
Removing lib/libcurlu_la-fake_addrinfo.lo
Removing lib/libcurlu_la-fake_addrinfo.o
Removing lib/libcurlu_la-file.lo
Removing lib/libcurlu_la-file.o
Removing lib/libcurlu_la-fileinfo.lo
Removing lib/libcurlu_la-fileinfo.o
Removing lib/libcurlu_la-fopen.lo
Removing lib/libcurlu_la-fopen.o
Removing lib/libcurlu_la-formdata.lo
Removing lib/libcurlu_la-formdata.o
Removing lib/libcurlu_la-ftp.lo
Removing lib/libcurlu_la-ftp.o
Removing lib/libcurlu_la-ftplistparser.lo
Removing lib/libcurlu_la-ftplistparser.o
Removing lib/libcurlu_la-getenv.lo
Removing lib/libcurlu_la-getenv.o
Removing lib/libcurlu_la-getinfo.lo
Removing lib/libcurlu_la-getinfo.o
Removing lib/libcurlu_la-gopher.lo
Removing lib/libcurlu_la-gopher.o
Removing lib/libcurlu_la-hash.lo
Removing lib/libcurlu_la-hash.o
Removing lib/libcurlu_la-headers.lo
Removing lib/libcurlu_la-headers.o
Removing lib/libcurlu_la-hmac.lo
Removing lib/libcurlu_la-hmac.o
Removing lib/libcurlu_la-hostip.lo
Removing lib/libcurlu_la-hostip.o
Removing lib/libcurlu_la-hostip4.lo
Removing lib/libcurlu_la-hostip4.o
Removing lib/libcurlu_la-hostip6.lo
Removing lib/libcurlu_la-hostip6.o
Removing lib/libcurlu_la-hsts.lo
Removing lib/libcurlu_la-hsts.o
Removing lib/libcurlu_la-http.lo
Removing lib/libcurlu_la-http.o
Removing lib/libcurlu_la-http1.lo
Removing lib/libcurlu_la-http1.o
Removing lib/libcurlu_la-http2.lo
Removing lib/libcurlu_la-http2.o
Removing lib/libcurlu_la-http_aws_sigv4.lo
Removing lib/libcurlu_la-http_aws_sigv4.o
Removing lib/libcurlu_la-http_chunks.lo
Removing lib/libcurlu_la-http_chunks.o
Removing lib/libcurlu_la-http_digest.lo
Removing lib/libcurlu_la-http_digest.o
Removing lib/libcurlu_la-http_negotiate.lo
Removing lib/libcurlu_la-http_negotiate.o
Removing lib/libcurlu_la-http_ntlm.lo
Removing lib/libcurlu_la-http_ntlm.o
Removing lib/libcurlu_la-http_proxy.lo
Removing lib/libcurlu_la-http_proxy.o
Removing lib/libcurlu_la-httpsrr.lo
Removing lib/libcurlu_la-httpsrr.o
Removing lib/libcurlu_la-idn.lo
Removing lib/libcurlu_la-idn.o
Removing lib/libcurlu_la-if2ip.lo
Removing lib/libcurlu_la-if2ip.o
Removing lib/libcurlu_la-imap.lo
Removing lib/libcurlu_la-imap.o
Removing lib/libcurlu_la-inet_ntop.lo
Removing lib/libcurlu_la-inet_ntop.o
Removing lib/libcurlu_la-inet_pton.lo
Removing lib/libcurlu_la-inet_pton.o
Removing lib/libcurlu_la-krb5.lo
Removing lib/libcurlu_la-krb5.o
Removing lib/libcurlu_la-ldap.lo
Removing lib/libcurlu_la-ldap.o
Removing lib/libcurlu_la-llist.lo
Removing lib/libcurlu_la-llist.o
Removing lib/libcurlu_la-macos.lo
Removing lib/libcurlu_la-macos.o
Removing lib/libcurlu_la-md4.lo
Removing lib/libcurlu_la-md4.o
Removing lib/libcurlu_la-md5.lo
Removing lib/libcurlu_la-md5.o
Removing lib/libcurlu_la-memdebug.lo
Removing lib/libcurlu_la-memdebug.o
Removing lib/libcurlu_la-mime.lo
Removing lib/libcurlu_la-mime.o
Removing lib/libcurlu_la-mprintf.lo
Removing lib/libcurlu_la-mprintf.o
Removing lib/libcurlu_la-mqtt.lo
Removing lib/libcurlu_la-mqtt.o
Removing lib/libcurlu_la-multi.lo
Removing lib/libcurlu_la-multi.o
Removing lib/libcurlu_la-multi_ev.lo
Removing lib/libcurlu_la-multi_ev.o
Removing lib/libcurlu_la-netrc.lo
Removing lib/libcurlu_la-netrc.o
Removing lib/libcurlu_la-nonblock.lo
Removing lib/libcurlu_la-nonblock.o
Removing lib/libcurlu_la-noproxy.lo
Removing lib/libcurlu_la-noproxy.o
Removing lib/libcurlu_la-openldap.lo
Removing lib/libcurlu_la-openldap.o
Removing lib/libcurlu_la-parsedate.lo
Removing lib/libcurlu_la-parsedate.o
Removing lib/libcurlu_la-pingpong.lo
Removing lib/libcurlu_la-pingpong.o
Removing lib/libcurlu_la-pop3.lo
Removing lib/libcurlu_la-pop3.o
Removing lib/libcurlu_la-progress.lo
Removing lib/libcurlu_la-progress.o
Removing lib/libcurlu_la-psl.lo
Removing lib/libcurlu_la-psl.o
Removing lib/libcurlu_la-rand.lo
Removing lib/libcurlu_la-rand.o
Removing lib/libcurlu_la-rename.lo
Removing lib/libcurlu_la-rename.o
Removing lib/libcurlu_la-request.lo
Removing lib/libcurlu_la-request.o
Removing lib/libcurlu_la-rtsp.lo
Removing lib/libcurlu_la-rtsp.o
Removing lib/libcurlu_la-select.lo
Removing lib/libcurlu_la-select.o
Removing lib/libcurlu_la-sendf.lo
Removing lib/libcurlu_la-sendf.o
Removing lib/libcurlu_la-setopt.lo
Removing lib/libcurlu_la-setopt.o
Removing lib/libcurlu_la-sha256.lo
Removing lib/libcurlu_la-sha256.o
Removing lib/libcurlu_la-share.lo
Removing lib/libcurlu_la-share.o
Removing lib/libcurlu_la-slist.lo
Removing lib/libcurlu_la-slist.o
Removing lib/libcurlu_la-smb.lo
Removing lib/libcurlu_la-smb.o
Removing lib/libcurlu_la-smtp.lo
Removing lib/libcurlu_la-smtp.o
Removing lib/libcurlu_la-socketpair.lo
Removing lib/libcurlu_la-socketpair.o
Removing lib/libcurlu_la-socks.lo
Removing lib/libcurlu_la-socks.o
Removing lib/libcurlu_la-socks_gssapi.lo
Removing lib/libcurlu_la-socks_gssapi.o
Removing lib/libcurlu_la-socks_sspi.lo
Removing lib/libcurlu_la-socks_sspi.o
Removing lib/libcurlu_la-speedcheck.lo
Removing lib/libcurlu_la-speedcheck.o
Removing lib/libcurlu_la-splay.lo
Removing lib/libcurlu_la-splay.o
Removing lib/libcurlu_la-strcase.lo
Removing lib/libcurlu_la-strcase.o
Removing lib/libcurlu_la-strdup.lo
Removing lib/libcurlu_la-strdup.o
Removing lib/libcurlu_la-strequal.lo
Removing lib/libcurlu_la-strequal.o
Removing lib/libcurlu_la-strerror.lo
Removing lib/libcurlu_la-strerror.o
Removing lib/libcurlu_la-system_win32.lo
Removing lib/libcurlu_la-system_win32.o
Removing lib/libcurlu_la-telnet.lo
Removing lib/libcurlu_la-telnet.o
Removing lib/libcurlu_la-tftp.lo
Removing lib/libcurlu_la-tftp.o
Removing lib/libcurlu_la-transfer.lo
Removing lib/libcurlu_la-transfer.o
Removing lib/libcurlu_la-uint-bset.lo
Removing lib/libcurlu_la-uint-bset.o
Removing lib/libcurlu_la-uint-hash.lo
Removing lib/libcurlu_la-uint-hash.o
Removing lib/libcurlu_la-uint-spbset.lo
Removing lib/libcurlu_la-uint-spbset.o
Removing lib/libcurlu_la-uint-table.lo
Removing lib/libcurlu_la-uint-table.o
Removing lib/libcurlu_la-url.lo
Removing lib/libcurlu_la-url.o
Removing lib/libcurlu_la-urlapi.lo
Removing lib/libcurlu_la-urlapi.o
Removing lib/libcurlu_la-version.lo
Removing lib/libcurlu_la-version.o
Removing lib/libcurlu_la-version_win32.lo
Removing lib/libcurlu_la-version_win32.o
Removing lib/libcurlu_la-ws.lo
Removing lib/libcurlu_la-ws.o
Removing lib/stamp-h1
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/vauth/libcurlu_la-cleartext.lo
Removing lib/vauth/libcurlu_la-cleartext.o
Removing lib/vauth/libcurlu_la-cram.lo
Removing lib/vauth/libcurlu_la-cram.o
Removing lib/vauth/libcurlu_la-digest.lo
Removing lib/vauth/libcurlu_la-digest.o
Removing lib/vauth/libcurlu_la-digest_sspi.lo
Removing lib/vauth/libcurlu_la-digest_sspi.o
Removing lib/vauth/libcurlu_la-gsasl.lo
Removing lib/vauth/libcurlu_la-gsasl.o
Removing lib/vauth/libcurlu_la-krb5_gssapi.lo
Removing lib/vauth/libcurlu_la-krb5_gssapi.o
Removing lib/vauth/libcurlu_la-krb5_sspi.lo
Removing lib/vauth/libcurlu_la-krb5_sspi.o
Removing lib/vauth/libcurlu_la-ntlm.lo
Removing lib/vauth/libcurlu_la-ntlm.o
Removing lib/vauth/libcurlu_la-ntlm_sspi.lo
Removing lib/vauth/libcurlu_la-ntlm_sspi.o
Removing lib/vauth/libcurlu_la-oauth2.lo
Removing lib/vauth/libcurlu_la-oauth2.o
Removing lib/vauth/libcurlu_la-spnego_gssapi.lo
Removing lib/vauth/libcurlu_la-spnego_gssapi.o
Removing lib/vauth/libcurlu_la-spnego_sspi.lo
Removing lib/vauth/libcurlu_la-spnego_sspi.o
Removing lib/vauth/libcurlu_la-vauth.lo
Removing lib/vauth/libcurlu_la-vauth.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/vquic/libcurlu_la-curl_msh3.lo
Removing lib/vquic/libcurlu_la-curl_msh3.o
Removing lib/vquic/libcurlu_la-curl_ngtcp2.lo
Removing lib/vquic/libcurlu_la-curl_ngtcp2.o
Removing lib/vquic/libcurlu_la-curl_osslq.lo
Removing lib/vquic/libcurlu_la-curl_osslq.o
Removing lib/vquic/libcurlu_la-curl_quiche.lo
Removing lib/vquic/libcurlu_la-curl_quiche.o
Removing lib/vquic/libcurlu_la-vquic-tls.lo
Removing lib/vquic/libcurlu_la-vquic-tls.o
Removing lib/vquic/libcurlu_la-vquic.lo
Removing lib/vquic/libcurlu_la-vquic.o
Removing lib/vssh/.deps/
Removing lib/vssh/.dirstamp
Removing lib/vssh/libcurl_la-curl_path.lo
Removing lib/vssh/libcurl_la-curl_path.o
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/vssh/libcurlu_la-curl_path.lo
Removing lib/vssh/libcurlu_la-curl_path.o
Removing lib/vssh/libcurlu_la-libssh.lo
Removing lib/vssh/libcurlu_la-libssh.o
Removing lib/vssh/libcurlu_la-libssh2.lo
Removing lib/vssh/libcurlu_la-libssh2.o
Removing lib/vssh/libcurlu_la-wolfssh.lo
Removing lib/vssh/libcurlu_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-vtls_scache.lo
Removing lib/vtls/libcurl_la-vtls_scache.o
Removing lib/vtls/libcurl_la-vtls_spack.lo
Removing lib/vtls/libcurl_la-vtls_spack.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/vtls/libcurlu_la-bearssl.lo
Removing lib/vtls/libcurlu_la-bearssl.o
Removing lib/vtls/libcurlu_la-cipher_suite.lo
Removing lib/vtls/libcurlu_la-cipher_suite.o
Removing lib/vtls/libcurlu_la-gtls.lo
Removing lib/vtls/libcurlu_la-gtls.o
Removing lib/vtls/libcurlu_la-hostcheck.lo
Removing lib/vtls/libcurlu_la-hostcheck.o
Removing lib/vtls/libcurlu_la-keylog.lo
Removing lib/vtls/libcurlu_la-keylog.o
Removing lib/vtls/libcurlu_la-mbedtls.lo
Removing lib/vtls/libcurlu_la-mbedtls.o
Removing lib/vtls/libcurlu_la-mbedtls_threadlock.lo
Removing lib/vtls/libcurlu_la-mbedtls_threadlock.o
Removing lib/vtls/libcurlu_la-openssl.lo
Removing lib/vtls/libcurlu_la-openssl.o
Removing lib/vtls/libcurlu_la-rustls.lo
Removing lib/vtls/libcurlu_la-rustls.o
Removing lib/vtls/libcurlu_la-schannel.lo
Removing lib/vtls/libcurlu_la-schannel.o
Removing lib/vtls/libcurlu_la-schannel_verify.lo
Removing lib/vtls/libcurlu_la-schannel_verify.o
Removing lib/vtls/libcurlu_la-sectransp.lo
Removing lib/vtls/libcurlu_la-sectransp.o
Removing lib/vtls/libcurlu_la-vtls.lo
Removing lib/vtls/libcurlu_la-vtls.o
Removing lib/vtls/libcurlu_la-vtls_scache.lo
Removing lib/vtls/libcurlu_la-vtls_scache.o
Removing lib/vtls/libcurlu_la-vtls_spack.lo
Removing lib/vtls/libcurlu_la-vtls_spack.o
Removing lib/vtls/libcurlu_la-wolfssl.lo
Removing lib/vtls/libcurlu_la-wolfssl.o
Removing lib/vtls/libcurlu_la-x509asn1.lo
Removing lib/vtls/libcurlu_la-x509asn1.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/.dirstamp
Removing src/.libs/
Removing src/Makefile
Removing src/Makefile.in
Removing src/curl
Removing src/curl-slist_wc.o
Removing src/curl-terminal.o
Removing src/curl-tool_bname.o
Removing src/curl-tool_ca_embed.o
Removing src/curl-tool_cb_dbg.o
Removing src/curl-tool_cb_hdr.o
Removing src/curl-tool_cb_prg.o
Removing src/curl-tool_cb_rea.o
Removing src/curl-tool_cb_see.o
Removing src/curl-tool_cb_soc.o
Removing src/curl-tool_cb_wrt.o
Removing src/curl-tool_cfgable.o
Removing src/curl-tool_dirhie.o
Removing src/curl-tool_doswin.o
Removing src/curl-tool_easysrc.o
Removing src/curl-tool_filetime.o
Removing src/curl-tool_findfile.o
Removing src/curl-tool_formparse.o
Removing src/curl-tool_getparam.o
Removing src/curl-tool_getpass.o
Removing src/curl-tool_help.o
Removing src/curl-tool_helpers.o
Removing src/curl-tool_hugehelp.o
Removing src/curl-tool_ipfs.o
Removing src/curl-tool_libinfo.o
Removing src/curl-tool_listhelp.o
Removing src/curl-tool_main.o
Removing src/curl-tool_msgs.o
Removing src/curl-tool_operate.o
Removing src/curl-tool_operhlp.o
Removing src/curl-tool_paramhlp.o
Removing src/curl-tool_parsecfg.o
Removing src/curl-tool_progress.o
Removing src/curl-tool_setopt.o
Removing src/curl-tool_sleep.o
Removing src/curl-tool_ssls.o
Removing src/curl-tool_stderr.o
Removing src/curl-tool_strdup.o
Removing src/curl-tool_urlglob.o
Removing src/curl-tool_util.o
Removing src/curl-tool_vms.o
Removing src/curl-tool_writeout.o
Removing src/curl-tool_writeout_json.o
Removing src/curl-tool_xattr.o
Removing src/curl-var.o
Removing src/curlinfo
Removing src/curlinfo.o
Removing src/libcurltool.la
Removing src/libcurltool_la-slist_wc.lo
Removing src/libcurltool_la-slist_wc.o
Removing src/libcurltool_la-terminal.lo
Removing src/libcurltool_la-terminal.o
Removing src/libcurltool_la-tool_bname.lo
Removing src/libcurltool_la-tool_bname.o
Removing src/libcurltool_la-tool_cb_dbg.lo
Removing src/libcurltool_la-tool_cb_dbg.o
Removing src/libcurltool_la-tool_cb_hdr.lo
Removing src/libcurltool_la-tool_cb_hdr.o
Removing src/libcurltool_la-tool_cb_prg.lo
Removing src/libcurltool_la-tool_cb_prg.o
Removing src/libcurltool_la-tool_cb_rea.lo
Removing src/libcurltool_la-tool_cb_rea.o
Removing src/libcurltool_la-tool_cb_see.lo
Removing src/libcurltool_la-tool_cb_see.o
Removing src/libcurltool_la-tool_cb_soc.lo
Removing src/libcurltool_la-tool_cb_soc.o
Removing src/libcurltool_la-tool_cb_wrt.lo
Removing src/libcurltool_la-tool_cb_wrt.o
Removing src/libcurltool_la-tool_cfgable.lo
Removing src/libcurltool_la-tool_cfgable.o
Removing src/libcurltool_la-tool_dirhie.lo
Removing src/libcurltool_la-tool_dirhie.o
Removing src/libcurltool_la-tool_doswin.lo
Removing src/libcurltool_la-tool_doswin.o
Removing src/libcurltool_la-tool_easysrc.lo
Removing src/libcurltool_la-tool_easysrc.o
Removing src/libcurltool_la-tool_filetime.lo
Removing src/libcurltool_la-tool_filetime.o
Removing src/libcurltool_la-tool_findfile.lo
Removing src/libcurltool_la-tool_findfile.o
Removing src/libcurltool_la-tool_formparse.lo
Removing src/libcurltool_la-tool_formparse.o
Removing src/libcurltool_la-tool_getparam.lo
Removing src/libcurltool_la-tool_getparam.o
Removing src/libcurltool_la-tool_getpass.lo
Removing src/libcurltool_la-tool_getpass.o
Removing src/libcurltool_la-tool_help.lo
Removing src/libcurltool_la-tool_help.o
Removing src/libcurltool_la-tool_helpers.lo
Removing src/libcurltool_la-tool_helpers.o
Removing src/libcurltool_la-tool_ipfs.lo
Removing src/libcurltool_la-tool_ipfs.o
Removing src/libcurltool_la-tool_libinfo.lo
Removing src/libcurltool_la-tool_libinfo.o
Removing src/libcurltool_la-tool_listhelp.lo
Removing src/libcurltool_la-tool_listhelp.o
Removing src/libcurltool_la-tool_main.lo
Removing src/libcurltool_la-tool_main.o
Removing src/libcurltool_la-tool_msgs.lo
Removing src/libcurltool_la-tool_msgs.o
Removing src/libcurltool_la-tool_operate.lo
Removing src/libcurltool_la-tool_operate.o
Removing src/libcurltool_la-tool_operhlp.lo
Removing src/libcurltool_la-tool_operhlp.o
Removing src/libcurltool_la-tool_paramhlp.lo
Removing src/libcurltool_la-tool_paramhlp.o
Removing src/libcurltool_la-tool_parsecfg.lo
Removing src/libcurltool_la-tool_parsecfg.o
Removing src/libcurltool_la-tool_progress.lo
Removing src/libcurltool_la-tool_progress.o
Removing src/libcurltool_la-tool_setopt.lo
Removing src/libcurltool_la-tool_setopt.o
Removing src/libcurltool_la-tool_sleep.lo
Removing src/libcurltool_la-tool_sleep.o
Removing src/libcurltool_la-tool_ssls.lo
Removing src/libcurltool_la-tool_ssls.o
Removing src/libcurltool_la-tool_stderr.lo
Removing src/libcurltool_la-tool_stderr.o
Removing src/libcurltool_la-tool_strdup.lo
Removing src/libcurltool_la-tool_strdup.o
Removing src/libcurltool_la-tool_urlglob.lo
Removing src/libcurltool_la-tool_urlglob.o
Removing src/libcurltool_la-tool_util.lo
Removing src/libcurltool_la-tool_util.o
Removing src/libcurltool_la-tool_vms.lo
Removing src/libcurltool_la-tool_vms.o
Removing src/libcurltool_la-tool_writeout.lo
Removing src/libcurltool_la-tool_writeout.o
Removing src/libcurltool_la-tool_writeout_json.lo
Removing src/libcurltool_la-tool_writeout_json.o
Removing src/libcurltool_la-tool_xattr.lo
Removing src/libcurltool_la-tool_xattr.o
Removing src/libcurltool_la-var.lo
Removing src/libcurltool_la-var.o
Removing src/tool_ca_embed.c
Removing src/tool_hugehelp.c
Removing tests/Makefile
Removing tests/Makefile.in
Removing tests/certs/Makefile
Removing tests/certs/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/tunit/.deps/
Removing tests/tunit/Makefile
Removing tests/tunit/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:127: installing './compile'
configure.ac:423: installing './config.guess'
configure.ac:423: installing './config.sub'
configure.ac:127: installing './install-sh'
configure.ac:133: 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 whether to enable SSL session export 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.14.0-DEV
checking for httpd... no
checking for apache2... 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
no
checking whether build target supports Win32 crypto API... no
checking whether to build libcurl and curl in "unity" mode... no
checking whether to build tests into single-binary bundles... no
checking whether to support http... yes
checking whether to support ftp... yes
checking whether to support file... yes
checking whether to support IPFS... 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 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 sys/resource.h... yes
checking for libgen.h... yes
checking for locale.h... yes
checking for stdbool.h... yes
checking for stdint.h... (cached) yes
checking for sys/filio.h... no
checking for sys/eventfd.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 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 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_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 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 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 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 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... yes
checking if memrchr is compilable... yes
checking if memrchr usage allowed... yes
checking if memrchr 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 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... 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 for accept4... yes
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 mach_absolute_time... no
checking for pipe... yes
checking for pipe2... yes
checking for poll... yes
checking for sendmmsg... yes
checking for sendmsg... yes
checking for setlocale... yes
checking for setrlimit... yes
checking for snprintf... yes
checking for utime... yes
checking for utimes... yes
checking for if_nametoindex... yes
checking for realpath... yes
checking for sched_yield... 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 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 stricmp can be linked... no
checking if stricmp might be used... no
checking for setmode... no
checking for arc4random... no
checking for fseeko... yes
checking for ccache gcc options needed to detect all undeclared functions... none needed
checking whether fseeko is declared... yes
checking how to set a socket into non-blocking mode... fcntl O_NONBLOCK
checking for perl... /usr/bin/perl
checking whether to enable the threaded resolver... yes
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 enable HTTPS-RR support... no
checking whether to support WebSockets... yes
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/configurehelp.pm
config.status: creating tests/certs/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/tunit/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: -D_GNU_SOURCE
LDFLAGS:
curl-config:
LIBS: -lpsl -lz
curl version: 8.14.0-DEV
SSL: no (--with-{openssl,gnutls,mbedtls,wolfssl,schannel,secure-transport,amissl,bearssl,rustls} )
SSH: no (--with-{libssh,libssh2})
zlib: enabled
brotli: no (--with-brotli)
zstd: no (--with-zstd)
GSS-API: no (--with-gssapi)
GSASL: no (libgsasl not found)
TLS-SRP: no (--enable-tls-srp)
resolver: POSIX threaded
IPv6: enabled
Unix sockets: enabled
IDN: no (--with-{libidn2,winidn})
Build docs: no
Build libcurl: Shared=no, Static=yes
Built-in manual: no (--enable-manual)
--libcurl option: enabled (--disable-libcurl-option)
Verbose errors: enabled (--disable-verbose)
Code coverage: disabled
SSPI: no (--enable-sspi)
ca cert bundle: no
ca cert path:
ca cert embed: no
ca fallback:
LDAP: no (--enable-ldap / --with-ldap-lib / --with-lber-lib)
LDAPS: no (--enable-ldaps)
IPFS/IPNS: enabled
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)
HTTPS RR: no (--enable-httpsrr)
SSLS-EXPORT: no (--enable-ssls-export)
Protocols: dict file ftp gopher http imap ipfs ipns mqtt pop3 rtsp smtp telnet tftp ws
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-base.lo
CC libcurl_la-asyn-thrdd.lo
CC libcurl_la-bufq.lo
CC libcurl_la-bufref.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-cshutdn.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_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-cw-pause.lo
CC libcurl_la-dict.lo
CC libcurl_la-doh.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-fake_addrinfo.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-hostip.lo
CC libcurl_la-hostip4.lo
CC libcurl_la-hostip6.lo
CC libcurl_la-hsts.lo
CC libcurl_la-http.lo
CC libcurl_la-http1.lo
CC libcurl_la-http2.lo
CC libcurl_la-http_aws_sigv4.lo
CC libcurl_la-http_chunks.lo
CC libcurl_la-http_digest.lo
CC libcurl_la-http_negotiate.lo
CC libcurl_la-http_ntlm.lo
CC libcurl_la-http_proxy.lo
CC libcurl_la-idn.lo
CC libcurl_la-httpsrr.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-macos.lo
CC libcurl_la-llist.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-multi_ev.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-strequal.lo
CC libcurl_la-strerror.lo
CC libcurl_la-system_win32.lo
CC libcurl_la-telnet.lo
CC libcurl_la-tftp.lo
CC libcurl_la-transfer.lo
CC libcurl_la-uint-bset.lo
CC libcurl_la-uint-hash.lo
CC libcurl_la-uint-spbset.lo
CC libcurl_la-uint-table.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-ws.lo
CC libcurlu_la-altsvc.lo
CC libcurlu_la-amigaos.lo
CC libcurlu_la-asyn-ares.lo
CC libcurlu_la-asyn-base.lo
CC libcurlu_la-asyn-thrdd.lo
CC libcurlu_la-bufq.lo
CC libcurlu_la-bufref.lo
CC libcurlu_la-cf-h1-proxy.lo
CC libcurlu_la-cf-h2-proxy.lo
CC libcurlu_la-cf-haproxy.lo
CC libcurlu_la-cf-https-connect.lo
CC libcurlu_la-cf-socket.lo
CC libcurlu_la-cfilters.lo
CC libcurlu_la-conncache.lo
CC libcurlu_la-connect.lo
CC libcurlu_la-content_encoding.lo
CC libcurlu_la-cookie.lo
CC libcurlu_la-cshutdn.lo
CC libcurlu_la-curl_des.lo
CC libcurlu_la-curl_addrinfo.lo
CC libcurlu_la-curl_endian.lo
CC libcurlu_la-curl_fnmatch.lo
CC libcurlu_la-curl_get_line.lo
CC libcurlu_la-curl_gethostname.lo
CC libcurlu_la-curl_gssapi.lo
CC libcurlu_la-curl_memrchr.lo
CC libcurlu_la-curl_multibyte.lo
CC libcurlu_la-curl_ntlm_core.lo
CC libcurlu_la-curl_range.lo
CC libcurlu_la-curl_rtmp.lo
CC libcurlu_la-curl_sasl.lo
CC libcurlu_la-curl_sha512_256.lo
CC libcurlu_la-curl_sspi.lo
CC libcurlu_la-curl_threads.lo
CC libcurlu_la-curl_trc.lo
CC libcurlu_la-cw-out.lo
CC libcurlu_la-cw-pause.lo
CC libcurlu_la-dict.lo
CC libcurlu_la-doh.lo
CC libcurlu_la-dynhds.lo
CC libcurlu_la-easy.lo
CC libcurlu_la-easygetopt.lo
CC libcurlu_la-easyoptions.lo
CC libcurlu_la-escape.lo
CC libcurlu_la-fake_addrinfo.lo
CC libcurlu_la-file.lo
CC libcurlu_la-fileinfo.lo
CC libcurlu_la-fopen.lo
CC libcurlu_la-formdata.lo
CC libcurlu_la-ftp.lo
CC libcurlu_la-ftplistparser.lo
CC libcurlu_la-getenv.lo
CC libcurlu_la-getinfo.lo
CC libcurlu_la-gopher.lo
CC libcurlu_la-hash.lo
CC libcurlu_la-headers.lo
CC libcurlu_la-hmac.lo
CC libcurlu_la-hostip.lo
CC libcurlu_la-hostip4.lo
CC libcurlu_la-hostip6.lo
CC libcurlu_la-hsts.lo
CC libcurlu_la-http.lo
CC libcurlu_la-http1.lo
CC libcurlu_la-http2.lo
CC libcurlu_la-http_aws_sigv4.lo
CC libcurlu_la-http_chunks.lo
CC libcurlu_la-http_digest.lo
CC libcurlu_la-http_negotiate.lo
CC libcurlu_la-http_ntlm.lo
CC libcurlu_la-http_proxy.lo
CC libcurlu_la-httpsrr.lo
CC libcurlu_la-idn.lo
CC libcurlu_la-if2ip.lo
CC libcurlu_la-imap.lo
CC libcurlu_la-inet_ntop.lo
CC libcurlu_la-inet_pton.lo
CC libcurlu_la-krb5.lo
CC libcurlu_la-ldap.lo
CC libcurlu_la-llist.lo
CC libcurlu_la-macos.lo
CC libcurlu_la-md4.lo
CC libcurlu_la-md5.lo
CC libcurlu_la-memdebug.lo
CC libcurlu_la-mime.lo
CC libcurlu_la-mprintf.lo
CC libcurlu_la-mqtt.lo
CC libcurlu_la-multi.lo
CC libcurlu_la-multi_ev.lo
CC libcurlu_la-netrc.lo
CC libcurlu_la-nonblock.lo
CC libcurlu_la-noproxy.lo
CC libcurlu_la-openldap.lo
CC libcurlu_la-parsedate.lo
CC libcurlu_la-pingpong.lo
CC libcurlu_la-pop3.lo
CC libcurlu_la-progress.lo
CC libcurlu_la-psl.lo
CC libcurlu_la-rand.lo
CC libcurlu_la-rename.lo
CC libcurlu_la-request.lo
CC libcurlu_la-rtsp.lo
CC libcurlu_la-select.lo
CC libcurlu_la-sendf.lo
CC libcurlu_la-setopt.lo
CC libcurlu_la-sha256.lo
CC libcurlu_la-share.lo
CC libcurlu_la-slist.lo
CC libcurlu_la-smb.lo
CC libcurlu_la-smtp.lo
CC libcurlu_la-socketpair.lo
CC libcurlu_la-socks.lo
CC libcurlu_la-socks_gssapi.lo
CC libcurlu_la-socks_sspi.lo
CC libcurlu_la-speedcheck.lo
CC libcurlu_la-splay.lo
CC libcurlu_la-strcase.lo
CC libcurlu_la-strdup.lo
CC libcurlu_la-strequal.lo
CC libcurlu_la-strerror.lo
CC libcurlu_la-system_win32.lo
CC libcurlu_la-telnet.lo
CC libcurlu_la-tftp.lo
CC libcurlu_la-transfer.lo
CC libcurlu_la-uint-bset.lo
CC libcurlu_la-uint-hash.lo
CC libcurlu_la-uint-spbset.lo
CC libcurlu_la-uint-table.lo
CC libcurlu_la-url.lo
CC libcurlu_la-urlapi.lo
CC libcurlu_la-version.lo
CC libcurlu_la-version_win32.lo
CC libcurlu_la-ws.lo
CC vauth/libcurlu_la-cleartext.lo
CC vauth/libcurlu_la-cram.lo
CC vauth/libcurlu_la-digest.lo
CC vauth/libcurlu_la-digest_sspi.lo
CC vauth/libcurlu_la-gsasl.lo
CC vauth/libcurlu_la-krb5_gssapi.lo
CC vauth/libcurlu_la-krb5_sspi.lo
CC vauth/libcurlu_la-ntlm.lo
CC vauth/libcurlu_la-ntlm_sspi.lo
CC vauth/libcurlu_la-oauth2.lo
CC vauth/libcurlu_la-spnego_gssapi.lo
CC vauth/libcurlu_la-spnego_sspi.lo
CC vauth/libcurlu_la-vauth.lo
CC vtls/libcurlu_la-bearssl.lo
CC vtls/libcurlu_la-cipher_suite.lo
CC vtls/libcurlu_la-gtls.lo
CC vtls/libcurlu_la-hostcheck.lo
CC vtls/libcurlu_la-keylog.lo
CC vtls/libcurlu_la-mbedtls.lo
CC vtls/libcurlu_la-mbedtls_threadlock.lo
CC vtls/libcurlu_la-openssl.lo
CC vtls/libcurlu_la-rustls.lo
CC vtls/libcurlu_la-schannel.lo
CC vtls/libcurlu_la-schannel_verify.lo
CC vtls/libcurlu_la-sectransp.lo
CC vtls/libcurlu_la-vtls.lo
CC vtls/libcurlu_la-vtls_scache.lo
CC vtls/libcurlu_la-vtls_spack.lo
CC vtls/libcurlu_la-wolfssl.lo
CC vtls/libcurlu_la-x509asn1.lo
CC vquic/libcurlu_la-curl_msh3.lo
CC vquic/libcurlu_la-curl_ngtcp2.lo
CC vquic/libcurlu_la-curl_osslq.lo
CC vquic/libcurlu_la-curl_quiche.lo
CC vquic/libcurlu_la-vquic.lo
CC vquic/libcurlu_la-vquic-tls.lo
CC vssh/libcurlu_la-libssh.lo
CC vssh/libcurlu_la-libssh2.lo
CC vssh/libcurlu_la-curl_path.lo
CC vssh/libcurlu_la-wolfssh.lo
CC curlx/libcurlu_la-base64.lo
CC curlx/libcurlu_la-dynbuf.lo
CC curlx/libcurlu_la-strparse.lo
CC curlx/libcurlu_la-timediff.lo
CC curlx/libcurlu_la-timeval.lo
CC curlx/libcurlu_la-warnless.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-vtls_scache.lo
CC vtls/libcurl_la-vtls_spack.lo
CC vtls/libcurl_la-wolfssl.lo
CC vtls/libcurl_la-x509asn1.lo
CC vquic/libcurl_la-curl_ngtcp2.lo
CC vquic/libcurl_la-curl_msh3.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-curl_path.lo
CC vssh/libcurl_la-wolfssh.lo
CC curlx/libcurl_la-base64.lo
CC curlx/libcurl_la-dynbuf.lo
CC curlx/libcurl_la-strparse.lo
CC curlx/libcurl_la-timediff.lo
CC curlx/libcurl_la-timeval.lo
CC curlx/libcurl_la-warnless.lo
CCLD libcurlu.la
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 curl-slist_wc.o
CC curl-terminal.o
CC curl-tool_bname.o
CC curl-tool_cb_dbg.o
CC curl-tool_cb_hdr.o
CC curl-tool_cb_prg.o
CC curl-tool_cb_rea.o
CC curl-tool_cb_see.o
CC curl-tool_cb_soc.o
CC curl-tool_cfgable.o
CC curl-tool_cb_wrt.o
CC curl-tool_dirhie.o
CC curl-tool_doswin.o
CC curl-tool_easysrc.o
CC curl-tool_filetime.o
CC curl-tool_findfile.o
CC curl-tool_formparse.o
CC curl-tool_getparam.o
CC curl-tool_getpass.o
CC curl-tool_help.o
CC curl-tool_helpers.o
CC curl-tool_ipfs.o
CC curl-tool_libinfo.o
CC curl-tool_listhelp.o
CC curl-tool_main.o
CC curl-tool_msgs.o
CC curl-tool_operate.o
CC curl-tool_operhlp.o
CC curl-tool_paramhlp.o
CC curl-tool_parsecfg.o
CC curl-tool_progress.o
CC curl-tool_setopt.o
CC curl-tool_sleep.o
CC curl-tool_ssls.o
CC curl-tool_stderr.o
CC curl-tool_strdup.o
CC curl-tool_urlglob.o
CC curl-tool_util.o
CC curl-tool_vms.o
CC curl-tool_writeout.o
CC curl-tool_writeout_json.o
CC curl-tool_xattr.o
CC curl-var.o
CC ../lib/curlx/curl-base64.o
CC ../lib/curlx/curl-dynbuf.o
CC ../lib/curlx/curl-strparse.o
CC ../lib/curlx/curl-timediff.o
CC ../lib/curlx/curl-timeval.o
CC ../lib/curl-version_win32.o
CC ../lib/curlx/curl-warnless.o
echo '#include "tool_hugehelp.h"' >> ./tool_hugehelp.c
echo 'extern const void *curl_ca_embed; const void *curl_ca_embed;' > ./tool_ca_embed.c
CC libcurltool_la-slist_wc.lo
CC curlinfo.o
CC libcurltool_la-terminal.lo
CC libcurltool_la-tool_bname.lo
CC libcurltool_la-tool_cb_dbg.lo
CC libcurltool_la-tool_cb_hdr.lo
CC libcurltool_la-tool_cb_prg.lo
CC libcurltool_la-tool_cb_rea.lo
CC libcurltool_la-tool_cb_see.lo
CC libcurltool_la-tool_cb_soc.lo
CC libcurltool_la-tool_cb_wrt.lo
CC libcurltool_la-tool_cfgable.lo
CC libcurltool_la-tool_dirhie.lo
CC libcurltool_la-tool_doswin.lo
CC libcurltool_la-tool_easysrc.lo
CC libcurltool_la-tool_filetime.lo
CC libcurltool_la-tool_findfile.lo
CC libcurltool_la-tool_formparse.lo
CC libcurltool_la-tool_getparam.lo
CC libcurltool_la-tool_getpass.lo
CC libcurltool_la-tool_help.lo
CC libcurltool_la-tool_helpers.lo
CC libcurltool_la-tool_ipfs.lo
CC libcurltool_la-tool_libinfo.lo
CC libcurltool_la-tool_listhelp.lo
CC libcurltool_la-tool_main.lo
CC libcurltool_la-tool_msgs.lo
CC libcurltool_la-tool_operate.lo
CC libcurltool_la-tool_operhlp.lo
CC libcurltool_la-tool_paramhlp.lo
CC libcurltool_la-tool_parsecfg.lo
CC libcurltool_la-tool_setopt.lo
CC libcurltool_la-tool_progress.lo
CC libcurltool_la-tool_sleep.lo
CC libcurltool_la-tool_ssls.lo
CC libcurltool_la-tool_strdup.lo
CC libcurltool_la-tool_stderr.lo
CC libcurltool_la-tool_urlglob.lo
CC libcurltool_la-tool_util.lo
CC libcurltool_la-tool_vms.lo
CC libcurltool_la-tool_writeout.lo
CC libcurltool_la-tool_writeout_json.lo
CC libcurltool_la-tool_xattr.lo
CC libcurltool_la-var.lo
CC ../lib/curlx/libcurltool_la-base64.lo
CC ../lib/libcurltool_la-curl_multibyte.lo
CC ../lib/curlx/libcurltool_la-dynbuf.lo
CC ../lib/libcurltool_la-nonblock.lo
CC ../lib/curlx/libcurltool_la-strparse.lo
CC ../lib/libcurltool_la-strcase.lo
CC ../lib/curlx/libcurltool_la-timediff.lo
CC ../lib/curlx/libcurltool_la-timeval.lo
CC ../lib/libcurltool_la-version_win32.lo
CC ../lib/curlx/libcurltool_la-warnless.lo
CC ../lib/curl-curl_multibyte.o
CC ../lib/curl-nonblock.o
CC ../lib/curl-strcase.o
CC curl-tool_hugehelp.o
CC curl-tool_ca_embed.o
CCLD curlinfo
CCLD libcurltool.la
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'
| @@ -15,10 +15,10 @@ The `struct dynbuf` is used to hold data for each instance of a dynamic | |
| buffer. The members of that struct **MUST NOT** be accessed or modified | |
| without using the dedicated dynbuf API. | |
| - | ## `Curl_dyn_init` |
| + | ## `curlx_dyn_init` |
| ```c | |
| - | void Curl_dyn_init(struct dynbuf *s, size_t toobig); |
| + | void curlx_dyn_init(struct dynbuf *s, size_t toobig); |
| ``` | |
| This initializes a struct to use for dynbuf and it cannot fail. The `toobig` | |
| @@ -26,117 +26,117 @@ value **must** be set to the maximum size we allow this buffer instance to | |
| grow to. The functions below return `CURLE_OUT_OF_MEMORY` when hitting this | |
| limit. | |
| - | ## `Curl_dyn_free` |
| + | ## `curlx_dyn_free` |
| ```c | |
| - | void Curl_dyn_free(struct dynbuf *s); |
| + | void curlx_dyn_free(struct dynbuf *s); |
| ``` | |
| Free the associated memory and clean up. After a free, the `dynbuf` struct can | |
| be reused to start appending new data to. | |
| - | ## `Curl_dyn_addn` |
| + | ## `curlx_dyn_addn` |
| ```c | |
| - | CURLcode Curl_dyn_addn(struct dynbuf *s, const void *mem, size_t len); |
| + | CURLcode curlx_dyn_addn(struct dynbuf *s, const void *mem, size_t len); |
| ``` | |
| Append arbitrary data of a given length to the end of the buffer. | |
| - | If this function fails it calls `Curl_dyn_free` on `dynbuf`. |
| + | If this function fails it calls `curlx_dyn_free` on `dynbuf`. |
| - | ## `Curl_dyn_add` |
| + | ## `curlx_dyn_add` |
| ```c | |
| - | CURLcode Curl_dyn_add(struct dynbuf *s, const char *str); |
| + | CURLcode curlx_dyn_add(struct dynbuf *s, const char *str); |
| ``` | |
| Append a C string to the end of the buffer. | |
| - | If this function fails it calls `Curl_dyn_free` on `dynbuf`. |
| + | If this function fails it calls `curlx_dyn_free` on `dynbuf`. |
| - | ## `Curl_dyn_addf` |
| + | ## `curlx_dyn_addf` |
| ```c | |
| - | CURLcode Curl_dyn_addf(struct dynbuf *s, const char *fmt, ...); |
| + | CURLcode curlx_dyn_addf(struct dynbuf *s, const char *fmt, ...); |
| ``` | |
| Append a `printf()`-style string to the end of the buffer. | |
| - | If this function fails it calls `Curl_dyn_free` on `dynbuf`. |
| + | If this function fails it calls `curlx_dyn_free` on `dynbuf`. |
| - | ## `Curl_dyn_vaddf` |
| + | ## `curlx_dyn_vaddf` |
| ```c | |
| - | CURLcode Curl_dyn_vaddf(struct dynbuf *s, const char *fmt, va_list ap); |
| + | CURLcode curlx_dyn_vaddf(struct dynbuf *s, const char *fmt, va_list ap); |
| ``` | |
| Append a `vprintf()`-style string to the end of the buffer. | |
| - | If this function fails it calls `Curl_dyn_free` on `dynbuf`. |
| + | If this function fails it calls `curlx_dyn_free` on `dynbuf`. |
| - | ## `Curl_dyn_reset` |
| + | ## `curlx_dyn_reset` |
| ```c | |
| - | void Curl_dyn_reset(struct dynbuf *s); |
| + | void curlx_dyn_reset(struct dynbuf *s); |
| ``` | |
| Reset the buffer length, but leave the allocation. | |
| - | ## `Curl_dyn_tail` |
| + | ## `curlx_dyn_tail` |
| ```c | |
| - | CURLcode Curl_dyn_tail(struct dynbuf *s, size_t length); |
| + | CURLcode curlx_dyn_tail(struct dynbuf *s, size_t length); |
| ``` | |
| Keep `length` bytes of the buffer tail (the last `length` bytes of the | |
| buffer). The rest of the buffer is dropped. The specified `length` must not be | |
| larger than the buffer length. To instead keep the leading part, see | |
| - | `Curl_dyn_setlen()`. |
| + | `curlx_dyn_setlen()`. |
| - | ## `Curl_dyn_ptr` |
| + | ## `curlx_dyn_ptr` |
| ```c | |
| - | char *Curl_dyn_ptr(const struct dynbuf *s); |
| + | char *curlx_dyn_ptr(const struct dynbuf *s); |
| ``` | |
| Returns a `char *` to the buffer if it has a length, otherwise may return | |
| NULL. Since the buffer may be reallocated, this pointer should not be trusted | |
| or used anymore after the next buffer manipulation call. | |
| - | ## `Curl_dyn_uptr` |
| + | ## `curlx_dyn_uptr` |
| ```c | |
| - | unsigned char *Curl_dyn_uptr(const struct dynbuf *s); |
| + | unsigned char *curlx_dyn_uptr(const struct dynbuf *s); |
| ``` | |
| Returns an `unsigned char *` to the buffer if it has a length, otherwise may | |
| return NULL. Since the buffer may be reallocated, this pointer should not be | |
| trusted or used anymore after the next buffer manipulation call. | |
| - | ## `Curl_dyn_len` |
| + | ## `curlx_dyn_len` |
| ```c | |
| - | size_t Curl_dyn_len(const struct dynbuf *s); |
| + | size_t curlx_dyn_len(const struct dynbuf *s); |
| ``` | |
| Returns the length of the buffer in bytes. Does not include the terminating | |
| zero byte. | |
| - | ## `Curl_dyn_setlen` |
| + | ## `curlx_dyn_setlen` |
| ```c | |
| - | CURLcode Curl_dyn_setlen(struct dynbuf *s, size_t len); |
| + | CURLcode curlx_dyn_setlen(struct dynbuf *s, size_t len); |
| ``` | |
| Sets the new shorter length of the buffer in number of bytes. Keeps the | |
| leftmost set number of bytes, discards the rest. To instead keep the tail part | |
| - | of the buffer, see `Curl_dyn_tail()`. |
| + | of the buffer, see `curlx_dyn_tail()`. |
| - | ## `Curl_dyn_take` |
| + | ## `curlx_dyn_take` |
| ```c | |
| - | char *Curl_dyn_take(struct dynbuf *s, size_t *plen); |
| + | char *curlx_dyn_take(struct dynbuf *s, size_t *plen); |
| ``` | |
| Transfers ownership of the internal buffer to the caller. The dynbuf | |
| @@ -12,9 +12,9 @@ functions to advance the pointer on success which then by extension allows | |
| second word: | |
| ~~~c | |
| - | if(Curl_str_word(&line, &word1, MAX) || |
| - | Curl_str_singlespace(&line) || |
| - | Curl_str_word(&line, &word2, MAX)) |
| + | if(curlx_str_word(&line, &word1, MAX) || |
| + | curlx_str_singlespace(&line) || |
| + | curlx_str_word(&line, &word2, MAX)) |
| fprintf(stderr, "ERROR\n"); | |
| ~~~ | |
| @@ -33,31 +33,31 @@ struct Curl_str { | |
| }; | |
| ~~~ | |
| - | Access the struct fields with `Curl_str()` for the pointer and `Curl_strlen()` |
| + | Access the struct fields with `curlx_str()` for the pointer and `curlx_strlen()` |
| for the length rather than using the struct fields directly. | |
| - | ## `Curl_str_init` |
| + | ## `curlx_str_init` |
| ~~~c | |
| - | void Curl_str_init(struct Curl_str *out) |
| + | void curlx_str_init(struct Curl_str *out) |
| ~~~ | |
| This initiates a string struct. The parser functions that store info in | |
| strings always init the string themselves, so this stand-alone use is often | |
| not necessary. | |
| - | ## `Curl_str_assign` |
| + | ## `curlx_str_assign` |
| ~~~c | |
| - | void Curl_str_assign(struct Curl_str *out, const char *str, size_t len) |
| + | void curlx_str_assign(struct Curl_str *out, const char *str, size_t len) |
| ~~~ | |
| Set a pointer and associated length in the string struct. | |
| - | ## `Curl_str_word` |
| + | ## `curlx_str_word` |
| ~~~c | |
| - | int Curl_str_word(char **linep, struct Curl_str *out, const size_t max); |
| + | int curlx_str_word(char **linep, struct Curl_str *out, const size_t max); |
| ~~~ | |
| Get a sequence of bytes until the first space or the end of the string. Return | |
| @@ -70,14 +70,14 @@ error. | |
| On a successful return, `linep` is updated to point to the byte immediately | |
| following the parsed word. | |
| - | ## `Curl_str_until` |
| + | ## `curlx_str_until` |
| ~~~c | |
| - | int Curl_str_until(char **linep, struct Curl_str *out, const size_t max, |
| + | int curlx_str_until(char **linep, struct Curl_str *out, const size_t max, |
| char delim); | |
| ~~~ | |
| - | Like `Curl_str_word` but instead of parsing to space, it parses to a given |
| + | Like `curlx_str_word` but instead of parsing to space, it parses to a given |
| custom delimiter non-zero byte `delim`. | |
| `max` is the longest accepted word, or it returns error. | |
| @@ -85,13 +85,13 @@ custom delimiter non-zero byte `delim`. | |
| The parsed word must be at least one byte, otherwise it is considered an | |
| error. | |
| - | ## `Curl_str_untilnl` |
| + | ## `curlx_str_untilnl` |
| ~~~c | |
| - | int Curl_str_untilnl(char **linep, struct Curl_str *out, const size_t max); |
| + | int curlx_str_untilnl(char **linep, struct Curl_str *out, const size_t max); |
| ~~~ | |
| - | Like `Curl_str_untilnl` but instead parses until it finds a "newline byte". |
| + | Like `curlx_str_untilnl` but instead parses until it finds a "newline byte". |
| That means either a CR (ASCII 13) or an LF (ASCII 10) octet. | |
| `max` is the longest accepted word, or it returns error. | |
| @@ -99,19 +99,19 @@ That means either a CR (ASCII 13) or an LF (ASCII 10) octet. | |
| The parsed word must be at least one byte, otherwise it is considered an | |
| error. | |
| - | ## `Curl_str_cspn` |
| + | ## `curlx_str_cspn` |
| ~~~c | |
| - | int Curl_str_cspn(const char **linep, struct Curl_str *out, const char *cspn); |
| + | int curlx_str_cspn(const char **linep, struct Curl_str *out, const char *cspn); |
| ~~~ | |
| Get a sequence of characters until one of the bytes in the `cspn` string | |
| matches. Similar to the `strcspn` function. | |
| - | ## `Curl_str_quotedword` |
| + | ## `curlx_str_quotedword` |
| ~~~c | |
| - | int Curl_str_quotedword(char **linep, struct Curl_str *out, const size_t max); |
| + | int curlx_str_quotedword(char **linep, struct Curl_str *out, const size_t max); |
| ~~~ | |
| Get a "quoted" word. This means everything that is provided within a leading | |
| @@ -122,108 +122,108 @@ and an ending double quote character. No escaping possible. | |
| The parsed word must be at least one byte, otherwise it is considered an | |
| error. | |
| - | ## `Curl_str_single` |
| + | ## `curlx_str_single` |
| ~~~c | |
| - | int Curl_str_single(char **linep, char byte); |
| + | int curlx_str_single(char **linep, char byte); |
| ~~~ | |
| Advance over a single character provided in `byte`. Return non-zero on error. | |
| - | ## `Curl_str_singlespace` |
| + | ## `curlx_str_singlespace` |
| ~~~c | |
| - | int Curl_str_singlespace(char **linep); |
| + | int curlx_str_singlespace(char **linep); |
| ~~~ | |
| Advance over a single ASCII space. Return non-zero on error. | |
| - | ## `Curl_str_passblanks` |
| + | ## `curlx_str_passblanks` |
| ~~~c | |
| - | void Curl_str_passblanks(char **linep); |
| + | void curlx_str_passblanks(char **linep); |
| ~~~ | |
| Advance over all spaces and tabs. | |
| - | ## `Curl_str_trimblanks` |
| + | ## `curlx_str_trimblanks` |
| ~~~c | |
| - | void Curl_str_trimblanks(struct Curl_str *out); |
| + | void curlx_str_trimblanks(struct Curl_str *out); |
| ~~~ | |
| Trim off blanks (spaces and tabs) from the start and the end of the given | |
| string. | |
| - | ## `Curl_str_number` |
| + | ## `curlx_str_number` |
| ~~~c | |
| - | int Curl_str_number(char **linep, curl_size_t *nump, size_t max); |
| + | int curlx_str_number(char **linep, curl_size_t *nump, size_t max); |
| ~~~ | |
| Get an unsigned decimal number not larger than `max`. Leading zeroes are just | |
| swallowed. Return non-zero on error. Returns error if there was not a single | |
| digit. | |
| - | ## `Curl_str_numblanks` |
| + | ## `curlx_str_numblanks` |
| ~~~c | |
| - | int Curl_str_numblanks(char **linep, curl_size_t *nump); |
| + | int curlx_str_numblanks(char **linep, curl_size_t *nump); |
| ~~~ | |
| Get an unsigned 63-bit decimal number. Leading blanks and zeroes are skipped. | |
| Returns non-zero on error. Returns error if there was not a single digit. | |
| - | ## `Curl_str_hex` |
| + | ## `curlx_str_hex` |
| ~~~c | |
| - | int Curl_str_hex(char **linep, curl_size_t *nump, size_t max); |
| + | int curlx_str_hex(char **linep, curl_size_t *nump, size_t max); |
| ~~~ | |
| Get an unsigned hexadecimal number not larger than `max`. Leading zeroes are | |
| just swallowed. Return non-zero on error. Returns error if there was not a | |
| single digit. Does *not* handled `0x` prefix. | |
| - | ## `Curl_str_octal` |
| + | ## `curlx_str_octal` |
| ~~~c | |
| - | int Curl_str_octal(char **linep, curl_size_t *nump, size_t max); |
| + | int curlx_str_octal(char **linep, curl_size_t *nump, size_t max); |
| ~~~ | |
| Get an unsigned octal number not larger than `max`. Leading zeroes are just | |
| swallowed. Return non-zero on error. Returns error if there was not a single | |
| digit. | |
| - | ## `Curl_str_newline` |
| + | ## `curlx_str_newline` |
| ~~~c | |
| - | int Curl_str_newline(char **linep); |
| + | int curlx_str_newline(char **linep); |
| ~~~ | |
| Check for a single CR or LF. Return non-zero on error */ | |
| - | ## `Curl_str_casecompare` |
| + | ## `curlx_str_casecompare` |
| ~~~c | |
| - | int Curl_str_casecompare(struct Curl_str *str, const char *check); |
| + | int curlx_str_casecompare(struct Curl_str *str, const char *check); |
| ~~~ | |
| Returns true if the provided string in the `str` argument matches the `check` | |
| string case insensitively. | |
| - | ## `Curl_str_cmp` |
| + | ## `curlx_str_cmp` |
| ~~~c | |
| - | int Curl_str_cmp(struct Curl_str *str, const char *check); |
| + | int curlx_str_cmp(struct Curl_str *str, const char *check); |
| ~~~ | |
| Returns true if the provided string in the `str` argument matches the `check` | |
| string case sensitively. This is *not* the same return code as `strcmp`. | |
| - | ## `Curl_str_nudge` |
| + | ## `curlx_str_nudge` |
| ~~~c | |
| - | int Curl_str_nudge(struct Curl_str *str, size_t num); |
| + | int curlx_str_nudge(struct Curl_str *str, size_t num); |
| ~~~ | |
| Removes `num` bytes from the beginning (left) of the string kept in `str`. If | |
| @@ -3326,9 +3326,7 @@ CURL_EXTERN CURLcode curl_easy_ssls_export(CURL *handle, | |
| #include "options.h" | |
| #include "header.h" | |
| #include "websockets.h" | |
| - | #ifndef CURL_SKIP_INCLUDE_MPRINTF |
| #include "mprintf.h" | |
| - | #endif |
| /* the typechecker does not work in C++ (yet) */ | |
| #if defined(__GNUC__) && defined(__GNUC_MINOR__) && \ | |
| @@ -37,7 +37,9 @@ list(APPEND HHEADERS "${CMAKE_CURRENT_BINARY_DIR}/curl_config.h") | |
| # The rest of the build | |
| - | set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES "${PROJECT_BINARY_DIR}/lib") # for "curl_config.h" |
| + | set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES |
| + | "${PROJECT_BINARY_DIR}/lib" # for "curl_config.h" |
| + | ) |
| if(USE_ARES) | |
| include_directories(SYSTEM ${CARES_INCLUDE_DIRS}) | |
| @@ -30,7 +30,8 @@ CHECKSRC_DIST = .checksrc vauth/.checksrc vquic/.checksrc vssh/.checksrc \ | |
| EXTRA_DIST = config-mac.h config-os400.h config-plan9.h config-riscos.h \ | |
| config-win32.h curl_config.h.in libcurl.rc libcurl.def \ | |
| - | $(CMAKE_DIST) Makefile.soname optiontable.pl $(CHECKSRC_DIST) |
| + | $(CMAKE_DIST) Makefile.soname optiontable.pl $(CHECKSRC_DIST) \ |
| + | curlx/README.md |
| lib_LTLIBRARIES = libcurl.la | |
| @@ -51,7 +52,7 @@ CFLAGS += @CURL_CFLAG_EXTRAS@ | |
| # $(top_srcdir)/include is for libcurl's external include files | |
| # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file | |
| - | AM_CPPFLAGS = -I$(top_srcdir)/include \ |
| + | AM_CPPFLAGS = -I$(top_srcdir)/include \ |
| -I$(top_builddir)/lib | |
| # Prevent LIBS from being used for all link targets | |
| @@ -83,7 +84,7 @@ endif | |
| if USE_UNITY | |
| # Keep these separate to avoid duplicate definitions when linking libtests | |
| # in static mode. | |
| - | curl_EXCLUDE = curl_threads.c timediff.c warnless.c |
| + | curl_EXCLUDE = curl_threads.c curlx/timediff.c curlx/warnless.c |
| if CURLDEBUG | |
| # We must compile this source separately to avoid memdebug.h redefinitions | |
| # applying to it. | |
| @@ -22,6 +22,23 @@ | |
| # | |
| ########################################################################### | |
| + | LIB_CURLX_CFILES = \ |
| + | curlx/base64.c \ |
| + | curlx/dynbuf.c \ |
| + | curlx/strparse.c \ |
| + | curlx/timediff.c \ |
| + | curlx/timeval.c \ |
| + | curlx/warnless.c |
| + | |
| + | LIB_CURLX_HFILES = \ |
| + | curlx/base64.h \ |
| + | curlx/curlx.h \ |
| + | curlx/dynbuf.h \ |
| + | curlx/strparse.h \ |
| + | curlx/timediff.h \ |
| + | curlx/timeval.h \ |
| + | curlx/warnless.h |
| + | |
| LIB_VAUTH_CFILES = \ | |
| vauth/cleartext.c \ | |
| vauth/cram.c \ | |
| @@ -113,7 +130,6 @@ LIB_CFILES = \ | |
| asyn-ares.c \ | |
| asyn-base.c \ | |
| asyn-thrdd.c \ | |
| - | base64.c \ |
| bufq.c \ | |
| bufref.c \ | |
| cf-h1-proxy.c \ | |
| @@ -148,7 +164,6 @@ LIB_CFILES = \ | |
| cw-pause.c \ | |
| dict.c \ | |
| doh.c \ | |
| - | dynbuf.c \ |
| dynhds.c \ | |
| easy.c \ | |
| easygetopt.c \ | |
| @@ -229,12 +244,9 @@ LIB_CFILES = \ | |
| strdup.c \ | |
| strequal.c \ | |
| strerror.c \ | |
| - | strparse.c \ |
| system_win32.c \ | |
| telnet.c \ | |
| tftp.c \ | |
| - | timediff.c \ |
| - | timeval.c \ |
| transfer.c \ | |
| uint-bset.c \ | |
| uint-hash.c \ | |
| @@ -244,7 +256,6 @@ LIB_CFILES = \ | |
| urlapi.c \ | |
| version.c \ | |
| version_win32.c \ | |
| - | warnless.c \ |
| ws.c | |
| LIB_HFILES = \ | |
| @@ -266,7 +277,6 @@ LIB_HFILES = \ | |
| content_encoding.h \ | |
| cookie.h \ | |
| curl_addrinfo.h \ | |
| - | curl_base64.h \ |
| curl_ctype.h \ | |
| curl_des.h \ | |
| curl_endian.h \ | |
| @@ -294,12 +304,10 @@ LIB_HFILES = \ | |
| curl_sspi.h \ | |
| curl_threads.h \ | |
| curl_trc.h \ | |
| - | curlx.h \ |
| cw-out.h \ | |
| cw-pause.h \ | |
| dict.h \ | |
| doh.h \ | |
| - | dynbuf.h \ |
| dynhds.h \ | |
| easy_lock.h \ | |
| easyif.h \ | |
| @@ -373,12 +381,9 @@ LIB_HFILES = \ | |
| strcase.h \ | |
| strdup.h \ | |
| strerror.h \ | |
| - | strparse.h \ |
| system_win32.h \ | |
| telnet.h \ | |
| tftp.h \ | |
| - | timediff.h \ |
| - | timeval.h \ |
| transfer.h \ | |
| uint-bset.h \ | |
| uint-hash.h \ | |
| @@ -388,12 +393,11 @@ LIB_HFILES = \ | |
| urlapi-int.h \ | |
| urldata.h \ | |
| version_win32.h \ | |
| - | warnless.h \ |
| ws.h | |
| LIB_RCFILES = libcurl.rc | |
| CSOURCES = $(LIB_CFILES) $(LIB_VAUTH_CFILES) $(LIB_VTLS_CFILES) \ | |
| - | $(LIB_VQUIC_CFILES) $(LIB_VSSH_CFILES) |
| + | $(LIB_VQUIC_CFILES) $(LIB_VSSH_CFILES) $(LIB_CURLX_CFILES) |
| HHEADERS = $(LIB_HFILES) $(LIB_VAUTH_HFILES) $(LIB_VTLS_HFILES) \ | |
| - | $(LIB_VQUIC_HFILES) $(LIB_VSSH_HFILES) |
| + | $(LIB_VQUIC_HFILES) $(LIB_VSSH_HFILES) $(LIB_CURLX_HFILES) |
| @@ -35,12 +35,12 @@ | |
| #include "strcase.h" | |
| #include "parsedate.h" | |
| #include "sendf.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "fopen.h" | |
| #include "rename.h" | |
| #include "strdup.h" | |
| #include "inet_pton.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| #include "connect.h" | |
| /* The last 3 #include files should be in this order */ | |
| @@ -139,13 +139,13 @@ static struct altsvc *altsvc_create(struct Curl_str *srchost, | |
| size_t dstport) | |
| { | |
| enum alpnid dstalpnid = | |
| - | Curl_alpn2alpnid(Curl_str(dstalpn), Curl_strlen(dstalpn)); |
| + | Curl_alpn2alpnid(curlx_str(dstalpn), curlx_strlen(dstalpn)); |
| enum alpnid srcalpnid = | |
| - | Curl_alpn2alpnid(Curl_str(srcalpn), Curl_strlen(srcalpn)); |
| + | Curl_alpn2alpnid(curlx_str(srcalpn), curlx_strlen(srcalpn)); |
| if(!srcalpnid || !dstalpnid) | |
| return NULL; | |
| - | return altsvc_createid(Curl_str(srchost), Curl_strlen(srchost), |
| - | Curl_str(dsthost), Curl_strlen(dsthost), |
| + | return altsvc_createid(curlx_str(srchost), curlx_strlen(srchost), |
| + | curlx_str(dsthost), curlx_strlen(dsthost), |
| srcalpnid, dstalpnid, | |
| srcport, dstport); | |
| } | |
| @@ -166,24 +166,24 @@ static CURLcode altsvc_add(struct altsvcinfo *asi, const char *line) | |
| curl_off_t persist; | |
| curl_off_t prio; | |
| - | if(Curl_str_word(&line, &srcalpn, MAX_ALTSVC_ALPNLEN) || |
| - | Curl_str_singlespace(&line) || |
| - | Curl_str_word(&line, &srchost, MAX_ALTSVC_HOSTLEN) || |
| - | Curl_str_singlespace(&line) || |
| - | Curl_str_number(&line, &srcport, 65535) || |
| - | Curl_str_singlespace(&line) || |
| - | Curl_str_word(&line, &dstalpn, MAX_ALTSVC_ALPNLEN) || |
| - | Curl_str_singlespace(&line) || |
| - | Curl_str_word(&line, &dsthost, MAX_ALTSVC_HOSTLEN) || |
| - | Curl_str_singlespace(&line) || |
| - | Curl_str_number(&line, &dstport, 65535) || |
| - | Curl_str_singlespace(&line) || |
| - | Curl_str_quotedword(&line, &date, MAX_ALTSVC_DATELEN) || |
| - | Curl_str_singlespace(&line) || |
| - | Curl_str_number(&line, &persist, 1) || |
| - | Curl_str_singlespace(&line) || |
| - | Curl_str_number(&line, &prio, 0) || |
| - | Curl_str_newline(&line)) |
| + | if(curlx_str_word(&line, &srcalpn, MAX_ALTSVC_ALPNLEN) || |
| + | curlx_str_singlespace(&line) || |
| + | curlx_str_word(&line, &srchost, MAX_ALTSVC_HOSTLEN) || |
| + | curlx_str_singlespace(&line) || |
| + | curlx_str_number(&line, &srcport, 65535) || |
| + | curlx_str_singlespace(&line) || |
| + | curlx_str_word(&line, &dstalpn, MAX_ALTSVC_ALPNLEN) || |
| + | curlx_str_singlespace(&line) || |
| + | curlx_str_word(&line, &dsthost, MAX_ALTSVC_HOSTLEN) || |
| + | curlx_str_singlespace(&line) || |
| + | curlx_str_number(&line, &dstport, 65535) || |
| + | curlx_str_singlespace(&line) || |
| + | curlx_str_quotedword(&line, &date, MAX_ALTSVC_DATELEN) || |
| + | curlx_str_singlespace(&line) || |
| + | curlx_str_number(&line, &persist, 1) || |
| + | curlx_str_singlespace(&line) || |
| + | curlx_str_number(&line, &prio, 0) || |
| + | curlx_str_newline(&line)) |
| ; | |
| else { | |
| struct altsvc *as; | |
| @@ -191,9 +191,9 @@ static CURLcode altsvc_add(struct altsvcinfo *asi, const char *line) | |
| time_t expires; | |
| /* The date parser works on a null terminated string. The maximum length | |
| - | is upheld by Curl_str_quotedword(). */ |
| - | memcpy(dbuf, Curl_str(&date), Curl_strlen(&date)); |
| - | dbuf[Curl_strlen(&date)] = 0; |
| + | is upheld by curlx_str_quotedword(). */ |
| + | memcpy(dbuf, curlx_str(&date), curlx_strlen(&date)); |
| + | dbuf[curlx_strlen(&date)] = 0; |
| expires = Curl_getdate_capped(dbuf); | |
| as = altsvc_create(&srchost, &dsthost, &srcalpn, &dstalpn, | |
| (size_t)srcport, (size_t)dstport); | |
| @@ -231,14 +231,14 @@ static CURLcode altsvc_load(struct altsvcinfo *asi, const char *file) | |
| fp = fopen(file, FOPEN_READTEXT); | |
| if(fp) { | |
| struct dynbuf buf; | |
| - | Curl_dyn_init(&buf, MAX_ALTSVC_LINE); |
| + | curlx_dyn_init(&buf, MAX_ALTSVC_LINE); |
| while(Curl_get_line(&buf, fp)) { | |
| - | const char *lineptr = Curl_dyn_ptr(&buf); |
| - | Curl_str_passblanks(&lineptr); |
| - | if(Curl_str_single(&lineptr, '#')) |
| + | const char *lineptr = curlx_dyn_ptr(&buf); |
| + | curlx_str_passblanks(&lineptr); |
| + | if(curlx_str_single(&lineptr, '#')) |
| altsvc_add(asi, lineptr); | |
| } | |
| - | Curl_dyn_free(&buf); /* free the line buffer */ |
| + | curlx_dyn_free(&buf); /* free the line buffer */ |
| fclose(fp); | |
| } | |
| return result; | |
| @@ -447,7 +447,7 @@ static time_t altsvc_debugtime(void *unused) | |
| (void)unused; | |
| if(timestr) { | |
| curl_off_t val; | |
| - | Curl_str_number(×tr, &val, TIME_T_MAX); |
| + | curlx_str_number(×tr, &val, TIME_T_MAX); |
| return (time_t)val; | |
| } | |
| return time(NULL); | |
| @@ -487,11 +487,11 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data, | |
| DEBUGASSERT(asi); | |
| /* initial check for "clear" */ | |
| - | if(!Curl_str_until(&p, &alpn, MAX_ALTSVC_LINE, ';') && |
| - | !Curl_str_single(&p, ';')) { |
| - | Curl_str_trimblanks(&alpn); |
| + | if(!curlx_str_until(&p, &alpn, MAX_ALTSVC_LINE, ';') && |
| + | !curlx_str_single(&p, ';')) { |
| + | curlx_str_trimblanks(&alpn); |
| /* "clear" is a magic keyword */ | |
| - | if(Curl_str_casecompare(&alpn, "clear")) { |
| + | if(curlx_str_casecompare(&alpn, "clear")) { |
| /* Flush cached alternatives for this source origin */ | |
| altsvc_flush(asi, srcalpnid, srchost, srcport); | |
| return CURLE_OK; | |
| @@ -500,10 +500,10 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data, | |
| p = value; | |
| - | if(Curl_str_until(&p, &alpn, MAX_ALTSVC_LINE, '=')) |
| + | if(curlx_str_until(&p, &alpn, MAX_ALTSVC_LINE, '=')) |
| return CURLE_OK; /* strange line */ | |
| - | Curl_str_trimblanks(&alpn); |
| + | curlx_str_trimblanks(&alpn); |
| /* Handle the optional 'ma' and 'persist' flags once first, as they need to | |
| be known for each alternative service. Unknown flags are skipped. */ | |
| @@ -517,69 +517,69 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data, | |
| curl_off_t num; | |
| bool quoted; | |
| /* allow some extra whitespaces around name and value */ | |
| - | if(Curl_str_until(&sp, &name, 20, '=') || |
| - | Curl_str_single(&sp, '=') || |
| - | Curl_str_until(&sp, &val, 80, ';')) |
| + | if(curlx_str_until(&sp, &name, 20, '=') || |
| + | curlx_str_single(&sp, '=') || |
| + | curlx_str_until(&sp, &val, 80, ';')) |
| break; | |
| - | Curl_str_trimblanks(&name); |
| - | Curl_str_trimblanks(&val); |
| + | curlx_str_trimblanks(&name); |
| + | curlx_str_trimblanks(&val); |
| /* the value might be quoted */ | |
| - | vp = Curl_str(&val); |
| + | vp = curlx_str(&val); |
| quoted = (*vp == '\"'); | |
| if(quoted) | |
| vp++; | |
| - | if(!Curl_str_number(&vp, &num, TIME_T_MAX)) { |
| - | if(Curl_str_casecompare(&name, "ma")) |
| + | if(!curlx_str_number(&vp, &num, TIME_T_MAX)) { |
| + | if(curlx_str_casecompare(&name, "ma")) |
| maxage = (time_t)num; | |
| - | else if(Curl_str_casecompare(&name, "persist") && (num == 1)) |
| + | else if(curlx_str_casecompare(&name, "persist") && (num == 1)) |
| persist = TRUE; | |
| } | |
| - | if(quoted && Curl_str_single(&sp, '\"')) |
| + | if(quoted && curlx_str_single(&sp, '\"')) |
| break; | |
| - | if(Curl_str_single(&sp, ';')) |
| + | if(curlx_str_single(&sp, ';')) |
| break; | |
| } | |
| } | |
| do { | |
| - | if(!Curl_str_single(&p, '=')) { |
| + | if(!curlx_str_single(&p, '=')) { |
| /* [protocol]="[host][:port], [protocol]="[host][:port]" */ | |
| enum alpnid dstalpnid = | |
| - | Curl_alpn2alpnid(Curl_str(&alpn), Curl_strlen(&alpn)); |
| - | if(!Curl_str_single(&p, '\"')) { |
| + | Curl_alpn2alpnid(curlx_str(&alpn), curlx_strlen(&alpn)); |
| + | if(!curlx_str_single(&p, '\"')) { |
| struct Curl_str dsthost; | |
| curl_off_t port = 0; | |
| - | if(Curl_str_single(&p, ':')) { |
| + | if(curlx_str_single(&p, ':')) { |
| /* hostname starts here */ | |
| - | if(Curl_str_single(&p, '[')) { |
| - | if(Curl_str_until(&p, &dsthost, MAX_ALTSVC_HOSTLEN, ':')) { |
| + | if(curlx_str_single(&p, '[')) { |
| + | if(curlx_str_until(&p, &dsthost, MAX_ALTSVC_HOSTLEN, ':')) { |
| infof(data, "Bad alt-svc hostname, ignoring."); | |
| break; | |
| } | |
| } | |
| else { | |
| /* IPv6 host name */ | |
| - | if(Curl_str_until(&p, &dsthost, MAX_IPADR_LEN, ']') || |
| - | Curl_str_single(&p, ']')) { |
| + | if(curlx_str_until(&p, &dsthost, MAX_IPADR_LEN, ']') || |
| + | curlx_str_single(&p, ']')) { |
| infof(data, "Bad alt-svc IPv6 hostname, ignoring."); | |
| break; | |
| } | |
| } | |
| - | if(Curl_str_single(&p, ':')) |
| + | if(curlx_str_single(&p, ':')) |
| break; | |
| } | |
| else | |
| /* no destination name, use source host */ | |
| - | Curl_str_assign(&dsthost, srchost, strlen(srchost)); |
| + | curlx_str_assign(&dsthost, srchost, strlen(srchost)); |
| - | if(Curl_str_number(&p, &port, 0xffff)) { |
| + | if(curlx_str_number(&p, &port, 0xffff)) { |
| infof(data, "Unknown alt-svc port number, ignoring."); | |
| break; | |
| } | |
| dstport = (unsigned short)port; | |
| - | if(Curl_str_single(&p, '\"')) |
| + | if(curlx_str_single(&p, '\"')) |
| break; | |
| if(dstalpnid) { | |
| @@ -589,8 +589,8 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data, | |
| altsvc_flush(asi, srcalpnid, srchost, srcport); | |
| as = altsvc_createid(srchost, strlen(srchost), | |
| - | Curl_str(&dsthost), |
| - | Curl_strlen(&dsthost), |
| + | curlx_str(&dsthost), |
| + | curlx_strlen(&dsthost), |
| srcalpnid, dstalpnid, | |
| srcport, dstport); | |
| if(as) { | |
| @@ -604,7 +604,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data, | |
| as->persist = persist; | |
| Curl_llist_append(&asi->list, as, &as->node); | |
| infof(data, "Added alt-svc: %.*s:%d over %s", | |
| - | (int)Curl_strlen(&dsthost), Curl_str(&dsthost), |
| + | (int)curlx_strlen(&dsthost), curlx_str(&dsthost), |
| dstport, Curl_alpnid2str(dstalpnid)); | |
| } | |
| } | |
| @@ -614,13 +614,13 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data, | |
| /* after the double quote there can be a comma if there is another | |
| string or a semicolon if no more */ | |
| - | if(Curl_str_single(&p, ',')) |
| + | if(curlx_str_single(&p, ',')) |
| break; | |
| /* comma means another alternative is present */ | |
| - | if(Curl_str_until(&p, &alpn, MAX_ALTSVC_LINE, '=')) |
| + | if(curlx_str_until(&p, &alpn, MAX_ALTSVC_LINE, '=')) |
| break; | |
| - | Curl_str_trimblanks(&alpn); |
| + | curlx_str_trimblanks(&alpn); |
| } | |
| else | |
| break; | |
| @@ -58,7 +58,7 @@ | |
| #include "connect.h" | |
| #include "select.h" | |
| #include "progress.h" | |
| - | #include "timediff.h" |
| + | #include "curlx/timediff.h" |
| #include "httpsrr.h" | |
| #include "strdup.h" | |
| @@ -315,7 +315,7 @@ CURLcode Curl_async_is_resolved(struct Curl_easy *data, | |
| /* This is only set to non-zero if the timer was started. */ | |
| && (ares->happy_eyeballs_dns_time.tv_sec | |
| || ares->happy_eyeballs_dns_time.tv_usec) | |
| - | && (Curl_timediff(Curl_now(), ares->happy_eyeballs_dns_time) |
| + | && (curlx_timediff(curlx_now(), ares->happy_eyeballs_dns_time) |
| >= HAPPY_EYEBALLS_DNS_TIMEOUT)) { | |
| /* Remember that the EXPIRE_HAPPY_EYEBALLS_DNS timer is no longer | |
| running. */ | |
| @@ -385,7 +385,7 @@ CURLcode Curl_async_await(struct Curl_easy *data, | |
| struct async_ares_ctx *ares = &data->state.async.ares; | |
| CURLcode result = CURLE_OK; | |
| timediff_t timeout; | |
| - | struct curltime now = Curl_now(); |
| + | struct curltime now = curlx_now(); |
| DEBUGASSERT(entry); | |
| *entry = NULL; /* clear on entry */ | |
| @@ -434,8 +434,8 @@ CURLcode Curl_async_await(struct Curl_easy *data, | |
| if(Curl_pgrsUpdate(data)) | |
| result = CURLE_ABORTED_BY_CALLBACK; | |
| else { | |
| - | struct curltime now2 = Curl_now(); |
| - | timediff_t timediff = Curl_timediff(now2, now); /* spent time */ |
| + | struct curltime now2 = curlx_now(); |
| + | timediff_t timediff = curlx_timediff(now2, now); /* spent time */ |
| if(timediff <= 0) | |
| timeout -= 1; /* always deduct at least 1 */ | |
| else if(timediff > timeout) | |
| @@ -581,7 +581,7 @@ static void async_ares_hostbyname_cb(void *user_data, | |
| timeout to prevent it. After all, we do not even know where in the | |
| c-ares retry cycle each request is. | |
| */ | |
| - | ares->happy_eyeballs_dns_time = Curl_now(); |
| + | ares->happy_eyeballs_dns_time = curlx_now(); |
| Curl_expire(data, HAPPY_EYEBALLS_DNS_TIMEOUT, | |
| EXPIRE_HAPPY_EYEBALLS_DNS); | |
| } | |
| @@ -431,7 +431,7 @@ static bool async_thrdd_init(struct Curl_easy *data, | |
| Curl_mutex_acquire(&addr_ctx->mutx); | |
| DEBUGASSERT(addr_ctx->ref_count == 1); | |
| /* passing addr_ctx to the thread adds a reference */ | |
| - | addr_ctx->start = Curl_now(); |
| + | addr_ctx->start = curlx_now(); |
| ++addr_ctx->ref_count; | |
| #ifdef HAVE_GETADDRINFO | |
| addr_ctx->thread_hnd = Curl_thread_create(getaddrinfo_thread, addr_ctx); | |
| @@ -616,7 +616,7 @@ CURLcode Curl_async_is_resolved(struct Curl_easy *data, | |
| else { | |
| /* poll for name lookup done with exponential backoff up to 250ms */ | |
| /* should be fine even if this converts to 32-bit */ | |
| - | timediff_t elapsed = Curl_timediff(Curl_now(), |
| + | timediff_t elapsed = curlx_timediff(curlx_now(), |
| data->progress.t_startsingle); | |
| if(elapsed < 0) | |
| elapsed = 0; | |
| @@ -669,7 +669,7 @@ int Curl_async_getsock(struct Curl_easy *data, curl_socket_t *socks) | |
| #endif | |
| { | |
| timediff_t milli; | |
| - | timediff_t ms = Curl_timediff(Curl_now(), thrdd->addr->start); |
| + | timediff_t ms = curlx_timediff(curlx_now(), thrdd->addr->start); |
| if(ms < 3) | |
| milli = 0; | |
| else if(ms <= 50) | |
| @@ -28,7 +28,7 @@ | |
| #include <curl/curl.h> | |
| #include "urldata.h" | |
| - | #include "dynbuf.h" |
| + | #include "curlx/dynbuf.h" |
| #include "sendf.h" | |
| #include "http.h" | |
| #include "http1.h" | |
| @@ -40,11 +40,11 @@ | |
| #include "cf-h1-proxy.h" | |
| #include "connect.h" | |
| #include "curl_trc.h" | |
| - | #include "curlx.h" |
| + | #include "strcase.h" |
| #include "vtls/vtls.h" | |
| #include "transfer.h" | |
| #include "multiif.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -97,8 +97,8 @@ static CURLcode tunnel_reinit(struct Curl_cfilter *cf, | |
| (void)data; | |
| (void)cf; | |
| DEBUGASSERT(ts); | |
| - | Curl_dyn_reset(&ts->rcvbuf); |
| - | Curl_dyn_reset(&ts->request_data); |
| + | curlx_dyn_reset(&ts->rcvbuf); |
| + | curlx_dyn_reset(&ts->request_data); |
| ts->tunnel_state = H1_TUNNEL_INIT; | |
| ts->keepon = KEEPON_CONNECT; | |
| ts->cl = 0; | |
| @@ -123,8 +123,8 @@ static CURLcode tunnel_init(struct Curl_cfilter *cf, | |
| infof(data, "allocate connect buffer"); | |
| - | Curl_dyn_init(&ts->rcvbuf, DYN_PROXY_CONNECT_HEADERS); |
| - | Curl_dyn_init(&ts->request_data, DYN_HTTP_REQUEST); |
| + | curlx_dyn_init(&ts->rcvbuf, DYN_PROXY_CONNECT_HEADERS); |
| + | curlx_dyn_init(&ts->request_data, DYN_HTTP_REQUEST); |
| Curl_httpchunk_init(data, &ts->ch, TRUE); | |
| *pts = ts; | |
| @@ -150,7 +150,7 @@ static void h1_tunnel_go_state(struct Curl_cfilter *cf, | |
| CURL_TRC_CF(data, cf, "new tunnel state 'connect'"); | |
| ts->tunnel_state = H1_TUNNEL_CONNECT; | |
| ts->keepon = KEEPON_CONNECT; | |
| - | Curl_dyn_reset(&ts->rcvbuf); |
| + | curlx_dyn_reset(&ts->rcvbuf); |
| break; | |
| case H1_TUNNEL_RECEIVE: | |
| @@ -173,8 +173,8 @@ static void h1_tunnel_go_state(struct Curl_cfilter *cf, | |
| if(new_state == H1_TUNNEL_FAILED) | |
| CURL_TRC_CF(data, cf, "new tunnel state 'failed'"); | |
| ts->tunnel_state = new_state; | |
| - | Curl_dyn_reset(&ts->rcvbuf); |
| - | Curl_dyn_reset(&ts->request_data); |
| + | curlx_dyn_reset(&ts->rcvbuf); |
| + | curlx_dyn_reset(&ts->request_data); |
| /* restore the protocol pointer */ | |
| data->info.httpcode = 0; /* clear it as it might've been used for the | |
| proxy */ | |
| @@ -193,8 +193,8 @@ static void tunnel_free(struct Curl_cfilter *cf, | |
| struct h1_tunnel_state *ts = cf->ctx; | |
| if(ts) { | |
| h1_tunnel_go_state(cf, ts, H1_TUNNEL_FAILED, data); | |
| - | Curl_dyn_free(&ts->rcvbuf); |
| - | Curl_dyn_free(&ts->request_data); |
| + | curlx_dyn_free(&ts->rcvbuf); |
| + | curlx_dyn_free(&ts->request_data); |
| Curl_httpchunk_free(data, &ts->ch); | |
| free(ts); | |
| cf->ctx = NULL; | |
| @@ -226,7 +226,7 @@ static CURLcode start_CONNECT(struct Curl_cfilter *cf, | |
| infof(data, "Establish HTTP proxy tunnel to %s", req->authority); | |
| - | Curl_dyn_reset(&ts->request_data); |
| + | curlx_dyn_reset(&ts->request_data); |
| ts->nsent = 0; | |
| ts->headerlines = 0; | |
| http_minor = (cf->conn->http_proxy.proxytype == CURLPROXY_HTTP_1_0) ? 0 : 1; | |
| @@ -248,8 +248,8 @@ static CURLcode send_CONNECT(struct Curl_cfilter *cf, | |
| struct h1_tunnel_state *ts, | |
| bool *done) | |
| { | |
| - | char *buf = Curl_dyn_ptr(&ts->request_data); |
| - | size_t request_len = Curl_dyn_len(&ts->request_data); |
| + | char *buf = curlx_dyn_ptr(&ts->request_data); |
| + | size_t request_len = curlx_dyn_len(&ts->request_data); |
| size_t blen = request_len; | |
| CURLcode result = CURLE_OK; | |
| ssize_t nwritten; | |
| @@ -316,7 +316,7 @@ static CURLcode on_resp_header(struct Curl_cfilter *cf, | |
| } | |
| else { | |
| const char *p = header + strlen("Content-Length:"); | |
| - | if(Curl_str_numblanks(&p, &ts->cl)) { |
| + | if(curlx_str_numblanks(&p, &ts->cl)) { |
| failf(data, "Unsupported Content-Length value"); | |
| return CURLE_WEIRD_SERVER_REPLY; | |
| } | |
| @@ -444,7 +444,7 @@ static CURLcode recv_CONNECT_resp(struct Curl_cfilter *cf, | |
| continue; | |
| } | |
| - | if(Curl_dyn_addn(&ts->rcvbuf, &byte, 1)) { |
| + | if(curlx_dyn_addn(&ts->rcvbuf, &byte, 1)) { |
| failf(data, "CONNECT response too large"); | |
| return CURLE_RECV_ERROR; | |
| } | |
| @@ -454,8 +454,8 @@ static CURLcode recv_CONNECT_resp(struct Curl_cfilter *cf, | |
| continue; | |
| ts->headerlines++; | |
| - | linep = Curl_dyn_ptr(&ts->rcvbuf); |
| - | line_len = Curl_dyn_len(&ts->rcvbuf); /* amount of bytes in this line */ |
| + | linep = curlx_dyn_ptr(&ts->rcvbuf); |
| + | line_len = curlx_dyn_len(&ts->rcvbuf); /* amount of bytes in this line */ |
| /* output debug if that is requested */ | |
| Curl_debug(data, CURLINFO_HEADER_IN, linep, line_len); | |
| @@ -512,7 +512,7 @@ static CURLcode recv_CONNECT_resp(struct Curl_cfilter *cf, | |
| if(result) | |
| return result; | |
| - | Curl_dyn_reset(&ts->rcvbuf); |
| + | curlx_dyn_reset(&ts->rcvbuf); |
| } /* while there is buffer left and loop is requested */ | |
| if(error) | |
| @@ -32,7 +32,7 @@ | |
| #include "connect.h" | |
| #include "curl_trc.h" | |
| #include "bufq.h" | |
| - | #include "dynbuf.h" |
| + | #include "curlx/dynbuf.h" |
| #include "dynhds.h" | |
| #include "http1.h" | |
| #include "http2.h" | |
| @@ -54,13 +54,13 @@ static void cf_haproxy_ctx_reset(struct cf_haproxy_ctx *ctx) | |
| { | |
| DEBUGASSERT(ctx); | |
| ctx->state = HAPROXY_INIT; | |
| - | Curl_dyn_reset(&ctx->data_out); |
| + | curlx_dyn_reset(&ctx->data_out); |
| } | |
| static void cf_haproxy_ctx_free(struct cf_haproxy_ctx *ctx) | |
| { | |
| if(ctx) { | |
| - | Curl_dyn_free(&ctx->data_out); |
| + | curlx_dyn_free(&ctx->data_out); |
| free(ctx); | |
| } | |
| } | |
| @@ -79,7 +79,7 @@ static CURLcode cf_haproxy_date_out_set(struct Curl_cfilter*cf, | |
| #ifdef USE_UNIX_SOCKETS | |
| if(cf->conn->unix_domain_socket) | |
| /* the buffer is large enough to hold this! */ | |
| - | result = Curl_dyn_addn(&ctx->data_out, STRCONST("PROXY UNKNOWN\r\n")); |
| + | result = curlx_dyn_addn(&ctx->data_out, STRCONST("PROXY UNKNOWN\r\n")); |
| else { | |
| #endif /* USE_UNIX_SOCKETS */ | |
| result = Curl_conn_cf_get_ip_info(cf->next, data, &is_ipv6, &ipquad); | |
| @@ -92,10 +92,10 @@ static CURLcode cf_haproxy_date_out_set(struct Curl_cfilter*cf, | |
| else | |
| client_ip = ipquad.local_ip; | |
| - | result = Curl_dyn_addf(&ctx->data_out, "PROXY %s %s %s %i %i\r\n", |
| - | is_ipv6 ? "TCP6" : "TCP4", |
| - | client_ip, ipquad.remote_ip, |
| - | ipquad.local_port, ipquad.remote_port); |
| + | result = curlx_dyn_addf(&ctx->data_out, "PROXY %s %s %s %i %i\r\n", |
| + | is_ipv6 ? "TCP6" : "TCP4", |
| + | client_ip, ipquad.remote_ip, |
| + | ipquad.local_port, ipquad.remote_port); |
| #ifdef USE_UNIX_SOCKETS | |
| } | |
| @@ -129,11 +129,11 @@ static CURLcode cf_haproxy_connect(struct Curl_cfilter *cf, | |
| ctx->state = HAPROXY_SEND; | |
| FALLTHROUGH(); | |
| case HAPROXY_SEND: | |
| - | len = Curl_dyn_len(&ctx->data_out); |
| + | len = curlx_dyn_len(&ctx->data_out); |
| if(len > 0) { | |
| ssize_t nwritten; | |
| nwritten = Curl_conn_cf_send(cf->next, data, | |
| - | Curl_dyn_ptr(&ctx->data_out), len, FALSE, |
| + | curlx_dyn_ptr(&ctx->data_out), len, FALSE, |
| &result); | |
| if(nwritten < 0) { | |
| if(result != CURLE_AGAIN) | |
| @@ -141,8 +141,8 @@ static CURLcode cf_haproxy_connect(struct Curl_cfilter *cf, | |
| result = CURLE_OK; | |
| nwritten = 0; | |
| } | |
| - | Curl_dyn_tail(&ctx->data_out, len - (size_t)nwritten); |
| - | if(Curl_dyn_len(&ctx->data_out) > 0) { |
| + | curlx_dyn_tail(&ctx->data_out, len - (size_t)nwritten); |
| + | if(curlx_dyn_len(&ctx->data_out) > 0) { |
| result = CURLE_OK; | |
| goto out; | |
| } | |
| @@ -150,7 +150,7 @@ static CURLcode cf_haproxy_connect(struct Curl_cfilter *cf, | |
| ctx->state = HAPROXY_DONE; | |
| FALLTHROUGH(); | |
| default: | |
| - | Curl_dyn_free(&ctx->data_out); |
| + | curlx_dyn_free(&ctx->data_out); |
| break; | |
| } | |
| @@ -222,7 +222,7 @@ static CURLcode cf_haproxy_create(struct Curl_cfilter **pcf, | |
| goto out; | |
| } | |
| ctx->state = HAPROXY_INIT; | |
| - | Curl_dyn_init(&ctx->data_out, DYN_HAXPROXY); |
| + | curlx_dyn_init(&ctx->data_out, DYN_HAXPROXY); |
| result = Curl_cf_create(&cf, &Curl_cft_haproxy, ctx); | |
| if(result) | |
| @@ -151,7 +151,7 @@ static void cf_hc_baller_init(struct cf_hc_baller *b, | |
| struct Curl_cfilter *save = cf->next; | |
| cf->next = NULL; | |
| - | b->started = Curl_now(); |
| + | b->started = curlx_now(); |
| switch(b->alpn_id) { | |
| case ALPN_h3: | |
| transport = TRNSPRT_QUIC; | |
| @@ -213,11 +213,12 @@ static CURLcode baller_connected(struct Curl_cfilter *cf, | |
| reply_ms = cf_hc_baller_reply_ms(winner, data); | |
| if(reply_ms >= 0) | |
| CURL_TRC_CF(data, cf, "connect+handshake %s: %dms, 1st data: %dms", | |
| - | winner->name, (int)Curl_timediff(Curl_now(), winner->started), |
| - | reply_ms); |
| + | winner->name, (int)curlx_timediff(curlx_now(), |
| + | winner->started), reply_ms); |
| else | |
| CURL_TRC_CF(data, cf, "deferred handshake %s: %dms", | |
| - | winner->name, (int)Curl_timediff(Curl_now(), winner->started)); |
| + | winner->name, (int)curlx_timediff(curlx_now(), |
| + | winner->started)); |
| cf->next = winner->cf; | |
| winner->cf = NULL; | |
| @@ -267,7 +268,7 @@ static bool time_to_start_next(struct Curl_cfilter *cf, | |
| ctx->ballers[idx].name); | |
| return TRUE; | |
| } | |
| - | elapsed_ms = Curl_timediff(now, ctx->started); |
| + | elapsed_ms = curlx_timediff(now, ctx->started); |
| if(elapsed_ms >= ctx->hard_eyeballs_timeout_ms) { | |
| CURL_TRC_CF(data, cf, "hard timeout of %dms reached, starting %s", | |
| ctx->hard_eyeballs_timeout_ms, ctx->ballers[idx].name); | |
| @@ -304,7 +305,7 @@ static CURLcode cf_hc_connect(struct Curl_cfilter *cf, | |
| } | |
| *done = FALSE; | |
| - | now = Curl_now(); |
| + | now = curlx_now(); |
| switch(ctx->state) { | |
| case CF_HC_INIT: | |
| DEBUGASSERT(!cf->next); | |
| @@ -469,7 +470,7 @@ static struct curltime cf_get_max_baller_time(struct Curl_cfilter *cf, | |
| struct Curl_cfilter *cfb = ctx->ballers[i].cf; | |
| memset(&t, 0, sizeof(t)); | |
| if(cfb && !cfb->cft->query(cfb, data, query, NULL, &t)) { | |
| - | if((t.tv_sec || t.tv_usec) && Curl_timediff_us(t, tmax) > 0) |
| + | if((t.tv_sec || t.tv_usec) && curlx_timediff_us(t, tmax) > 0) |
| tmax = t; | |
| } | |
| } | |
| @@ -76,7 +76,7 @@ | |
| #include "inet_ntop.h" | |
| #include "inet_pton.h" | |
| #include "progress.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "conncache.h" | |
| #include "multihandle.h" | |
| #include "rand.h" | |
| @@ -84,7 +84,7 @@ | |
| #include "strdup.h" | |
| #include "system_win32.h" | |
| #include "version_win32.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -724,7 +724,7 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn, | |
| IDs and the former returns none at all. So the scope ID, if | |
| present, is known to be numeric */ | |
| curl_off_t scope_id; | |
| - | if(Curl_str_number((const char **)CURL_UNCONST(&scope_ptr), |
| + | if(curlx_str_number((const char **)CURL_UNCONST(&scope_ptr), |
| &scope_id, UINT_MAX)) | |
| return CURLE_UNSUPPORTED_PROTOCOL; | |
| si6->sin6_scope_id = (unsigned int)scope_id; | |
| @@ -959,25 +959,25 @@ static CURLcode cf_socket_ctx_init(struct cf_socket_ctx *ctx, | |
| const char *p = getenv("CURL_DBG_SOCK_WBLOCK"); | |
| if(p) { | |
| curl_off_t l; | |
| - | if(!Curl_str_number(&p, &l, 100)) |
| + | if(!curlx_str_number(&p, &l, 100)) |
| ctx->wblock_percent = (int)l; | |
| } | |
| p = getenv("CURL_DBG_SOCK_WPARTIAL"); | |
| if(p) { | |
| curl_off_t l; | |
| - | if(!Curl_str_number(&p, &l, 100)) |
| + | if(!curlx_str_number(&p, &l, 100)) |
| ctx->wpartial_percent = (int)l; | |
| } | |
| p = getenv("CURL_DBG_SOCK_RBLOCK"); | |
| if(p) { | |
| curl_off_t l; | |
| - | if(!Curl_str_number(&p, &l, 100)) |
| + | if(!curlx_str_number(&p, &l, 100)) |
| ctx->rblock_percent = (int)l; | |
| } | |
| p = getenv("CURL_DBG_SOCK_RMAX"); | |
| if(p) { | |
| curl_off_t l; | |
| - | if(!Curl_str_number(&p, &l, CURL_OFF_T_MAX)) |
| + | if(!curlx_str_number(&p, &l, CURL_OFF_T_MAX)) |
| ctx->recv_max = (size_t)l; | |
| } | |
| } | |
| @@ -1105,7 +1105,7 @@ static CURLcode cf_socket_open(struct Curl_cfilter *cf, | |
| (void)data; | |
| DEBUGASSERT(ctx->sock == CURL_SOCKET_BAD); | |
| - | ctx->started_at = Curl_now(); |
| + | ctx->started_at = curlx_now(); |
| #ifdef SOCK_NONBLOCK | |
| /* Do not tuck SOCK_NONBLOCK into socktype when opensocket callback is set | |
| * because we would not know how socketype is about to be used in the | |
| @@ -1221,7 +1221,7 @@ out: | |
| } | |
| else if(isconnected) { | |
| set_local_ip(cf, data); | |
| - | ctx->connected_at = Curl_now(); |
| + | ctx->connected_at = curlx_now(); |
| cf->connected = TRUE; | |
| } | |
| CURL_TRC_CF(data, cf, "cf_socket_open() -> %d, fd=%" FMT_SOCKET_T, | |
| @@ -1340,7 +1340,7 @@ static CURLcode cf_tcp_connect(struct Curl_cfilter *cf, | |
| else if(rc == CURL_CSELECT_OUT || cf->conn->bits.tcp_fastopen) { | |
| if(verifyconnect(ctx->sock, &ctx->error)) { | |
| /* we are connected with TCP, awesome! */ | |
| - | ctx->connected_at = Curl_now(); |
| + | ctx->connected_at = curlx_now(); |
| set_local_ip(cf, data); | |
| *done = TRUE; | |
| cf->connected = TRUE; | |
| @@ -1441,9 +1441,9 @@ static void win_update_sndbuf_size(struct cf_socket_ctx *ctx) | |
| { | |
| ULONG ideal; | |
| DWORD ideallen; | |
| - | struct curltime n = Curl_now(); |
| + | struct curltime n = curlx_now(); |
| - | if(Curl_timediff(n, ctx->last_sndbuf_query_at) > 1000) { |
| + | if(curlx_timediff(n, ctx->last_sndbuf_query_at) > 1000) { |
| if(!WSAIoctl(ctx->sock, SIO_IDEAL_SEND_BACKLOG_QUERY, 0, 0, | |
| &ideal, sizeof(ideal), &ideallen, 0, 0) && | |
| ideal != ctx->sndbuf_size && | |
| @@ -1604,7 +1604,7 @@ static ssize_t cf_socket_recv(struct Curl_cfilter *cf, struct Curl_easy *data, | |
| CURL_TRC_CF(data, cf, "recv(len=%zu) -> %d, err=%d", len, (int)nread, | |
| *err); | |
| if(nread > 0 && !ctx->got_first_byte) { | |
| - | ctx->first_byte_at = Curl_now(); |
| + | ctx->first_byte_at = curlx_now(); |
| ctx->got_first_byte = TRUE; | |
| } | |
| return nread; | |
| @@ -1715,7 +1715,7 @@ static CURLcode cf_socket_query(struct Curl_cfilter *cf, | |
| return CURLE_OK; | |
| case CF_QUERY_CONNECT_REPLY_MS: | |
| if(ctx->got_first_byte) { | |
| - | timediff_t ms = Curl_timediff(ctx->first_byte_at, ctx->started_at); |
| + | timediff_t ms = curlx_timediff(ctx->first_byte_at, ctx->started_at); |
| *pres1 = (ms < INT_MAX) ? (int)ms : INT_MAX; | |
| } | |
| else | |
| @@ -2032,7 +2032,7 @@ static timediff_t cf_tcp_accept_timeleft(struct Curl_cfilter *cf, | |
| timeout_ms = data->set.accepttimeout; | |
| #endif | |
| - | now = Curl_now(); |
| + | now = curlx_now(); |
| /* check if the generic timeout possibly is set shorter */ | |
| other = Curl_timeleft(data, &now, FALSE); | |
| if(other && (other < timeout_ms)) | |
| @@ -2041,7 +2041,7 @@ static timediff_t cf_tcp_accept_timeleft(struct Curl_cfilter *cf, | |
| timeout_ms = other; | |
| else { | |
| /* subtract elapsed time */ | |
| - | timeout_ms -= Curl_timediff(now, ctx->started_at); |
| + | timeout_ms -= curlx_timediff(now, ctx->started_at); |
| if(!timeout_ms) | |
| /* avoid returning 0 as that means no timeout! */ | |
| timeout_ms = -1; | |
| @@ -2164,7 +2164,7 @@ static CURLcode cf_tcp_accept_connect(struct Curl_cfilter *cf, | |
| cf_tcp_set_accepted_remote_ip(cf, data); | |
| set_local_ip(cf, data); | |
| ctx->active = TRUE; | |
| - | ctx->connected_at = Curl_now(); |
| + | ctx->connected_at = curlx_now(); |
| cf->connected = TRUE; | |
| CURL_TRC_CF(data, cf, "accepted_set(sock=%" FMT_SOCKET_T | |
| ", remote=%s port=%d)", | |
| @@ -2231,7 +2231,7 @@ CURLcode Curl_conn_tcp_listen_set(struct Curl_easy *data, | |
| goto out; | |
| Curl_conn_cf_add(data, conn, sockindex, cf); | |
| - | ctx->started_at = Curl_now(); |
| + | ctx->started_at = curlx_now(); |
| conn->sock[sockindex] = ctx->sock; | |
| set_local_ip(cf, data); | |
| CURL_TRC_CF(data, cf, "set filter for listen socket fd=%" FMT_SOCKET_T | |
| @@ -34,8 +34,8 @@ | |
| #include "multiif.h" | |
| #include "progress.h" | |
| #include "select.h" | |
| - | #include "warnless.h" |
| - | #include "strparse.h" |
| + | #include "curlx/warnless.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -198,7 +198,7 @@ CURLcode Curl_conn_shutdown(struct Curl_easy *data, int sockindex, bool *done) | |
| } | |
| *done = FALSE; | |
| - | now = Curl_now(); |
| + | now = curlx_now(); |
| if(!Curl_shutdown_started(data, sockindex)) { | |
| CURL_TRC_M(data, "shutdown start on%s connection", | |
| sockindex ? " secondary" : ""); | |
| @@ -442,7 +442,7 @@ CURLcode Curl_conn_connect(struct Curl_easy *data, | |
| * socket and ip related information. */ | |
| cf_cntrl_update_info(data, data->conn); | |
| conn_report_connect_stats(data, data->conn); | |
| - | data->conn->keepalive = Curl_now(); |
| + | data->conn->keepalive = curlx_now(); |
| Curl_verboseconnect(data, data->conn, sockindex); | |
| goto out; | |
| } | |
| @@ -941,7 +941,7 @@ CURLcode Curl_conn_send(struct Curl_easy *data, int sockindex, | |
| const char *p = getenv("CURL_SMALLSENDS"); | |
| if(p) { | |
| curl_off_t altsize; | |
| - | if(!Curl_str_number(&p, &altsize, write_len)) |
| + | if(!curlx_str_number(&p, &altsize, write_len)) |
| write_len = (size_t)altsize; | |
| } | |
| } | |
| @@ -24,7 +24,7 @@ | |
| * | |
| ***************************************************************************/ | |
| - | #include "timediff.h" |
| + | #include "curlx/timediff.h" |
| struct Curl_cfilter; | |
| struct Curl_easy; | |
| @@ -43,7 +43,7 @@ | |
| #include "connect.h" | |
| #include "select.h" | |
| #include "strcase.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| #include "uint-table.h" | |
| /* The last 3 #include files should be in this order */ | |
| @@ -139,7 +139,7 @@ void Curl_cpool_init(struct cpool *cpool, | |
| size_t size) | |
| { | |
| Curl_hash_init(&cpool->dest2bundle, size, Curl_hash_str, | |
| - | Curl_str_key_compare, cpool_bundle_free_entry); |
| + | curlx_str_key_compare, cpool_bundle_free_entry); |
| DEBUGASSERT(idata); | |
| @@ -294,14 +294,14 @@ cpool_bundle_get_oldest_idle(struct cpool_bundle *bundle) | |
| struct connectdata *oldest_idle = NULL; | |
| struct connectdata *conn; | |
| - | now = Curl_now(); |
| + | now = curlx_now(); |
| curr = Curl_llist_head(&bundle->conns); | |
| while(curr) { | |
| conn = Curl_node_elem(curr); | |
| if(!CONN_INUSE(conn)) { | |
| /* Set higher score for the age passed since the connection was used */ | |
| - | score = Curl_timediff(now, conn->lastused); |
| + | score = curlx_timediff(now, conn->lastused); |
| if(score > highscore) { | |
| highscore = score; | |
| @@ -324,7 +324,7 @@ static struct connectdata *cpool_get_oldest_idle(struct cpool *cpool) | |
| timediff_t highscore =- 1; | |
| timediff_t score; | |
| - | now = Curl_now(); |
| + | now = curlx_now(); |
| Curl_hash_start_iterate(&cpool->dest2bundle, &iter); | |
| for(he = Curl_hash_next_element(&iter); he; | |
| @@ -338,7 +338,7 @@ static struct connectdata *cpool_get_oldest_idle(struct cpool *cpool) | |
| if(CONN_INUSE(conn) || conn->bits.close || conn->connect_only) | |
| continue; | |
| /* Set higher score for the age passed since the connection was used */ | |
| - | score = Curl_timediff(now, conn->lastused); |
| + | score = curlx_timediff(now, conn->lastused); |
| if(score > highscore) { | |
| highscore = score; | |
| oldest_idle = conn; | |
| @@ -539,7 +539,7 @@ bool Curl_cpool_conn_now_idle(struct Curl_easy *data, | |
| struct cpool *cpool = cpool_get_instance(data); | |
| bool kept = TRUE; | |
| - | conn->lastused = Curl_now(); /* it was used up until now */ |
| + | conn->lastused = curlx_now(); /* it was used up until now */ |
| if(cpool && maxconnects) { | |
| /* may be called form a callback already under lock */ | |
| bool do_lock = !CPOOL_IS_LOCKED(cpool); | |
| @@ -734,9 +734,9 @@ void Curl_cpool_prune_dead(struct Curl_easy *data) | |
| if(!cpool) | |
| return; | |
| - | rctx.now = Curl_now(); |
| + | rctx.now = curlx_now(); |
| CPOOL_LOCK(cpool, data); | |
| - | elapsed = Curl_timediff(rctx.now, cpool->last_cleanup); |
| + | elapsed = curlx_timediff(rctx.now, cpool->last_cleanup); |
| if(elapsed >= 1000L) { | |
| while(cpool_foreach(data, cpool, &rctx, cpool_reap_dead_cb)) | |
| @@ -758,7 +758,7 @@ static int conn_upkeep(struct Curl_easy *data, | |
| CURLcode Curl_cpool_upkeep(void *data) | |
| { | |
| struct cpool *cpool = cpool_get_instance(data); | |
| - | struct curltime now = Curl_now(); |
| + | struct curltime now = curlx_now(); |
| if(!cpool) | |
| return CURLE_OK; | |
| @@ -26,7 +26,7 @@ | |
| ***************************************************************************/ | |
| #include <curl/curl.h> | |
| - | #include "timeval.h" |
| + | #include "curlx/timeval.h" |
| struct connectdata; | |
| struct Curl_easy; | |
| @@ -70,7 +70,7 @@ | |
| #include "inet_pton.h" | |
| #include "vtls/vtls.h" /* for vtsl cfilters */ | |
| #include "progress.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "conncache.h" | |
| #include "multihandle.h" | |
| #include "share.h" | |
| @@ -112,7 +112,7 @@ enum alpnid Curl_alpn2alpnid(const char *name, size_t len) | |
| * infinite time left). If the value is negative, the timeout time has already | |
| * elapsed. | |
| * @param data the transfer to check on | |
| - | * @param nowp timestamp to use for calculation, NULL to use Curl_now() |
| + | * @param nowp timestamp to use for calculation, NULL to use curlx_now() |
| * @param duringconnect TRUE iff connect timeout is also taken into account. | |
| * @unittest: 1303 | |
| */ | |
| @@ -133,13 +133,13 @@ timediff_t Curl_timeleft(struct Curl_easy *data, | |
| return 0; /* no timeout in place or checked, return "no limit" */ | |
| if(!nowp) { | |
| - | now = Curl_now(); |
| + | now = curlx_now(); |
| nowp = &now; | |
| } | |
| if(data->set.timeout > 0) { | |
| timeleft_ms = data->set.timeout - | |
| - | Curl_timediff(*nowp, data->progress.t_startop); |
| + | curlx_timediff(*nowp, data->progress.t_startop); |
| if(!timeleft_ms) | |
| timeleft_ms = -1; /* 0 is "no limit", fake 1 ms expiry */ | |
| if(!duringconnect) | |
| @@ -150,7 +150,7 @@ timediff_t Curl_timeleft(struct Curl_easy *data, | |
| timediff_t ctimeout_ms = (data->set.connecttimeout > 0) ? | |
| data->set.connecttimeout : DEFAULT_CONNECT_TIMEOUT; | |
| ctimeleft_ms = ctimeout_ms - | |
| - | Curl_timediff(*nowp, data->progress.t_startsingle); |
| + | curlx_timediff(*nowp, data->progress.t_startsingle); |
| if(!ctimeleft_ms) | |
| ctimeleft_ms = -1; /* 0 is "no limit", fake 1 ms expiry */ | |
| if(!timeleft_ms) | |
| @@ -167,7 +167,7 @@ void Curl_shutdown_start(struct Curl_easy *data, int sockindex, | |
| DEBUGASSERT(data->conn); | |
| if(!nowp) { | |
| - | now = Curl_now(); |
| + | now = curlx_now(); |
| nowp = &now; | |
| } | |
| data->conn->shutdown.start[sockindex] = *nowp; | |
| @@ -191,11 +191,11 @@ timediff_t Curl_shutdown_timeleft(struct connectdata *conn, int sockindex, | |
| return 0; /* not started or no limits */ | |
| if(!nowp) { | |
| - | now = Curl_now(); |
| + | now = curlx_now(); |
| nowp = &now; | |
| } | |
| left_ms = conn->shutdown.timeout_ms - | |
| - | Curl_timediff(*nowp, conn->shutdown.start[sockindex]); |
| + | curlx_timediff(*nowp, conn->shutdown.start[sockindex]); |
| return left_ms ? left_ms : -1; | |
| } | |
| @@ -210,7 +210,7 @@ timediff_t Curl_conn_shutdown_timeleft(struct connectdata *conn, | |
| if(!conn->shutdown.start[i].tv_sec) | |
| continue; | |
| if(!nowp) { | |
| - | now = Curl_now(); |
| + | now = curlx_now(); |
| nowp = &now; | |
| } | |
| ms = Curl_shutdown_timeleft(conn, i, nowp); | |
| @@ -547,7 +547,7 @@ static CURLcode baller_start(struct Curl_cfilter *cf, | |
| baller->has_started = TRUE; | |
| while(baller->addr) { | |
| - | baller->started = Curl_now(); |
| + | baller->started = curlx_now(); |
| baller->timeoutms = addr_next_match(baller->addr, baller->ai_family) ? | |
| USETIME(timeoutms) : timeoutms; | |
| baller_initiate(cf, data, baller); | |
| @@ -606,7 +606,7 @@ static CURLcode baller_connect(struct Curl_cfilter *cf, | |
| baller->connected = TRUE; | |
| baller->is_done = TRUE; | |
| } | |
| - | else if(Curl_timediff(*now, baller->started) >= baller->timeoutms) { |
| + | else if(curlx_timediff(*now, baller->started) >= baller->timeoutms) { |
| infof(data, "%s connect timeout after %" FMT_TIMEDIFF_T | |
| "ms, move on!", baller->name, baller->timeoutms); | |
| #ifdef SOCKETIMEDOUT | |
| @@ -644,7 +644,7 @@ static CURLcode is_connected(struct Curl_cfilter *cf, | |
| * cot ballers in a QUIC appropriate way. */ | |
| evaluate: | |
| *connected = FALSE; /* a negative world view is best */ | |
| - | now = Curl_now(); |
| + | now = curlx_now(); |
| ongoing = not_started = 0; | |
| for(i = 0; i < CURL_ARRAYSIZE(ctx->baller); i++) { | |
| struct eyeballer *baller = ctx->baller[i]; | |
| @@ -699,7 +699,7 @@ evaluate: | |
| * start new ballers or return ok. */ | |
| if((ongoing || not_started) && Curl_timeleft(data, &now, TRUE) < 0) { | |
| failf(data, "Connection timeout after %" FMT_OFF_T " ms", | |
| - | Curl_timediff(now, data->progress.t_startsingle)); |
| + | curlx_timediff(now, data->progress.t_startsingle)); |
| return CURLE_OPERATION_TIMEDOUT; | |
| } | |
| @@ -715,7 +715,7 @@ evaluate: | |
| /* We start its primary baller has failed to connect or if | |
| * its start delay_ms have expired */ | |
| if((baller->primary && baller->primary->is_done) || | |
| - | Curl_timediff(now, ctx->started) >= baller->delay_ms) { |
| + | curlx_timediff(now, ctx->started) >= baller->delay_ms) { |
| baller_start(cf, data, baller, Curl_timeleft(data, &now, TRUE)); | |
| if(baller->is_done) { | |
| CURL_TRC_CF(data, cf, "%s done", baller->name); | |
| @@ -768,7 +768,7 @@ evaluate: | |
| failf(data, "Failed to connect to %s port %u after " | |
| "%" FMT_TIMEDIFF_T " ms: %s", | |
| hostname, conn->primary.remote_port, | |
| - | Curl_timediff(now, data->progress.t_startsingle), |
| + | curlx_timediff(now, data->progress.t_startsingle), |
| curl_easy_strerror(result)); | |
| #ifdef SOCKETIMEDOUT | |
| @@ -800,7 +800,7 @@ static CURLcode start_connect(struct Curl_cfilter *cf, | |
| return CURLE_OPERATION_TIMEDOUT; | |
| } | |
| - | ctx->started = Curl_now(); |
| + | ctx->started = curlx_now(); |
| /* remotehost->addr is the list of addresses from the resolver, each | |
| * with an address family. The list has at least one entry, possibly | |
| @@ -1060,7 +1060,7 @@ static struct curltime get_max_baller_time(struct Curl_cfilter *cf, | |
| memset(&t, 0, sizeof(t)); | |
| if(baller && baller->cf && | |
| !baller->cf->cft->query(baller->cf, data, query, NULL, &t)) { | |
| - | if((t.tv_sec || t.tv_usec) && Curl_timediff_us(t, tmax) > 0) |
| + | if((t.tv_sec || t.tv_usec) && curlx_timediff_us(t, tmax) > 0) |
| tmax = t; | |
| } | |
| } | |
| @@ -27,7 +27,7 @@ | |
| #include "nonblock.h" /* for curlx_nonblock(), formerly Curl_nonblock() */ | |
| #include "sockaddr.h" | |
| - | #include "timeval.h" |
| + | #include "curlx/timeval.h" |
| struct Curl_dns_entry; | |
| struct ip_quadruple; | |
| @@ -87,7 +87,7 @@ Example set of cookies: | |
| #include "fopen.h" | |
| #include "strdup.h" | |
| #include "llist.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -497,25 +497,25 @@ parse_cookie_header(struct Curl_easy *data, | |
| struct Curl_str val; | |
| /* we have a <name>=<value> pair or a stand-alone word here */ | |
| - | if(!Curl_str_cspn(&ptr, &name, ";\t\r\n=")) { |
| + | if(!curlx_str_cspn(&ptr, &name, ";\t\r\n=")) { |
| bool done = FALSE; | |
| bool sep = FALSE; | |
| - | Curl_str_trimblanks(&name); |
| + | curlx_str_trimblanks(&name); |
| - | if(!Curl_str_single(&ptr, '=')) { |
| + | if(!curlx_str_single(&ptr, '=')) { |
| sep = TRUE; /* a '=' was used */ | |
| - | if(!Curl_str_cspn(&ptr, &val, ";\r\n")) { |
| - | Curl_str_trimblanks(&val); |
| + | if(!curlx_str_cspn(&ptr, &val, ";\r\n")) { |
| + | curlx_str_trimblanks(&val); |
| /* Reject cookies with a TAB inside the value */ | |
| - | if(memchr(Curl_str(&val), '\t', Curl_strlen(&val))) { |
| + | if(memchr(curlx_str(&val), '\t', curlx_strlen(&val))) { |
| infof(data, "cookie contains TAB, dropping"); | |
| return CERR_TAB; | |
| } | |
| } | |
| } | |
| else { | |
| - | Curl_str_init(&val); |
| + | curlx_str_init(&val); |
| } | |
| /* | |
| @@ -523,11 +523,11 @@ parse_cookie_header(struct Curl_easy *data, | |
| * combination of name + contents. Chrome and Firefox support 4095 or | |
| * 4096 bytes combo | |
| */ | |
| - | if(Curl_strlen(&name) >= (MAX_NAME-1) || |
| - | Curl_strlen(&val) >= (MAX_NAME-1) || |
| - | ((Curl_strlen(&name) + Curl_strlen(&val)) > MAX_NAME)) { |
| + | if(curlx_strlen(&name) >= (MAX_NAME-1) || |
| + | curlx_strlen(&val) >= (MAX_NAME-1) || |
| + | ((curlx_strlen(&name) + curlx_strlen(&val)) > MAX_NAME)) { |
| infof(data, "oversized cookie dropped, name/val %zu + %zu bytes", | |
| - | Curl_strlen(&name), Curl_strlen(&val)); |
| + | curlx_strlen(&name), curlx_strlen(&val)); |
| return CERR_TOO_BIG; | |
| } | |
| @@ -537,9 +537,9 @@ parse_cookie_header(struct Curl_easy *data, | |
| * "the rest". Prefixes must start with '__' and end with a '-', so | |
| * only test for names where that can possibly be true. | |
| */ | |
| - | if(!strncmp("__Secure-", Curl_str(&name), 9)) |
| + | if(!strncmp("__Secure-", curlx_str(&name), 9)) |
| co->prefix_secure = TRUE; | |
| - | else if(!strncmp("__Host-", Curl_str(&name), 7)) |
| + | else if(!strncmp("__Host-", curlx_str(&name), 7)) |
| co->prefix_host = TRUE; | |
| /* | |
| @@ -554,8 +554,8 @@ parse_cookie_header(struct Curl_easy *data, | |
| /* Bad name/value pair. */ | |
| return CERR_NO_SEP; | |
| - | strstore(&co->name, Curl_str(&name), Curl_strlen(&name)); |
| - | strstore(&co->value, Curl_str(&val), Curl_strlen(&val)); |
| + | strstore(&co->name, curlx_str(&name), curlx_strlen(&name)); |
| + | strstore(&co->value, curlx_str(&val), curlx_strlen(&val)); |
| done = TRUE; | |
| if(!co->name || !co->value) | |
| return CERR_NO_NAME_VALUE; | |
| @@ -565,7 +565,7 @@ parse_cookie_header(struct Curl_easy *data, | |
| return CERR_INVALID_OCTET; | |
| } | |
| } | |
| - | else if(!Curl_strlen(&val)) { |
| + | else if(!curlx_strlen(&val)) { |
| /* | |
| * this was a "<name>=" with no content, and we must allow | |
| * 'secure' and 'httponly' specified this weirdly | |
| @@ -576,7 +576,7 @@ parse_cookie_header(struct Curl_easy *data, | |
| * using a secure protocol, or when the cookie is being set by | |
| * reading from file | |
| */ | |
| - | if(Curl_str_casecompare(&name, "secure")) { |
| + | if(curlx_str_casecompare(&name, "secure")) { |
| if(secure || !ci->running) { | |
| co->secure = TRUE; | |
| } | |
| @@ -584,7 +584,7 @@ parse_cookie_header(struct Curl_easy *data, | |
| return CERR_BAD_SECURE; | |
| } | |
| } | |
| - | else if(Curl_str_casecompare(&name, "httponly")) |
| + | else if(curlx_str_casecompare(&name, "httponly")) |
| co->httponly = TRUE; | |
| else if(sep) | |
| /* there was a '=' so we are not done parsing this field */ | |
| @@ -592,8 +592,8 @@ parse_cookie_header(struct Curl_easy *data, | |
| } | |
| if(done) | |
| ; | |
| - | else if(Curl_str_casecompare(&name, "path")) { |
| - | strstore(&co->path, Curl_str(&val), Curl_strlen(&val)); |
| + | else if(curlx_str_casecompare(&name, "path")) { |
| + | strstore(&co->path, curlx_str(&val), curlx_strlen(&val)); |
| if(!co->path) | |
| return CERR_OUT_OF_MEMORY; | |
| free(co->spath); /* if this is set again */ | |
| @@ -601,16 +601,16 @@ parse_cookie_header(struct Curl_easy *data, | |
| if(!co->spath) | |
| return CERR_OUT_OF_MEMORY; | |
| } | |
| - | else if(Curl_str_casecompare(&name, "domain") && Curl_strlen(&val)) { |
| + | else if(curlx_str_casecompare(&name, "domain") && curlx_strlen(&val)) { |
| bool is_ip; | |
| - | const char *v = Curl_str(&val); |
| + | const char *v = curlx_str(&val); |
| /* | |
| * Now, we make sure that our host is within the given domain, or | |
| * the given domain is not valid and thus cannot be set. | |
| */ | |
| if('.' == *v) | |
| - | Curl_str_nudge(&val, 1); |
| + | curlx_str_nudge(&val, 1); |
| #ifndef USE_LIBPSL | |
| /* | |
| @@ -618,18 +618,19 @@ parse_cookie_header(struct Curl_easy *data, | |
| * TLD or otherwise "protected" suffix. To reduce risk, we require a | |
| * dot OR the exact hostname being "localhost". | |
| */ | |
| - | if(bad_domain(Curl_str(&val), Curl_strlen(&val))) |
| + | if(bad_domain(curlx_str(&val), curlx_strlen(&val))) |
| domain = ":"; | |
| #endif | |
| - | is_ip = Curl_host_is_ipnum(domain ? domain : Curl_str(&val)); |
| + | is_ip = Curl_host_is_ipnum(domain ? domain : curlx_str(&val)); |
| if(!domain | |
| - | || (is_ip && !strncmp(Curl_str(&val), domain, Curl_strlen(&val)) && |
| - | (Curl_strlen(&val) == strlen(domain))) |
| - | || (!is_ip && cookie_tailmatch(Curl_str(&val), |
| - | Curl_strlen(&val), domain))) { |
| - | strstore(&co->domain, Curl_str(&val), Curl_strlen(&val)); |
| + | || (is_ip && !strncmp(curlx_str(&val), domain, |
| + | curlx_strlen(&val)) && |
| + | (curlx_strlen(&val) == strlen(domain))) |
| + | || (!is_ip && cookie_tailmatch(curlx_str(&val), |
| + | curlx_strlen(&val), domain))) { |
| + | strstore(&co->domain, curlx_str(&val), curlx_strlen(&val)); |
| if(!co->domain) | |
| return CERR_OUT_OF_MEMORY; | |
| @@ -643,14 +644,14 @@ parse_cookie_header(struct Curl_easy *data, | |
| * not a domain to which the current host belongs. Mark as bad. | |
| */ | |
| infof(data, "skipped cookie with bad tailmatch domain: %s", | |
| - | Curl_str(&val)); |
| + | curlx_str(&val)); |
| return CERR_NO_TAILMATCH; | |
| } | |
| } | |
| - | else if(Curl_str_casecompare(&name, "version")) { |
| + | else if(curlx_str_casecompare(&name, "version")) { |
| /* just ignore */ | |
| } | |
| - | else if(Curl_str_casecompare(&name, "max-age") && Curl_strlen(&val)) { |
| + | else if(curlx_str_casecompare(&name, "max-age") && curlx_strlen(&val)) { |
| /* | |
| * Defined in RFC2109: | |
| * | |
| @@ -661,10 +662,10 @@ parse_cookie_header(struct Curl_easy *data, | |
| * cookie should be discarded immediately. | |
| */ | |
| int rc; | |
| - | const char *maxage = Curl_str(&val); |
| + | const char *maxage = curlx_str(&val); |
| if(*maxage == '\"') | |
| maxage++; | |
| - | rc = Curl_str_number(&maxage, &co->expires, CURL_OFF_T_MAX); |
| + | rc = curlx_str_number(&maxage, &co->expires, CURL_OFF_T_MAX); |
| switch(rc) { | |
| case STRE_OVERFLOW: | |
| @@ -688,8 +689,8 @@ parse_cookie_header(struct Curl_easy *data, | |
| } | |
| cap_expires(now, co); | |
| } | |
| - | else if(Curl_str_casecompare(&name, "expires") && Curl_strlen(&val)) { |
| - | if(!co->expires && (Curl_strlen(&val) < MAX_DATE_LENGTH)) { |
| + | else if(curlx_str_casecompare(&name, "expires") && curlx_strlen(&val)) { |
| + | if(!co->expires && (curlx_strlen(&val) < MAX_DATE_LENGTH)) { |
| /* | |
| * Let max-age have priority. | |
| * | |
| @@ -697,8 +698,8 @@ parse_cookie_header(struct Curl_easy *data, | |
| * will be treated as a session cookie | |
| */ | |
| char dbuf[MAX_DATE_LENGTH + 1]; | |
| - | memcpy(dbuf, Curl_str(&val), Curl_strlen(&val)); |
| - | dbuf[Curl_strlen(&val)] = 0; |
| + | memcpy(dbuf, curlx_str(&val), curlx_strlen(&val)); |
| + | dbuf[curlx_strlen(&val)] = 0; |
| co->expires = Curl_getdate_capped(dbuf); | |
| /* | |
| @@ -719,7 +720,7 @@ parse_cookie_header(struct Curl_easy *data, | |
| */ | |
| } | |
| - | if(Curl_str_single(&ptr, ';')) |
| + | if(curlx_str_single(&ptr, ';')) |
| break; | |
| } while(1); | |
| @@ -849,7 +850,7 @@ parse_netscape(struct Cookie *co, | |
| } | |
| break; | |
| case 4: | |
| - | if(Curl_str_number(&ptr, &co->expires, CURL_OFF_T_MAX)) |
| + | if(curlx_str_number(&ptr, &co->expires, CURL_OFF_T_MAX)) |
| return CERR_RANGE; | |
| break; | |
| case 5: | |
| @@ -1209,20 +1210,20 @@ struct CookieInfo *Curl_cookie_init(struct Curl_easy *data, | |
| ci->running = FALSE; /* this is not running, this is init */ | |
| if(fp) { | |
| struct dynbuf buf; | |
| - | Curl_dyn_init(&buf, MAX_COOKIE_LINE); |
| + | curlx_dyn_init(&buf, MAX_COOKIE_LINE); |
| while(Curl_get_line(&buf, fp)) { | |
| - | const char *lineptr = Curl_dyn_ptr(&buf); |
| + | const char *lineptr = curlx_dyn_ptr(&buf); |
| bool headerline = FALSE; | |
| if(checkprefix("Set-Cookie:", lineptr)) { | |
| /* This is a cookie line, get it! */ | |
| lineptr += 11; | |
| headerline = TRUE; | |
| - | Curl_str_passblanks(&lineptr); |
| + | curlx_str_passblanks(&lineptr); |
| } | |
| Curl_cookie_add(data, ci, headerline, TRUE, lineptr, NULL, NULL, TRUE); | |
| } | |
| - | Curl_dyn_free(&buf); /* free the line buffer */ |
| + | curlx_dyn_free(&buf); /* free the line buffer */ |
| /* | |
| * Remove expired cookies from the hash. We must make sure to run this | |
| @@ -41,7 +41,7 @@ | |
| #include "connect.h" | |
| #include "select.h" | |
| #include "strcase.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -270,7 +270,7 @@ static void cshutdn_perform(struct cshutdn *cshutdn, | |
| /* idata has one timer list, but maybe more than one connection. | |
| * Set EXPIRE_SHUTDOWN to the smallest time left for all. */ | |
| if(!nowp) { | |
| - | now = Curl_now(); |
| + | now = curlx_now(); |
| nowp = &now; | |
| } | |
| ms = Curl_conn_shutdown_timeleft(conn, nowp); | |
| @@ -289,7 +289,7 @@ static void cshutdn_terminate_all(struct cshutdn *cshutdn, | |
| struct Curl_easy *data, | |
| int timeout_ms) | |
| { | |
| - | struct curltime started = Curl_now(); |
| + | struct curltime started = curlx_now(); |
| struct Curl_llist_node *e; | |
| SIGPIPE_VARIABLE(pipe_st); | |
| @@ -312,7 +312,7 @@ static void cshutdn_terminate_all(struct cshutdn *cshutdn, | |
| } | |
| /* wait for activity, timeout or "nothing" */ | |
| - | timespent = Curl_timediff(Curl_now(), started); |
| + | timespent = curlx_timediff(curlx_now(), started); |
| if(timespent >= (timediff_t)timeout_ms) { | |
| CURL_TRC_M(data, "[SHUTDOWN] shutdown finished, %s", | |
| (timeout_ms > 0) ? "timeout" : "best effort done"); | |
| @@ -362,7 +362,7 @@ void Curl_cshutdn_destroy(struct cshutdn *cshutdn, | |
| const char *p = getenv("CURL_GRACEFUL_SHUTDOWN"); | |
| if(p) { | |
| curl_off_t l; | |
| - | if(!Curl_str_number(&p, &l, INT_MAX)) |
| + | if(!curlx_str_number(&p, &l, INT_MAX)) |
| timeout_ms = (int)l; | |
| } | |
| } | |
| @@ -26,7 +26,7 @@ | |
| ***************************************************************************/ | |
| #include <curl/curl.h> | |
| - | #include "timeval.h" |
| + | #include "curlx/timeval.h" |
| struct connectdata; | |
| struct Curl_easy; | |
| @@ -52,7 +52,7 @@ | |
| #include "curl_addrinfo.h" | |
| #include "fake_addrinfo.h" | |
| #include "inet_pton.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| #include "curl_memory.h" | |
| @@ -28,9 +28,7 @@ | |
| !defined(CURL_DISABLE_HSTS) || !defined(CURL_DISABLE_NETRC) | |
| #include "curl_get_line.h" | |
| - | #ifdef BUILDING_LIBCURL |
| #include "curl_memory.h" | |
| - | #endif |
| /* The last #include file should be: */ | |
| #include "memdebug.h" | |
| @@ -42,7 +40,7 @@ int Curl_get_line(struct dynbuf *buf, FILE *input) | |
| { | |
| CURLcode result; | |
| char buffer[128]; | |
| - | Curl_dyn_reset(buf); |
| + | curlx_dyn_reset(buf); |
| while(1) { | |
| char *b = fgets(buffer, sizeof(buffer), input); | |
| @@ -52,7 +50,7 @@ int Curl_get_line(struct dynbuf *buf, FILE *input) | |
| if(!rlen) | |
| break; | |
| - | result = Curl_dyn_addn(buf, b, rlen); |
| + | result = curlx_dyn_addn(buf, b, rlen); |
| if(result) | |
| /* too long line or out of memory */ | |
| return 0; /* error */ | |
| @@ -63,14 +61,14 @@ int Curl_get_line(struct dynbuf *buf, FILE *input) | |
| else if(feof(input)) { | |
| /* append a newline */ | |
| - | result = Curl_dyn_addn(buf, "\n", 1); |
| + | result = curlx_dyn_addn(buf, "\n", 1); |
| if(result) | |
| /* too long line or out of memory */ | |
| return 0; /* error */ | |
| return 1; /* all good */ | |
| } | |
| } | |
| - | else if(Curl_dyn_len(buf)) |
| + | else if(curlx_dyn_len(buf)) |
| return 1; /* all good */ | |
| else | |
| break; | |
| @@ -24,13 +24,7 @@ | |
| * | |
| ***************************************************************************/ | |
| - | #include "dynbuf.h" |
| - | |
| - | #ifndef BUILDING_LIBCURL |
| - | /* this renames functions so that the tool code can use the same code |
| - | without getting symbol collisions */ |
| - | #define Curl_get_line(a,b) curlx_get_line(a,b) |
| - | #endif |
| + | #include "curlx/dynbuf.h" |
| /* Curl_get_line() returns complete lines that end with a newline. */ | |
| int Curl_get_line(struct dynbuf *buf, FILE *input); | |
| @@ -126,7 +126,7 @@ | |
| #include "curl_ntlm_core.h" | |
| #include "curl_md5.h" | |
| #include "curl_hmac.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "curl_endian.h" | |
| #include "curl_des.h" | |
| #include "curl_md4.h" | |
| @@ -24,21 +24,19 @@ | |
| * | |
| ***************************************************************************/ | |
| - | /* |
| - | * This header should be included by ALL code in libcurl that uses any |
| - | * *rintf() functions. |
| - | */ |
| - | |
| - | #ifndef CURL_TEMP_PRINTF |
| - | #error "CURL_TEMP_PRINTF must be set before including curl/mprintf.h" |
| - | #endif |
| - | |
| #include <curl/mprintf.h> | |
| #define MERR_OK 0 | |
| #define MERR_MEM 1 | |
| #define MERR_TOO_LARGE 2 | |
| + | #ifdef BUILDING_LIBCURL |
| + | |
| + | /* |
| + | * This header should be included by ALL code in libcurl that uses any |
| + | * *rintf() functions. |
| + | */ |
| + | |
| # undef printf | |
| # undef fprintf | |
| # undef msnprintf | |
| @@ -55,4 +53,6 @@ | |
| # define mvsnprintf curl_mvsnprintf | |
| # define aprintf curl_maprintf | |
| # define vaprintf curl_mvaprintf | |
| + | |
| + | #endif /* BUILDING_LIBCURL */ |
| #endif /* HEADER_CURL_PRINTF_H */ | |
| @@ -26,7 +26,7 @@ | |
| #include <curl/curl.h> | |
| #include "curl_range.h" | |
| #include "sendf.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* Only include this function if one or more of FTP, FILE are enabled. */ | |
| #if !defined(CURL_DISABLE_FTP) || !defined(CURL_DISABLE_FILE) | |
| @@ -41,14 +41,14 @@ CURLcode Curl_range(struct Curl_easy *data) | |
| curl_off_t from, to; | |
| bool first_num = TRUE; | |
| const char *p = data->state.range; | |
| - | if(Curl_str_number(&p, &from, CURL_OFF_T_MAX)) |
| + | if(curlx_str_number(&p, &from, CURL_OFF_T_MAX)) |
| first_num = FALSE; | |
| - | if(Curl_str_single(&p, '-')) |
| + | if(curlx_str_single(&p, '-')) |
| /* no leading dash or after the first number is an error */ | |
| return CURLE_RANGE_ERROR; | |
| - | if(Curl_str_number(&p, &to, CURL_OFF_T_MAX)) { |
| + | if(curlx_str_number(&p, &to, CURL_OFF_T_MAX)) { |
| /* no second number */ | |
| /* X - */ | |
| data->state.resume_from = from; | |
| @@ -33,7 +33,7 @@ | |
| #include "nonblock.h" /* for curlx_nonblock */ | |
| #include "progress.h" /* for Curl_pgrsSetUploadSize */ | |
| #include "transfer.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include <curl/curl.h> | |
| #include <librtmp/rtmp.h> | |
| @@ -42,14 +42,14 @@ | |
| #include <curl/curl.h> | |
| #include "urldata.h" | |
| - | #include "curl_base64.h" |
| + | #include "curlx/base64.h" |
| #include "curl_md5.h" | |
| #include "vauth/vauth.h" | |
| #include "cfilters.h" | |
| #include "vtls/vtls.h" | |
| #include "curl_hmac.h" | |
| #include "curl_sasl.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "sendf.h" | |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -283,7 +283,7 @@ static CURLcode get_server_message(struct SASL *sasl, struct Curl_easy *data, | |
| if(!*serverdata || *serverdata == '=') | |
| Curl_bufref_set(out, NULL, 0, NULL); | |
| else { | |
| - | result = Curl_base64_decode(serverdata, &msg, &msglen); |
| + | result = curlx_base64_decode(serverdata, &msg, &msglen); |
| if(!result) | |
| Curl_bufref_set(out, msg, msglen, curl_free); | |
| } | |
| @@ -306,8 +306,8 @@ static CURLcode build_message(struct SASL *sasl, struct bufref *msg) | |
| char *base64; | |
| size_t base64len; | |
| - | result = Curl_base64_encode((const char *) Curl_bufref_ptr(msg), |
| - | Curl_bufref_len(msg), &base64, &base64len); |
| + | result = curlx_base64_encode((const char *) Curl_bufref_ptr(msg), |
| + | Curl_bufref_len(msg), &base64, &base64len); |
| if(!result) | |
| Curl_bufref_set(msg, base64, base64len, curl_free); | |
| } | |
| @@ -28,9 +28,6 @@ | |
| #define CURL_NO_OLDIES | |
| #endif | |
| - | /* Tell "curl/curl.h" not to include "curl/mprintf.h" */ |
| - | #define CURL_SKIP_INCLUDE_MPRINTF |
| - | |
| /* Set default _WIN32_WINNT */ | |
| #ifdef __MINGW32__ | |
| #include <_mingw.h> | |
| @@ -27,7 +27,7 @@ | |
| #if !defined(CURL_DISABLE_DIGEST_AUTH) && !defined(CURL_DISABLE_SHA512_256) | |
| #include "curl_sha512_256.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| /* The recommended order of the TLS backends: | |
| * * OpenSSL | |
| @@ -31,7 +31,7 @@ | |
| #include "curl_multibyte.h" | |
| #include "system_win32.h" | |
| #include "version_win32.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| /* The last #include files should be: */ | |
| #include "curl_memory.h" | |
| @@ -35,9 +35,7 @@ | |
| #endif | |
| #include "curl_threads.h" | |
| - | #ifdef BUILDING_LIBCURL |
| #include "curl_memory.h" | |
| - | #endif |
| /* The last #include file should be: */ | |
| #include "memdebug.h" | |
| @@ -43,7 +43,7 @@ | |
| #include "cf-haproxy.h" | |
| #include "cf-https-connect.h" | |
| #include "socks.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| #include "vtls/vtls.h" | |
| #include "vquic/vquic.h" | |
| @@ -497,13 +497,13 @@ static void trc_apply_level_by_name(struct Curl_str *token, int lvl) | |
| size_t i; | |
| for(i = 0; i < CURL_ARRAYSIZE(trc_cfts); ++i) { | |
| - | if(Curl_str_casecompare(token, trc_cfts[i].cft->name)) { |
| + | if(curlx_str_casecompare(token, trc_cfts[i].cft->name)) { |
| trc_cfts[i].cft->log_level = lvl; | |
| break; | |
| } | |
| } | |
| for(i = 0; i < CURL_ARRAYSIZE(trc_feats); ++i) { | |
| - | if(Curl_str_casecompare(token, trc_feats[i].feat->name)) { |
| + | if(curlx_str_casecompare(token, trc_feats[i].feat->name)) { |
| trc_feats[i].feat->log_level = lvl; | |
| break; | |
| } | |
| @@ -527,33 +527,33 @@ static void trc_apply_level_by_category(int category, int lvl) | |
| static CURLcode trc_opt(const char *config) | |
| { | |
| struct Curl_str out; | |
| - | while(!Curl_str_until(&config, &out, 32, ',')) { |
| + | while(!curlx_str_until(&config, &out, 32, ',')) { |
| int lvl = CURL_LOG_LVL_INFO; | |
| - | const char *token = Curl_str(&out); |
| + | const char *token = curlx_str(&out); |
| if(*token == '-') { | |
| lvl = CURL_LOG_LVL_NONE; | |
| - | Curl_str_nudge(&out, 1); |
| + | curlx_str_nudge(&out, 1); |
| } | |
| else if(*token == '+') | |
| - | Curl_str_nudge(&out, 1); |
| + | curlx_str_nudge(&out, 1); |
| - | if(Curl_str_casecompare(&out, "all")) |
| + | if(curlx_str_casecompare(&out, "all")) |
| trc_apply_level_by_category(TRC_CT_NONE, lvl); | |
| - | else if(Curl_str_casecompare(&out, "protocol")) |
| + | else if(curlx_str_casecompare(&out, "protocol")) |
| trc_apply_level_by_category(TRC_CT_PROTOCOL, lvl); | |
| - | else if(Curl_str_casecompare(&out, "network")) |
| + | else if(curlx_str_casecompare(&out, "network")) |
| trc_apply_level_by_category(TRC_CT_NETWORK, lvl); | |
| - | else if(Curl_str_casecompare(&out, "proxy")) |
| + | else if(curlx_str_casecompare(&out, "proxy")) |
| trc_apply_level_by_category(TRC_CT_PROXY, lvl); | |
| - | else if(Curl_str_casecompare(&out, "doh")) { |
| + | else if(curlx_str_casecompare(&out, "doh")) { |
| struct Curl_str dns = { "dns", 3 }; | |
| trc_apply_level_by_name(&dns, lvl); | |
| } | |
| else | |
| trc_apply_level_by_name(&out, lvl); | |
| - | if(Curl_str_single(&config, ',')) |
| + | if(curlx_str_single(&config, ',')) |
| break; | |
| } | |
| return CURLE_OK; | |
| @@ -0,0 +1,24 @@ | |
| + | <!-- |
| + | Copyright (C) Daniel Stenberg, <[email protected]>, et al. |
| + | |
| + | SPDX-License-Identifier: curl |
| + | --> |
| + | |
| + | # `curlx` |
| + | |
| + | Functions that are prefixed with `curlx_` are internal global functions that |
| + | are written in a way to allow them to be "borrowed" and used outside of the |
| + | library: in the curl tool and in the curl test suite. |
| + | |
| + | The `curlx` functions are not part of the libcurl API, but are stand-alone |
| + | functions whose sources can be built and used outside of libcurl. There are |
| + | not API or ABI guarantees. The functions are not written or meant to be used |
| + | outside of the curl project. |
| + | |
| + | Only functions actually used by the library are provided here. |
| + | |
| + | ## Ways to success |
| + | |
| + | - Do not use `struct Curl_easy` in these files |
| + | - Do not use the printf defines in these files |
| + | - Make them as stand-alone as possible |
| @@ -24,7 +24,7 @@ | |
| /* Base64 encoding/decoding */ | |
| - | #include "curl_setup.h" |
| + | #include "../curl_setup.h" |
| #if !defined(CURL_DISABLE_HTTP_AUTH) || defined(USE_SSH) || \ | |
| !defined(CURL_DISABLE_LDAP) || \ | |
| @@ -33,15 +33,15 @@ | |
| !defined(CURL_DISABLE_IMAP) || \ | |
| !defined(CURL_DISABLE_DIGEST_AUTH) || \ | |
| !defined(CURL_DISABLE_DOH) || defined(USE_SSL) || !defined(BUILDING_LIBCURL) | |
| - | #include "curl/curl.h" |
| + | #include <curl/curl.h> |
| #include "warnless.h" | |
| - | #include "curl_base64.h" |
| + | #include "base64.h" |
| /* The last 2 #include files should be in this order */ | |
| #ifdef BUILDING_LIBCURL | |
| - | #include "curl_memory.h" |
| + | #include "../curl_memory.h" |
| #endif | |
| - | #include "memdebug.h" |
| + | #include "../memdebug.h" |
| /* ---- Base64 Encoding/Decoding Table --- */ | |
| /* Padding character string starts at offset 64. */ | |
| @@ -60,7 +60,7 @@ static const unsigned char decodetable[] = | |
| 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, | |
| 48, 49, 50, 51 }; | |
| /* | |
| - | * Curl_base64_decode() |
| + | * curlx_base64_decode() |
| * | |
| * Given a base64 NUL-terminated string at src, decode it and return a | |
| * pointer in *outptr to a newly allocated memory area holding decoded | |
| @@ -73,8 +73,8 @@ static const unsigned char decodetable[] = | |
| * | |
| * @unittest: 1302 | |
| */ | |
| - | CURLcode Curl_base64_decode(const char *src, |
| - | unsigned char **outptr, size_t *outlen) |
| + | CURLcode curlx_base64_decode(const char *src, |
| + | unsigned char **outptr, size_t *outlen) |
| { | |
| size_t srclen = 0; | |
| size_t padding = 0; | |
| @@ -249,7 +249,7 @@ static CURLcode base64_encode(const char *table64, | |
| } | |
| /* | |
| - | * Curl_base64_encode() |
| + | * curlx_base64_encode() |
| * | |
| * Given a pointer to an input buffer and an input size, encode it and | |
| * return a pointer in *outptr to a newly allocated memory area holding | |
| @@ -263,14 +263,14 @@ static CURLcode base64_encode(const char *table64, | |
| * | |
| * @unittest: 1302 | |
| */ | |
| - | CURLcode Curl_base64_encode(const char *inputbuff, size_t insize, |
| - | char **outptr, size_t *outlen) |
| + | CURLcode curlx_base64_encode(const char *inputbuff, size_t insize, |
| + | char **outptr, size_t *outlen) |
| { | |
| return base64_encode(base64encdec, inputbuff, insize, outptr, outlen); | |
| } | |
| /* | |
| - | * Curl_base64url_encode() |
| + | * curlx_base64url_encode() |
| * | |
| * Given a pointer to an input buffer and an input size, encode it and | |
| * return a pointer in *outptr to a newly allocated memory area holding | |
| @@ -284,8 +284,8 @@ CURLcode Curl_base64_encode(const char *inputbuff, size_t insize, | |
| * | |
| * @unittest: 1302 | |
| */ | |
| - | CURLcode Curl_base64url_encode(const char *inputbuff, size_t insize, |
| - | char **outptr, size_t *outlen) |
| + | CURLcode curlx_base64url_encode(const char *inputbuff, size_t insize, |
| + | char **outptr, size_t *outlen) |
| { | |
| return base64_encode(base64url, inputbuff, insize, outptr, outlen); | |
| } | |
| @@ -24,18 +24,10 @@ | |
| * | |
| ***************************************************************************/ | |
| - | #ifndef BUILDING_LIBCURL |
| - | /* this renames functions so that the tool code can use the same code |
| - | without getting symbol collisions */ |
| - | #define Curl_base64_encode(a,b,c,d) curlx_base64_encode(a,b,c,d) |
| - | #define Curl_base64url_encode(a,b,c,d) curlx_base64url_encode(a,b,c,d) |
| - | #define Curl_base64_decode(a,b,c) curlx_base64_decode(a,b,c) |
| - | #endif |
| - | |
| - | CURLcode Curl_base64_encode(const char *inputbuff, size_t insize, |
| - | char **outptr, size_t *outlen); |
| - | CURLcode Curl_base64url_encode(const char *inputbuff, size_t insize, |
| - | char **outptr, size_t *outlen); |
| - | CURLcode Curl_base64_decode(const char *src, |
| - | unsigned char **outptr, size_t *outlen); |
| + | CURLcode curlx_base64_encode(const char *inputbuff, size_t insize, |
| + | char **outptr, size_t *outlen); |
| + | CURLcode curlx_base64url_encode(const char *inputbuff, size_t insize, |
| + | char **outptr, size_t *outlen); |
| + | CURLcode curlx_base64_decode(const char *src, |
| + | unsigned char **outptr, size_t *outlen); |
| #endif /* HEADER_CURL_BASE64_H */ | |
| @@ -31,13 +31,7 @@ | |
| * be. | |
| */ | |
| - | /* map standard printf functions to curl implementations */ |
| - | #include "curl_printf.h" |
| - | |
| - | #include "strcase.h" |
| - | /* "strcase.h" provides the strcasecompare protos */ |
| - | |
| - | #include "nonblock.h" |
| + | #include "../nonblock.h" |
| /* "nonblock.h" provides curlx_nonblock() */ | |
| #include "warnless.h" | |
| @@ -48,7 +42,7 @@ | |
| curlx_uztosi() | |
| */ | |
| - | #include "curl_multibyte.h" |
| + | #include "../curl_multibyte.h" |
| /* "curl_multibyte.h" provides these functions and macros: | |
| curlx_convert_UTF8_to_wchar() | |
| @@ -58,12 +52,21 @@ | |
| curlx_unicodefree() | |
| */ | |
| - | #include "version_win32.h" |
| + | #include "../version_win32.h" |
| /* "version_win32.h" provides curlx_verify_windows_version() */ | |
| #include "strparse.h" | |
| /* The curlx_str_* parsing functions */ | |
| + | #include "dynbuf.h" |
| + | /* The curlx_dyn_* functions */ |
| + | |
| + | #include "base64.h" |
| + | #include "timeval.h" |
| + | #include "timediff.h" |
| + | |
| + | #include "../curl_get_line.h" |
| + | |
| #define curlx_safefree(x) Curl_safefree(x) | |
| #endif /* HEADER_CURL_CURLX_H */ | |
| @@ -22,13 +22,13 @@ | |
| * | |
| ***************************************************************************/ | |
| - | #include "curl_setup.h" |
| + | #include "../curl_setup.h" |
| #include "dynbuf.h" | |
| - | #include "curl_printf.h" |
| + | #include "../curl_printf.h" |
| #ifdef BUILDING_LIBCURL | |
| - | #include "curl_memory.h" |
| + | #include "../curl_memory.h" |
| #endif | |
| - | #include "memdebug.h" |
| + | #include "../memdebug.h" |
| #define MIN_FIRST_ALLOC 32 | |
| @@ -39,7 +39,7 @@ | |
| /* | |
| * Init a dynbuf struct. | |
| */ | |
| - | void Curl_dyn_init(struct dynbuf *s, size_t toobig) |
| + | void curlx_dyn_init(struct dynbuf *s, size_t toobig) |
| { | |
| DEBUGASSERT(s); | |
| DEBUGASSERT(toobig); | |
| @@ -57,7 +57,7 @@ void Curl_dyn_init(struct dynbuf *s, size_t toobig) | |
| * free the buffer and re-init the necessary fields. It does not touch the | |
| * 'init' field and thus this buffer can be reused to add data to again. | |
| */ | |
| - | void Curl_dyn_free(struct dynbuf *s) |
| + | void curlx_dyn_free(struct dynbuf *s) |
| { | |
| DEBUGASSERT(s); | |
| DEBUGASSERT(s->init == DYNINIT); | |
| @@ -84,7 +84,7 @@ static CURLcode dyn_nappend(struct dynbuf *s, | |
| DEBUGASSERT(!len || mem); | |
| if(fit > s->toobig) { | |
| - | Curl_dyn_free(s); |
| + | curlx_dyn_free(s); |
| return CURLE_TOO_LARGE; | |
| } | |
| else if(!a) { | |
| @@ -110,7 +110,7 @@ static CURLcode dyn_nappend(struct dynbuf *s, | |
| include that as well when it uses this code */ | |
| void *p = realloc(s->bufr, a); | |
| if(!p) { | |
| - | Curl_dyn_free(s); |
| + | curlx_dyn_free(s); |
| return CURLE_OUT_OF_MEMORY; | |
| } | |
| s->bufr = p; | |
| @@ -128,7 +128,7 @@ static CURLcode dyn_nappend(struct dynbuf *s, | |
| * Clears the string, keeps the allocation. This can also be called on a | |
| * buffer that already was freed. | |
| */ | |
| - | void Curl_dyn_reset(struct dynbuf *s) |
| + | void curlx_dyn_reset(struct dynbuf *s) |
| { | |
| DEBUGASSERT(s); | |
| DEBUGASSERT(s->init == DYNINIT); | |
| @@ -142,7 +142,7 @@ void Curl_dyn_reset(struct dynbuf *s) | |
| * Specify the size of the tail to keep (number of bytes from the end of the | |
| * buffer). The rest will be dropped. | |
| */ | |
| - | CURLcode Curl_dyn_tail(struct dynbuf *s, size_t trail) |
| + | CURLcode curlx_dyn_tail(struct dynbuf *s, size_t trail) |
| { | |
| DEBUGASSERT(s); | |
| DEBUGASSERT(s->init == DYNINIT); | |
| @@ -152,7 +152,7 @@ CURLcode Curl_dyn_tail(struct dynbuf *s, size_t trail) | |
| else if(trail == s->leng) | |
| return CURLE_OK; | |
| else if(!trail) { | |
| - | Curl_dyn_reset(s); |
| + | curlx_dyn_reset(s); |
| } | |
| else { | |
| memmove(&s->bufr[0], &s->bufr[s->leng - trail], trail); | |
| @@ -166,7 +166,7 @@ CURLcode Curl_dyn_tail(struct dynbuf *s, size_t trail) | |
| /* | |
| * Appends a buffer with length. | |
| */ | |
| - | CURLcode Curl_dyn_addn(struct dynbuf *s, const void *mem, size_t len) |
| + | CURLcode curlx_dyn_addn(struct dynbuf *s, const void *mem, size_t len) |
| { | |
| DEBUGASSERT(s); | |
| DEBUGASSERT(s->init == DYNINIT); | |
| @@ -177,7 +177,7 @@ CURLcode Curl_dyn_addn(struct dynbuf *s, const void *mem, size_t len) | |
| /* | |
| * Append a null-terminated string at the end. | |
| */ | |
| - | CURLcode Curl_dyn_add(struct dynbuf *s, const char *str) |
| + | CURLcode curlx_dyn_add(struct dynbuf *s, const char *str) |
| { | |
| size_t n; | |
| DEBUGASSERT(str); | |
| @@ -191,7 +191,7 @@ CURLcode Curl_dyn_add(struct dynbuf *s, const char *str) | |
| /* | |
| * Append a string vprintf()-style | |
| */ | |
| - | CURLcode Curl_dyn_vaddf(struct dynbuf *s, const char *fmt, va_list ap) |
| + | CURLcode curlx_dyn_vaddf(struct dynbuf *s, const char *fmt, va_list ap) |
| { | |
| #ifdef BUILDING_LIBCURL | |
| int rc; | |
| @@ -199,7 +199,7 @@ CURLcode Curl_dyn_vaddf(struct dynbuf *s, const char *fmt, va_list ap) | |
| DEBUGASSERT(s->init == DYNINIT); | |
| DEBUGASSERT(!s->leng || s->bufr); | |
| DEBUGASSERT(fmt); | |
| - | rc = Curl_dyn_vprintf(s, fmt, ap); |
| + | rc = curlx_dyn_vprintf(s, fmt, ap); |
| if(!rc) | |
| return CURLE_OK; | |
| @@ -208,7 +208,7 @@ CURLcode Curl_dyn_vaddf(struct dynbuf *s, const char *fmt, va_list ap) | |
| return CURLE_OUT_OF_MEMORY; | |
| #else | |
| char *str; | |
| - | str = vaprintf(fmt, ap); /* this allocs a new string to append */ |
| + | str = curl_mvaprintf(fmt, ap); /* this allocs a new string to append */ |
| if(str) { | |
| CURLcode result = dyn_nappend(s, (const unsigned char *)str, strlen(str)); | |
| @@ -216,7 +216,7 @@ CURLcode Curl_dyn_vaddf(struct dynbuf *s, const char *fmt, va_list ap) | |
| return result; | |
| } | |
| /* If we failed, we cleanup the whole buffer and return error */ | |
| - | Curl_dyn_free(s); |
| + | curlx_dyn_free(s); |
| return CURLE_OUT_OF_MEMORY; | |
| #endif | |
| } | |
| @@ -224,7 +224,7 @@ CURLcode Curl_dyn_vaddf(struct dynbuf *s, const char *fmt, va_list ap) | |
| /* | |
| * Append a string printf()-style | |
| */ | |
| - | CURLcode Curl_dyn_addf(struct dynbuf *s, const char *fmt, ...) |
| + | CURLcode curlx_dyn_addf(struct dynbuf *s, const char *fmt, ...) |
| { | |
| CURLcode result; | |
| va_list ap; | |
| @@ -232,7 +232,7 @@ CURLcode Curl_dyn_addf(struct dynbuf *s, const char *fmt, ...) | |
| DEBUGASSERT(s->init == DYNINIT); | |
| DEBUGASSERT(!s->leng || s->bufr); | |
| va_start(ap, fmt); | |
| - | result = Curl_dyn_vaddf(s, fmt, ap); |
| + | result = curlx_dyn_vaddf(s, fmt, ap); |
| va_end(ap); | |
| return result; | |
| } | |
| @@ -240,7 +240,7 @@ CURLcode Curl_dyn_addf(struct dynbuf *s, const char *fmt, ...) | |
| /* | |
| * Returns a pointer to the buffer. | |
| */ | |
| - | char *Curl_dyn_ptr(const struct dynbuf *s) |
| + | char *curlx_dyn_ptr(const struct dynbuf *s) |
| { | |
| DEBUGASSERT(s); | |
| DEBUGASSERT(s->init == DYNINIT); | |
| @@ -248,7 +248,7 @@ char *Curl_dyn_ptr(const struct dynbuf *s) | |
| return s->bufr; | |
| } | |
| - | char *Curl_dyn_take(struct dynbuf *s, size_t *plen) |
| + | char *curlx_dyn_take(struct dynbuf *s, size_t *plen) |
| { | |
| char *ptr = s->bufr; | |
| DEBUGASSERT(s); | |
| @@ -263,7 +263,7 @@ char *Curl_dyn_take(struct dynbuf *s, size_t *plen) | |
| /* | |
| * Returns an unsigned pointer to the buffer. | |
| */ | |
| - | unsigned char *Curl_dyn_uptr(const struct dynbuf *s) |
| + | unsigned char *curlx_dyn_uptr(const struct dynbuf *s) |
| { | |
| DEBUGASSERT(s); | |
| DEBUGASSERT(s->init == DYNINIT); | |
| @@ -274,7 +274,7 @@ unsigned char *Curl_dyn_uptr(const struct dynbuf *s) | |
| /* | |
| * Returns the length of the buffer. | |
| */ | |
| - | size_t Curl_dyn_len(const struct dynbuf *s) |
| + | size_t curlx_dyn_len(const struct dynbuf *s) |
| { | |
| DEBUGASSERT(s); | |
| DEBUGASSERT(s->init == DYNINIT); | |
| @@ -285,7 +285,7 @@ size_t Curl_dyn_len(const struct dynbuf *s) | |
| /* | |
| * Set a new (smaller) length. | |
| */ | |
| - | CURLcode Curl_dyn_setlen(struct dynbuf *s, size_t set) |
| + | CURLcode curlx_dyn_setlen(struct dynbuf *s, size_t set) |
| { | |
| DEBUGASSERT(s); | |
| DEBUGASSERT(s->init == DYNINIT); | |
| @@ -26,25 +26,6 @@ | |
| #include <curl/curl.h> | |
| - | #ifndef BUILDING_LIBCURL |
| - | /* this renames the functions so that the tool code can use the same code |
| - | without getting symbol collisions */ |
| - | #define Curl_dyn_init(a,b) curlx_dyn_init(a,b) |
| - | #define Curl_dyn_add(a,b) curlx_dyn_add(a,b) |
| - | #define Curl_dyn_addn(a,b,c) curlx_dyn_addn(a,b,c) |
| - | #define Curl_dyn_addf curlx_dyn_addf |
| - | #define Curl_dyn_vaddf curlx_dyn_vaddf |
| - | #define Curl_dyn_free(a) curlx_dyn_free(a) |
| - | #define Curl_dyn_ptr(a) curlx_dyn_ptr(a) |
| - | #define Curl_dyn_uptr(a) curlx_dyn_uptr(a) |
| - | #define Curl_dyn_len(a) curlx_dyn_len(a) |
| - | #define Curl_dyn_reset(a) curlx_dyn_reset(a) |
| - | #define Curl_dyn_take(a,b) curlx_dyn_take(a,b) |
| - | #define Curl_dyn_tail(a,b) curlx_dyn_tail(a,b) |
| - | #define Curl_dyn_setlen(a,b) curlx_dyn_setlen(a,b) |
| - | #define curlx_dynbuf dynbuf /* for the struct name */ |
| - | #endif |
| - | |
| struct dynbuf { | |
| char *bufr; /* point to a null-terminated allocated buffer */ | |
| size_t leng; /* number of bytes *EXCLUDING* the null-terminator */ | |
| @@ -55,30 +36,30 @@ struct dynbuf { | |
| #endif | |
| }; | |
| - | void Curl_dyn_init(struct dynbuf *s, size_t toobig); |
| - | void Curl_dyn_free(struct dynbuf *s); |
| - | CURLcode Curl_dyn_addn(struct dynbuf *s, const void *mem, size_t len) |
| + | void curlx_dyn_init(struct dynbuf *s, size_t toobig); |
| + | void curlx_dyn_free(struct dynbuf *s); |
| + | CURLcode curlx_dyn_addn(struct dynbuf *s, const void *mem, size_t len) |
| WARN_UNUSED_RESULT; | |
| - | CURLcode Curl_dyn_add(struct dynbuf *s, const char *str) |
| + | CURLcode curlx_dyn_add(struct dynbuf *s, const char *str) |
| WARN_UNUSED_RESULT; | |
| - | CURLcode Curl_dyn_addf(struct dynbuf *s, const char *fmt, ...) |
| + | CURLcode curlx_dyn_addf(struct dynbuf *s, const char *fmt, ...) |
| WARN_UNUSED_RESULT CURL_PRINTF(2, 3); | |
| - | CURLcode Curl_dyn_vaddf(struct dynbuf *s, const char *fmt, va_list ap) |
| + | CURLcode curlx_dyn_vaddf(struct dynbuf *s, const char *fmt, va_list ap) |
| WARN_UNUSED_RESULT CURL_PRINTF(2, 0); | |
| - | void Curl_dyn_reset(struct dynbuf *s); |
| - | CURLcode Curl_dyn_tail(struct dynbuf *s, size_t trail); |
| - | CURLcode Curl_dyn_setlen(struct dynbuf *s, size_t set); |
| - | char *Curl_dyn_ptr(const struct dynbuf *s); |
| - | unsigned char *Curl_dyn_uptr(const struct dynbuf *s); |
| - | size_t Curl_dyn_len(const struct dynbuf *s); |
| + | void curlx_dyn_reset(struct dynbuf *s); |
| + | CURLcode curlx_dyn_tail(struct dynbuf *s, size_t trail); |
| + | CURLcode curlx_dyn_setlen(struct dynbuf *s, size_t set); |
| + | char *curlx_dyn_ptr(const struct dynbuf *s); |
| + | unsigned char *curlx_dyn_uptr(const struct dynbuf *s); |
| + | size_t curlx_dyn_len(const struct dynbuf *s); |
| /* returns 0 on success, -1 on error */ | |
| /* The implementation of this function exists in mprintf.c */ | |
| - | int Curl_dyn_vprintf(struct dynbuf *dyn, const char *format, va_list ap_save); |
| + | int curlx_dyn_vprintf(struct dynbuf *dyn, const char *format, va_list ap_save); |
| /* Take the buffer out of the dynbuf. Caller has ownership and | |
| * dynbuf resets to initial state. */ | |
| - | char *Curl_dyn_take(struct dynbuf *s, size_t *plen); |
| + | char *curlx_dyn_take(struct dynbuf *s, size_t *plen); |
| /* Dynamic buffer max sizes */ | |
| #define MAX_DYNBUF_SIZE (SIZE_T_MAX/2) | |
| @@ -23,15 +23,15 @@ | |
| ***************************************************************************/ | |
| #include "strparse.h" | |
| - | #include "strcase.h" |
| + | #include "../strcase.h" |
| - | void Curl_str_init(struct Curl_str *out) |
| + | void curlx_str_init(struct Curl_str *out) |
| { | |
| out->str = NULL; | |
| out->len = 0; | |
| } | |
| - | void Curl_str_assign(struct Curl_str *out, const char *str, size_t len) |
| + | void curlx_str_assign(struct Curl_str *out, const char *str, size_t len) |
| { | |
| out->str = str; | |
| out->len = len; | |
| @@ -39,14 +39,14 @@ void Curl_str_assign(struct Curl_str *out, const char *str, size_t len) | |
| /* Get a word until the first DELIM or end of string. At least one byte long. | |
| return non-zero on error */ | |
| - | int Curl_str_until(const char **linep, struct Curl_str *out, |
| + | int curlx_str_until(const char **linep, struct Curl_str *out, |
| const size_t max, char delim) | |
| { | |
| const char *s = *linep; | |
| size_t len = 0; | |
| DEBUGASSERT(linep && *linep && out && max && delim); | |
| - | Curl_str_init(out); |
| + | curlx_str_init(out); |
| while(*s && (*s != delim)) { | |
| s++; | |
| if(++len > max) { | |
| @@ -63,22 +63,22 @@ int Curl_str_until(const char **linep, struct Curl_str *out, | |
| /* Get a word until the first space or end of string. At least one byte long. | |
| return non-zero on error */ | |
| - | int Curl_str_word(const char **linep, struct Curl_str *out, |
| + | int curlx_str_word(const char **linep, struct Curl_str *out, |
| const size_t max) | |
| { | |
| - | return Curl_str_until(linep, out, max, ' '); |
| + | return curlx_str_until(linep, out, max, ' '); |
| } | |
| /* Get a word until a newline byte or end of string. At least one byte long. | |
| return non-zero on error */ | |
| - | int Curl_str_untilnl(const char **linep, struct Curl_str *out, |
| + | int curlx_str_untilnl(const char **linep, struct Curl_str *out, |
| const size_t max) | |
| { | |
| const char *s = *linep; | |
| size_t len = 0; | |
| DEBUGASSERT(linep && *linep && out && max); | |
| - | Curl_str_init(out); |
| + | curlx_str_init(out); |
| while(*s && !ISNEWLINE(*s)) { | |
| s++; | |
| if(++len > max) | |
| @@ -95,14 +95,14 @@ int Curl_str_untilnl(const char **linep, struct Curl_str *out, | |
| /* Get a "quoted" word. No escaping possible. | |
| return non-zero on error */ | |
| - | int Curl_str_quotedword(const char **linep, struct Curl_str *out, |
| + | int curlx_str_quotedword(const char **linep, struct Curl_str *out, |
| const size_t max) | |
| { | |
| const char *s = *linep; | |
| size_t len = 0; | |
| DEBUGASSERT(linep && *linep && out && max); | |
| - | Curl_str_init(out); |
| + | curlx_str_init(out); |
| if(*s != '\"') | |
| return STRE_BEGQUOTE; | |
| s++; | |
| @@ -121,7 +121,7 @@ int Curl_str_quotedword(const char **linep, struct Curl_str *out, | |
| /* Advance over a single character. | |
| return non-zero on error */ | |
| - | int Curl_str_single(const char **linep, char byte) |
| + | int curlx_str_single(const char **linep, char byte) |
| { | |
| DEBUGASSERT(linep && *linep); | |
| if(**linep != byte) | |
| @@ -132,9 +132,9 @@ int Curl_str_single(const char **linep, char byte) | |
| /* Advance over a single space. | |
| return non-zero on error */ | |
| - | int Curl_str_singlespace(const char **linep) |
| + | int curlx_str_singlespace(const char **linep) |
| { | |
| - | return Curl_str_single(linep, ' '); |
| + | return curlx_str_single(linep, ' '); |
| } | |
| /* given an ASCII character and max ascii, return TRUE if valid */ | |
| @@ -191,21 +191,21 @@ static int str_num_base(const char **linep, curl_off_t *nump, curl_off_t max, | |
| /* Get an unsigned decimal number with no leading space or minus. Leading | |
| zeroes are accepted. return non-zero on error */ | |
| - | int Curl_str_number(const char **linep, curl_off_t *nump, curl_off_t max) |
| + | int curlx_str_number(const char **linep, curl_off_t *nump, curl_off_t max) |
| { | |
| return str_num_base(linep, nump, max, 10); | |
| } | |
| /* Get an unsigned hexadecimal number with no leading space or minus and no | |
| "0x" support. Leading zeroes are accepted. return non-zero on error */ | |
| - | int Curl_str_hex(const char **linep, curl_off_t *nump, curl_off_t max) |
| + | int curlx_str_hex(const char **linep, curl_off_t *nump, curl_off_t max) |
| { | |
| return str_num_base(linep, nump, max, 16); | |
| } | |
| /* Get an unsigned octal number with no leading space or minus and no "0" | |
| prefix support. Leading zeroes are accepted. return non-zero on error */ | |
| - | int Curl_str_octal(const char **linep, curl_off_t *nump, curl_off_t max) |
| + | int curlx_str_octal(const char **linep, curl_off_t *nump, curl_off_t max) |
| { | |
| return str_num_base(linep, nump, max, 8); | |
| } | |
| @@ -214,15 +214,15 @@ int Curl_str_octal(const char **linep, curl_off_t *nump, curl_off_t max) | |
| * Parse a positive number up to 63-bit number written in ASCII. Skip leading | |
| * blanks. No support for prefixes. | |
| */ | |
| - | int Curl_str_numblanks(const char **str, curl_off_t *num) |
| + | int curlx_str_numblanks(const char **str, curl_off_t *num) |
| { | |
| - | Curl_str_passblanks(str); |
| - | return Curl_str_number(str, num, CURL_OFF_T_MAX); |
| + | curlx_str_passblanks(str); |
| + | return curlx_str_number(str, num, CURL_OFF_T_MAX); |
| } | |
| /* CR or LF | |
| return non-zero on error */ | |
| - | int Curl_str_newline(const char **linep) |
| + | int curlx_str_newline(const char **linep) |
| { | |
| DEBUGASSERT(linep && *linep); | |
| if(ISNEWLINE(**linep)) { | |
| @@ -234,14 +234,14 @@ int Curl_str_newline(const char **linep) | |
| /* case insensitive compare that the parsed string matches the | |
| given string. Returns non-zero on match. */ | |
| - | int Curl_str_casecompare(struct Curl_str *str, const char *check) |
| + | int curlx_str_casecompare(struct Curl_str *str, const char *check) |
| { | |
| size_t clen = check ? strlen(check) : 0; | |
| return ((str->len == clen) && strncasecompare(str->str, check, clen)); | |
| } | |
| /* case sensitive string compare. Returns non-zero on match. */ | |
| - | int Curl_str_cmp(struct Curl_str *str, const char *check) |
| + | int curlx_str_cmp(struct Curl_str *str, const char *check) |
| { | |
| if(check) { | |
| size_t clen = strlen(check); | |
| @@ -252,7 +252,7 @@ int Curl_str_cmp(struct Curl_str *str, const char *check) | |
| /* Trim off 'num' number of bytes from the beginning (left side) of the | |
| string. If 'num' is larger than the string, return error. */ | |
| - | int Curl_str_nudge(struct Curl_str *str, size_t num) |
| + | int curlx_str_nudge(struct Curl_str *str, size_t num) |
| { | |
| if(num <= str->len) { | |
| str->str += num; | |
| @@ -264,7 +264,8 @@ int Curl_str_nudge(struct Curl_str *str, size_t num) | |
| /* Get the following character sequence that consists only of bytes not | |
| present in the 'reject' string. Like strcspn(). */ | |
| - | int Curl_str_cspn(const char **linep, struct Curl_str *out, const char *reject) |
| + | int curlx_str_cspn(const char **linep, struct Curl_str *out, |
| + | const char *reject) |
| { | |
| const char *s = *linep; | |
| size_t len; | |
| @@ -277,15 +278,15 @@ int Curl_str_cspn(const char **linep, struct Curl_str *out, const char *reject) | |
| *linep = &s[len]; | |
| return STRE_OK; | |
| } | |
| - | Curl_str_init(out); |
| + | curlx_str_init(out); |
| return STRE_SHORT; | |
| } | |
| /* remove ISBLANK()s from both ends of the string */ | |
| - | void Curl_str_trimblanks(struct Curl_str *out) |
| + | void curlx_str_trimblanks(struct Curl_str *out) |
| { | |
| while(out->len && ISBLANK(*out->str)) | |
| - | Curl_str_nudge(out, 1); |
| + | curlx_str_nudge(out, 1); |
| /* trim trailing spaces and tabs */ | |
| while(out->len && ISBLANK(out->str[out->len - 1])) | |
| @@ -293,7 +294,7 @@ void Curl_str_trimblanks(struct Curl_str *out) | |
| } | |
| /* increase the pointer until it has moved over all blanks */ | |
| - | void Curl_str_passblanks(const char **linep) |
| + | void curlx_str_passblanks(const char **linep) |
| { | |
| while(ISBLANK(**linep)) | |
| (*linep)++; /* move over it */ | |
| @@ -23,7 +23,7 @@ | |
| * SPDX-License-Identifier: curl | |
| * | |
| ***************************************************************************/ | |
| - | #include "curl_setup.h" |
| + | #include "../curl_setup.h" |
| #define STRE_OK 0 | |
| #define STRE_BIG 1 | |
| @@ -42,65 +42,65 @@ struct Curl_str { | |
| size_t len; | |
| }; | |
| - | void Curl_str_init(struct Curl_str *out); |
| - | void Curl_str_assign(struct Curl_str *out, const char *str, size_t len); |
| + | void curlx_str_init(struct Curl_str *out); |
| + | void curlx_str_assign(struct Curl_str *out, const char *str, size_t len); |
| - | #define Curl_str(x) ((x)->str) |
| - | #define Curl_strlen(x) ((x)->len) |
| + | #define curlx_str(x) ((x)->str) |
| + | #define curlx_strlen(x) ((x)->len) |
| /* Get a word until the first space | |
| return non-zero on error */ | |
| - | int Curl_str_word(const char **linep, struct Curl_str *out, const size_t max); |
| + | int curlx_str_word(const char **linep, struct Curl_str *out, const size_t max); |
| /* Get a word until the first DELIM or end of string | |
| return non-zero on error */ | |
| - | int Curl_str_until(const char **linep, struct Curl_str *out, const size_t max, |
| + | int curlx_str_until(const char **linep, struct Curl_str *out, const size_t max, |
| char delim); | |
| /* Get a word until a newline byte or end of string. At least one byte long. | |
| return non-zero on error */ | |
| - | int Curl_str_untilnl(const char **linep, struct Curl_str *out, |
| + | int curlx_str_untilnl(const char **linep, struct Curl_str *out, |
| const size_t max); | |
| /* Get a "quoted" word. No escaping possible. | |
| return non-zero on error */ | |
| - | int Curl_str_quotedword(const char **linep, struct Curl_str *out, |
| + | int curlx_str_quotedword(const char **linep, struct Curl_str *out, |
| const size_t max); | |
| /* Advance over a single character. | |
| return non-zero on error */ | |
| - | int Curl_str_single(const char **linep, char byte); |
| + | int curlx_str_single(const char **linep, char byte); |
| /* Advance over a single space. | |
| return non-zero on error */ | |
| - | int Curl_str_singlespace(const char **linep); |
| + | int curlx_str_singlespace(const char **linep); |
| /* Get an unsigned decimal number. Return non-zero on error */ | |
| - | int Curl_str_number(const char **linep, curl_off_t *nump, curl_off_t max); |
| + | int curlx_str_number(const char **linep, curl_off_t *nump, curl_off_t max); |
| /* As above with CURL_OFF_T_MAX but also pass leading blanks */ | |
| - | int Curl_str_numblanks(const char **str, curl_off_t *num); |
| + | int curlx_str_numblanks(const char **str, curl_off_t *num); |
| /* Get an unsigned hexadecimal number. Return non-zero on error */ | |
| - | int Curl_str_hex(const char **linep, curl_off_t *nump, curl_off_t max); |
| + | int curlx_str_hex(const char **linep, curl_off_t *nump, curl_off_t max); |
| /* Get an unsigned octal number. Return non-zero on error */ | |
| - | int Curl_str_octal(const char **linep, curl_off_t *nump, curl_off_t max); |
| + | int curlx_str_octal(const char **linep, curl_off_t *nump, curl_off_t max); |
| /* Check for CR or LF | |
| return non-zero on error */ | |
| - | int Curl_str_newline(const char **linep); |
| + | int curlx_str_newline(const char **linep); |
| /* case insensitive compare that the parsed string matches the | |
| given string. */ | |
| - | int Curl_str_casecompare(struct Curl_str *str, const char *check); |
| - | int Curl_str_cmp(struct Curl_str *str, const char *check); |
| + | int curlx_str_casecompare(struct Curl_str *str, const char *check); |
| + | int curlx_str_cmp(struct Curl_str *str, const char *check); |
| - | int Curl_str_nudge(struct Curl_str *str, size_t num); |
| + | int curlx_str_nudge(struct Curl_str *str, size_t num); |
| - | int Curl_str_cspn(const char **linep, struct Curl_str *out, const char *cspn); |
| - | void Curl_str_trimblanks(struct Curl_str *out); |
| - | void Curl_str_passblanks(const char **linep); |
| + | int curlx_str_cspn(const char **linep, struct Curl_str *out, const char *cspn); |
| + | void curlx_str_trimblanks(struct Curl_str *out); |
| + | void curlx_str_passblanks(const char **linep); |
| /* given a hexadecimal letter, return the binary value. '0' returns 0, 'a' | |
| returns 10. THIS ONLY WORKS ON VALID HEXADECIMAL LETTER INPUT. Verify | |
| @@ -109,10 +109,4 @@ void Curl_str_passblanks(const char **linep); | |
| extern const unsigned char Curl_hexasciitable[]; | |
| #define Curl_hexval(x) (unsigned char)(Curl_hexasciitable[(x) - '0'] & 0x0f) | |
| - | #define curlx_str_number(x,y,z) Curl_str_number(x,y,z) |
| - | #define curlx_str_octal(x,y,z) Curl_str_octal(x,y,z) |
| - | #define curlx_str_single(x,y) Curl_str_single(x,y) |
| - | #define curlx_str_passblanks(x) Curl_str_passblanks(x) |
| - | #define curlx_str_numblanks(x,y) Curl_str_numblanks(x,y) |
| - | |
| #endif /* HEADER_CURL_STRPARSE_H */ | |
| @@ -24,7 +24,7 @@ | |
| * | |
| ***************************************************************************/ | |
| - | #include "curl_setup.h" |
| + | #include "../curl_setup.h" |
| /* Use a larger type even for 32-bit time_t systems so that we can keep | |
| microsecond accuracy in it */ | |
| @@ -27,45 +27,35 @@ | |
| #ifdef _WIN32 | |
| #include <curl/curl.h> | |
| - | #ifdef BUILDING_LIBCURL |
| - | #include "system_win32.h" |
| - | #else |
| - | #include "version_win32.h" |
| + | #include "../version_win32.h" |
| + | #include "../system_win32.h" |
| - | static LARGE_INTEGER s_freq; |
| - | static bool s_isVistaOrGreater; |
| + | LARGE_INTEGER Curl_freq; |
| + | bool Curl_isVistaOrGreater; |
| - | /* For tool or tests, we must initialize before calling Curl_now() */ |
| + | /* For tool or tests, we must initialize before calling curlx_now(). |
| + | Providing this function here is wrong. */ |
| void curlx_now_init(void) | |
| { | |
| if(curlx_verify_windows_version(6, 0, 0, PLATFORM_WINNT, | |
| VERSION_GREATER_THAN_EQUAL)) | |
| - | s_isVistaOrGreater = true; |
| + | Curl_isVistaOrGreater = true; |
| else | |
| - | s_isVistaOrGreater = false; |
| + | Curl_isVistaOrGreater = false; |
| - | QueryPerformanceFrequency(&s_freq); |
| + | QueryPerformanceFrequency(&Curl_freq); |
| } | |
| - | #endif |
| /* In case of bug fix this function has a counterpart in tool_util.c */ | |
| - | struct curltime Curl_now(void) |
| + | struct curltime curlx_now(void) |
| { | |
| struct curltime now; | |
| bool isVistaOrGreater; | |
| - | #ifdef BUILDING_LIBCURL |
| isVistaOrGreater = Curl_isVistaOrGreater; | |
| - | #else |
| - | isVistaOrGreater = s_isVistaOrGreater; |
| - | #endif |
| if(isVistaOrGreater) { /* QPC timer might have issues pre-Vista */ | |
| LARGE_INTEGER count; | |
| LARGE_INTEGER freq; | |
| - | #ifdef BUILDING_LIBCURL |
| freq = Curl_freq; | |
| - | #else |
| - | freq = s_freq; |
| - | #endif |
| DEBUGASSERT(freq.QuadPart); | |
| QueryPerformanceCounter(&count); | |
| now.tv_sec = (time_t)(count.QuadPart / freq.QuadPart); | |
| @@ -92,7 +82,7 @@ struct curltime Curl_now(void) | |
| #elif defined(HAVE_CLOCK_GETTIME_MONOTONIC) || \ | |
| defined(HAVE_CLOCK_GETTIME_MONOTONIC_RAW) | |
| - | struct curltime Curl_now(void) |
| + | struct curltime curlx_now(void) |
| { | |
| /* | |
| ** clock_gettime() is granted to be increased monotonically when the | |
| @@ -166,7 +156,7 @@ struct curltime Curl_now(void) | |
| #include <stdint.h> | |
| #include <mach/mach_time.h> | |
| - | struct curltime Curl_now(void) |
| + | struct curltime curlx_now(void) |
| { | |
| /* | |
| ** Monotonic timer on macOS is provided by mach_absolute_time(), which | |
| @@ -194,7 +184,7 @@ struct curltime Curl_now(void) | |
| #elif defined(HAVE_GETTIMEOFDAY) | |
| - | struct curltime Curl_now(void) |
| + | struct curltime curlx_now(void) |
| { | |
| /* | |
| ** gettimeofday() is not granted to be increased monotonically, due to | |
| @@ -211,7 +201,7 @@ struct curltime Curl_now(void) | |
| #else | |
| - | struct curltime Curl_now(void) |
| + | struct curltime curlx_now(void) |
| { | |
| /* | |
| ** time() returns the value of time in seconds since the Epoch. | |
| @@ -230,7 +220,7 @@ struct curltime Curl_now(void) | |
| * | |
| * @unittest: 1323 | |
| */ | |
| - | timediff_t Curl_timediff(struct curltime newer, struct curltime older) |
| + | timediff_t curlx_timediff(struct curltime newer, struct curltime older) |
| { | |
| timediff_t diff = (timediff_t)newer.tv_sec-older.tv_sec; | |
| if(diff >= (TIMEDIFF_T_MAX/1000)) | |
| @@ -244,7 +234,7 @@ timediff_t Curl_timediff(struct curltime newer, struct curltime older) | |
| * Returns: time difference in number of milliseconds, rounded up. | |
| * For too large diffs it returns max value. | |
| */ | |
| - | timediff_t Curl_timediff_ceil(struct curltime newer, struct curltime older) |
| + | timediff_t curlx_timediff_ceil(struct curltime newer, struct curltime older) |
| { | |
| timediff_t diff = (timediff_t)newer.tv_sec-older.tv_sec; | |
| if(diff >= (TIMEDIFF_T_MAX/1000)) | |
| @@ -258,7 +248,7 @@ timediff_t Curl_timediff_ceil(struct curltime newer, struct curltime older) | |
| * Returns: time difference in number of microseconds. For too large diffs it | |
| * returns max value. | |
| */ | |
| - | timediff_t Curl_timediff_us(struct curltime newer, struct curltime older) |
| + | timediff_t curlx_timediff_us(struct curltime newer, struct curltime older) |
| { | |
| timediff_t diff = (timediff_t)newer.tv_sec-older.tv_sec; | |
| if(diff >= (TIMEDIFF_T_MAX/1000000)) | |
| @@ -24,28 +24,21 @@ | |
| * | |
| ***************************************************************************/ | |
| - | #include "curl_setup.h" |
| + | #include "../curl_setup.h" |
| #include "timediff.h" | |
| - | #ifndef BUILDING_LIBCURL |
| - | /* this renames the functions so that the tool code can use the same code |
| - | without getting symbol collisions */ |
| - | #define Curl_now curlx_now |
| - | #define Curl_timediff(a,b) curlx_timediff(a,b) |
| - | #define Curl_timediff_ceil(a,b) curlx_timediff_ceil(a,b) |
| - | #define Curl_timediff_us(a,b) curlx_timediff_us(a,b) |
| - | |
| - | /* For tool or tests, we must initialize before calling Curl_now() */ |
| - | void curlx_now_init(void); |
| - | #endif |
| - | |
| struct curltime { | |
| time_t tv_sec; /* seconds */ | |
| int tv_usec; /* microseconds */ | |
| }; | |
| - | struct curltime Curl_now(void); |
| + | #ifdef _WIN32 |
| + | /* For tool or tests, we must initialize before calling curlx_now() */ |
| + | void curlx_now_init(void); |
| + | #endif |
| + | |
| + | struct curltime curlx_now(void); |
| /* | |
| * Make sure that the first argument (newer) is the more recent time and older | |
| @@ -53,7 +46,7 @@ struct curltime Curl_now(void); | |
| * | |
| * Returns: the time difference in number of milliseconds. | |
| */ | |
| - | timediff_t Curl_timediff(struct curltime newer, struct curltime older); |
| + | timediff_t curlx_timediff(struct curltime newer, struct curltime older); |
| /* | |
| * Make sure that the first argument (newer) is the more recent time and older | |
| @@ -61,7 +54,7 @@ timediff_t Curl_timediff(struct curltime newer, struct curltime older); | |
| * | |
| * Returns: the time difference in number of milliseconds, rounded up. | |
| */ | |
| - | timediff_t Curl_timediff_ceil(struct curltime newer, struct curltime older); |
| + | timediff_t curlx_timediff_ceil(struct curltime newer, struct curltime older); |
| /* | |
| * Make sure that the first argument (newer) is the more recent time and older | |
| @@ -69,6 +62,6 @@ timediff_t Curl_timediff_ceil(struct curltime newer, struct curltime older); | |
| * | |
| * Returns: the time difference in number of microseconds. | |
| */ | |
| - | timediff_t Curl_timediff_us(struct curltime newer, struct curltime older); |
| + | timediff_t curlx_timediff_us(struct curltime newer, struct curltime older); |
| #endif /* HEADER_CURL_TIMEVAL_H */ | |
| @@ -22,7 +22,7 @@ | |
| * | |
| ***************************************************************************/ | |
| - | #include "curl_setup.h" |
| + | #include "warnless.h" |
| #if defined(__INTEL_COMPILER) && defined(__unix__) | |
| @@ -35,8 +35,6 @@ | |
| #endif /* __INTEL_COMPILER && __unix__ */ | |
| - | #include "warnless.h" |
| - | |
| #ifdef _WIN32 | |
| #undef read | |
| #undef write | |
| @@ -24,7 +24,7 @@ | |
| * | |
| ***************************************************************************/ | |
| - | #include "curl_setup.h" |
| + | #include "../curl_setup.h" |
| #ifdef USE_WINSOCK | |
| #include <curl/curl.h> /* for curl_socket_t */ | |
| @@ -87,7 +87,7 @@ static struct cw_out_buf *cw_out_buf_create(cw_out_type otype) | |
| struct cw_out_buf *cwbuf = calloc(1, sizeof(*cwbuf)); | |
| if(cwbuf) { | |
| cwbuf->type = otype; | |
| - | Curl_dyn_init(&cwbuf->b, DYN_PAUSE_BUFFER); |
| + | curlx_dyn_init(&cwbuf->b, DYN_PAUSE_BUFFER); |
| } | |
| return cwbuf; | |
| } | |
| @@ -95,7 +95,7 @@ static struct cw_out_buf *cw_out_buf_create(cw_out_type otype) | |
| static void cw_out_buf_free(struct cw_out_buf *cwbuf) | |
| { | |
| if(cwbuf) { | |
| - | Curl_dyn_free(&cwbuf->b); |
| + | curlx_dyn_free(&cwbuf->b); |
| free(cwbuf); | |
| } | |
| } | |
| @@ -146,7 +146,7 @@ static size_t cw_out_bufs_len(struct cw_out_ctx *ctx) | |
| struct cw_out_buf *cwbuf = ctx->buf; | |
| size_t len = 0; | |
| while(cwbuf) { | |
| - | len += Curl_dyn_len(&cwbuf->b); |
| + | len += curlx_dyn_len(&cwbuf->b); |
| cwbuf = cwbuf->next; | |
| } | |
| return len; | |
| @@ -263,23 +263,24 @@ static CURLcode cw_out_buf_flush(struct cw_out_ctx *ctx, | |
| { | |
| CURLcode result = CURLE_OK; | |
| - | if(Curl_dyn_len(&cwbuf->b)) { |
| + | if(curlx_dyn_len(&cwbuf->b)) { |
| size_t consumed; | |
| result = cw_out_ptr_flush(ctx, data, cwbuf->type, flush_all, | |
| - | Curl_dyn_ptr(&cwbuf->b), |
| - | Curl_dyn_len(&cwbuf->b), |
| + | curlx_dyn_ptr(&cwbuf->b), |
| + | curlx_dyn_len(&cwbuf->b), |
| &consumed); | |
| if(result) | |
| return result; | |
| if(consumed) { | |
| - | if(consumed == Curl_dyn_len(&cwbuf->b)) { |
| - | Curl_dyn_free(&cwbuf->b); |
| + | if(consumed == curlx_dyn_len(&cwbuf->b)) { |
| + | curlx_dyn_free(&cwbuf->b); |
| } | |
| else { | |
| - | DEBUGASSERT(consumed < Curl_dyn_len(&cwbuf->b)); |
| - | result = Curl_dyn_tail(&cwbuf->b, Curl_dyn_len(&cwbuf->b) - consumed); |
| + | DEBUGASSERT(consumed < curlx_dyn_len(&cwbuf->b)); |
| + | result = curlx_dyn_tail(&cwbuf->b, |
| + | curlx_dyn_len(&cwbuf->b) - consumed); |
| if(result) | |
| return result; | |
| } | |
| @@ -319,7 +320,7 @@ static CURLcode cw_out_flush_chain(struct cw_out_ctx *ctx, | |
| result = cw_out_buf_flush(ctx, data, cwbuf, flush_all); | |
| if(result) | |
| return result; | |
| - | if(!Curl_dyn_len(&cwbuf->b)) { |
| + | if(!curlx_dyn_len(&cwbuf->b)) { |
| cw_out_buf_free(cwbuf); | |
| *pcwbuf = NULL; | |
| } | |
| @@ -349,7 +350,7 @@ static CURLcode cw_out_append(struct cw_out_ctx *ctx, | |
| ctx->buf = cwbuf; | |
| } | |
| DEBUGASSERT(ctx->buf && (ctx->buf->type == otype)); | |
| - | return Curl_dyn_addn(&ctx->buf->b, buf, blen); |
| + | return curlx_dyn_addn(&ctx->buf->b, buf, blen); |
| } | |
| static CURLcode cw_out_do_write(struct cw_out_ctx *ctx, | |
| @@ -115,7 +115,7 @@ static char *unescape_word(const char *input) | |
| struct dynbuf out; | |
| const char *ptr; | |
| CURLcode result = CURLE_OK; | |
| - | Curl_dyn_init(&out, DYN_DICT_WORD); |
| + | curlx_dyn_init(&out, DYN_DICT_WORD); |
| /* According to RFC2229 section 2.2, these letters need to be escaped with | |
| \[letter] */ | |
| @@ -123,13 +123,13 @@ static char *unescape_word(const char *input) | |
| char ch = *ptr; | |
| if((ch <= 32) || (ch == 127) || | |
| (ch == '\'') || (ch == '\"') || (ch == '\\')) | |
| - | result = Curl_dyn_addn(&out, "\\", 1); |
| + | result = curlx_dyn_addn(&out, "\\", 1); |
| if(!result) | |
| - | result = Curl_dyn_addn(&out, ptr, 1); |
| + | result = curlx_dyn_addn(&out, ptr, 1); |
| if(result) | |
| return NULL; | |
| } | |
| - | return Curl_dyn_ptr(&out); |
| + | return curlx_dyn_ptr(&out); |
| } | |
| /* sendf() sends formatted data to the server */ | |
| @@ -34,10 +34,10 @@ | |
| #include "multiif.h" | |
| #include "url.h" | |
| #include "share.h" | |
| - | #include "curl_base64.h" |
| + | #include "curlx/base64.h" |
| #include "connect.h" | |
| #include "strdup.h" | |
| - | #include "dynbuf.h" |
| + | #include "curlx/dynbuf.h" |
| #include "escape.h" | |
| #include "urlapi-int.h" | |
| @@ -183,7 +183,7 @@ doh_probe_write_cb(char *contents, size_t size, size_t nmemb, void *userp) | |
| if(!doh_req) | |
| return CURL_WRITEFUNC_ERROR; | |
| - | if(Curl_dyn_addn(&doh_req->resp_body, contents, realsize)) |
| + | if(curlx_dyn_addn(&doh_req->resp_body, contents, realsize)) |
| return 0; | |
| return realsize; | |
| @@ -244,10 +244,10 @@ static void doh_probe_done(struct Curl_easy *data, | |
| if(doh_req) { | |
| if(!result) { | |
| dohp->probe_resp[i].dnstype = doh_req->dnstype; | |
| - | result = Curl_dyn_addn(&dohp->probe_resp[i].body, |
| - | Curl_dyn_ptr(&doh_req->resp_body), |
| - | Curl_dyn_len(&doh_req->resp_body)); |
| - | Curl_dyn_free(&doh_req->resp_body); |
| + | result = curlx_dyn_addn(&dohp->probe_resp[i].body, |
| + | curlx_dyn_ptr(&doh_req->resp_body), |
| + | curlx_dyn_len(&doh_req->resp_body)); |
| + | curlx_dyn_free(&doh_req->resp_body); |
| } | |
| Curl_meta_remove(doh, CURL_EZM_DOH_PROBE); | |
| } | |
| @@ -269,7 +269,7 @@ static void doh_probe_dtor(void *key, size_t klen, void *e) | |
| if(e) { | |
| struct doh_request *doh_req = e; | |
| curl_slist_free_all(doh_req->req_hds); | |
| - | Curl_dyn_free(&doh_req->resp_body); |
| + | curlx_dyn_free(&doh_req->resp_body); |
| free(e); | |
| } | |
| } | |
| @@ -301,7 +301,7 @@ static CURLcode doh_probe_run(struct Curl_easy *data, | |
| if(!doh_req) | |
| return CURLE_OUT_OF_MEMORY; | |
| doh_req->dnstype = dnstype; | |
| - | Curl_dyn_init(&doh_req->resp_body, DYN_DOH_RESPONSE); |
| + | curlx_dyn_init(&doh_req->resp_body, DYN_DOH_RESPONSE); |
| d = doh_req_encode(host, dnstype, doh_req->req_body, | |
| sizeof(doh_req->req_body), | |
| @@ -490,7 +490,7 @@ struct Curl_addrinfo *Curl_doh(struct Curl_easy *data, | |
| for(i = 0; i < DOH_SLOT_COUNT; ++i) { | |
| dohp->probe_resp[i].probe_mid = UINT_MAX; | |
| - | Curl_dyn_init(&dohp->probe_resp[i].body, DYN_DOH_RESPONSE); |
| + | curlx_dyn_init(&dohp->probe_resp[i].body, DYN_DOH_RESPONSE); |
| } | |
| conn->bits.doh = TRUE; | |
| @@ -665,14 +665,14 @@ static DOHcode doh_store_cname(const unsigned char *doh, size_t dohlen, | |
| index++; | |
| if(length) { | |
| - | if(Curl_dyn_len(c)) { |
| - | if(Curl_dyn_addn(c, STRCONST("."))) |
| + | if(curlx_dyn_len(c)) { |
| + | if(curlx_dyn_addn(c, STRCONST("."))) |
| return DOH_OUT_OF_MEM; | |
| } | |
| if((index + length) > dohlen) | |
| return DOH_DNS_BAD_LABEL; | |
| - | if(Curl_dyn_addn(c, &doh[index], length)) |
| + | if(curlx_dyn_addn(c, &doh[index], length)) |
| return DOH_OUT_OF_MEM; | |
| index += length; | |
| } | |
| @@ -736,7 +736,7 @@ UNITTEST void de_init(struct dohentry *de) | |
| memset(de, 0, sizeof(*de)); | |
| de->ttl = INT_MAX; | |
| for(i = 0; i < DOH_MAX_CNAME; i++) | |
| - | Curl_dyn_init(&de->cname[i], DYN_DOH_CNAME); |
| + | curlx_dyn_init(&de->cname[i], DYN_DOH_CNAME); |
| } | |
| @@ -923,7 +923,7 @@ static void doh_show(struct Curl_easy *data, | |
| } | |
| #endif | |
| for(i = 0; i < d->numcname; i++) { | |
| - | infof(data, "CNAME: %s", Curl_dyn_ptr(&d->cname[i])); |
| + | infof(data, "CNAME: %s", curlx_dyn_ptr(&d->cname[i])); |
| } | |
| } | |
| #else | |
| @@ -1060,7 +1060,7 @@ UNITTEST void de_cleanup(struct dohentry *d) | |
| { | |
| int i = 0; | |
| for(i = 0; i < d->numcname; i++) { | |
| - | Curl_dyn_free(&d->cname[i]); |
| + | curlx_dyn_free(&d->cname[i]); |
| } | |
| #ifdef USE_HTTPSRR | |
| for(i = 0; i < d->numhttps_rrs; i++) | |
| @@ -1095,35 +1095,35 @@ static CURLcode doh_decode_rdata_name(const unsigned char **buf, | |
| DEBUGASSERT(buf && remaining && dnsname); | |
| if(!buf || !remaining || !dnsname || !*remaining) | |
| return CURLE_OUT_OF_MEMORY; | |
| - | Curl_dyn_init(&thename, CURL_MAXLEN_host_name); |
| + | curlx_dyn_init(&thename, CURL_MAXLEN_host_name); |
| rem = *remaining; | |
| cp = *buf; | |
| clen = *cp++; | |
| if(clen == 0) { | |
| /* special case - return "." as name */ | |
| - | if(Curl_dyn_addn(&thename, ".", 1)) |
| + | if(curlx_dyn_addn(&thename, ".", 1)) |
| return CURLE_OUT_OF_MEMORY; | |
| } | |
| while(clen) { | |
| if(clen >= rem) { | |
| - | Curl_dyn_free(&thename); |
| + | curlx_dyn_free(&thename); |
| return CURLE_OUT_OF_MEMORY; | |
| } | |
| - | if(Curl_dyn_addn(&thename, cp, clen) || |
| - | Curl_dyn_addn(&thename, ".", 1)) |
| + | if(curlx_dyn_addn(&thename, cp, clen) || |
| + | curlx_dyn_addn(&thename, ".", 1)) |
| return CURLE_TOO_LARGE; | |
| cp += clen; | |
| rem -= (clen + 1); | |
| if(rem <= 0) { | |
| - | Curl_dyn_free(&thename); |
| + | curlx_dyn_free(&thename); |
| return CURLE_OUT_OF_MEMORY; | |
| } | |
| clen = *cp++; | |
| } | |
| *buf = cp; | |
| *remaining = rem - 1; | |
| - | *dnsname = Curl_dyn_ptr(&thename); |
| + | *dnsname = curlx_dyn_ptr(&thename); |
| return CURLE_OK; | |
| } | |
| @@ -1260,8 +1260,8 @@ CURLcode Curl_doh_is_resolved(struct Curl_easy *data, | |
| struct doh_response *p = &dohp->probe_resp[slot]; | |
| if(!p->dnstype) | |
| continue; | |
| - | rc[slot] = doh_resp_decode(Curl_dyn_uptr(&p->body), |
| - | Curl_dyn_len(&p->body), |
| + | rc[slot] = doh_resp_decode(curlx_dyn_uptr(&p->body), |
| + | curlx_dyn_len(&p->body), |
| p->dnstype, &de); | |
| #ifndef CURL_DISABLE_VERBOSE_STRINGS | |
| if(rc[slot]) { | |
| @@ -1364,7 +1364,7 @@ void Curl_doh_cleanup(struct Curl_easy *data) | |
| int i; | |
| Curl_doh_close(data); | |
| for(i = 0; i < DOH_SLOT_COUNT; ++i) { | |
| - | Curl_dyn_free(&dohp->probe_resp[i].body); |
| + | curlx_dyn_free(&dohp->probe_resp[i].body); |
| } | |
| Curl_safefree(data->state.async.doh); | |
| } | |
| @@ -359,9 +359,10 @@ CURLcode Curl_dynhds_h1_dprint(struct dynhds *dynhds, struct dynbuf *dbuf) | |
| return result; | |
| for(i = 0; i < dynhds->hds_len; ++i) { | |
| - | result = Curl_dyn_addf(dbuf, "%.*s: %.*s\r\n", |
| - | (int)dynhds->hds[i]->namelen, dynhds->hds[i]->name, |
| - | (int)dynhds->hds[i]->valuelen, dynhds->hds[i]->value); |
| + | result = curlx_dyn_addf(dbuf, "%.*s: %.*s\r\n", |
| + | (int)dynhds->hds[i]->namelen, dynhds->hds[i]->name, |
| + | (int)dynhds->hds[i]->valuelen, |
| + | dynhds->hds[i]->value); |
| if(result) | |
| break; | |
| } | |
| @@ -26,7 +26,7 @@ | |
| #include "curl_setup.h" | |
| #include <curl/curl.h> | |
| - | #include "dynbuf.h" |
| + | #include "curlx/dynbuf.h" |
| struct dynbuf; | |
| @@ -66,14 +66,14 @@ | |
| #include "mime.h" | |
| #include "amigaos.h" | |
| #include "macos.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "sigpipe.h" | |
| #include "vssh/ssh.h" | |
| #include "setopt.h" | |
| #include "http_digest.h" | |
| #include "system_win32.h" | |
| #include "http2.h" | |
| - | #include "dynbuf.h" |
| + | #include "curlx/dynbuf.h" |
| #include "altsvc.h" | |
| #include "hsts.h" | |
| @@ -590,7 +590,7 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev) | |
| const unsigned int numfds = populate_fds(fds, ev); | |
| /* get the time stamp to use to figure out how long poll takes */ | |
| - | before = Curl_now(); |
| + | before = curlx_now(); |
| if(numfds) { | |
| /* wait for activity or timeout */ | |
| @@ -645,7 +645,7 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev) | |
| /* If nothing updated the timeout, we decrease it by the spent time. | |
| * If it was updated, it has the new timeout time stored already. | |
| */ | |
| - | timediff_t timediff = Curl_timediff(Curl_now(), before); |
| + | timediff_t timediff = curlx_timediff(curlx_now(), before); |
| if(timediff > 0) { | |
| #if DEBUG_EV_POLL | |
| fprintf(stderr, "poll timeout %ldms not updated, decrease by " | |
| @@ -967,8 +967,8 @@ CURL *curl_easy_duphandle(CURL *d) | |
| outcurl->set.buffer_size = data->set.buffer_size; | |
| Curl_hash_init(&outcurl->meta_hash, 23, | |
| - | Curl_hash_str, Curl_str_key_compare, dupeasy_meta_freeentry); |
| - | Curl_dyn_init(&outcurl->state.headerb, CURL_MAX_HTTP_HEADER); |
| + | Curl_hash_str, curlx_str_key_compare, dupeasy_meta_freeentry); |
| + | curlx_dyn_init(&outcurl->state.headerb, CURL_MAX_HTTP_HEADER); |
| Curl_netrc_init(&outcurl->state.netrc); | |
| /* the connection pool is setup on demand */ | |
| @@ -1062,7 +1062,7 @@ fail: | |
| #ifndef CURL_DISABLE_COOKIES | |
| free(outcurl->cookies); | |
| #endif | |
| - | Curl_dyn_free(&outcurl->state.headerb); |
| + | curlx_dyn_free(&outcurl->state.headerb); |
| Curl_altsvc_cleanup(&outcurl->asi); | |
| Curl_hsts_cleanup(&outcurl->hsts); | |
| Curl_freeset(outcurl); | |
| @@ -32,10 +32,10 @@ | |
| struct Curl_easy; | |
| #include "urldata.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "escape.h" | |
| #include "strdup.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -71,7 +71,7 @@ char *curl_easy_escape(CURL *data, const char *string, | |
| if(!length) | |
| return strdup(""); | |
| - | Curl_dyn_init(&d, length * 3 + 1); |
| + | curlx_dyn_init(&d, length * 3 + 1); |
| while(length--) { | |
| /* treat the characters unsigned */ | |
| @@ -79,19 +79,19 @@ char *curl_easy_escape(CURL *data, const char *string, | |
| if(ISUNRESERVED(in)) { | |
| /* append this */ | |
| - | if(Curl_dyn_addn(&d, &in, 1)) |
| + | if(curlx_dyn_addn(&d, &in, 1)) |
| return NULL; | |
| } | |
| else { | |
| /* encode it */ | |
| unsigned char out[3]={'%'}; | |
| Curl_hexbyte(&out[1], in, FALSE); | |
| - | if(Curl_dyn_addn(&d, out, 3)) |
| + | if(curlx_dyn_addn(&d, out, 3)) |
| return NULL; | |
| } | |
| } | |
| - | return Curl_dyn_ptr(&d); |
| + | return curlx_dyn_ptr(&d); |
| } | |
| /* | |
| @@ -70,7 +70,7 @@ | |
| #include "transfer.h" | |
| #include "url.h" | |
| #include "parsedate.h" /* for the week day and month names */ | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "curl_range.h" | |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -391,7 +391,7 @@ static CURLcode file_upload(struct Curl_easy *data) | |
| if(Curl_pgrsUpdate(data)) | |
| result = CURLE_ABORTED_BY_CALLBACK; | |
| else | |
| - | result = Curl_speedcheck(data, Curl_now()); |
| + | result = Curl_speedcheck(data, curlx_now()); |
| } | |
| if(!result && Curl_pgrsUpdate(data)) | |
| result = CURLE_ABORTED_BY_CALLBACK; | |
| @@ -596,7 +596,7 @@ static CURLcode file_do(struct Curl_easy *data, bool *done) | |
| if(Curl_pgrsUpdate(data)) | |
| result = CURLE_ABORTED_BY_CALLBACK; | |
| else | |
| - | result = Curl_speedcheck(data, Curl_now()); |
| + | result = Curl_speedcheck(data, curlx_now()); |
| if(result) | |
| goto out; | |
| } | |
| @@ -40,7 +40,7 @@ void Curl_fileinfo_cleanup(struct fileinfo *finfo) | |
| if(!finfo) | |
| return; | |
| - | Curl_dyn_free(&finfo->buf); |
| + | curlx_dyn_free(&finfo->buf); |
| free(finfo); | |
| } | |
| #endif | |
| @@ -26,7 +26,7 @@ | |
| #include <curl/curl.h> | |
| #include "llist.h" | |
| - | #include "dynbuf.h" |
| + | #include "curlx/dynbuf.h" |
| struct fileinfo { | |
| struct curl_fileinfo info; | |
| @@ -66,7 +66,7 @@ static char *dirslash(const char *path) | |
| size_t n; | |
| struct dynbuf out; | |
| DEBUGASSERT(path); | |
| - | Curl_dyn_init(&out, CURL_MAX_INPUT_LENGTH); |
| + | curlx_dyn_init(&out, CURL_MAX_INPUT_LENGTH); |
| n = strlen(path); | |
| if(n) { | |
| /* find the rightmost path separator, if any */ | |
| @@ -76,12 +76,12 @@ static char *dirslash(const char *path) | |
| while(n && IS_SEP(path[n-1])) | |
| --n; | |
| } | |
| - | if(Curl_dyn_addn(&out, path, n)) |
| + | if(curlx_dyn_addn(&out, path, n)) |
| return NULL; | |
| /* if there was a directory, append a single trailing slash */ | |
| - | if(n && Curl_dyn_addn(&out, PATHSEP, 1)) |
| + | if(n && curlx_dyn_addn(&out, PATHSEP, 1)) |
| return NULL; | |
| - | return Curl_dyn_ptr(&out); |
| + | return curlx_dyn_ptr(&out); |
| } | |
| /* | |
| @@ -38,7 +38,7 @@ struct Curl_easy; | |
| #include "sendf.h" | |
| #include "strdup.h" | |
| #include "rand.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| #include "curl_memory.h" | |
| @@ -68,11 +68,11 @@ | |
| #include "multiif.h" | |
| #include "url.h" | |
| #include "speedcheck.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "http_proxy.h" | |
| #include "socks.h" | |
| #include "strdup.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| #include "curl_memory.h" | |
| @@ -452,7 +452,7 @@ static CURLcode ftp_check_ctrl_on_data_wait(struct Curl_easy *data, | |
| bool response = FALSE; | |
| /* First check whether there is a cached response from server */ | |
| - | if(Curl_dyn_len(&pp->recvbuf) && (*Curl_dyn_ptr(&pp->recvbuf) > '3')) { |
| + | if(curlx_dyn_len(&pp->recvbuf) && (*curlx_dyn_ptr(&pp->recvbuf) > '3')) { |
| /* Data connection could not be established, let's return */ | |
| infof(data, "There is negative response in cache while serv connect"); | |
| (void)Curl_GetFTPResponse(data, &nread, &ftpcode); | |
| @@ -481,16 +481,16 @@ static CURLcode ftp_check_ctrl_on_data_wait(struct Curl_easy *data, | |
| if(response) { | |
| infof(data, "Ctrl conn has data while waiting for data conn"); | |
| if(pp->overflow > 3) { | |
| - | const char *r = Curl_dyn_ptr(&pp->recvbuf); |
| + | const char *r = curlx_dyn_ptr(&pp->recvbuf); |
| DEBUGASSERT((pp->overflow + pp->nfinal) <= | |
| - | Curl_dyn_len(&pp->recvbuf)); |
| + | curlx_dyn_len(&pp->recvbuf)); |
| /* move over the most recently handled response line */ | |
| r += pp->nfinal; | |
| if(LASTLINE(r)) { | |
| curl_off_t status; | |
| - | if(!Curl_str_number(&r, &status, 999) && (status == 226)) { |
| + | if(!curlx_str_number(&r, &status, 999) && (status == 226)) { |
| /* funny timing situation where we get the final message on the | |
| control connection before traffic on the data connection has been | |
| noticed. Leave the 226 in there and use this as a trigger to read | |
| @@ -564,7 +564,7 @@ static bool ftp_endofresp(struct Curl_easy *data, struct connectdata *conn, | |
| (void)data; | |
| (void)conn; | |
| - | if((len > 3) && LASTLINE(line) && !Curl_str_number(&line, &status, 999)) { |
| + | if((len > 3) && LASTLINE(line) && !curlx_str_number(&line, &status, 999)) { |
| *code = (int)status; | |
| return TRUE; | |
| } | |
| @@ -585,7 +585,7 @@ static CURLcode ftp_readresp(struct Curl_easy *data, | |
| #ifdef HAVE_GSSAPI | |
| { | |
| struct connectdata *conn = data->conn; | |
| - | char * const buf = Curl_dyn_ptr(&ftpc->pp.recvbuf); |
| + | char * const buf = curlx_dyn_ptr(&ftpc->pp.recvbuf); |
| /* handle the security-oriented responses 6xx ***/ | |
| switch(code) { | |
| @@ -695,7 +695,7 @@ CURLcode Curl_GetFTPResponse(struct Curl_easy *data, | |
| * | |
| */ | |
| - | if(Curl_dyn_len(&pp->recvbuf) && (cache_skip < 2)) { |
| + | if(curlx_dyn_len(&pp->recvbuf) && (cache_skip < 2)) { |
| /* | |
| * There is a cache left since before. We then skipping the wait for | |
| * socket action, unless this is the same cache like the previous round | |
| @@ -729,7 +729,7 @@ CURLcode Curl_GetFTPResponse(struct Curl_easy *data, | |
| if(result) | |
| break; | |
| - | if(!nread && Curl_dyn_len(&pp->recvbuf)) |
| + | if(!nread && curlx_dyn_len(&pp->recvbuf)) |
| /* bump cache skip counter as on repeated skips we must wait for more | |
| data */ | |
| cache_skip++; | |
| @@ -953,12 +953,12 @@ static CURLcode ftp_state_use_port(struct Curl_easy *data, | |
| curl_off_t start; | |
| curl_off_t end; | |
| portp++; | |
| - | if(!Curl_str_number(&portp, &start, 0xffff)) { |
| + | if(!curlx_str_number(&portp, &start, 0xffff)) { |
| /* got the first number */ | |
| port_min = (unsigned short)start; | |
| - | if(!Curl_str_single(&portp, '-')) { |
| + | if(!curlx_str_single(&portp, '-')) { |
| /* got the dash */ | |
| - | if(!Curl_str_number(&portp, &end, 0xffff)) |
| + | if(!curlx_str_number(&portp, &end, 0xffff)) |
| /* got the second number */ | |
| port_max = (unsigned short)end; | |
| } | |
| @@ -1790,7 +1790,7 @@ static bool match_pasv_6nums(const char *p, | |
| return FALSE; | |
| p++; | |
| } | |
| - | if(Curl_str_number(&p, &num, 0xff)) |
| + | if(curlx_str_number(&p, &num, 0xff)) |
| return FALSE; | |
| array[i] = (unsigned int)num; | |
| } | |
| @@ -1807,7 +1807,7 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, | |
| unsigned short connectport; /* the local port connect() should use! */ | |
| struct pingpong *pp = &ftpc->pp; | |
| char *str = | |
| - | Curl_dyn_ptr(&pp->recvbuf) + 4; /* start on the first letter */ |
| + | curlx_dyn_ptr(&pp->recvbuf) + 4; /* start on the first letter */ |
| /* if we come here again, make sure the former name is cleared */ | |
| Curl_safefree(ftpc->newhost); | |
| @@ -1824,7 +1824,7 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data, | |
| if((ptr[1] == sep) && (ptr[2] == sep) && ISDIGIT(ptr[3])) { | |
| const char *p = &ptr[3]; | |
| curl_off_t num; | |
| - | if(Curl_str_number(&p, &num, 0xffff) || (*p != sep)) { |
| + | if(curlx_str_number(&p, &num, 0xffff) || (*p != sep)) { |
| failf(data, "Illegal port number in EPSV reply"); | |
| return CURLE_FTP_WEIRD_PASV_REPLY; | |
| } | |
| @@ -2073,7 +2073,7 @@ static CURLcode ftp_state_mdtm_resp(struct Curl_easy *data, | |
| last .sss part is optional and means fractions of a second */ | |
| int year, month, day, hour, minute, second; | |
| struct pingpong *pp = &ftpc->pp; | |
| - | char *resp = Curl_dyn_ptr(&pp->recvbuf) + 4; |
| + | char *resp = curlx_dyn_ptr(&pp->recvbuf) + 4; |
| if(ftp_213_date(resp, &year, &month, &day, &hour, &minute, &second)) { | |
| /* we have a time, reformat it */ | |
| char timebuf[24]; | |
| @@ -2297,7 +2297,7 @@ static CURLcode ftp_state_size_resp(struct Curl_easy *data, | |
| { | |
| CURLcode result = CURLE_OK; | |
| curl_off_t filesize = -1; | |
| - | char *buf = Curl_dyn_ptr(&ftpc->pp.recvbuf); |
| + | char *buf = curlx_dyn_ptr(&ftpc->pp.recvbuf); |
| size_t len = ftpc->pp.nfinal; | |
| /* get the size from the ascii string: */ | |
| @@ -2316,7 +2316,7 @@ static CURLcode ftp_state_size_resp(struct Curl_easy *data, | |
| } | |
| else | |
| fdigit = start; | |
| - | if(Curl_str_number(&fdigit, &filesize, CURL_OFF_T_MAX)) |
| + | if(curlx_str_number(&fdigit, &filesize, CURL_OFF_T_MAX)) |
| filesize = -1; /* size remain unknown */ | |
| } | |
| else if(ftpcode == 550) { /* "No such file or directory" */ | |
| @@ -2479,7 +2479,7 @@ static CURLcode ftp_state_get_resp(struct Curl_easy *data, | |
| * | |
| * Example D above makes this parsing a little tricky */ | |
| const char *bytes; | |
| - | char *buf = Curl_dyn_ptr(&ftpc->pp.recvbuf); |
| + | char *buf = curlx_dyn_ptr(&ftpc->pp.recvbuf); |
| bytes = strstr(buf, " bytes"); | |
| if(bytes) { | |
| long in = (long)(--bytes-buf); | |
| @@ -2500,7 +2500,7 @@ static CURLcode ftp_state_get_resp(struct Curl_easy *data, | |
| if(bytes) { | |
| ++bytes; | |
| /* get the number! */ | |
| - | if(Curl_str_number(&bytes, &size, CURL_OFF_T_MAX)) |
| + | if(curlx_str_number(&bytes, &size, CURL_OFF_T_MAX)) |
| size = 1; | |
| } | |
| } | |
| @@ -2854,11 +2854,11 @@ static CURLcode ftp_pp_statemachine(struct Curl_easy *data, | |
| case FTP_PWD: | |
| if(ftpcode == 257) { | |
| - | char *ptr = Curl_dyn_ptr(&pp->recvbuf) + 4; /* start on the first |
| - | letter */ |
| + | char *ptr = curlx_dyn_ptr(&pp->recvbuf) + 4; /* start on the first |
| + | letter */ |
| bool entry_extracted = FALSE; | |
| struct dynbuf out; | |
| - | Curl_dyn_init(&out, 1000); |
| + | curlx_dyn_init(&out, 1000); |
| /* Reply format is like | |
| 257<space>[rubbish]"<directory-name>"<space><commentary> and the | |
| @@ -2879,18 +2879,18 @@ static CURLcode ftp_pp_statemachine(struct Curl_easy *data, | |
| if('\"' == *ptr) { | |
| if('\"' == ptr[1]) { | |
| /* "quote-doubling" */ | |
| - | result = Curl_dyn_addn(&out, &ptr[1], 1); |
| + | result = curlx_dyn_addn(&out, &ptr[1], 1); |
| ptr++; | |
| } | |
| else { | |
| /* end of path */ | |
| - | if(Curl_dyn_len(&out)) |
| + | if(curlx_dyn_len(&out)) |
| entry_extracted = TRUE; | |
| break; /* get out of this loop */ | |
| } | |
| } | |
| else | |
| - | result = Curl_dyn_addn(&out, ptr, 1); |
| + | result = curlx_dyn_addn(&out, ptr, 1); |
| if(result) | |
| return result; | |
| } | |
| @@ -2907,7 +2907,7 @@ static CURLcode ftp_pp_statemachine(struct Curl_easy *data, | |
| The method used here is to check the server OS: we do it only | |
| if the path name looks strange to minimize overhead on other | |
| systems. */ | |
| - | char *dir = Curl_dyn_ptr(&out); |
| + | char *dir = curlx_dyn_ptr(&out); |
| if(!ftpc->server_os && dir[0] != '/') { | |
| result = Curl_pp_sendf(data, &ftpc->pp, "%s", "SYST"); | |
| @@ -2938,7 +2938,7 @@ static CURLcode ftp_pp_statemachine(struct Curl_easy *data, | |
| } | |
| else { | |
| /* could not get the path */ | |
| - | Curl_dyn_free(&out); |
| + | curlx_dyn_free(&out); |
| infof(data, "Failed to figure out path"); | |
| } | |
| } | |
| @@ -2948,7 +2948,7 @@ static CURLcode ftp_pp_statemachine(struct Curl_easy *data, | |
| case FTP_SYST: | |
| if(ftpcode == 215) { | |
| - | char *ptr = Curl_dyn_ptr(&pp->recvbuf) + 4; /* start on the first |
| + | char *ptr = curlx_dyn_ptr(&pp->recvbuf) + 4; /* start on the first |
| letter */ | |
| char *os; | |
| char *start; | |
| @@ -3351,7 +3351,7 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status, | |
| timediff_t old_time = pp->response_time; | |
| pp->response_time = 60*1000; /* give it only a minute for now */ | |
| - | pp->response = Curl_now(); /* timeout relative now */ |
| + | pp->response = curlx_now(); /* timeout relative now */ |
| result = Curl_GetFTPResponse(data, &nread, &ftpcode); | |
| @@ -3476,7 +3476,7 @@ CURLcode ftp_sendquote(struct Curl_easy *data, | |
| result = Curl_pp_sendf(data, &ftpc->pp, "%s", cmd); | |
| if(!result) { | |
| - | pp->response = Curl_now(); /* timeout relative now */ |
| + | pp->response = curlx_now(); /* timeout relative now */ |
| result = Curl_GetFTPResponse(data, &nread, &ftpcode); | |
| } | |
| if(result) | |
| @@ -50,7 +50,7 @@ | |
| #include "ftplistparser.h" | |
| #include "curl_fnmatch.h" | |
| #include "multiif.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -318,7 +318,7 @@ static CURLcode ftp_pl_insert_finfo(struct Curl_easy *data, | |
| struct curl_fileinfo *finfo = &infop->info; | |
| /* set the finfo pointers */ | |
| - | char *str = Curl_dyn_ptr(&infop->buf); |
| + | char *str = curlx_dyn_ptr(&infop->buf); |
| finfo->filename = str + parser->offsets.filename; | |
| finfo->strings.group = parser->offsets.group ? | |
| str + parser->offsets.group : NULL; | |
| @@ -403,18 +403,18 @@ size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb, | |
| } | |
| parser->item_offset = 0; | |
| parser->item_length = 0; | |
| - | Curl_dyn_init(&parser->file_data->buf, MAX_FTPLIST_BUFFER); |
| + | curlx_dyn_init(&parser->file_data->buf, MAX_FTPLIST_BUFFER); |
| } | |
| infop = parser->file_data; | |
| finfo = &infop->info; | |
| - | if(Curl_dyn_addn(&infop->buf, &c, 1)) { |
| + | if(curlx_dyn_addn(&infop->buf, &c, 1)) { |
| parser->error = CURLE_OUT_OF_MEMORY; | |
| goto fail; | |
| } | |
| - | len = Curl_dyn_len(&infop->buf); |
| - | mem = Curl_dyn_ptr(&infop->buf); |
| + | len = curlx_dyn_len(&infop->buf); |
| + | mem = curlx_dyn_ptr(&infop->buf); |
| switch(parser->os_type) { | |
| case OS_TYPE_UNIX: | |
| @@ -429,7 +429,7 @@ size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb, | |
| else { | |
| parser->state.UNIX.main = PL_UNIX_FILETYPE; | |
| /* start FSM again not considering size of directory */ | |
| - | Curl_dyn_reset(&infop->buf); |
| + | curlx_dyn_reset(&infop->buf); |
| continue; | |
| } | |
| break; | |
| @@ -437,7 +437,7 @@ size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb, | |
| parser->item_length++; | |
| if(c == '\r') { | |
| parser->item_length--; | |
| - | Curl_dyn_setlen(&infop->buf, --len); |
| + | curlx_dyn_setlen(&infop->buf, --len); |
| } | |
| else if(c == '\n') { | |
| mem[parser->item_length - 1] = 0; | |
| @@ -445,7 +445,7 @@ size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb, | |
| const char *endptr = mem + 6; | |
| /* here we can deal with directory size, pass the leading | |
| whitespace and then the digits */ | |
| - | Curl_str_passblanks(&endptr); |
| + | curlx_str_passblanks(&endptr); |
| while(ISDIGIT(*endptr)) | |
| endptr++; | |
| if(*endptr) { | |
| @@ -453,7 +453,7 @@ size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb, | |
| goto fail; | |
| } | |
| parser->state.UNIX.main = PL_UNIX_FILETYPE; | |
| - | Curl_dyn_reset(&infop->buf); |
| + | curlx_dyn_reset(&infop->buf); |
| } | |
| else { | |
| parser->error = CURLE_FTP_BAD_FILE_LIST; | |
| @@ -548,7 +548,7 @@ size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb, | |
| curl_off_t hlinks; | |
| mem[parser->item_offset + parser->item_length - 1] = 0; | |
| - | if(!Curl_str_number(&p, &hlinks, LONG_MAX)) { |
| + | if(!curlx_str_number(&p, &hlinks, LONG_MAX)) { |
| parser->file_data->info.flags |= CURLFINFOFLAG_KNOWN_HLINKCOUNT; | |
| parser->file_data->info.hardlinks = (long)hlinks; | |
| } | |
| @@ -629,7 +629,7 @@ size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb, | |
| const char *p = mem + parser->item_offset; | |
| curl_off_t fsize; | |
| mem[parser->item_offset + parser->item_length - 1] = 0; | |
| - | if(!Curl_str_numblanks(&p, &fsize)) { |
| + | if(!curlx_str_numblanks(&p, &fsize)) { |
| if(p[0] == '\0' && fsize != CURL_OFF_T_MAX) { | |
| parser->file_data->info.flags |= CURLFINFOFLAG_KNOWN_SIZE; | |
| parser->file_data->info.size = fsize; | |
| @@ -952,7 +952,7 @@ size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb, | |
| } | |
| else { | |
| const char *p = mem + parser->item_offset; | |
| - | if(Curl_str_numblanks(&p, &finfo->size)) { |
| + | if(curlx_str_numblanks(&p, &finfo->size)) { |
| parser->error = CURLE_FTP_BAD_FILE_LIST; | |
| goto fail; | |
| } | |
| @@ -31,7 +31,7 @@ | |
| #include "vtls/vtls.h" | |
| #include "connect.h" /* Curl_getconnectinfo() */ | |
| #include "progress.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last #include files should be: */ | |
| #include "curl_memory.h" | |
| @@ -207,7 +207,7 @@ static CURLcode getinfo_long(struct Curl_easy *data, CURLINFO info, | |
| const char *timestr = getenv("CURL_TIME"); | |
| if(timestr) { | |
| curl_off_t val; | |
| - | Curl_str_number(×tr, &val, TIME_T_MAX); |
| + | curlx_str_number(×tr, &val, TIME_T_MAX); |
| switch(info) { | |
| case CURLINFO_LOCAL_PORT: | |
| *param_longp = (long)val; | |
| @@ -220,7 +220,7 @@ static CURLcode getinfo_long(struct Curl_easy *data, CURLINFO info, | |
| timestr = getenv("CURL_DEBUG_SIZE"); | |
| if(timestr) { | |
| curl_off_t val; | |
| - | Curl_str_number(×tr, &val, LONG_MAX); |
| + | curlx_str_number(×tr, &val, LONG_MAX); |
| switch(info) { | |
| case CURLINFO_HEADER_SIZE: | |
| case CURLINFO_REQUEST_SIZE: | |
| @@ -384,7 +384,7 @@ static CURLcode getinfo_offt(struct Curl_easy *data, CURLINFO info, | |
| const char *timestr = getenv("CURL_TIME"); | |
| if(timestr) { | |
| curl_off_t val; | |
| - | Curl_str_number(×tr, &val, CURL_OFF_T_MAX); |
| + | curlx_str_number(×tr, &val, CURL_OFF_T_MAX); |
| switch(info) { | |
| case CURLINFO_TOTAL_TIME_T: | |
| @@ -483,7 +483,7 @@ static CURLcode getinfo_double(struct Curl_easy *data, CURLINFO info, | |
| const char *timestr = getenv("CURL_TIME"); | |
| if(timestr) { | |
| curl_off_t val; | |
| - | Curl_str_number(×tr, &val, CURL_OFF_T_MAX); |
| + | curlx_str_number(×tr, &val, CURL_OFF_T_MAX); |
| switch(info) { | |
| case CURLINFO_TOTAL_TIME: | |
| @@ -39,7 +39,7 @@ | |
| #include "vtls/vtls.h" | |
| #include "url.h" | |
| #include "escape.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "curl_printf.h" | |
| #include "curl_memory.h" | |
| /* The last #include file should be: */ | |
| @@ -352,7 +352,7 @@ size_t Curl_hash_str(void *key, size_t key_length, size_t slots_num) | |
| return (h % slots_num); | |
| } | |
| - | size_t Curl_str_key_compare(void *k1, size_t key1_len, |
| + | size_t curlx_str_key_compare(void *k1, size_t key1_len, |
| void *k2, size_t key2_len) | |
| { | |
| if((key1_len == key2_len) && !memcmp(k1, k2, key1_len)) | |
| @@ -98,7 +98,7 @@ void Curl_hash_clean(struct Curl_hash *h); | |
| void Curl_hash_clean_with_criterium(struct Curl_hash *h, void *user, | |
| int (*comp)(void *, void *)); | |
| size_t Curl_hash_str(void *key, size_t key_length, size_t slots_num); | |
| - | size_t Curl_str_key_compare(void *k1, size_t key1_len, void *k2, |
| + | size_t curlx_str_key_compare(void *k1, size_t key1_len, void *k2, |
| size_t key2_len); | |
| void Curl_hash_start_iterate(struct Curl_hash *hash, | |
| struct Curl_hash_iterator *iter); | |
| @@ -29,7 +29,7 @@ | |
| #include "strcase.h" | |
| #include "sendf.h" | |
| #include "headers.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -34,7 +34,7 @@ | |
| #include "curl_hmac.h" | |
| #include "curl_memory.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| /* The last #include file should be: */ | |
| #include "memdebug.h" | |
| @@ -58,11 +58,11 @@ | |
| #include "inet_pton.h" | |
| #include "multiif.h" | |
| #include "doh.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "select.h" | |
| #include "strcase.h" | |
| #include "easy_lock.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -1126,7 +1126,7 @@ clean_up: | |
| the time we spent until now! */ | |
| if(prev_alarm) { | |
| /* there was an alarm() set before us, now put it back */ | |
| - | timediff_t elapsed_secs = Curl_timediff(Curl_now(), |
| + | timediff_t elapsed_secs = curlx_timediff(curlx_now(), |
| data->conn->created) / 1000; | |
| /* the alarm period is counted in even number of seconds */ | |
| @@ -1197,7 +1197,7 @@ static void dnscache_entry_dtor(void *entry) | |
| */ | |
| void Curl_dnscache_init(struct Curl_dnscache *dns, size_t size) | |
| { | |
| - | Curl_hash_init(&dns->entries, size, Curl_hash_str, Curl_str_key_compare, |
| + | Curl_hash_init(&dns->entries, size, Curl_hash_str, curlx_str_key_compare, |
| dnscache_entry_dtor); | |
| } | |
| @@ -1227,23 +1227,23 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data) | |
| curl_off_t num = 0; | |
| size_t entry_len; | |
| host++; | |
| - | if(!Curl_str_single(&host, '[')) { |
| - | if(Curl_str_until(&host, &source, MAX_IPADR_LEN, ']') || |
| - | Curl_str_single(&host, ']') || |
| - | Curl_str_single(&host, ':')) |
| + | if(!curlx_str_single(&host, '[')) { |
| + | if(curlx_str_until(&host, &source, MAX_IPADR_LEN, ']') || |
| + | curlx_str_single(&host, ']') || |
| + | curlx_str_single(&host, ':')) |
| continue; | |
| } | |
| else { | |
| - | if(Curl_str_until(&host, &source, 4096, ':') || |
| - | Curl_str_single(&host, ':')) { |
| + | if(curlx_str_until(&host, &source, 4096, ':') || |
| + | curlx_str_single(&host, ':')) { |
| continue; | |
| } | |
| } | |
| - | if(!Curl_str_number(&host, &num, 0xffff)) { |
| + | if(!curlx_str_number(&host, &num, 0xffff)) { |
| /* Create an entry id, based upon the hostname and port */ | |
| - | entry_len = create_dnscache_id(Curl_str(&source), |
| - | Curl_strlen(&source), (int)num, |
| + | entry_len = create_dnscache_id(curlx_str(&source), |
| + | curlx_strlen(&source), (int)num, |
| entry_id, sizeof(entry_id)); | |
| dnscache_lock(data, dnscache); | |
| /* delete entry, ignore if it did not exist */ | |
| @@ -1267,18 +1267,18 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data) | |
| host++; | |
| permanent = FALSE; | |
| } | |
| - | if(!Curl_str_single(&host, '[')) { |
| - | if(Curl_str_until(&host, &source, MAX_IPADR_LEN, ']') || |
| - | Curl_str_single(&host, ']')) |
| + | if(!curlx_str_single(&host, '[')) { |
| + | if(curlx_str_until(&host, &source, MAX_IPADR_LEN, ']') || |
| + | curlx_str_single(&host, ']')) |
| continue; | |
| } | |
| else { | |
| - | if(Curl_str_until(&host, &source, 4096, ':')) |
| + | if(curlx_str_until(&host, &source, 4096, ':')) |
| continue; | |
| } | |
| - | if(Curl_str_single(&host, ':') || |
| - | Curl_str_number(&host, &port, 0xffff) || |
| - | Curl_str_single(&host, ':')) |
| + | if(curlx_str_single(&host, ':') || |
| + | curlx_str_number(&host, &port, 0xffff) || |
| + | curlx_str_single(&host, ':')) |
| goto err; | |
| #if !defined(CURL_DISABLE_VERBOSE_STRINGS) | |
| @@ -1290,14 +1290,14 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data) | |
| struct Curl_str target; | |
| struct Curl_addrinfo *ai; | |
| - | if(!Curl_str_single(&host, '[')) { |
| - | if(Curl_str_until(&host, &target, MAX_IPADR_LEN, ']') || |
| - | Curl_str_single(&host, ']')) |
| + | if(!curlx_str_single(&host, '[')) { |
| + | if(curlx_str_until(&host, &target, MAX_IPADR_LEN, ']') || |
| + | curlx_str_single(&host, ']')) |
| goto err; | |
| } | |
| else { | |
| - | if(Curl_str_until(&host, &target, 4096, ',')) { |
| - | if(Curl_str_single(&host, ',')) |
| + | if(curlx_str_until(&host, &target, 4096, ',')) { |
| + | if(curlx_str_single(&host, ',')) |
| goto err; | |
| /* survive nothing but just a comma */ | |
| continue; | |
| @@ -1307,17 +1307,17 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data) | |
| if(memchr(target.str, ':', target.len)) { | |
| infof(data, "Ignoring resolve address '%s', missing IPv6 support.", | |
| address); | |
| - | if(Curl_str_single(&host, ',')) |
| + | if(curlx_str_single(&host, ',')) |
| goto err; | |
| continue; | |
| } | |
| #endif | |
| - | if(Curl_strlen(&target) >= sizeof(address)) |
| + | if(curlx_strlen(&target) >= sizeof(address)) |
| goto err; | |
| - | memcpy(address, Curl_str(&target), Curl_strlen(&target)); |
| - | address[Curl_strlen(&target)] = '\0'; |
| + | memcpy(address, curlx_str(&target), curlx_strlen(&target)); |
| + | address[curlx_strlen(&target)] = '\0'; |
| ai = Curl_str2addr(address, (int)port); | |
| if(!ai) { | |
| @@ -1332,7 +1332,7 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data) | |
| else { | |
| head = tail = ai; | |
| } | |
| - | if(Curl_str_single(&host, ',')) |
| + | if(curlx_str_single(&host, ',')) |
| break; | |
| } | |
| @@ -1349,7 +1349,7 @@ err: | |
| } | |
| /* Create an entry id, based upon the hostname and port */ | |
| - | entry_len = create_dnscache_id(Curl_str(&source), Curl_strlen(&source), |
| + | entry_len = create_dnscache_id(curlx_str(&source), curlx_strlen(&source), |
| (int)port, | |
| entry_id, sizeof(entry_id)); | |
| @@ -1360,8 +1360,8 @@ err: | |
| if(dns) { | |
| infof(data, "RESOLVE %.*s:%" CURL_FORMAT_CURL_OFF_T | |
| - | " - old addresses discarded", (int)Curl_strlen(&source), |
| - | Curl_str(&source), port); |
| + | " - old addresses discarded", (int)curlx_strlen(&source), |
| + | curlx_str(&source), port); |
| /* delete old entry, there are two reasons for this | |
| 1. old entry may have different addresses. | |
| 2. even if entry with correct addresses is already in the cache, | |
| @@ -1377,8 +1377,8 @@ err: | |
| } | |
| /* put this new host in the cache */ | |
| - | dns = dnscache_add_addr(data, dnscache, head, Curl_str(&source), |
| - | Curl_strlen(&source), (int)port, permanent); |
| + | dns = dnscache_add_addr(data, dnscache, head, curlx_str(&source), |
| + | curlx_strlen(&source), (int)port, permanent); |
| if(dns) { | |
| /* release the returned reference; the cache itself will keep the | |
| * entry alive: */ | |
| @@ -1392,12 +1392,12 @@ err: | |
| #ifndef CURL_DISABLE_VERBOSE_STRINGS | |
| infof(data, "Added %.*s:%" CURL_FORMAT_CURL_OFF_T ":%s to DNS cache%s", | |
| - | (int)Curl_strlen(&source), Curl_str(&source), port, addresses, |
| + | (int)curlx_strlen(&source), curlx_str(&source), port, addresses, |
| permanent ? "" : " (non-permanent)"); | |
| #endif | |
| /* Wildcard hostname */ | |
| - | if(Curl_str_casecompare(&source, "*")) { |
| + | if(curlx_str_casecompare(&source, "*")) { |
| infof(data, "RESOLVE *:%" CURL_FORMAT_CURL_OFF_T " using wildcard", | |
| port); | |
| data->state.wildcard_resolve = TRUE; | |
| @@ -1433,9 +1433,9 @@ static void show_resolve_info(struct Curl_easy *data, | |
| infof(data, "Host %s:%d was resolved.", | |
| (dns->hostname[0] ? dns->hostname : "(none)"), dns->hostport); | |
| - | Curl_dyn_init(&out[0], 1024); |
| + | curlx_dyn_init(&out[0], 1024); |
| #ifdef CURLRES_IPV6 | |
| - | Curl_dyn_init(&out[1], 1024); |
| + | curlx_dyn_init(&out[1], 1024); |
| #endif | |
| while(a) { | |
| @@ -1447,10 +1447,10 @@ static void show_resolve_info(struct Curl_easy *data, | |
| char buf[MAX_IPADR_LEN]; | |
| struct dynbuf *d = &out[(a->ai_family != PF_INET)]; | |
| Curl_printable_address(a, buf, sizeof(buf)); | |
| - | if(Curl_dyn_len(d)) |
| - | result = Curl_dyn_addn(d, ", ", 2); |
| + | if(curlx_dyn_len(d)) |
| + | result = curlx_dyn_addn(d, ", ", 2); |
| if(!result) | |
| - | result = Curl_dyn_add(d, buf); |
| + | result = curlx_dyn_add(d, buf); |
| if(result) { | |
| infof(data, "too many IP, cannot show"); | |
| goto fail; | |
| @@ -1461,15 +1461,15 @@ static void show_resolve_info(struct Curl_easy *data, | |
| #ifdef CURLRES_IPV6 | |
| infof(data, "IPv6: %s", | |
| - | (Curl_dyn_len(&out[1]) ? Curl_dyn_ptr(&out[1]) : "(none)")); |
| + | (curlx_dyn_len(&out[1]) ? curlx_dyn_ptr(&out[1]) : "(none)")); |
| #endif | |
| infof(data, "IPv4: %s", | |
| - | (Curl_dyn_len(&out[0]) ? Curl_dyn_ptr(&out[0]) : "(none)")); |
| + | (curlx_dyn_len(&out[0]) ? curlx_dyn_ptr(&out[0]) : "(none)")); |
| fail: | |
| - | Curl_dyn_free(&out[0]); |
| + | curlx_dyn_free(&out[0]); |
| #ifdef CURLRES_IPV6 | |
| - | Curl_dyn_free(&out[1]); |
| + | curlx_dyn_free(&out[1]); |
| #endif | |
| } | |
| #endif | |
| @@ -27,7 +27,7 @@ | |
| #include "curl_setup.h" | |
| #include "hash.h" | |
| #include "curl_addrinfo.h" | |
| - | #include "timeval.h" /* for timediff_t */ |
| + | #include "curlx/timeval.h" /* for timediff_t */ |
| #include "asyn.h" | |
| #include "httpsrr.h" | |
| @@ -40,7 +40,7 @@ | |
| #include "rename.h" | |
| #include "share.h" | |
| #include "strdup.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -62,7 +62,7 @@ static time_t hsts_debugtime(void *unused) | |
| (void)unused; | |
| if(timestr) { | |
| curl_off_t val; | |
| - | if(!Curl_str_number(×tr, &val, TIME_T_MAX)) |
| + | if(!curlx_str_number(×tr, &val, TIME_T_MAX)) |
| val += (curl_off_t)deltatime; | |
| return (time_t)val; | |
| } | |
| @@ -154,7 +154,7 @@ CURLcode Curl_hsts_parse(struct hsts *h, const char *hostname, | |
| return CURLE_OK; | |
| do { | |
| - | Curl_str_passblanks(&p); |
| + | curlx_str_passblanks(&p); |
| if(strncasecompare("max-age", p, 7)) { | |
| bool quoted = FALSE; | |
| int rc; | |
| @@ -163,15 +163,15 @@ CURLcode Curl_hsts_parse(struct hsts *h, const char *hostname, | |
| return CURLE_BAD_FUNCTION_ARGUMENT; | |
| p += 7; | |
| - | Curl_str_passblanks(&p); |
| - | if(Curl_str_single(&p, '=')) |
| + | curlx_str_passblanks(&p); |
| + | if(curlx_str_single(&p, '=')) |
| return CURLE_BAD_FUNCTION_ARGUMENT; | |
| - | Curl_str_passblanks(&p); |
| + | curlx_str_passblanks(&p); |
| - | if(!Curl_str_single(&p, '\"')) |
| + | if(!curlx_str_single(&p, '\"')) |
| quoted = TRUE; | |
| - | rc = Curl_str_number(&p, &expires, TIME_T_MAX); |
| + | rc = curlx_str_number(&p, &expires, TIME_T_MAX); |
| if(rc == STRE_OVERFLOW) | |
| expires = CURL_OFF_T_MAX; | |
| else if(rc) | |
| @@ -198,7 +198,7 @@ CURLcode Curl_hsts_parse(struct hsts *h, const char *hostname, | |
| p++; | |
| } | |
| - | Curl_str_passblanks(&p); |
| + | curlx_str_passblanks(&p); |
| if(*p == ';') | |
| p++; | |
| } while(*p); | |
| @@ -417,10 +417,10 @@ static CURLcode hsts_add(struct hsts *h, const char *line) | |
| struct Curl_str host; | |
| struct Curl_str date; | |
| - | if(Curl_str_word(&line, &host, MAX_HSTS_HOSTLEN) || |
| - | Curl_str_singlespace(&line) || |
| - | Curl_str_quotedword(&line, &date, MAX_HSTS_DATELEN) || |
| - | Curl_str_newline(&line)) |
| + | if(curlx_str_word(&line, &host, MAX_HSTS_HOSTLEN) || |
| + | curlx_str_singlespace(&line) || |
| + | curlx_str_quotedword(&line, &date, MAX_HSTS_DATELEN) || |
| + | curlx_str_newline(&line)) |
| ; | |
| else { | |
| CURLcode result = CURLE_OK; | |
| @@ -428,26 +428,26 @@ static CURLcode hsts_add(struct hsts *h, const char *line) | |
| struct stsentry *e; | |
| char dbuf[MAX_HSTS_DATELEN + 1]; | |
| time_t expires; | |
| - | const char *hp = Curl_str(&host); |
| + | const char *hp = curlx_str(&host); |
| /* The date parser works on a null terminated string. The maximum length | |
| - | is upheld by Curl_str_quotedword(). */ |
| - | memcpy(dbuf, Curl_str(&date), Curl_strlen(&date)); |
| - | dbuf[Curl_strlen(&date)] = 0; |
| + | is upheld by curlx_str_quotedword(). */ |
| + | memcpy(dbuf, curlx_str(&date), curlx_strlen(&date)); |
| + | dbuf[curlx_strlen(&date)] = 0; |
| expires = strcmp(dbuf, UNLIMITED) ? Curl_getdate_capped(dbuf) : | |
| TIME_T_MAX; | |
| if(hp[0] == '.') { | |
| - | Curl_str_nudge(&host, 1); |
| + | curlx_str_nudge(&host, 1); |
| subdomain = TRUE; | |
| } | |
| /* only add it if not already present */ | |
| - | e = Curl_hsts(h, Curl_str(&host), Curl_strlen(&host), subdomain); |
| + | e = Curl_hsts(h, curlx_str(&host), curlx_strlen(&host), subdomain); |
| if(!e) | |
| - | result = hsts_create(h, Curl_str(&host), Curl_strlen(&host), |
| + | result = hsts_create(h, curlx_str(&host), curlx_strlen(&host), |
| subdomain, expires); | |
| - | else if(Curl_str_casecompare(&host, e->host)) { |
| + | else if(curlx_str_casecompare(&host, e->host)) { |
| /* the same hostname, use the largest expire time */ | |
| if(expires > e->expires) | |
| e->expires = expires; | |
| @@ -526,10 +526,10 @@ static CURLcode hsts_load(struct hsts *h, const char *file) | |
| fp = fopen(file, FOPEN_READTEXT); | |
| if(fp) { | |
| struct dynbuf buf; | |
| - | Curl_dyn_init(&buf, MAX_HSTS_LINE); |
| + | curlx_dyn_init(&buf, MAX_HSTS_LINE); |
| while(Curl_get_line(&buf, fp)) { | |
| - | const char *lineptr = Curl_dyn_ptr(&buf); |
| - | Curl_str_passblanks(&lineptr); |
| + | const char *lineptr = curlx_dyn_ptr(&buf); |
| + | curlx_str_passblanks(&lineptr); |
| /* | |
| * Skip empty or commented lines, since we know the line will have a | |
| @@ -540,7 +540,7 @@ static CURLcode hsts_load(struct hsts *h, const char *file) | |
| hsts_add(h, lineptr); | |
| } | |
| - | Curl_dyn_free(&buf); /* free the line buffer */ |
| + | curlx_dyn_free(&buf); /* free the line buffer */ |
| fclose(fp); | |
| } | |
| return result; | |
| @@ -54,7 +54,7 @@ | |
| #include "formdata.h" | |
| #include "mime.h" | |
| #include "progress.h" | |
| - | #include "curl_base64.h" |
| + | #include "curlx/base64.h" |
| #include "cookie.h" | |
| #include "vauth/vauth.h" | |
| #include "vtls/vtls.h" | |
| @@ -76,7 +76,7 @@ | |
| #include "strcase.h" | |
| #include "content_encoding.h" | |
| #include "http_proxy.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "http2.h" | |
| #include "cfilters.h" | |
| #include "connect.h" | |
| @@ -85,7 +85,7 @@ | |
| #include "hsts.h" | |
| #include "ws.h" | |
| #include "curl_ctype.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -116,7 +116,7 @@ static CURLcode http_req_set_reader(struct Curl_easy *data, | |
| const char **tep); | |
| static CURLcode http_size(struct Curl_easy *data); | |
| static CURLcode http_statusline(struct Curl_easy *data, | |
| - | struct connectdata *conn); |
| + | struct connectdata *conn); |
| static CURLcode http_target(struct Curl_easy *data, struct connectdata *conn, | |
| struct dynbuf *req); | |
| static CURLcode http_useragent(struct Curl_easy *data); | |
| @@ -285,12 +285,12 @@ char *Curl_copy_header_value(const char *header) | |
| struct Curl_str out; | |
| /* find the end of the header name */ | |
| - | if(!Curl_str_cspn(&header, &out, ";:") && |
| - | (!Curl_str_single(&header, ':') || !Curl_str_single(&header, ';'))) { |
| - | Curl_str_untilnl(&header, &out, MAX_HTTP_RESP_HEADER_SIZE); |
| - | Curl_str_trimblanks(&out); |
| + | if(!curlx_str_cspn(&header, &out, ";:") && |
| + | (!curlx_str_single(&header, ':') || !curlx_str_single(&header, ';'))) { |
| + | curlx_str_untilnl(&header, &out, MAX_HTTP_RESP_HEADER_SIZE); |
| + | curlx_str_trimblanks(&out); |
| - | return Curl_memdup0(Curl_str(&out), Curl_strlen(&out)); |
| + | return Curl_memdup0(curlx_str(&out), curlx_strlen(&out)); |
| } | |
| /* bad input */ | |
| return NULL; | |
| @@ -336,7 +336,7 @@ static CURLcode http_output_basic(struct Curl_easy *data, bool proxy) | |
| if(!out) | |
| return CURLE_OUT_OF_MEMORY; | |
| - | result = Curl_base64_encode(out, strlen(out), &authorization, &size); |
| + | result = curlx_base64_encode(out, strlen(out), &authorization, &size); |
| if(result) | |
| goto fail; | |
| @@ -768,12 +768,12 @@ Curl_http_output_auth(struct Curl_easy *data, | |
| #ifndef CURL_DISABLE_PROXY | |
| (conn->bits.httpproxy && conn->bits.proxy_user_passwd) || | |
| #endif | |
| - | data->state.aptr.user || |
| + | data->state.aptr.user || |
| #ifdef USE_SPNEGO | |
| - | authhost->want & CURLAUTH_NEGOTIATE || |
| - | authproxy->want & CURLAUTH_NEGOTIATE || |
| + | authhost->want & CURLAUTH_NEGOTIATE || |
| + | authproxy->want & CURLAUTH_NEGOTIATE || |
| #endif | |
| - | data->set.str[STRING_BEARER]) |
| + | data->set.str[STRING_BEARER]) |
| /* continue please */; | |
| else { | |
| authhost->done = TRUE; | |
| @@ -1073,7 +1073,7 @@ CURLcode Curl_http_input_auth(struct Curl_easy *data, bool proxy, | |
| auth++; | |
| else | |
| break; | |
| - | Curl_str_passblanks(&auth); |
| + | curlx_str_passblanks(&auth); |
| } | |
| return result; | |
| #else | |
| @@ -1474,15 +1474,15 @@ Curl_compareheader(const char *headerline, /* line to check */ | |
| /* pass the header */ | |
| p = &headerline[hlen]; | |
| - | if(Curl_str_untilnl(&p, &val, MAX_HTTP_RESP_HEADER_SIZE)) |
| + | if(curlx_str_untilnl(&p, &val, MAX_HTTP_RESP_HEADER_SIZE)) |
| return FALSE; | |
| - | Curl_str_trimblanks(&val); |
| + | curlx_str_trimblanks(&val); |
| /* find the content string in the rest of the line */ | |
| - | if(Curl_strlen(&val) >= clen) { |
| + | if(curlx_strlen(&val) >= clen) { |
| size_t len; | |
| - | p = Curl_str(&val); |
| - | for(len = Curl_strlen(&val); len >= Curl_strlen(&val); len--, p++) { |
| + | p = curlx_str(&val); |
| + | for(len = curlx_strlen(&val); len >= curlx_strlen(&val); len--, p++) { |
| if(strncasecompare(p, content, clen)) | |
| return TRUE; /* match! */ | |
| } | |
| @@ -1533,7 +1533,7 @@ CURLcode Curl_http_done(struct Curl_easy *data, | |
| data->state.authhost.multipass = FALSE; | |
| data->state.authproxy.multipass = FALSE; | |
| - | Curl_dyn_reset(&data->state.headerb); |
| + | curlx_dyn_reset(&data->state.headerb); |
| if(status) | |
| return status; | |
| @@ -1654,19 +1654,19 @@ CURLcode Curl_add_custom_headers(struct Curl_easy *data, | |
| /* explicitly asked to send header without content is done by a header | |
| that ends with a semicolon, but there must be no colon present in the | |
| name */ | |
| - | if(!Curl_str_until(&p, &name, MAX_HTTP_RESP_HEADER_SIZE, ';') && |
| - | !Curl_str_single(&p, ';') && |
| - | !Curl_str_single(&p, '\0') && |
| - | !memchr(Curl_str(&name), ':', Curl_strlen(&name))) |
| + | if(!curlx_str_until(&p, &name, MAX_HTTP_RESP_HEADER_SIZE, ';') && |
| + | !curlx_str_single(&p, ';') && |
| + | !curlx_str_single(&p, '\0') && |
| + | !memchr(curlx_str(&name), ':', curlx_strlen(&name))) |
| blankheader = TRUE; | |
| else { | |
| p = origp; | |
| - | if(!Curl_str_until(&p, &name, MAX_HTTP_RESP_HEADER_SIZE, ':') && |
| - | !Curl_str_single(&p, ':')) { |
| + | if(!curlx_str_until(&p, &name, MAX_HTTP_RESP_HEADER_SIZE, ':') && |
| + | !curlx_str_single(&p, ':')) { |
| struct Curl_str val; | |
| - | Curl_str_untilnl(&p, &val, MAX_HTTP_RESP_HEADER_SIZE); |
| - | Curl_str_trimblanks(&val); |
| - | if(!Curl_strlen(&val)) |
| + | curlx_str_untilnl(&p, &val, MAX_HTTP_RESP_HEADER_SIZE); |
| + | curlx_str_trimblanks(&val); |
| + | if(!curlx_strlen(&val)) |
| /* no content, don't send this */ | |
| continue; | |
| } | |
| @@ -1681,41 +1681,41 @@ CURLcode Curl_add_custom_headers(struct Curl_easy *data, | |
| /* a Host: header was sent already, do not pass on any custom | |
| Host: header as that will produce *two* in the same | |
| request! */ | |
| - | Curl_str_casecompare(&name, "Host")) |
| + | curlx_str_casecompare(&name, "Host")) |
| ; | |
| else if(data->state.httpreq == HTTPREQ_POST_FORM && | |
| /* this header (extended by formdata.c) is sent later */ | |
| - | Curl_str_casecompare(&name, "Content-Type")) |
| + | curlx_str_casecompare(&name, "Content-Type")) |
| ; | |
| else if(data->state.httpreq == HTTPREQ_POST_MIME && | |
| /* this header is sent later */ | |
| - | Curl_str_casecompare(&name, "Content-Type")) |
| + | curlx_str_casecompare(&name, "Content-Type")) |
| ; | |
| else if(data->req.authneg && | |
| /* while doing auth neg, do not allow the custom length since | |
| we will force length zero then */ | |
| - | Curl_str_casecompare(&name, "Content-Length")) |
| + | curlx_str_casecompare(&name, "Content-Length")) |
| ; | |
| else if(data->state.aptr.te && | |
| /* when asking for Transfer-Encoding, do not pass on a custom | |
| Connection: */ | |
| - | Curl_str_casecompare(&name, "Connection")) |
| + | curlx_str_casecompare(&name, "Connection")) |
| ; | |
| else if((httpversion >= 20) && | |
| - | Curl_str_casecompare(&name, "Transfer-Encoding")) |
| + | curlx_str_casecompare(&name, "Transfer-Encoding")) |
| /* HTTP/2 does not support chunked requests */ | |
| ; | |
| - | else if((Curl_str_casecompare(&name, "Authorization") || |
| - | Curl_str_casecompare(&name, "Cookie")) && |
| + | else if((curlx_str_casecompare(&name, "Authorization") || |
| + | curlx_str_casecompare(&name, "Cookie")) && |
| /* be careful of sending this potentially sensitive header to | |
| other hosts */ | |
| !Curl_auth_allowed_to_host(data)) | |
| ; | |
| else if(blankheader) | |
| - | result = Curl_dyn_addf(req, "%.*s:\r\n", (int)Curl_strlen(&name), |
| - | Curl_str(&name)); |
| + | result = curlx_dyn_addf(req, "%.*s:\r\n", (int)curlx_strlen(&name), |
| + | curlx_str(&name)); |
| else | |
| - | result = Curl_dyn_addf(req, "%s\r\n", origp); |
| + | result = curlx_dyn_addf(req, "%s\r\n", origp); |
| if(result) | |
| return result; | |
| @@ -1790,7 +1790,7 @@ CURLcode Curl_add_timecondition(struct Curl_easy *data, | |
| tm->tm_min, | |
| tm->tm_sec); | |
| - | result = Curl_dyn_add(req, datestr); |
| + | result = curlx_dyn_add(req, datestr); |
| return result; | |
| } | |
| #else | |
| @@ -2014,7 +2014,7 @@ static CURLcode http_target(struct Curl_easy *data, | |
| curl_url_cleanup(h); | |
| /* target or URL */ | |
| - | result = Curl_dyn_add(r, data->set.str[STRING_TARGET] ? |
| + | result = curlx_dyn_add(r, data->set.str[STRING_TARGET] ? |
| data->set.str[STRING_TARGET] : url); | |
| free(url); | |
| if(result) | |
| @@ -2035,8 +2035,8 @@ static CURLcode http_target(struct Curl_easy *data, | |
| } | |
| } | |
| if(!type) { | |
| - | result = Curl_dyn_addf(r, ";type=%c", |
| - | data->state.prefer_ascii ? 'a' : 'i'); |
| + | result = curlx_dyn_addf(r, ";type=%c", |
| + | data->state.prefer_ascii ? 'a' : 'i'); |
| if(result) | |
| return result; | |
| } | |
| @@ -2049,11 +2049,11 @@ static CURLcode http_target(struct Curl_easy *data, | |
| (void)conn; /* not used in disabled-proxy builds */ | |
| #endif | |
| { | |
| - | result = Curl_dyn_add(r, path); |
| + | result = curlx_dyn_add(r, path); |
| if(result) | |
| return result; | |
| if(query) | |
| - | result = Curl_dyn_addf(r, "?%s", query); |
| + | result = curlx_dyn_addf(r, "?%s", query); |
| } | |
| return result; | |
| @@ -2311,7 +2311,7 @@ static CURLcode addexpect(struct Curl_easy *data, struct dynbuf *r, | |
| operations (as there is one packet coming back from the web server) */ | |
| curl_off_t client_len = Curl_creader_client_length(data); | |
| if(client_len > EXPECT_100_THRESHOLD || client_len < 0) { | |
| - | result = Curl_dyn_addn(r, STRCONST("Expect: 100-continue\r\n")); |
| + | result = curlx_dyn_addn(r, STRCONST("Expect: 100-continue\r\n")); |
| if(result) | |
| return result; | |
| *announced_exp100 = TRUE; | |
| @@ -2355,8 +2355,8 @@ static CURLcode http_req_complete(struct Curl_easy *data, | |
| !Curl_checkheaders(data, STRCONST("Content-Length")))) { | |
| /* we allow replacing this header if not during auth negotiation, | |
| although it is not very wise to actually set your own */ | |
| - | result = Curl_dyn_addf(r, "Content-Length: %" FMT_OFF_T "\r\n", |
| - | req_clen); |
| + | result = curlx_dyn_addf(r, "Content-Length: %" FMT_OFF_T "\r\n", |
| + | req_clen); |
| } | |
| if(result) | |
| goto out; | |
| @@ -2368,7 +2368,7 @@ static CURLcode http_req_complete(struct Curl_easy *data, | |
| struct curl_slist *hdr; | |
| for(hdr = data->state.mimepost->curlheaders; hdr; hdr = hdr->next) { | |
| - | result = Curl_dyn_addf(r, "%s\r\n", hdr->data); |
| + | result = curlx_dyn_addf(r, "%s\r\n", hdr->data); |
| if(result) | |
| goto out; | |
| } | |
| @@ -2376,8 +2376,8 @@ static CURLcode http_req_complete(struct Curl_easy *data, | |
| #endif | |
| if(httpreq == HTTPREQ_POST) { | |
| if(!Curl_checkheaders(data, STRCONST("Content-Type"))) { | |
| - | result = Curl_dyn_addn(r, STRCONST("Content-Type: application/" |
| - | "x-www-form-urlencoded\r\n")); |
| + | result = curlx_dyn_addn(r, STRCONST("Content-Type: application/" |
| + | "x-www-form-urlencoded\r\n")); |
| if(result) | |
| goto out; | |
| } | |
| @@ -2391,7 +2391,7 @@ static CURLcode http_req_complete(struct Curl_easy *data, | |
| } | |
| /* end of headers */ | |
| - | result = Curl_dyn_addn(r, STRCONST("\r\n")); |
| + | result = curlx_dyn_addn(r, STRCONST("\r\n")); |
| if(!result) { | |
| Curl_pgrsSetUploadSize(data, req_clen); | |
| if(announced_exp100) | |
| @@ -2447,7 +2447,7 @@ static CURLcode http_cookies(struct Curl_easy *data, | |
| if(co->value) { | |
| size_t add; | |
| if(!count) { | |
| - | result = Curl_dyn_addn(r, STRCONST("Cookie: ")); |
| + | result = curlx_dyn_addn(r, STRCONST("Cookie: ")); |
| if(result) | |
| break; | |
| } | |
| @@ -2458,8 +2458,8 @@ static CURLcode http_cookies(struct Curl_easy *data, | |
| linecap = TRUE; | |
| break; | |
| } | |
| - | result = Curl_dyn_addf(r, "%s%s=%s", count ? "; " : "", |
| - | co->name, co->value); |
| + | result = curlx_dyn_addf(r, "%s%s=%s", count ? "; " : "", |
| + | co->name, co->value); |
| if(result) | |
| break; | |
| clen += add + (count ? 2 : 0); | |
| @@ -2470,14 +2470,14 @@ static CURLcode http_cookies(struct Curl_easy *data, | |
| } | |
| if(addcookies && !result && !linecap) { | |
| if(!count) | |
| - | result = Curl_dyn_addn(r, STRCONST("Cookie: ")); |
| + | result = curlx_dyn_addn(r, STRCONST("Cookie: ")); |
| if(!result) { | |
| - | result = Curl_dyn_addf(r, "%s%s", count ? "; " : "", addcookies); |
| + | result = curlx_dyn_addf(r, "%s%s", count ? "; " : "", addcookies); |
| count++; | |
| } | |
| } | |
| if(count && !result) | |
| - | result = Curl_dyn_addn(r, STRCONST("\r\n")); |
| + | result = curlx_dyn_addn(r, STRCONST("\r\n")); |
| if(result) | |
| return result; | |
| @@ -2766,19 +2766,19 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) | |
| goto fail; | |
| /* initialize a dynamic send-buffer */ | |
| - | Curl_dyn_init(&req, DYN_HTTP_REQUEST); |
| + | curlx_dyn_init(&req, DYN_HTTP_REQUEST); |
| /* make sure the header buffer is reset - if there are leftovers from a | |
| previous transfer */ | |
| - | Curl_dyn_reset(&data->state.headerb); |
| + | curlx_dyn_reset(&data->state.headerb); |
| /* add the main request stuff */ | |
| /* GET/HEAD/POST/PUT */ | |
| - | result = Curl_dyn_addf(&req, "%s ", request); |
| + | result = curlx_dyn_addf(&req, "%s ", request); |
| if(!result) | |
| result = http_target(data, conn, &req); | |
| if(result) { | |
| - | Curl_dyn_free(&req); |
| + | curlx_dyn_free(&req); |
| goto fail; | |
| } | |
| @@ -2787,62 +2787,62 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) | |
| altused = aprintf("Alt-Used: %s:%d\r\n", | |
| conn->conn_to_host.name, conn->conn_to_port); | |
| if(!altused) { | |
| - | Curl_dyn_free(&req); |
| + | curlx_dyn_free(&req); |
| return CURLE_OUT_OF_MEMORY; | |
| } | |
| } | |
| #endif | |
| result = | |
| - | Curl_dyn_addf(&req, |
| - | " HTTP/%s\r\n" /* HTTP version */ |
| - | "%s" /* host */ |
| - | "%s" /* proxyuserpwd */ |
| - | "%s" /* userpwd */ |
| - | "%s" /* range */ |
| - | "%s" /* user agent */ |
| - | "%s" /* accept */ |
| - | "%s" /* TE: */ |
| - | "%s" /* accept-encoding */ |
| - | "%s" /* referer */ |
| - | "%s" /* Proxy-Connection */ |
| - | "%s" /* transfer-encoding */ |
| - | "%s",/* Alt-Used */ |
| - | |
| - | httpstring, |
| - | (data->state.aptr.host ? data->state.aptr.host : ""), |
| + | curlx_dyn_addf(&req, |
| + | " HTTP/%s\r\n" /* HTTP version */ |
| + | "%s" /* host */ |
| + | "%s" /* proxyuserpwd */ |
| + | "%s" /* userpwd */ |
| + | "%s" /* range */ |
| + | "%s" /* user agent */ |
| + | "%s" /* accept */ |
| + | "%s" /* TE: */ |
| + | "%s" /* accept-encoding */ |
| + | "%s" /* referer */ |
| + | "%s" /* Proxy-Connection */ |
| + | "%s" /* transfer-encoding */ |
| + | "%s",/* Alt-Used */ |
| + | |
| + | httpstring, |
| + | (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->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->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.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->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> */, |
| #ifndef CURL_DISABLE_PROXY | |
| - | (conn->bits.httpproxy && |
| - | !conn->bits.tunnel_proxy && |
| - | !Curl_checkheaders(data, STRCONST("Proxy-Connection")) && |
| - | !Curl_checkProxyheaders(data, conn, |
| - | STRCONST("Proxy-Connection"))) ? |
| - | "Proxy-Connection: Keep-Alive\r\n":"", |
| + | (conn->bits.httpproxy && |
| + | !conn->bits.tunnel_proxy && |
| + | !Curl_checkheaders(data, STRCONST("Proxy-Connection")) && |
| + | !Curl_checkProxyheaders(data, conn, |
| + | STRCONST("Proxy-Connection"))) ? |
| + | "Proxy-Connection: Keep-Alive\r\n":"", |
| #else | |
| - | "", |
| + | "", |
| #endif | |
| - | te, |
| - | altused ? altused : "" |
| + | te, |
| + | altused ? altused : "" |
| ); | |
| /* clear userpwd and proxyuserpwd to avoid reusing old credentials | |
| @@ -2854,7 +2854,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) | |
| free(altused); | |
| if(result) { | |
| - | Curl_dyn_free(&req); |
| + | curlx_dyn_free(&req); |
| goto fail; | |
| } | |
| @@ -2865,7 +2865,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) | |
| over SSL */ | |
| result = Curl_http2_request_upgrade(&req, data); | |
| if(result) { | |
| - | Curl_dyn_free(&req); |
| + | curlx_dyn_free(&req); |
| return result; | |
| } | |
| } | |
| @@ -2886,7 +2886,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) | |
| if(!result) | |
| result = Curl_req_send(data, &req, httpversion); | |
| } | |
| - | Curl_dyn_free(&req); |
| + | curlx_dyn_free(&req); |
| if(result) | |
| goto fail; | |
| @@ -3026,7 +3026,7 @@ static CURLcode http_header(struct Curl_easy *data, | |
| HD_VAL(hd, hdlen, "Content-Length:") : NULL; | |
| if(v) { | |
| curl_off_t contentlength; | |
| - | int offt = Curl_str_numblanks(&v, &contentlength); |
| + | int offt = curlx_str_numblanks(&v, &contentlength); |
| if(offt == STRE_OK) { | |
| k->size = contentlength; | |
| @@ -3118,7 +3118,7 @@ static CURLcode http_header(struct Curl_easy *data, | |
| /* if it truly stopped on a digit */ | |
| if(ISDIGIT(*ptr)) { | |
| - | if(!Curl_str_number(&ptr, &k->offset, CURL_OFF_T_MAX) && |
| + | if(!curlx_str_number(&ptr, &k->offset, CURL_OFF_T_MAX) && |
| (data->state.resume_from == k->offset)) | |
| /* we asked for a resume and we got it */ | |
| k->content_range = TRUE; | |
| @@ -3229,7 +3229,7 @@ static CURLcode http_header(struct Curl_easy *data, | |
| /* Retry-After = HTTP-date / delay-seconds */ | |
| curl_off_t retry_after = 0; /* zero for unknown or "now" */ | |
| time_t date; | |
| - | Curl_str_passblanks(&v); |
| + | curlx_str_passblanks(&v); |
| /* try it as a date first, because a date can otherwise start with and | |
| get treated as a number */ | |
| @@ -3243,7 +3243,7 @@ static CURLcode http_header(struct Curl_easy *data, | |
| } | |
| else | |
| /* Try it as a decimal number */ | |
| - | Curl_str_number(&v, &retry_after, CURL_OFF_T_MAX); |
| + | curlx_str_number(&v, &retry_after, CURL_OFF_T_MAX); |
| /* limit to 6 hours max. this is not documented so that it can be changed | |
| in the future if necessary. */ | |
| if(retry_after > 21600) | |
| @@ -3858,8 +3858,8 @@ static CURLcode http_rw_hd(struct Curl_easy *data, | |
| struct dynbuf last_header; | |
| size_t consumed; | |
| - | Curl_dyn_init(&last_header, hdlen + 1); |
| - | result = Curl_dyn_addn(&last_header, hd, hdlen); |
| + | curlx_dyn_init(&last_header, hdlen + 1); |
| + | result = curlx_dyn_addn(&last_header, hd, hdlen); |
| if(result) | |
| return result; | |
| @@ -3867,12 +3867,12 @@ static CURLcode http_rw_hd(struct Curl_easy *data, | |
| /* Caveat: we clear anything in the header brigade, because a | |
| * response might switch HTTP version which may call use recursively. | |
| * Not nice, but that is currently the way of things. */ | |
| - | Curl_dyn_reset(&data->state.headerb); |
| - | result = http_on_response(data, Curl_dyn_ptr(&last_header), |
| - | Curl_dyn_len(&last_header), |
| + | curlx_dyn_reset(&data->state.headerb); |
| + | result = http_on_response(data, curlx_dyn_ptr(&last_header), |
| + | curlx_dyn_len(&last_header), |
| buf_remain, blen, &consumed); | |
| *pconsumed += consumed; | |
| - | Curl_dyn_free(&last_header); |
| + | curlx_dyn_free(&last_header); |
| return result; | |
| } | |
| @@ -3897,7 +3897,7 @@ static CURLcode http_rw_hd(struct Curl_easy *data, | |
| */ | |
| const char *p = hd; | |
| - | Curl_str_passblanks(&p); |
| + | curlx_str_passblanks(&p); |
| if(!strncmp(p, "HTTP/", 5)) { | |
| p += 5; | |
| switch(*p) { | |
| @@ -3960,11 +3960,11 @@ static CURLcode http_rw_hd(struct Curl_easy *data, | |
| curl_off_t status; | |
| /* we set the max string a little excessive to forgive some leading | |
| spaces */ | |
| - | if(!Curl_str_until(&p, &ver, 32, ' ') && |
| - | !Curl_str_single(&p, ' ') && |
| - | !Curl_str_number(&p, &status, 999)) { |
| - | Curl_str_trimblanks(&ver); |
| - | if(Curl_str_cmp(&ver, "RTSP/1.0")) { |
| + | if(!curlx_str_until(&p, &ver, 32, ' ') && |
| + | !curlx_str_single(&p, ' ') && |
| + | !curlx_str_number(&p, &status, 999)) { |
| + | curlx_str_trimblanks(&ver); |
| + | if(curlx_str_cmp(&ver, "RTSP/1.0")) { |
| k->httpcode = (int)status; | |
| fine_statusline = TRUE; | |
| k->httpversion = 11; /* RTSP acts like HTTP 1.1 */ | |
| @@ -4034,7 +4034,7 @@ static CURLcode http_parse_headers(struct Curl_easy *data, | |
| if(!end_ptr) { | |
| /* Not a complete header line within buffer, append the data to | |
| the end of the headerbuff. */ | |
| - | result = Curl_dyn_addn(&data->state.headerb, buf, blen); |
| + | result = curlx_dyn_addn(&data->state.headerb, buf, blen); |
| if(result) | |
| return result; | |
| *pconsumed += blen; | |
| @@ -4043,8 +4043,8 @@ static CURLcode http_parse_headers(struct Curl_easy *data, | |
| /* check if this looks like a protocol header */ | |
| statusline st = | |
| checkprotoprefix(data, conn, | |
| - | Curl_dyn_ptr(&data->state.headerb), |
| - | Curl_dyn_len(&data->state.headerb)); |
| + | curlx_dyn_ptr(&data->state.headerb), |
| + | curlx_dyn_len(&data->state.headerb)); |
| if(st == STATUS_BAD) { | |
| /* this is not the beginning of a protocol first header line. | |
| @@ -4068,7 +4068,7 @@ static CURLcode http_parse_headers(struct Curl_easy *data, | |
| /* decrease the size of the remaining (supposed) header line */ | |
| consumed = (end_ptr - buf) + 1; | |
| - | result = Curl_dyn_addn(&data->state.headerb, buf, consumed); |
| + | result = curlx_dyn_addn(&data->state.headerb, buf, consumed); |
| if(result) | |
| return result; | |
| blen -= consumed; | |
| @@ -4082,8 +4082,8 @@ static CURLcode http_parse_headers(struct Curl_easy *data, | |
| if(!k->headerline) { | |
| /* the first read header */ | |
| statusline st = checkprotoprefix(data, conn, | |
| - | Curl_dyn_ptr(&data->state.headerb), |
| - | Curl_dyn_len(&data->state.headerb)); |
| + | curlx_dyn_ptr(&data->state.headerb), |
| + | curlx_dyn_len(&data->state.headerb)); |
| if(st == STATUS_BAD) { | |
| streamclose(conn, "bad HTTP: No end-of-message indicator"); | |
| /* this is not the beginning of a protocol first header line. | |
| @@ -4102,13 +4102,13 @@ static CURLcode http_parse_headers(struct Curl_easy *data, | |
| } | |
| } | |
| - | result = http_rw_hd(data, Curl_dyn_ptr(&data->state.headerb), |
| - | Curl_dyn_len(&data->state.headerb), |
| + | result = http_rw_hd(data, curlx_dyn_ptr(&data->state.headerb), |
| + | curlx_dyn_len(&data->state.headerb), |
| buf, blen, &consumed); | |
| /* We are done with this line. We reset because response | |
| * processing might switch to HTTP/2 and that might call us | |
| * directly again. */ | |
| - | Curl_dyn_reset(&data->state.headerb); |
| + | curlx_dyn_reset(&data->state.headerb); |
| if(consumed) { | |
| blen -= consumed; | |
| buf += consumed; | |
| @@ -4123,7 +4123,7 @@ static CURLcode http_parse_headers(struct Curl_easy *data, | |
| buffer. */ | |
| out: | |
| if(!k->header && !leftover_body) { | |
| - | Curl_dyn_free(&data->state.headerb); |
| + | curlx_dyn_free(&data->state.headerb); |
| } | |
| return CURLE_OK; | |
| } | |
| @@ -4161,15 +4161,15 @@ CURLcode Curl_http_write_resp_hds(struct Curl_easy *data, | |
| result = http_parse_headers(data, buf, blen, pconsumed); | |
| if(!result && !data->req.header) { | |
| - | if(!data->req.no_body && Curl_dyn_len(&data->state.headerb)) { |
| + | if(!data->req.no_body && curlx_dyn_len(&data->state.headerb)) { |
| /* leftover from parsing something that turned out not | |
| * to be a header, only happens if we allow for | |
| * HTTP/0.9 like responses */ | |
| result = Curl_client_write(data, CLIENTWRITE_BODY, | |
| - | Curl_dyn_ptr(&data->state.headerb), |
| - | Curl_dyn_len(&data->state.headerb)); |
| + | curlx_dyn_ptr(&data->state.headerb), |
| + | curlx_dyn_len(&data->state.headerb)); |
| } | |
| - | Curl_dyn_free(&data->state.headerb); |
| + | curlx_dyn_free(&data->state.headerb); |
| } | |
| return result; | |
| } | |
| @@ -4278,7 +4278,7 @@ static CURLcode req_assign_url_authority(struct httpreq *req, CURLU *url) | |
| CURLcode result = CURLE_URL_MALFORMAT; | |
| user = pass = host = port = NULL; | |
| - | Curl_dyn_init(&buf, DYN_HTTP_REQUEST); |
| + | curlx_dyn_init(&buf, DYN_HTTP_REQUEST); |
| uc = curl_url_get(url, CURLUPART_HOST, &host, 0); | |
| if(uc && uc != CURLUE_NO_HOST) | |
| @@ -4302,27 +4302,27 @@ static CURLcode req_assign_url_authority(struct httpreq *req, CURLU *url) | |
| } | |
| if(user) { | |
| - | result = Curl_dyn_add(&buf, user); |
| + | result = curlx_dyn_add(&buf, user); |
| if(result) | |
| goto out; | |
| if(pass) { | |
| - | result = Curl_dyn_addf(&buf, ":%s", pass); |
| + | result = curlx_dyn_addf(&buf, ":%s", pass); |
| if(result) | |
| goto out; | |
| } | |
| - | result = Curl_dyn_add(&buf, "@"); |
| + | result = curlx_dyn_add(&buf, "@"); |
| if(result) | |
| goto out; | |
| } | |
| - | result = Curl_dyn_add(&buf, host); |
| + | result = curlx_dyn_add(&buf, host); |
| if(result) | |
| goto out; | |
| if(port) { | |
| - | result = Curl_dyn_addf(&buf, ":%s", port); |
| + | result = curlx_dyn_addf(&buf, ":%s", port); |
| if(result) | |
| goto out; | |
| } | |
| - | req->authority = strdup(Curl_dyn_ptr(&buf)); |
| + | req->authority = strdup(curlx_dyn_ptr(&buf)); |
| if(!req->authority) | |
| goto out; | |
| result = CURLE_OK; | |
| @@ -4332,7 +4332,7 @@ out: | |
| free(pass); | |
| free(host); | |
| free(port); | |
| - | Curl_dyn_free(&buf); |
| + | curlx_dyn_free(&buf); |
| return result; | |
| } | |
| @@ -4344,7 +4344,7 @@ static CURLcode req_assign_url_path(struct httpreq *req, CURLU *url) | |
| CURLcode result = CURLE_URL_MALFORMAT; | |
| path = query = NULL; | |
| - | Curl_dyn_init(&buf, DYN_HTTP_REQUEST); |
| + | curlx_dyn_init(&buf, DYN_HTTP_REQUEST); |
| uc = curl_url_get(url, CURLUPART_PATH, &path, CURLU_PATH_AS_IS); | |
| if(uc) | |
| @@ -4362,16 +4362,16 @@ static CURLcode req_assign_url_path(struct httpreq *req, CURLU *url) | |
| } | |
| else { | |
| if(path) { | |
| - | result = Curl_dyn_add(&buf, path); |
| + | result = curlx_dyn_add(&buf, path); |
| if(result) | |
| goto out; | |
| } | |
| if(query) { | |
| - | result = Curl_dyn_addf(&buf, "?%s", query); |
| + | result = curlx_dyn_addf(&buf, "?%s", query); |
| if(result) | |
| goto out; | |
| } | |
| - | req->path = strdup(Curl_dyn_ptr(&buf)); |
| + | req->path = strdup(curlx_dyn_ptr(&buf)); |
| if(!req->path) | |
| goto out; | |
| } | |
| @@ -4380,7 +4380,7 @@ static CURLcode req_assign_url_path(struct httpreq *req, CURLU *url) | |
| out: | |
| free(path); | |
| free(query); | |
| - | Curl_dyn_free(&buf); |
| + | curlx_dyn_free(&buf); |
| return result; | |
| } | |
| @@ -4474,9 +4474,9 @@ static bool http_TE_has_token(const char *fvalue, const char *token) | |
| /* skip to first token */ | |
| while(ISBLANK(*fvalue) || *fvalue == ',') | |
| fvalue++; | |
| - | if(Curl_str_cspn(&fvalue, &name, " \t\r;,")) |
| + | if(curlx_str_cspn(&fvalue, &name, " \t\r;,")) |
| return FALSE; | |
| - | if(Curl_str_casecompare(&name, token)) |
| + | if(curlx_str_casecompare(&name, token)) |
| return TRUE; | |
| /* skip any remainder after token, e.g. parameters with quoted strings */ | |
| @@ -4485,7 +4485,7 @@ static bool http_TE_has_token(const char *fvalue, const char *token) | |
| struct Curl_str qw; | |
| /* if we do not cleanly find a quoted word here, the header value | |
| * does not follow HTTP syntax and we reject */ | |
| - | if(Curl_str_quotedword(&fvalue, &qw, CURL_MAX_HTTP_HEADER)) |
| + | if(curlx_str_quotedword(&fvalue, &qw, CURL_MAX_HTTP_HEADER)) |
| return FALSE; | |
| } | |
| else | |
| @@ -4513,7 +4513,7 @@ CURLcode Curl_http_req_to_h2(struct dynhds *h2_headers, | |
| scheme = Curl_checkheaders(data, STRCONST(HTTP_PSEUDO_SCHEME)); | |
| if(scheme) { | |
| scheme += sizeof(HTTP_PSEUDO_SCHEME); | |
| - | Curl_str_passblanks(&scheme); |
| + | curlx_str_passblanks(&scheme); |
| infof(data, "set pseudo header %s to %s", HTTP_PSEUDO_SCHEME, scheme); | |
| } | |
| else { | |
| @@ -4648,7 +4648,7 @@ static CURLcode cr_exp100_read(struct Curl_easy *data, | |
| DEBUGF(infof(data, "cr_exp100_read, start AWAITING_CONTINUE, " | |
| "timeout %ldms", data->set.expect_100_timeout)); | |
| ctx->state = EXP100_AWAITING_CONTINUE; | |
| - | ctx->start = Curl_now(); |
| + | ctx->start = curlx_now(); |
| Curl_expire(data, data->set.expect_100_timeout, EXPIRE_100_TIMEOUT); | |
| data->req.keepon &= ~KEEP_SEND; | |
| data->req.keepon |= KEEP_SEND_TIMED; | |
| @@ -4661,7 +4661,7 @@ static CURLcode cr_exp100_read(struct Curl_easy *data, | |
| *eos = FALSE; | |
| return CURLE_READ_ERROR; | |
| case EXP100_AWAITING_CONTINUE: | |
| - | ms = Curl_timediff(Curl_now(), ctx->start); |
| + | ms = curlx_timediff(curlx_now(), ctx->start); |
| if(ms < data->set.expect_100_timeout) { | |
| DEBUGF(infof(data, "cr_exp100_read, AWAITING_CONTINUE, not expired")); | |
| data->req.keepon &= ~KEEP_SEND; | |
| @@ -44,14 +44,14 @@ void Curl_h1_req_parse_init(struct h1_req_parser *parser, size_t max_line_len) | |
| { | |
| memset(parser, 0, sizeof(*parser)); | |
| parser->max_line_len = max_line_len; | |
| - | Curl_dyn_init(&parser->scratch, max_line_len); |
| + | curlx_dyn_init(&parser->scratch, max_line_len); |
| } | |
| void Curl_h1_req_parse_free(struct h1_req_parser *parser) | |
| { | |
| if(parser) { | |
| Curl_http_req_free(parser->req); | |
| - | Curl_dyn_free(&parser->scratch); |
| + | curlx_dyn_free(&parser->scratch); |
| parser->req = NULL; | |
| parser->done = FALSE; | |
| } | |
| @@ -108,18 +108,18 @@ static ssize_t next_line(struct h1_req_parser *parser, | |
| if(parser->line) { | |
| parser->line = NULL; | |
| parser->line_len = 0; | |
| - | Curl_dyn_reset(&parser->scratch); |
| + | curlx_dyn_reset(&parser->scratch); |
| } | |
| nread = detect_line(parser, buf, buflen, err); | |
| if(nread >= 0) { | |
| - | if(Curl_dyn_len(&parser->scratch)) { |
| + | if(curlx_dyn_len(&parser->scratch)) { |
| /* append detected line to scratch to have the complete line */ | |
| - | *err = Curl_dyn_addn(&parser->scratch, parser->line, parser->line_len); |
| + | *err = curlx_dyn_addn(&parser->scratch, parser->line, parser->line_len); |
| if(*err) | |
| return -1; | |
| - | parser->line = Curl_dyn_ptr(&parser->scratch); |
| - | parser->line_len = Curl_dyn_len(&parser->scratch); |
| + | parser->line = curlx_dyn_ptr(&parser->scratch); |
| + | parser->line_len = curlx_dyn_len(&parser->scratch); |
| } | |
| *err = trim_line(parser, options); | |
| if(*err) | |
| @@ -127,7 +127,8 @@ 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); |
| + | *err = curlx_dyn_addn(&parser->scratch, (const unsigned char *)buf, |
| + | buflen); |
| nread = (*err) ? -1 : (ssize_t)buflen; | |
| } | |
| return nread; | |
| @@ -299,7 +300,7 @@ ssize_t Curl_h1_req_parse_read(struct h1_req_parser *parser, | |
| goto out; | |
| } | |
| parser->done = TRUE; | |
| - | Curl_dyn_reset(&parser->scratch); |
| + | curlx_dyn_reset(&parser->scratch); |
| /* last chance adjustments */ | |
| } | |
| else { | |
| @@ -321,13 +322,13 @@ CURLcode Curl_h1_req_write_head(struct httpreq *req, int http_minor, | |
| { | |
| CURLcode result; | |
| - | 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 : "", |
| - | http_minor); |
| + | result = curlx_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 : "", |
| + | http_minor); |
| if(result) | |
| goto out; | |
| @@ -335,7 +336,7 @@ CURLcode Curl_h1_req_write_head(struct httpreq *req, int http_minor, | |
| if(result) | |
| goto out; | |
| - | result = Curl_dyn_addn(dbuf, STRCONST("\r\n")); |
| + | result = curlx_dyn_addn(dbuf, STRCONST("\r\n")); |
| out: | |
| return result; | |
| @@ -35,7 +35,7 @@ | |
| #include "http.h" | |
| #include "sendf.h" | |
| #include "select.h" | |
| - | #include "curl_base64.h" |
| + | #include "curlx/base64.h" |
| #include "strcase.h" | |
| #include "multiif.h" | |
| #include "url.h" | |
| @@ -44,9 +44,9 @@ | |
| #include "connect.h" | |
| #include "rand.h" | |
| #include "strdup.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| #include "transfer.h" | |
| - | #include "dynbuf.h" |
| + | #include "curlx/dynbuf.h" |
| #include "headers.h" | |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -166,7 +166,7 @@ static void cf_h2_ctx_init(struct cf_h2_ctx *ctx, bool via_h1_upgrade) | |
| Curl_bufcp_init(&ctx->stream_bufcp, H2_CHUNK_SIZE, H2_STREAM_POOL_SPARES); | |
| Curl_bufq_initp(&ctx->inbufq, &ctx->stream_bufcp, H2_NW_RECV_CHUNKS, 0); | |
| Curl_bufq_initp(&ctx->outbufq, &ctx->stream_bufcp, H2_NW_SEND_CHUNKS, 0); | |
| - | Curl_dyn_init(&ctx->scratch, CURL_MAX_HTTP_HEADER); |
| + | curlx_dyn_init(&ctx->scratch, CURL_MAX_HTTP_HEADER); |
| Curl_uint_hash_init(&ctx->streams, 63, h2_stream_hash_free); | |
| ctx->remote_max_sid = 2147483647; | |
| ctx->via_h1_upgrade = via_h1_upgrade; | |
| @@ -177,7 +177,7 @@ static void cf_h2_ctx_init(struct cf_h2_ctx *ctx, bool via_h1_upgrade) | |
| ctx->stream_win_max = H2_STREAM_WINDOW_SIZE_MAX; | |
| if(p) { | |
| curl_off_t l; | |
| - | if(!Curl_str_number(&p, &l, INT_MAX)) |
| + | if(!curlx_str_number(&p, &l, INT_MAX)) |
| ctx->stream_win_max = (int32_t)l; | |
| } | |
| } | |
| @@ -191,7 +191,7 @@ static void cf_h2_ctx_free(struct cf_h2_ctx *ctx) | |
| Curl_bufq_free(&ctx->inbufq); | |
| Curl_bufq_free(&ctx->outbufq); | |
| Curl_bufcp_free(&ctx->stream_bufcp); | |
| - | Curl_dyn_free(&ctx->scratch); |
| + | curlx_dyn_free(&ctx->scratch); |
| Curl_uint_hash_destroy(&ctx->streams); | |
| memset(ctx, 0, sizeof(*ctx)); | |
| } | |
| @@ -206,7 +206,7 @@ static void cf_h2_ctx_close(struct cf_h2_ctx *ctx) | |
| } | |
| static CURLcode h2_progress_egress(struct Curl_cfilter *cf, | |
| - | struct Curl_easy *data); |
| + | struct Curl_easy *data); |
| /** | |
| * All about the H2 internals of a stream | |
| @@ -237,8 +237,9 @@ struct h2_stream_ctx { | |
| BIT(write_paused); /* stream write is paused */ | |
| }; | |
| - | #define H2_STREAM_CTX(ctx,data) ((struct h2_stream_ctx *)(\ |
| - | data? Curl_uint_hash_get(&(ctx)->streams, (data)->mid) : NULL)) |
| + | #define H2_STREAM_CTX(ctx,data) \ |
| + | ((struct h2_stream_ctx *)( \ |
| + | data? Curl_uint_hash_get(&(ctx)->streams, (data)->mid) : NULL)) |
| static struct h2_stream_ctx *h2_stream_ctx_create(struct cf_h2_ctx *ctx) | |
| { | |
| @@ -461,7 +462,7 @@ static int h2_client_new(struct Curl_cfilter *cf, | |
| struct cf_h2_ctx *ctx = cf->ctx; | |
| nghttp2_option *o; | |
| nghttp2_mem mem = {NULL, Curl_nghttp2_malloc, Curl_nghttp2_free, | |
| - | Curl_nghttp2_calloc, Curl_nghttp2_realloc}; |
| + | Curl_nghttp2_calloc, Curl_nghttp2_realloc}; |
| int rc = nghttp2_option_new(&o); | |
| if(rc) | |
| @@ -1721,15 +1722,15 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame, | |
| cf_h2_header_error(cf, data_s, stream, result); | |
| return NGHTTP2_ERR_CALLBACK_FAILURE; | |
| } | |
| - | Curl_dyn_reset(&ctx->scratch); |
| - | result = Curl_dyn_addn(&ctx->scratch, STRCONST("HTTP/2 ")); |
| + | curlx_dyn_reset(&ctx->scratch); |
| + | result = curlx_dyn_addn(&ctx->scratch, STRCONST("HTTP/2 ")); |
| if(!result) | |
| - | result = Curl_dyn_addn(&ctx->scratch, value, valuelen); |
| + | result = curlx_dyn_addn(&ctx->scratch, value, valuelen); |
| if(!result) | |
| - | result = Curl_dyn_addn(&ctx->scratch, STRCONST(" \r\n")); |
| + | result = curlx_dyn_addn(&ctx->scratch, STRCONST(" \r\n")); |
| if(!result) | |
| - | h2_xfer_write_resp_hd(cf, data_s, stream, Curl_dyn_ptr(&ctx->scratch), |
| - | Curl_dyn_len(&ctx->scratch), FALSE); |
| + | h2_xfer_write_resp_hd(cf, data_s, stream, curlx_dyn_ptr(&ctx->scratch), |
| + | curlx_dyn_len(&ctx->scratch), FALSE); |
| if(result) { | |
| cf_h2_header_error(cf, data_s, stream, result); | |
| return NGHTTP2_ERR_CALLBACK_FAILURE; | |
| @@ -1746,17 +1747,17 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame, | |
| /* nghttp2 guarantees that namelen > 0, and :status was already | |
| received, and this is not pseudo-header field . */ | |
| /* convert to an HTTP1-style header */ | |
| - | Curl_dyn_reset(&ctx->scratch); |
| - | result = Curl_dyn_addn(&ctx->scratch, (const char *)name, namelen); |
| + | curlx_dyn_reset(&ctx->scratch); |
| + | result = curlx_dyn_addn(&ctx->scratch, (const char *)name, namelen); |
| if(!result) | |
| - | result = Curl_dyn_addn(&ctx->scratch, STRCONST(": ")); |
| + | result = curlx_dyn_addn(&ctx->scratch, STRCONST(": ")); |
| if(!result) | |
| - | result = Curl_dyn_addn(&ctx->scratch, (const char *)value, valuelen); |
| + | result = curlx_dyn_addn(&ctx->scratch, (const char *)value, valuelen); |
| if(!result) | |
| - | result = Curl_dyn_addn(&ctx->scratch, STRCONST("\r\n")); |
| + | result = curlx_dyn_addn(&ctx->scratch, STRCONST("\r\n")); |
| if(!result) | |
| - | h2_xfer_write_resp_hd(cf, data_s, stream, Curl_dyn_ptr(&ctx->scratch), |
| - | Curl_dyn_len(&ctx->scratch), FALSE); |
| + | h2_xfer_write_resp_hd(cf, data_s, stream, curlx_dyn_ptr(&ctx->scratch), |
| + | curlx_dyn_len(&ctx->scratch), FALSE); |
| if(result) { | |
| cf_h2_header_error(cf, data_s, stream, result); | |
| return NGHTTP2_ERR_CALLBACK_FAILURE; | |
| @@ -1849,22 +1850,22 @@ CURLcode Curl_http2_request_upgrade(struct dynbuf *req, | |
| binlen = populate_binsettings(binsettings, data); | |
| if(binlen <= 0) { | |
| failf(data, "nghttp2 unexpectedly failed on pack_settings_payload"); | |
| - | Curl_dyn_free(req); |
| + | curlx_dyn_free(req); |
| return CURLE_FAILED_INIT; | |
| } | |
| - | result = Curl_base64url_encode((const char *)binsettings, (size_t)binlen, |
| - | &base64, &blen); |
| + | result = curlx_base64url_encode((const char *)binsettings, (size_t)binlen, |
| + | &base64, &blen); |
| if(result) { | |
| - | Curl_dyn_free(req); |
| + | curlx_dyn_free(req); |
| return result; | |
| } | |
| - | result = Curl_dyn_addf(req, |
| - | "Connection: Upgrade, HTTP2-Settings\r\n" |
| - | "Upgrade: %s\r\n" |
| - | "HTTP2-Settings: %s\r\n", |
| - | NGHTTP2_CLEARTEXT_PROTO_VERSION_ID, base64); |
| + | result = curlx_dyn_addf(req, |
| + | "Connection: Upgrade, HTTP2-Settings\r\n" |
| + | "Upgrade: %s\r\n" |
| + | "HTTP2-Settings: %s\r\n", |
| + | NGHTTP2_CLEARTEXT_PROTO_VERSION_ID, base64); |
| free(base64); | |
| k->upgr101 = UPGR101_H2; | |
| @@ -1924,25 +1925,25 @@ static ssize_t http2_handle_stream_close(struct Curl_cfilter *cf, | |
| size_t i; | |
| *err = CURLE_OK; | |
| - | Curl_dyn_init(&dbuf, DYN_TRAILERS); |
| + | curlx_dyn_init(&dbuf, DYN_TRAILERS); |
| for(i = 0; i < Curl_dynhds_count(&stream->resp_trailers); ++i) { | |
| e = Curl_dynhds_getn(&stream->resp_trailers, i); | |
| if(!e) | |
| break; | |
| - | Curl_dyn_reset(&dbuf); |
| - | *err = Curl_dyn_addf(&dbuf, "%.*s: %.*s\x0d\x0a", |
| - | (int)e->namelen, e->name, |
| - | (int)e->valuelen, e->value); |
| + | curlx_dyn_reset(&dbuf); |
| + | *err = curlx_dyn_addf(&dbuf, "%.*s: %.*s\x0d\x0a", |
| + | (int)e->namelen, e->name, |
| + | (int)e->valuelen, e->value); |
| if(*err) | |
| break; | |
| - | Curl_debug(data, CURLINFO_HEADER_IN, Curl_dyn_ptr(&dbuf), |
| - | Curl_dyn_len(&dbuf)); |
| + | Curl_debug(data, CURLINFO_HEADER_IN, curlx_dyn_ptr(&dbuf), |
| + | curlx_dyn_len(&dbuf)); |
| *err = Curl_client_write(data, CLIENTWRITE_HEADER|CLIENTWRITE_TRAILER, | |
| - | Curl_dyn_ptr(&dbuf), Curl_dyn_len(&dbuf)); |
| + | curlx_dyn_ptr(&dbuf), curlx_dyn_len(&dbuf)); |
| if(*err) | |
| break; | |
| } | |
| - | Curl_dyn_free(&dbuf); |
| + | curlx_dyn_free(&dbuf); |
| if(*err) | |
| goto out; | |
| } | |
| @@ -35,7 +35,7 @@ | |
| #include "parsedate.h" | |
| #include "sendf.h" | |
| #include "escape.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| #include <time.h> | |
| @@ -95,7 +95,7 @@ static void trim_headers(struct curl_slist *head) | |
| store = (char *)CURL_UNCONST(value); | |
| /* skip leading whitespace */ | |
| - | Curl_str_passblanks(&value); |
| + | curlx_str_passblanks(&value); |
| while(*value) { | |
| int space = 0; | |
| @@ -172,9 +172,9 @@ static CURLcode merge_duplicate_headers(struct curl_slist *head) | |
| char *colon_next; | |
| char *val_next; | |
| - | Curl_dyn_init(&buf, CURL_MAX_HTTP_HEADER); |
| + | curlx_dyn_init(&buf, CURL_MAX_HTTP_HEADER); |
| - | result = Curl_dyn_add(&buf, curr->data); |
| + | result = curlx_dyn_add(&buf, curr->data); |
| if(result) | |
| return result; | |
| @@ -182,16 +182,16 @@ static CURLcode merge_duplicate_headers(struct curl_slist *head) | |
| DEBUGASSERT(colon_next); | |
| val_next = colon_next + 1; | |
| - | result = Curl_dyn_addn(&buf, ",", 1); |
| + | result = curlx_dyn_addn(&buf, ",", 1); |
| if(result) | |
| return result; | |
| - | result = Curl_dyn_add(&buf, val_next); |
| + | result = curlx_dyn_add(&buf, val_next); |
| if(result) | |
| return result; | |
| free(curr->data); | |
| - | curr->data = Curl_dyn_ptr(&buf); |
| + | curr->data = curlx_dyn_ptr(&buf); |
| curr->next = next->next; | |
| free(next->data); | |
| @@ -319,7 +319,7 @@ static CURLcode make_headers(struct Curl_easy *data, | |
| goto fail; | |
| } | |
| ++value; | |
| - | Curl_str_passblanks(&value); |
| + | curlx_str_passblanks(&value); |
| endp = value; | |
| while(*endp && ISALNUM(*endp)) | |
| ++endp; | |
| @@ -357,9 +357,9 @@ static CURLcode make_headers(struct Curl_easy *data, | |
| for(l = head; l; l = l->next) { | |
| char *tmp; | |
| - | if(Curl_dyn_add(canonical_headers, l->data)) |
| + | if(curlx_dyn_add(canonical_headers, l->data)) |
| goto fail; | |
| - | if(Curl_dyn_add(canonical_headers, "\n")) |
| + | if(curlx_dyn_add(canonical_headers, "\n")) |
| goto fail; | |
| tmp = strchr(l->data, ':'); | |
| @@ -367,10 +367,10 @@ static CURLcode make_headers(struct Curl_easy *data, | |
| *tmp = 0; | |
| if(l != head) { | |
| - | if(Curl_dyn_add(signed_headers, ";")) |
| + | if(curlx_dyn_add(signed_headers, ";")) |
| goto fail; | |
| } | |
| - | if(Curl_dyn_add(signed_headers, l->data)) |
| + | if(curlx_dyn_add(signed_headers, l->data)) |
| goto fail; | |
| } | |
| @@ -409,7 +409,7 @@ static const char *parse_content_sha_hdr(struct Curl_easy *data, | |
| return NULL; | |
| ++value; | |
| - | Curl_str_passblanks(&value); |
| + | curlx_str_passblanks(&value); |
| len = strlen(value); | |
| while(len > 0 && ISBLANK(value[len-1])) | |
| @@ -512,7 +512,7 @@ static CURLcode canon_string(const char *q, size_t len, | |
| for(; len && !result; q++, len--) { | |
| if(ISALNUM(*q)) | |
| - | result = Curl_dyn_addn(dq, q, 1); |
| + | result = curlx_dyn_addn(dq, q, 1); |
| else { | |
| switch(*q) { | |
| case '-': | |
| @@ -520,7 +520,7 @@ static CURLcode canon_string(const char *q, size_t len, | |
| case '_': | |
| case '~': | |
| /* allowed as-is */ | |
| - | result = Curl_dyn_addn(dq, q, 1); |
| + | result = curlx_dyn_addn(dq, q, 1); |
| break; | |
| case '%': | |
| /* uppercase the following if hexadecimal */ | |
| @@ -528,13 +528,13 @@ static CURLcode canon_string(const char *q, size_t len, | |
| char tmp[3]="%"; | |
| tmp[1] = Curl_raw_toupper(q[1]); | |
| tmp[2] = Curl_raw_toupper(q[2]); | |
| - | result = Curl_dyn_addn(dq, tmp, 3); |
| + | result = curlx_dyn_addn(dq, tmp, 3); |
| q += 2; | |
| len -= 2; | |
| } | |
| else | |
| /* '%' without a following two-digit hex, encode it */ | |
| - | result = Curl_dyn_addn(dq, "%25", 3); |
| + | result = curlx_dyn_addn(dq, "%25", 3); |
| break; | |
| default: { | |
| unsigned char out[3]={'%'}; | |
| @@ -543,21 +543,21 @@ static CURLcode canon_string(const char *q, size_t len, | |
| /* if found_equals is NULL assuming, been in path */ | |
| if(*q == '/') { | |
| /* allowed as if */ | |
| - | result = Curl_dyn_addn(dq, q, 1); |
| + | result = curlx_dyn_addn(dq, q, 1); |
| break; | |
| } | |
| } | |
| else { | |
| /* allowed as-is */ | |
| if(*q == '=') { | |
| - | result = Curl_dyn_addn(dq, q, 1); |
| + | result = curlx_dyn_addn(dq, q, 1); |
| *found_equals = TRUE; | |
| break; | |
| } | |
| } | |
| /* URL encode */ | |
| Curl_hexbyte(&out[1], *q, FALSE); | |
| - | result = Curl_dyn_addn(dq, out, 3); |
| + | result = curlx_dyn_addn(dq, out, 3); |
| break; | |
| } | |
| } | |
| @@ -611,11 +611,11 @@ static CURLcode canon_query(struct Curl_easy *data, | |
| result = canon_string(q, ap->len, dq, &found_equals); | |
| if(!result && !found_equals) { | |
| /* queries without value still need an equals */ | |
| - | result = Curl_dyn_addn(dq, "=", 1); |
| + | result = curlx_dyn_addn(dq, "=", 1); |
| } | |
| if(!result && i < entry - 1) { | |
| /* insert ampersands between query pairs */ | |
| - | result = Curl_dyn_addn(dq, "&", 1); |
| + | result = curlx_dyn_addn(dq, "&", 1); |
| } | |
| } | |
| return result; | |
| @@ -664,10 +664,10 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data) | |
| } | |
| /* we init those buffers here, so goto fail will free initialized dynbuf */ | |
| - | Curl_dyn_init(&canonical_headers, CURL_MAX_HTTP_HEADER); |
| - | Curl_dyn_init(&canonical_query, CURL_MAX_HTTP_HEADER); |
| - | Curl_dyn_init(&signed_headers, CURL_MAX_HTTP_HEADER); |
| - | Curl_dyn_init(&canonical_path, CURL_MAX_HTTP_HEADER); |
| + | curlx_dyn_init(&canonical_headers, CURL_MAX_HTTP_HEADER); |
| + | curlx_dyn_init(&canonical_query, CURL_MAX_HTTP_HEADER); |
| + | curlx_dyn_init(&signed_headers, CURL_MAX_HTTP_HEADER); |
| + | curlx_dyn_init(&canonical_path, CURL_MAX_HTTP_HEADER); |
| /* | |
| * Parameters parsing | |
| @@ -684,62 +684,62 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data) | |
| No string can be longer than N bytes of non-whitespace | |
| */ | |
| - | if(Curl_str_until(&line, &provider0, MAX_SIGV4_LEN, ':')) { |
| + | if(curlx_str_until(&line, &provider0, MAX_SIGV4_LEN, ':')) { |
| failf(data, "first aws-sigv4 provider cannot be empty"); | |
| result = CURLE_BAD_FUNCTION_ARGUMENT; | |
| goto fail; | |
| } | |
| - | if(Curl_str_single(&line, ':') || |
| - | Curl_str_until(&line, &provider1, MAX_SIGV4_LEN, ':')) { |
| + | if(curlx_str_single(&line, ':') || |
| + | curlx_str_until(&line, &provider1, MAX_SIGV4_LEN, ':')) { |
| provider1 = provider0; | |
| } | |
| - | else if(Curl_str_single(&line, ':') || |
| - | Curl_str_until(&line, ®ion, MAX_SIGV4_LEN, ':') || |
| - | Curl_str_single(&line, ':') || |
| - | Curl_str_until(&line, &service, MAX_SIGV4_LEN, ':')) { |
| + | else if(curlx_str_single(&line, ':') || |
| + | curlx_str_until(&line, ®ion, MAX_SIGV4_LEN, ':') || |
| + | curlx_str_single(&line, ':') || |
| + | curlx_str_until(&line, &service, MAX_SIGV4_LEN, ':')) { |
| /* nothing to do */ | |
| } | |
| - | if(!Curl_strlen(&service)) { |
| + | if(!curlx_strlen(&service)) { |
| const char *p = hostname; | |
| - | if(Curl_str_until(&p, &service, MAX_SIGV4_LEN, '.') || |
| - | Curl_str_single(&p, '.')) { |
| + | if(curlx_str_until(&p, &service, MAX_SIGV4_LEN, '.') || |
| + | curlx_str_single(&p, '.')) { |
| failf(data, "aws-sigv4: service missing in parameters and hostname"); | |
| result = CURLE_URL_MALFORMAT; | |
| goto fail; | |
| } | |
| infof(data, "aws_sigv4: picked service %.*s from host", | |
| - | (int)Curl_strlen(&service), Curl_str(&service)); |
| + | (int)curlx_strlen(&service), curlx_str(&service)); |
| - | if(!Curl_strlen(®ion)) { |
| - | if(Curl_str_until(&p, ®ion, MAX_SIGV4_LEN, '.') || |
| - | Curl_str_single(&p, '.')) { |
| + | if(!curlx_strlen(®ion)) { |
| + | if(curlx_str_until(&p, ®ion, MAX_SIGV4_LEN, '.') || |
| + | curlx_str_single(&p, '.')) { |
| failf(data, "aws-sigv4: region missing in parameters and hostname"); | |
| result = CURLE_URL_MALFORMAT; | |
| goto fail; | |
| } | |
| infof(data, "aws_sigv4: picked region %.*s from host", | |
| - | (int)Curl_strlen(®ion), Curl_str(®ion)); |
| + | (int)curlx_strlen(®ion), curlx_str(®ion)); |
| } | |
| } | |
| Curl_http_method(data, conn, &method, &httpreq); | |
| payload_hash = | |
| - | parse_content_sha_hdr(data, Curl_str(&provider1), Curl_strlen(&provider1), |
| - | &payload_hash_len); |
| + | parse_content_sha_hdr(data, curlx_str(&provider1), |
| + | curlx_strlen(&provider1), &payload_hash_len); |
| if(!payload_hash) { | |
| /* AWS S3 requires a x-amz-content-sha256 header, and supports special | |
| * values like UNSIGNED-PAYLOAD */ | |
| - | bool sign_as_s3 = Curl_str_casecompare(&provider0, "aws") && |
| - | Curl_str_casecompare(&service, "s3"); |
| + | bool sign_as_s3 = curlx_str_casecompare(&provider0, "aws") && |
| + | curlx_str_casecompare(&service, "s3"); |
| if(sign_as_s3) | |
| - | result = calc_s3_payload_hash(data, httpreq, Curl_str(&provider1), |
| - | Curl_strlen(&provider1), sha_hash, sha_hex, |
| - | content_sha256_hdr); |
| + | result = calc_s3_payload_hash(data, httpreq, curlx_str(&provider1), |
| + | curlx_strlen(&provider1), sha_hash, |
| + | sha_hex, content_sha256_hdr); |
| else | |
| result = calc_payload_hash(data, sha_hash, sha_hex); | |
| if(result) | |
| @@ -771,7 +771,7 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data) | |
| } | |
| result = make_headers(data, hostname, timestamp, | |
| - | Curl_str(&provider1), Curl_strlen(&provider1), |
| + | curlx_str(&provider1), curlx_strlen(&provider1), |
| &date_header, content_sha256_hdr, | |
| &canonical_headers, &signed_headers); | |
| if(result) | |
| @@ -805,11 +805,11 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data) | |
| "%s\n" /* SignedHeaders */ | |
| "%.*s", /* HashedRequestPayload in hex */ | |
| method, | |
| - | Curl_dyn_ptr(&canonical_path), |
| - | Curl_dyn_ptr(&canonical_query) ? |
| - | Curl_dyn_ptr(&canonical_query) : "", |
| - | Curl_dyn_ptr(&canonical_headers), |
| - | Curl_dyn_ptr(&signed_headers), |
| + | curlx_dyn_ptr(&canonical_path), |
| + | curlx_dyn_ptr(&canonical_query) ? |
| + | curlx_dyn_ptr(&canonical_query) : "", |
| + | curlx_dyn_ptr(&canonical_headers), |
| + | curlx_dyn_ptr(&signed_headers), |
| (int)payload_hash_len, payload_hash); | |
| if(!canonical_request) | |
| goto fail; | |
| @@ -818,17 +818,17 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data) | |
| canonical_request); | |
| request_type = aprintf("%.*s4_request", | |
| - | (int)Curl_strlen(&provider0), Curl_str(&provider0)); |
| + | (int)curlx_strlen(&provider0), curlx_str(&provider0)); |
| if(!request_type) | |
| goto fail; | |
| /* provider0 is lowercased *after* aprintf() so that the buffer can be | |
| written to */ | |
| - | Curl_strntolower(request_type, request_type, Curl_strlen(&provider0)); |
| + | Curl_strntolower(request_type, request_type, curlx_strlen(&provider0)); |
| credential_scope = aprintf("%s/%.*s/%.*s/%s", date, | |
| - | (int)Curl_strlen(®ion), Curl_str(®ion), |
| - | (int)Curl_strlen(&service), Curl_str(&service), |
| + | (int)curlx_strlen(®ion), curlx_str(®ion), |
| + | (int)curlx_strlen(&service), curlx_str(&service), |
| request_type); | |
| if(!credential_scope) | |
| goto fail; | |
| @@ -847,7 +847,7 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data) | |
| "%s\n" /* RequestDateTime */ | |
| "%s\n" /* CredentialScope */ | |
| "%s", /* HashedCanonicalRequest in hex */ | |
| - | (int)Curl_strlen(&provider0), Curl_str(&provider0), |
| + | (int)curlx_strlen(&provider0), curlx_str(&provider0), |
| timestamp, | |
| credential_scope, | |
| sha_hex); | |
| @@ -855,24 +855,25 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data) | |
| goto fail; | |
| /* make provider0 part done uppercase */ | |
| - | Curl_strntoupper(str_to_sign, Curl_str(&provider0), Curl_strlen(&provider0)); |
| + | Curl_strntoupper(str_to_sign, curlx_str(&provider0), |
| + | curlx_strlen(&provider0)); |
| infof(data, "aws_sigv4: String to sign (enclosed in []) - [%s]", | |
| str_to_sign); | |
| - | secret = aprintf("%.*s4%s", (int)Curl_strlen(&provider0), |
| - | Curl_str(&provider0), data->state.aptr.passwd ? |
| + | secret = aprintf("%.*s4%s", (int)curlx_strlen(&provider0), |
| + | curlx_str(&provider0), data->state.aptr.passwd ? |
| data->state.aptr.passwd : ""); | |
| if(!secret) | |
| goto fail; | |
| /* make provider0 part done uppercase */ | |
| - | Curl_strntoupper(secret, Curl_str(&provider0), Curl_strlen(&provider0)); |
| + | Curl_strntoupper(secret, curlx_str(&provider0), curlx_strlen(&provider0)); |
| HMAC_SHA256(secret, strlen(secret), date, strlen(date), sign0); | |
| HMAC_SHA256(sign0, sizeof(sign0), | |
| - | Curl_str(®ion), Curl_strlen(®ion), sign1); |
| + | curlx_str(®ion), curlx_strlen(®ion), sign1); |
| HMAC_SHA256(sign1, sizeof(sign1), | |
| - | Curl_str(&service), Curl_strlen(&service), sign0); |
| + | curlx_str(&service), curlx_strlen(&service), sign0); |
| HMAC_SHA256(sign0, sizeof(sign0), request_type, strlen(request_type), sign1); | |
| HMAC_SHA256(sign1, sizeof(sign1), str_to_sign, strlen(str_to_sign), sign0); | |
| @@ -891,10 +892,10 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data) | |
| */ | |
| "%s" | |
| "%s", /* optional sha256 header includes \r\n */ | |
| - | (int)Curl_strlen(&provider0), Curl_str(&provider0), |
| + | (int)curlx_strlen(&provider0), curlx_str(&provider0), |
| user, | |
| credential_scope, | |
| - | Curl_dyn_ptr(&signed_headers), |
| + | curlx_dyn_ptr(&signed_headers), |
| sha_hex, | |
| date_header ? date_header : "", | |
| content_sha256_hdr); | |
| @@ -903,7 +904,7 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data) | |
| } | |
| /* provider 0 uppercase */ | |
| Curl_strntoupper(&auth_headers[sizeof("Authorization: ") - 1], | |
| - | Curl_str(&provider0), Curl_strlen(&provider0)); |
| + | curlx_str(&provider0), curlx_strlen(&provider0)); |
| free(data->state.aptr.userpwd); | |
| data->state.aptr.userpwd = auth_headers; | |
| @@ -911,10 +912,10 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data) | |
| result = CURLE_OK; | |
| fail: | |
| - | Curl_dyn_free(&canonical_query); |
| - | Curl_dyn_free(&canonical_path); |
| - | Curl_dyn_free(&canonical_headers); |
| - | Curl_dyn_free(&signed_headers); |
| + | curlx_dyn_free(&canonical_query); |
| + | curlx_dyn_free(&canonical_path); |
| + | curlx_dyn_free(&canonical_headers); |
| + | curlx_dyn_free(&signed_headers); |
| free(canonical_request); | |
| free(request_type); | |
| free(credential_scope); | |
| @@ -30,12 +30,12 @@ | |
| #include "curl_printf.h" | |
| #include "curl_trc.h" | |
| #include "sendf.h" /* for the client write stuff */ | |
| - | #include "dynbuf.h" |
| + | #include "curlx/dynbuf.h" |
| #include "content_encoding.h" | |
| #include "http.h" | |
| #include "multiif.h" | |
| - | #include "strparse.h" |
| - | #include "warnless.h" |
| + | #include "curlx/strparse.h" |
| + | #include "curlx/warnless.h" |
| /* The last #include files should be: */ | |
| #include "curl_memory.h" | |
| @@ -85,7 +85,7 @@ void Curl_httpchunk_init(struct Curl_easy *data, struct Curl_chunker *ch, | |
| ch->hexindex = 0; /* start at 0 */ | |
| ch->state = CHUNK_HEX; /* we get hex first! */ | |
| ch->last_code = CHUNKE_OK; | |
| - | Curl_dyn_init(&ch->trailer, DYN_H1_TRAILER); |
| + | curlx_dyn_init(&ch->trailer, DYN_H1_TRAILER); |
| ch->ignore_body = ignore_body; | |
| } | |
| @@ -96,14 +96,14 @@ void Curl_httpchunk_reset(struct Curl_easy *data, struct Curl_chunker *ch, | |
| ch->hexindex = 0; /* start at 0 */ | |
| ch->state = CHUNK_HEX; /* we get hex first! */ | |
| ch->last_code = CHUNKE_OK; | |
| - | Curl_dyn_reset(&ch->trailer); |
| + | curlx_dyn_reset(&ch->trailer); |
| ch->ignore_body = ignore_body; | |
| } | |
| void Curl_httpchunk_free(struct Curl_easy *data, struct Curl_chunker *ch) | |
| { | |
| (void)data; | |
| - | Curl_dyn_free(&ch->trailer); |
| + | curlx_dyn_free(&ch->trailer); |
| } | |
| bool Curl_httpchunk_is_done(struct Curl_easy *data, struct Curl_chunker *ch) | |
| @@ -170,7 +170,7 @@ static CURLcode httpchunk_readwrite(struct Curl_easy *data, | |
| /* blen and buf are unmodified */ | |
| ch->hexbuffer[ch->hexindex] = 0; | |
| p = &ch->hexbuffer[0]; | |
| - | if(Curl_str_hex(&p, &ch->datasize, CURL_OFF_T_MAX)) { |
| + | if(curlx_str_hex(&p, &ch->datasize, CURL_OFF_T_MAX)) { |
| failf(data, "invalid chunk size: '%s'", ch->hexbuffer); | |
| ch->state = CHUNK_FAILED; | |
| ch->last_code = CHUNKE_ILLEGAL_HEX; | |
| @@ -251,20 +251,20 @@ static CURLcode httpchunk_readwrite(struct Curl_easy *data, | |
| case CHUNK_TRAILER: | |
| if((*buf == 0x0d) || (*buf == 0x0a)) { | |
| - | char *tr = Curl_dyn_ptr(&ch->trailer); |
| + | char *tr = curlx_dyn_ptr(&ch->trailer); |
| /* this is the end of a trailer, but if the trailer was zero bytes | |
| there was no trailer and we move on */ | |
| if(tr) { | |
| size_t trlen; | |
| - | result = Curl_dyn_addn(&ch->trailer, STRCONST("\x0d\x0a")); |
| + | result = curlx_dyn_addn(&ch->trailer, STRCONST("\x0d\x0a")); |
| if(result) { | |
| ch->state = CHUNK_FAILED; | |
| ch->last_code = CHUNKE_OUT_OF_MEMORY; | |
| return result; | |
| } | |
| - | tr = Curl_dyn_ptr(&ch->trailer); |
| - | trlen = Curl_dyn_len(&ch->trailer); |
| + | tr = curlx_dyn_ptr(&ch->trailer); |
| + | trlen = curlx_dyn_len(&ch->trailer); |
| if(!data->set.http_te_skip) { | |
| if(cw_next) | |
| result = Curl_cwriter_write(data, cw_next, | |
| @@ -282,7 +282,7 @@ static CURLcode httpchunk_readwrite(struct Curl_easy *data, | |
| return result; | |
| } | |
| } | |
| - | Curl_dyn_reset(&ch->trailer); |
| + | curlx_dyn_reset(&ch->trailer); |
| ch->state = CHUNK_TRAILER_CR; | |
| if(*buf == 0x0a) | |
| /* already on the LF */ | |
| @@ -295,7 +295,7 @@ static CURLcode httpchunk_readwrite(struct Curl_easy *data, | |
| } | |
| } | |
| else { | |
| - | result = Curl_dyn_addn(&ch->trailer, buf, 1); |
| + | result = curlx_dyn_addn(&ch->trailer, buf, 1); |
| if(result) { | |
| ch->state = CHUNK_FAILED; | |
| ch->last_code = CHUNKE_OUT_OF_MEMORY; | |
| @@ -26,7 +26,7 @@ | |
| #ifndef CURL_DISABLE_HTTP | |
| - | #include "dynbuf.h" |
| + | #include "curlx/dynbuf.h" |
| struct connectdata; | |
| @@ -30,7 +30,7 @@ | |
| #include "strcase.h" | |
| #include "vauth/vauth.h" | |
| #include "http_digest.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -63,7 +63,7 @@ CURLcode Curl_input_digest(struct Curl_easy *data, | |
| return CURLE_BAD_CONTENT_ENCODING; | |
| header += strlen("Digest"); | |
| - | Curl_str_passblanks(&header); |
| + | curlx_str_passblanks(&header); |
| return Curl_auth_decode_digest_http_message(header, digest); | |
| } | |
| @@ -32,7 +32,7 @@ | |
| #include "http_negotiate.h" | |
| #include "vauth/vauth.h" | |
| #include "vtls/vtls.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -87,7 +87,7 @@ CURLcode Curl_input_negotiate(struct Curl_easy *data, struct connectdata *conn, | |
| /* Obtain the input token, if any */ | |
| header += strlen("Negotiate"); | |
| - | Curl_str_passblanks(&header); |
| + | curlx_str_passblanks(&header); |
| len = strlen(header); | |
| neg_ctx->havenegdata = len != 0; | |
| @@ -111,7 +111,7 @@ CURLcode Curl_input_negotiate(struct Curl_easy *data, struct connectdata *conn, | |
| /* Check if the connection is using SSL and get the channel binding data */ | |
| #ifdef HAVE_GSSAPI | |
| #ifdef USE_SSL | |
| - | Curl_dyn_init(&neg_ctx->channel_binding_data, SSL_CB_MAX_SIZE + 1); |
| + | curlx_dyn_init(&neg_ctx->channel_binding_data, SSL_CB_MAX_SIZE + 1); |
| if(Curl_conn_is_ssl(conn, FIRSTSOCKET)) { | |
| result = Curl_ssl_get_channel_binding( | |
| data, FIRSTSOCKET, &neg_ctx->channel_binding_data); | |
| @@ -121,7 +121,7 @@ CURLcode Curl_input_negotiate(struct Curl_easy *data, struct connectdata *conn, | |
| } | |
| } | |
| #else | |
| - | Curl_dyn_init(&neg_ctx->channel_binding_data, 1); |
| + | curlx_dyn_init(&neg_ctx->channel_binding_data, 1); |
| #endif /* USE_SSL */ | |
| #endif /* HAVE_GSSAPI */ | |
| @@ -130,7 +130,7 @@ CURLcode Curl_input_negotiate(struct Curl_easy *data, struct connectdata *conn, | |
| host, header, neg_ctx); | |
| #ifdef HAVE_GSSAPI | |
| - | Curl_dyn_free(&neg_ctx->channel_binding_data); |
| + | curlx_dyn_free(&neg_ctx->channel_binding_data); |
| #endif | |
| if(result) | |
| @@ -38,10 +38,10 @@ | |
| #include "strcase.h" | |
| #include "http_ntlm.h" | |
| #include "curl_ntlm_core.h" | |
| - | #include "curl_base64.h" |
| + | #include "curlx/base64.h" |
| #include "vauth/vauth.h" | |
| #include "url.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* SSL backend-specific #if branches in this file must be kept in the order | |
| documented in curl_ntlm_core. */ | |
| @@ -71,12 +71,12 @@ CURLcode Curl_input_ntlm(struct Curl_easy *data, | |
| if(checkprefix("NTLM", header)) { | |
| header += strlen("NTLM"); | |
| - | Curl_str_passblanks(&header); |
| + | curlx_str_passblanks(&header); |
| if(*header) { | |
| unsigned char *hdr; | |
| size_t hdrlen; | |
| - | result = Curl_base64_decode(header, &hdr, &hdrlen); |
| + | result = curlx_base64_decode(header, &hdr, &hdrlen); |
| if(!result) { | |
| struct bufref hdrbuf; | |
| @@ -205,7 +205,7 @@ CURLcode Curl_output_ntlm(struct Curl_easy *data, bool proxy) | |
| ntlm, &ntlmmsg); | |
| if(!result) { | |
| DEBUGASSERT(Curl_bufref_len(&ntlmmsg) != 0); | |
| - | result = Curl_base64_encode((const char *) Curl_bufref_ptr(&ntlmmsg), |
| + | result = curlx_base64_encode((const char *) Curl_bufref_ptr(&ntlmmsg), |
| Curl_bufref_len(&ntlmmsg), &base64, &len); | |
| if(!result) { | |
| free(*allocuserpwd); | |
| @@ -224,8 +224,8 @@ CURLcode Curl_output_ntlm(struct Curl_easy *data, bool proxy) | |
| result = Curl_auth_create_ntlm_type3_message(data, userp, passwdp, | |
| ntlm, &ntlmmsg); | |
| if(!result && Curl_bufref_len(&ntlmmsg)) { | |
| - | result = Curl_base64_encode((const char *) Curl_bufref_ptr(&ntlmmsg), |
| - | Curl_bufref_len(&ntlmmsg), &base64, &len); |
| + | result = curlx_base64_encode((const char *) Curl_bufref_ptr(&ntlmmsg), |
| + | Curl_bufref_len(&ntlmmsg), &base64, &len); |
| if(!result) { | |
| free(*allocuserpwd); | |
| *allocuserpwd = aprintf("%sAuthorization: NTLM %s\r\n", | |
| @@ -38,12 +38,12 @@ | |
| #include "cf-h1-proxy.h" | |
| #include "cf-h2-proxy.h" | |
| #include "connect.h" | |
| - | #include "curlx.h" |
| + | #include "strcase.h" |
| #include "vtls/vtls.h" | |
| #include "transfer.h" | |
| #include "multiif.h" | |
| #include "vauth/vauth.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -109,7 +109,7 @@ static CURLcode dynhds_add_custom(struct Curl_easy *data, | |
| name = headers->data; | |
| namelen = ptr - headers->data; | |
| ptr++; /* pass the colon */ | |
| - | Curl_str_passblanks(&ptr); |
| + | curlx_str_passblanks(&ptr); |
| if(*ptr) { | |
| value = ptr; | |
| valuelen = strlen(value); | |
| @@ -131,7 +131,7 @@ static CURLcode dynhds_add_custom(struct Curl_easy *data, | |
| name = headers->data; | |
| namelen = ptr - headers->data; | |
| ptr++; /* pass the semicolon */ | |
| - | Curl_str_passblanks(&ptr); |
| + | curlx_str_passblanks(&ptr); |
| if(!*ptr) { | |
| /* quirk #2, send an empty header */ | |
| value = ""; | |
| @@ -31,7 +31,7 @@ | |
| #include "idn.h" | |
| #include "sendf.h" | |
| #include "curl_multibyte.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #ifdef USE_LIBIDN2 | |
| #include <idn2.h> | |
| @@ -36,7 +36,7 @@ | |
| ***************************************************************************/ | |
| #include "curl_setup.h" | |
| - | #include "dynbuf.h" |
| + | #include "curlx/dynbuf.h" |
| #ifndef CURL_DISABLE_IMAP | |
| @@ -65,7 +65,7 @@ | |
| #include "socks.h" | |
| #include "imap.h" | |
| #include "mime.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| #include "strcase.h" | |
| #include "vtls/vtls.h" | |
| #include "cfilters.h" | |
| @@ -75,7 +75,7 @@ | |
| #include "url.h" | |
| #include "bufref.h" | |
| #include "curl_sasl.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "curl_ctype.h" | |
| /* The last 3 #include files should be in this order */ | |
| @@ -436,7 +436,7 @@ static CURLcode imap_get_message(struct Curl_easy *data, struct bufref *out) | |
| if(!imapc) | |
| return CURLE_FAILED_INIT; | |
| - | message = Curl_dyn_ptr(&imapc->pp.recvbuf); |
| + | message = curlx_dyn_ptr(&imapc->pp.recvbuf); |
| len = imapc->pp.nfinal; | |
| if(len > 2) { | |
| /* Find the start of the message */ | |
| @@ -912,7 +912,7 @@ static CURLcode imap_perform_append(struct Curl_easy *data, | |
| return CURLE_OUT_OF_MEMORY; | |
| /* Generate flags string and send the APPEND command */ | |
| - | Curl_dyn_init(&flags, 100); |
| + | curlx_dyn_init(&flags, 100); |
| if(data->set.upload_flags) { | |
| int i; | |
| struct ulbits ulflag[] = { | |
| @@ -925,29 +925,30 @@ static CURLcode imap_perform_append(struct Curl_easy *data, | |
| }; | |
| result = CURLE_OUT_OF_MEMORY; | |
| - | if(Curl_dyn_add(&flags, " (")) { |
| + | if(curlx_dyn_add(&flags, " (")) { |
| goto cleanup; | |
| } | |
| for(i = 0; ulflag[i].bit; i++) { | |
| if(data->set.upload_flags & ulflag[i].bit) { | |
| - | if((Curl_dyn_len(&flags) > 2 && Curl_dyn_add(&flags, " ")) || |
| - | Curl_dyn_add(&flags, "\\") || Curl_dyn_add(&flags, ulflag[i].flag)) |
| - | goto cleanup; |
| + | if((curlx_dyn_len(&flags) > 2 && curlx_dyn_add(&flags, " ")) || |
| + | curlx_dyn_add(&flags, "\\") || |
| + | curlx_dyn_add(&flags, ulflag[i].flag)) |
| + | goto cleanup; |
| } | |
| } | |
| - | if(Curl_dyn_add(&flags, ")")) |
| + | if(curlx_dyn_add(&flags, ")")) |
| goto cleanup; | |
| } | |
| - | else if(Curl_dyn_add(&flags, "")) |
| + | else if(curlx_dyn_add(&flags, "")) |
| goto cleanup; | |
| result = imap_sendf(data, imapc, "APPEND %s%s {%" FMT_OFF_T "}", | |
| - | mailbox, Curl_dyn_ptr(&flags), data->state.infilesize); |
| + | mailbox, curlx_dyn_ptr(&flags), data->state.infilesize); |
| cleanup: | |
| - | Curl_dyn_free(&flags); |
| + | curlx_dyn_free(&flags); |
| free(mailbox); | |
| if(!result) | |
| @@ -1030,7 +1031,7 @@ static CURLcode imap_state_capability_resp(struct Curl_easy *data, | |
| { | |
| CURLcode result = CURLE_OK; | |
| struct connectdata *conn = data->conn; | |
| - | const char *line = Curl_dyn_ptr(&imapc->pp.recvbuf); |
| + | const char *line = curlx_dyn_ptr(&imapc->pp.recvbuf); |
| (void)instate; /* no use for this yet */ | |
| @@ -1193,7 +1194,7 @@ static CURLcode imap_state_listsearch_resp(struct Curl_easy *data, | |
| imapstate instate) | |
| { | |
| CURLcode result = CURLE_OK; | |
| - | char *line = Curl_dyn_ptr(&imapc->pp.recvbuf); |
| + | char *line = curlx_dyn_ptr(&imapc->pp.recvbuf); |
| size_t len = imapc->pp.nfinal; | |
| (void)instate; /* No use for this yet */ | |
| @@ -1217,7 +1218,7 @@ static CURLcode imap_state_select_resp(struct Curl_easy *data, | |
| imapstate instate) | |
| { | |
| CURLcode result = CURLE_OK; | |
| - | const char *line = Curl_dyn_ptr(&imapc->pp.recvbuf); |
| + | const char *line = curlx_dyn_ptr(&imapc->pp.recvbuf); |
| (void)instate; /* no use for this yet */ | |
| @@ -1230,11 +1231,11 @@ static CURLcode imap_state_select_resp(struct Curl_easy *data, | |
| len++; | |
| if(len && (p[len] == ']')) { | |
| struct dynbuf uid; | |
| - | Curl_dyn_init(&uid, 20); |
| - | if(Curl_dyn_addn(&uid, p, len)) |
| + | curlx_dyn_init(&uid, 20); |
| + | if(curlx_dyn_addn(&uid, p, len)) |
| return CURLE_OUT_OF_MEMORY; | |
| free(imapc->mailbox_uidvalidity); | |
| - | imapc->mailbox_uidvalidity = Curl_dyn_ptr(&uid); |
| + | imapc->mailbox_uidvalidity = curlx_dyn_ptr(&uid); |
| } | |
| } | |
| } | |
| @@ -1276,7 +1277,7 @@ static CURLcode imap_state_fetch_resp(struct Curl_easy *data, | |
| { | |
| CURLcode result = CURLE_OK; | |
| struct pingpong *pp = &imapc->pp; | |
| - | const char *ptr = Curl_dyn_ptr(&imapc->pp.recvbuf); |
| + | const char *ptr = curlx_dyn_ptr(&imapc->pp.recvbuf); |
| size_t len = imapc->pp.nfinal; | |
| bool parsed = FALSE; | |
| curl_off_t size = 0; | |
| @@ -1294,8 +1295,8 @@ static CURLcode imap_state_fetch_resp(struct Curl_easy *data, | |
| ptr = memchr(ptr, '{', len); | |
| if(ptr) { | |
| ptr++; | |
| - | if(!Curl_str_number(&ptr, &size, CURL_OFF_T_MAX) && |
| - | !Curl_str_single(&ptr, '}')) |
| + | if(!curlx_str_number(&ptr, &size, CURL_OFF_T_MAX) && |
| + | !curlx_str_single(&ptr, '}')) |
| parsed = TRUE; | |
| } | |
| @@ -1310,7 +1311,7 @@ static CURLcode imap_state_fetch_resp(struct Curl_easy *data, | |
| size_t chunk = pp->overflow; | |
| /* keep only the overflow */ | |
| - | Curl_dyn_tail(&pp->recvbuf, chunk); |
| + | curlx_dyn_tail(&pp->recvbuf, chunk); |
| pp->nfinal = 0; /* done */ | |
| if(chunk > (size_t)size) | |
| @@ -1323,7 +1324,7 @@ static CURLcode imap_state_fetch_resp(struct Curl_easy *data, | |
| return CURLE_OK; | |
| } | |
| result = Curl_client_write(data, CLIENTWRITE_BODY, | |
| - | Curl_dyn_ptr(&pp->recvbuf), chunk); |
| + | curlx_dyn_ptr(&pp->recvbuf), chunk); |
| if(result) | |
| return result; | |
| @@ -1334,12 +1335,12 @@ static CURLcode imap_state_fetch_resp(struct Curl_easy *data, | |
| if(pp->overflow > chunk) { | |
| /* remember the remaining trailing overflow data */ | |
| pp->overflow -= chunk; | |
| - | Curl_dyn_tail(&pp->recvbuf, pp->overflow); |
| + | curlx_dyn_tail(&pp->recvbuf, pp->overflow); |
| } | |
| else { | |
| pp->overflow = 0; /* handled */ | |
| /* Free the cache */ | |
| - | Curl_dyn_reset(&pp->recvbuf); |
| + | curlx_dyn_reset(&pp->recvbuf); |
| } | |
| } | |
| @@ -1898,7 +1899,7 @@ static void imap_conn_dtor(void *key, size_t klen, void *entry) | |
| (void)key; | |
| (void)klen; | |
| Curl_pp_disconnect(&imapc->pp); | |
| - | Curl_dyn_free(&imapc->dyn); |
| + | curlx_dyn_free(&imapc->dyn); |
| Curl_safefree(imapc->mailbox); | |
| Curl_safefree(imapc->mailbox_uidvalidity); | |
| free(imapc); | |
| @@ -1922,7 +1923,7 @@ static CURLcode imap_setup_connection(struct Curl_easy *data, | |
| imapc->preftype = IMAP_TYPE_ANY; | |
| Curl_sasl_init(&imapc->sasl, data, &saslimap); | |
| - | Curl_dyn_init(&imapc->dyn, DYN_IMAP_CMD); |
| + | curlx_dyn_init(&imapc->dyn, DYN_IMAP_CMD); |
| Curl_pp_init(pp); | |
| if(Curl_conn_meta_set(conn, CURL_META_IMAP_CONN, imapc, imap_conn_dtor)) | |
| @@ -1958,10 +1959,10 @@ static CURLcode imap_sendf(struct Curl_easy *data, | |
| ++imapc->cmdid); | |
| /* start with a blank buffer */ | |
| - | Curl_dyn_reset(&imapc->dyn); |
| + | curlx_dyn_reset(&imapc->dyn); |
| /* append tag + space + fmt */ | |
| - | result = Curl_dyn_addf(&imapc->dyn, "%s %s", imapc->resptag, fmt); |
| + | result = curlx_dyn_addf(&imapc->dyn, "%s %s", imapc->resptag, fmt); |
| if(!result) { | |
| va_list ap; | |
| va_start(ap, fmt); | |
| @@ -1969,7 +1970,7 @@ static CURLcode imap_sendf(struct Curl_easy *data, | |
| #pragma clang diagnostic push | |
| #pragma clang diagnostic ignored "-Wformat-nonliteral" | |
| #endif | |
| - | result = Curl_pp_vsendf(data, &imapc->pp, Curl_dyn_ptr(&imapc->dyn), ap); |
| + | result = Curl_pp_vsendf(data, &imapc->pp, curlx_dyn_ptr(&imapc->dyn), ap); |
| #ifdef __clang__ | |
| #pragma clang diagnostic pop | |
| #endif | |
| @@ -2003,24 +2004,24 @@ static char *imap_atom(const char *str, bool escape_only) | |
| /* nothing to escape, return a strdup */ | |
| return strdup(str); | |
| - | Curl_dyn_init(&line, 2000); |
| + | curlx_dyn_init(&line, 2000); |
| - | if(!escape_only && Curl_dyn_addn(&line, "\"", 1)) |
| + | if(!escape_only && curlx_dyn_addn(&line, "\"", 1)) |
| return NULL; | |
| while(*str) { | |
| if((*str == '\\' || *str == '"') && | |
| - | Curl_dyn_addn(&line, "\\", 1)) |
| + | curlx_dyn_addn(&line, "\\", 1)) |
| return NULL; | |
| - | if(Curl_dyn_addn(&line, str, 1)) |
| + | if(curlx_dyn_addn(&line, str, 1)) |
| return NULL; | |
| str++; | |
| } | |
| - | if(!escape_only && Curl_dyn_addn(&line, "\"", 1)) |
| + | if(!escape_only && curlx_dyn_addn(&line, "\"", 1)) |
| return NULL; | |
| - | return Curl_dyn_ptr(&line); |
| + | return curlx_dyn_ptr(&line); |
| } | |
| /*********************************************************************** | |
| @@ -20,7 +20,7 @@ | |
| #include "curl_setup.h" | |
| #include "curl_ctype.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| #ifndef HAVE_INET_PTON | |
| @@ -49,13 +49,13 @@ | |
| #include "url.h" | |
| #include "cfilters.h" | |
| #include "cf-socket.h" | |
| - | #include "curl_base64.h" |
| + | #include "curlx/base64.h" |
| #include "ftp.h" | |
| #include "curl_gssapi.h" | |
| #include "sendf.h" | |
| #include "transfer.h" | |
| #include "curl_krb5.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "strcase.h" | |
| #include "strdup.h" | |
| @@ -247,7 +247,7 @@ krb5_auth(void *app_data, struct Curl_easy *data, struct connectdata *conn) | |
| if(Curl_GetFTPResponse(data, &nread, NULL)) | |
| return -1; | |
| else { | |
| - | char *line = Curl_dyn_ptr(&ftpc->pp.recvbuf); |
| + | char *line = curlx_dyn_ptr(&ftpc->pp.recvbuf); |
| if(line[0] != '3') | |
| return -1; | |
| } | |
| @@ -308,7 +308,7 @@ krb5_auth(void *app_data, struct Curl_easy *data, struct connectdata *conn) | |
| if(output_buffer.length) { | |
| char *cmd; | |
| - | result = Curl_base64_encode((char *)output_buffer.value, |
| + | result = curlx_base64_encode((char *)output_buffer.value, |
| output_buffer.length, &p, &base64_sz); | |
| if(result) { | |
| infof(data, "base64-encoding: %s", curl_easy_strerror(result)); | |
| @@ -335,8 +335,8 @@ krb5_auth(void *app_data, struct Curl_easy *data, struct connectdata *conn) | |
| break; | |
| } | |
| else { | |
| - | size_t len = Curl_dyn_len(&ftpc->pp.recvbuf); |
| - | p = Curl_dyn_ptr(&ftpc->pp.recvbuf); |
| + | size_t len = curlx_dyn_len(&ftpc->pp.recvbuf); |
| + | p = curlx_dyn_ptr(&ftpc->pp.recvbuf); |
| if((len < 4) || (p[0] != '2' && p[0] != '3')) { | |
| infof(data, "Server did not accept auth data"); | |
| ret = AUTH_ERROR; | |
| @@ -351,7 +351,7 @@ krb5_auth(void *app_data, struct Curl_easy *data, struct connectdata *conn) | |
| if(p) { | |
| unsigned char *outptr; | |
| size_t outlen; | |
| - | result = Curl_base64_decode(p + 5, &outptr, &outlen); |
| + | result = curlx_base64_decode(p + 5, &outptr, &outlen); |
| if(result) { | |
| failf(data, "base64-decoding: %s", curl_easy_strerror(result)); | |
| ret = AUTH_CONTINUE; | |
| @@ -540,7 +540,7 @@ static CURLcode read_data(struct Curl_easy *data, int sockindex, | |
| if(len > CURL_MAX_INPUT_LENGTH) | |
| return CURLE_TOO_LARGE; | |
| - | Curl_dyn_reset(&buf->buf); |
| + | curlx_dyn_reset(&buf->buf); |
| } | |
| else | |
| return CURLE_RECV_ERROR; | |
| @@ -551,18 +551,18 @@ static CURLcode read_data(struct Curl_easy *data, int sockindex, | |
| result = socket_read(data, sockindex, buffer, (size_t)nread); | |
| if(result) | |
| return result; | |
| - | result = Curl_dyn_addn(&buf->buf, buffer, nread); |
| + | result = curlx_dyn_addn(&buf->buf, buffer, nread); |
| if(result) | |
| return result; | |
| len -= nread; | |
| } while(len); | |
| /* this decodes the dynbuf *in place* */ | |
| nread = conn->mech->decode(conn->app_data, | |
| - | Curl_dyn_ptr(&buf->buf), |
| + | curlx_dyn_ptr(&buf->buf), |
| len, conn->data_prot, conn); | |
| if(nread < 0) | |
| return CURLE_RECV_ERROR; | |
| - | Curl_dyn_setlen(&buf->buf, nread); |
| + | curlx_dyn_setlen(&buf->buf, nread); |
| buf->index = 0; | |
| return CURLE_OK; | |
| } | |
| @@ -570,10 +570,10 @@ static CURLcode read_data(struct Curl_easy *data, int sockindex, | |
| static size_t | |
| buffer_read(struct krb5buffer *buf, void *data, size_t len) | |
| { | |
| - | size_t size = Curl_dyn_len(&buf->buf); |
| + | size_t size = curlx_dyn_len(&buf->buf); |
| if(size - buf->index < len) | |
| len = size - buf->index; | |
| - | memcpy(data, Curl_dyn_ptr(&buf->buf) + buf->index, len); |
| + | memcpy(data, curlx_dyn_ptr(&buf->buf) + buf->index, len); |
| buf->index += len; | |
| return len; | |
| } | |
| @@ -608,7 +608,7 @@ static ssize_t sec_recv(struct Curl_easy *data, int sockindex, | |
| while(len > 0) { | |
| if(read_data(data, sockindex, &conn->in_buffer)) | |
| return -1; | |
| - | if(Curl_dyn_len(&conn->in_buffer.buf) == 0) { |
| + | if(curlx_dyn_len(&conn->in_buffer.buf) == 0) { |
| if(bytes_read > 0) | |
| conn->in_buffer.eof_flag = 1; | |
| return bytes_read; | |
| @@ -648,7 +648,7 @@ static void do_sec_send(struct Curl_easy *data, struct connectdata *conn, | |
| return; /* error */ | |
| if(iscmd) { | |
| - | error = Curl_base64_encode(buffer, curlx_sitouz(bytes), |
| + | error = curlx_base64_encode(buffer, curlx_sitouz(bytes), |
| &cmd_buffer, &cmd_size); | |
| if(error) { | |
| free(buffer); | |
| @@ -726,7 +726,7 @@ int Curl_sec_read_msg(struct Curl_easy *data, struct connectdata *conn, | |
| DEBUGASSERT(level > PROT_NONE && level < PROT_LAST); | |
| - | error = Curl_base64_decode(buffer + 4, (unsigned char **)&buf, &decoded_sz); |
| + | error = curlx_base64_decode(buffer + 4, (unsigned char **)&buf, &decoded_sz); |
| if(error || decoded_sz == 0) | |
| return -1; | |
| @@ -800,7 +800,7 @@ static int sec_set_protection_level(struct Curl_easy *data) | |
| } | |
| conn->buffer_size = buffer_size; | |
| - | line = Curl_dyn_ptr(&ftpc->pp.recvbuf); |
| + | line = curlx_dyn_ptr(&ftpc->pp.recvbuf); |
| pbsz = strstr(line, "PBSZ="); | |
| if(pbsz) { | |
| /* stick to default value if the check fails */ | |
| @@ -922,7 +922,7 @@ Curl_sec_login(struct Curl_easy *data, struct connectdata *conn) | |
| void | |
| Curl_sec_conn_init(struct connectdata *conn) | |
| { | |
| - | Curl_dyn_init(&conn->in_buffer.buf, CURL_MAX_INPUT_LENGTH); |
| + | curlx_dyn_init(&conn->in_buffer.buf, CURL_MAX_INPUT_LENGTH); |
| conn->in_buffer.index = 0; | |
| conn->in_buffer.eof_flag = 0; | |
| } | |
| @@ -933,7 +933,7 @@ Curl_sec_conn_destroy(struct connectdata *conn) | |
| if(conn->mech && conn->mech->end) | |
| conn->mech->end(conn->app_data); | |
| Curl_safefree(conn->app_data); | |
| - | Curl_dyn_free(&conn->in_buffer.buf); |
| + | curlx_dyn_free(&conn->in_buffer.buf); |
| conn->in_buffer.index = 0; | |
| conn->in_buffer.eof_flag = 0; | |
| conn->sec_complete = 0; | |
| @@ -89,10 +89,10 @@ | |
| #include "progress.h" | |
| #include "transfer.h" | |
| #include "strcase.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| #include "curl_ldap.h" | |
| #include "curl_multibyte.h" | |
| - | #include "curl_base64.h" |
| + | #include "curlx/base64.h" |
| #include "connect.h" | |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -629,8 +629,8 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) | |
| if((attr_len > 7) && | |
| (strcmp(";binary", attr + (attr_len - 7)) == 0)) { | |
| /* Binary attribute, encode to base64. */ | |
| - | result = Curl_base64_encode(vals[i]->bv_val, vals[i]->bv_len, |
| - | &val_b64, &val_b64_sz); |
| + | result = curlx_base64_encode(vals[i]->bv_val, vals[i]->bv_len, |
| + | &val_b64, &val_b64_sz); |
| if(result) { | |
| ldap_value_free_len(vals); | |
| FREE_ON_WINLDAP(attr); | |
| @@ -729,7 +729,7 @@ static void _ldap_trace(const char *fmt, ...) | |
| if(do_trace == -1) { | |
| const char *env = getenv("CURL_TRACE"); | |
| curl_off_t e = 0; | |
| - | if(!Curl_str_number(&env, &e, INT_MAX)) |
| + | if(!curlx_str_number(&env, &e, INT_MAX)) |
| do_trace = e > 0; | |
| } | |
| if(!do_trace) | |
| @@ -884,7 +884,7 @@ static int _ldap_url_parse2(struct Curl_easy *data, | |
| CURLcode result; | |
| struct Curl_str out; | |
| - | if(Curl_str_until(&atp, &out, 1024, ',')) |
| + | if(curlx_str_until(&atp, &out, 1024, ',')) |
| break; | |
| LDAP_TRACE(("attr[%zu] '%.*s'\n", i, (int)out.len, out.str)); | |
| @@ -913,7 +913,7 @@ static int _ldap_url_parse2(struct Curl_easy *data, | |
| #endif | |
| ludp->lud_attrs_dups++; | |
| - | if(Curl_str_single(&atp, ',')) |
| + | if(curlx_str_single(&atp, ',')) |
| break; | |
| } | |
| } | |
| @@ -30,7 +30,7 @@ | |
| #include "strdup.h" | |
| #include "curl_md4.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #ifdef USE_OPENSSL | |
| #include <openssl/opensslv.h> | |
| @@ -32,7 +32,7 @@ | |
| #include "curl_md5.h" | |
| #include "curl_hmac.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #ifdef USE_MBEDTLS | |
| #include <mbedtls/version.h> | |
| @@ -29,7 +29,7 @@ | |
| struct Curl_easy; | |
| #include "mime.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "urldata.h" | |
| #include "sendf.h" | |
| #include "strdup.h" | |
| @@ -45,7 +45,7 @@ struct Curl_easy; | |
| #include "rand.h" | |
| #include "slist.h" | |
| #include "strcase.h" | |
| - | #include "dynbuf.h" |
| + | #include "curlx/dynbuf.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| #include "curl_memory.h" | |
| @@ -318,19 +318,19 @@ static char *escape_string(struct Curl_easy *data, | |
| if(strategy == MIMESTRATEGY_MAIL || (data && (data->set.mime_formescape))) | |
| table = mimetable; | |
| - | Curl_dyn_init(&db, CURL_MAX_INPUT_LENGTH); |
| + | curlx_dyn_init(&db, CURL_MAX_INPUT_LENGTH); |
| - | for(result = Curl_dyn_addn(&db, STRCONST("")); !result && *src; src++) { |
| + | for(result = curlx_dyn_addn(&db, STRCONST("")); !result && *src; src++) { |
| for(p = table; *p && **p != *src; p++) | |
| ; | |
| if(*p) | |
| - | result = Curl_dyn_add(&db, *p + 1); |
| + | result = curlx_dyn_add(&db, *p + 1); |
| else | |
| - | result = Curl_dyn_addn(&db, src, 1); |
| + | result = curlx_dyn_addn(&db, src, 1); |
| } | |
| - | return Curl_dyn_ptr(&db); |
| + | return curlx_dyn_ptr(&db); |
| } | |
| /* Check if header matches. */ | |
| @@ -23,9 +23,9 @@ | |
| */ | |
| #include "curl_setup.h" | |
| - | #include "dynbuf.h" |
| + | #include "curlx/dynbuf.h" |
| #include "curl_printf.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| #include "curl_memory.h" | |
| /* The last #include file should be: */ | |
| @@ -173,8 +173,8 @@ struct asprintf { | |
| static int dollarstring(const char *p, const char **end) | |
| { | |
| curl_off_t num; | |
| - | if(Curl_str_number(&p, &num, MAX_PARAMETERS) || |
| - | Curl_str_single(&p, '$') || !num) |
| + | if(curlx_str_number(&p, &num, MAX_PARAMETERS) || |
| + | curlx_str_single(&p, '$') || !num) |
| return -1; | |
| *end = p; | |
| return (int)num - 1; | |
| @@ -306,7 +306,7 @@ static int parsefmt(const char *format, | |
| is_neg = ('-' == *fmt); | |
| if(is_neg) | |
| fmt++; | |
| - | if(Curl_str_number(&fmt, &num, INT_MAX)) |
| + | if(curlx_str_number(&fmt, &num, INT_MAX)) |
| return PFMT_PREC; | |
| precision = (int)num; | |
| if(is_neg) | |
| @@ -378,7 +378,7 @@ static int parsefmt(const char *format, | |
| curl_off_t num; | |
| flags |= FLAGS_WIDTH; | |
| fmt--; | |
| - | if(Curl_str_number(&fmt, &num, INT_MAX)) |
| + | if(curlx_str_number(&fmt, &num, INT_MAX)) |
| return PFMT_WIDTH; | |
| width = (int)num; | |
| break; | |
| @@ -1087,7 +1087,7 @@ int curl_msnprintf(char *buffer, size_t maxlength, const char *format, ...) | |
| static int alloc_addbyter(unsigned char outc, void *f) | |
| { | |
| struct asprintf *infop = f; | |
| - | CURLcode result = Curl_dyn_addn(infop->b, &outc, 1); |
| + | CURLcode result = curlx_dyn_addn(infop->b, &outc, 1); |
| if(result) { | |
| infop->merr = result == CURLE_TOO_LARGE ? MERR_TOO_LARGE : MERR_MEM; | |
| return 1 ; /* fail */ | |
| @@ -1096,7 +1096,7 @@ static int alloc_addbyter(unsigned char outc, void *f) | |
| } | |
| /* appends the formatted string, returns MERR error code */ | |
| - | int Curl_dyn_vprintf(struct dynbuf *dyn, const char *format, va_list ap_save) |
| + | int curlx_dyn_vprintf(struct dynbuf *dyn, const char *format, va_list ap_save) |
| { | |
| struct asprintf info; | |
| info.b = dyn; | |
| @@ -1104,7 +1104,7 @@ int Curl_dyn_vprintf(struct dynbuf *dyn, const char *format, va_list ap_save) | |
| (void)formatf(&info, alloc_addbyter, format, ap_save); | |
| if(info.merr) { | |
| - | Curl_dyn_free(info.b); |
| + | curlx_dyn_free(info.b); |
| return info.merr; | |
| } | |
| return 0; | |
| @@ -1115,16 +1115,16 @@ char *curl_mvaprintf(const char *format, va_list ap_save) | |
| struct asprintf info; | |
| struct dynbuf dyn; | |
| info.b = &dyn; | |
| - | Curl_dyn_init(info.b, DYN_APRINTF); |
| + | curlx_dyn_init(info.b, DYN_APRINTF); |
| info.merr = MERR_OK; | |
| (void)formatf(&info, alloc_addbyter, format, ap_save); | |
| if(info.merr) { | |
| - | Curl_dyn_free(info.b); |
| + | curlx_dyn_free(info.b); |
| return NULL; | |
| } | |
| - | if(Curl_dyn_len(info.b)) |
| - | return Curl_dyn_ptr(info.b); |
| + | if(curlx_dyn_len(info.b)) |
| + | return curlx_dyn_ptr(info.b); |
| return strdup(""); | |
| } | |
| @@ -37,7 +37,7 @@ | |
| #include "strdup.h" | |
| #include "url.h" | |
| #include "escape.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "curl_printf.h" | |
| #include "curl_memory.h" | |
| #include "multiif.h" | |
| @@ -146,8 +146,8 @@ static void mqtt_easy_dtor(void *key, size_t klen, void *entry) | |
| struct MQTT *mq = entry; | |
| (void)key; | |
| (void)klen; | |
| - | Curl_dyn_free(&mq->sendbuf); |
| - | Curl_dyn_free(&mq->recvbuf); |
| + | curlx_dyn_free(&mq->sendbuf); |
| + | curlx_dyn_free(&mq->recvbuf); |
| free(mq); | |
| } | |
| @@ -173,8 +173,8 @@ static CURLcode mqtt_setup_conn(struct Curl_easy *data, | |
| mq = calloc(1, sizeof(struct MQTT)); | |
| if(!mq) | |
| return CURLE_OUT_OF_MEMORY; | |
| - | Curl_dyn_init(&mq->recvbuf, DYN_MQTT_RECV); |
| - | Curl_dyn_init(&mq->sendbuf, DYN_MQTT_SEND); |
| + | curlx_dyn_init(&mq->recvbuf, DYN_MQTT_RECV); |
| + | curlx_dyn_init(&mq->sendbuf, DYN_MQTT_SEND); |
| if(Curl_meta_set(data, CURL_META_MQTT_EASY, mq, mqtt_easy_dtor)) | |
| return CURLE_OUT_OF_MEMORY; | |
| return CURLE_OK; | |
| @@ -193,20 +193,20 @@ static CURLcode mqtt_send(struct Curl_easy *data, | |
| result = Curl_xfer_send(data, buf, len, FALSE, &n); | |
| if(result) | |
| return result; | |
| - | mq->lastTime = Curl_now(); |
| + | mq->lastTime = curlx_now(); |
| Curl_debug(data, CURLINFO_HEADER_OUT, buf, (size_t)n); | |
| if(len != n) { | |
| size_t nsend = len - n; | |
| - | if(Curl_dyn_len(&mq->sendbuf)) { |
| - | DEBUGASSERT(Curl_dyn_len(&mq->sendbuf) >= nsend); |
| - | result = Curl_dyn_tail(&mq->sendbuf, nsend); /* keep this much */ |
| + | if(curlx_dyn_len(&mq->sendbuf)) { |
| + | DEBUGASSERT(curlx_dyn_len(&mq->sendbuf) >= nsend); |
| + | result = curlx_dyn_tail(&mq->sendbuf, nsend); /* keep this much */ |
| } | |
| else { | |
| - | result = Curl_dyn_addn(&mq->sendbuf, &buf[n], nsend); |
| + | result = curlx_dyn_addn(&mq->sendbuf, &buf[n], nsend); |
| } | |
| } | |
| else | |
| - | Curl_dyn_reset(&mq->sendbuf); |
| + | curlx_dyn_reset(&mq->sendbuf); |
| return result; | |
| } | |
| @@ -424,7 +424,7 @@ static CURLcode mqtt_recv_atleast(struct Curl_easy *data, size_t nbytes) | |
| if(!mq) | |
| return CURLE_FAILED_INIT; | |
| - | rlen = Curl_dyn_len(&mq->recvbuf); |
| + | rlen = curlx_dyn_len(&mq->recvbuf); |
| if(rlen < nbytes) { | |
| unsigned char readbuf[1024]; | |
| @@ -435,9 +435,9 @@ static CURLcode mqtt_recv_atleast(struct Curl_easy *data, size_t nbytes) | |
| if(result) | |
| return result; | |
| DEBUGASSERT(nread >= 0); | |
| - | if(Curl_dyn_addn(&mq->recvbuf, readbuf, (size_t)nread)) |
| + | if(curlx_dyn_addn(&mq->recvbuf, readbuf, (size_t)nread)) |
| return CURLE_OUT_OF_MEMORY; | |
| - | rlen = Curl_dyn_len(&mq->recvbuf); |
| + | rlen = curlx_dyn_len(&mq->recvbuf); |
| } | |
| return (rlen >= nbytes) ? CURLE_OK : CURLE_AGAIN; | |
| } | |
| @@ -447,11 +447,11 @@ static void mqtt_recv_consume(struct Curl_easy *data, size_t nbytes) | |
| struct MQTT *mq = Curl_meta_get(data, CURL_META_MQTT_EASY); | |
| DEBUGASSERT(mq); | |
| if(mq) { | |
| - | size_t rlen = Curl_dyn_len(&mq->recvbuf); |
| + | size_t rlen = curlx_dyn_len(&mq->recvbuf); |
| if(rlen <= nbytes) | |
| - | Curl_dyn_reset(&mq->recvbuf); |
| + | curlx_dyn_reset(&mq->recvbuf); |
| else | |
| - | Curl_dyn_tail(&mq->recvbuf, rlen - nbytes); |
| + | curlx_dyn_tail(&mq->recvbuf, rlen - nbytes); |
| } | |
| } | |
| @@ -470,14 +470,14 @@ static CURLcode mqtt_verify_connack(struct Curl_easy *data) | |
| goto fail; | |
| /* verify CONNACK */ | |
| - | DEBUGASSERT(Curl_dyn_len(&mq->recvbuf) >= MQTT_CONNACK_LEN); |
| - | ptr = Curl_dyn_ptr(&mq->recvbuf); |
| + | DEBUGASSERT(curlx_dyn_len(&mq->recvbuf) >= MQTT_CONNACK_LEN); |
| + | ptr = curlx_dyn_ptr(&mq->recvbuf); |
| Curl_debug(data, CURLINFO_HEADER_IN, ptr, MQTT_CONNACK_LEN); | |
| if(ptr[0] != 0x00 || ptr[1] != 0x00) { | |
| failf(data, "Expected %02x%02x but got %02x%02x", | |
| 0x00, 0x00, ptr[0], ptr[1]); | |
| - | Curl_dyn_reset(&mq->recvbuf); |
| + | curlx_dyn_reset(&mq->recvbuf); |
| result = CURLE_WEIRD_SERVER_REPLY; | |
| goto fail; | |
| } | |
| @@ -572,14 +572,14 @@ static CURLcode mqtt_verify_suback(struct Curl_easy *data) | |
| goto fail; | |
| /* verify SUBACK */ | |
| - | DEBUGASSERT(Curl_dyn_len(&mq->recvbuf) >= MQTT_SUBACK_LEN); |
| - | ptr = Curl_dyn_ptr(&mq->recvbuf); |
| + | DEBUGASSERT(curlx_dyn_len(&mq->recvbuf) >= MQTT_SUBACK_LEN); |
| + | ptr = curlx_dyn_ptr(&mq->recvbuf); |
| Curl_debug(data, CURLINFO_HEADER_IN, ptr, MQTT_SUBACK_LEN); | |
| if(((unsigned char)ptr[0]) != ((mqtt->packetid >> 8) & 0xff) || | |
| ((unsigned char)ptr[1]) != (mqtt->packetid & 0xff) || | |
| ptr[2] != 0x00) { | |
| - | Curl_dyn_reset(&mq->recvbuf); |
| + | curlx_dyn_reset(&mq->recvbuf); |
| result = CURLE_WEIRD_SERVER_REPLY; | |
| goto fail; | |
| } | |
| @@ -777,7 +777,7 @@ MQTT_SUBACK_COMING: | |
| } | |
| /* we received something */ | |
| - | mq->lastTime = Curl_now(); |
| + | mq->lastTime = curlx_now(); |
| /* if QoS is set, message contains packet id */ | |
| result = Curl_client_write(data, CLIENTWRITE_BODY, buffer, nread); | |
| @@ -807,7 +807,7 @@ static CURLcode mqtt_do(struct Curl_easy *data, bool *done) | |
| if(!mq) | |
| return CURLE_FAILED_INIT; | |
| - | mq->lastTime = Curl_now(); |
| + | mq->lastTime = curlx_now(); |
| mq->pingsent = FALSE; | |
| result = mqtt_connect(data); | |
| @@ -826,8 +826,8 @@ static CURLcode mqtt_done(struct Curl_easy *data, | |
| (void)status; | |
| (void)premature; | |
| if(mq) { | |
| - | Curl_dyn_free(&mq->sendbuf); |
| - | Curl_dyn_free(&mq->recvbuf); |
| + | curlx_dyn_free(&mq->sendbuf); |
| + | curlx_dyn_free(&mq->recvbuf); |
| } | |
| return CURLE_OK; | |
| } | |
| @@ -846,8 +846,8 @@ static CURLcode mqtt_ping(struct Curl_easy *data) | |
| if(mqtt->state == MQTT_FIRST && | |
| !mq->pingsent && | |
| data->set.upkeep_interval_ms > 0) { | |
| - | struct curltime t = Curl_now(); |
| - | timediff_t diff = Curl_timediff(t, mq->lastTime); |
| + | struct curltime t = curlx_now(); |
| + | timediff_t diff = curlx_timediff(t, mq->lastTime); |
| if(diff > data->set.upkeep_interval_ms) { | |
| /* 0xC0 is PINGREQ, and 0x00 is remaining length */ | |
| @@ -877,10 +877,10 @@ static CURLcode mqtt_doing(struct Curl_easy *data, bool *done) | |
| *done = FALSE; | |
| - | if(Curl_dyn_len(&mq->sendbuf)) { |
| + | if(curlx_dyn_len(&mq->sendbuf)) { |
| /* send the remainder of an outgoing packet */ | |
| - | result = mqtt_send(data, Curl_dyn_ptr(&mq->sendbuf), |
| - | Curl_dyn_len(&mq->sendbuf)); |
| + | result = mqtt_send(data, curlx_dyn_ptr(&mq->sendbuf), |
| + | curlx_dyn_len(&mq->sendbuf)); |
| if(result) | |
| return result; | |
| } | |
| @@ -905,7 +905,7 @@ static CURLcode mqtt_doing(struct Curl_easy *data, bool *done) | |
| Curl_debug(data, CURLINFO_HEADER_IN, (const char *)&mq->firstbyte, 1); | |
| /* we received something */ | |
| - | mq->lastTime = Curl_now(); |
| + | mq->lastTime = curlx_now(); |
| /* remember the first byte */ | |
| mq->npacket = 0; | |
| @@ -38,10 +38,10 @@ | |
| #include "multiif.h" | |
| #include "multi_ev.h" | |
| #include "sendf.h" | |
| - | #include "timeval.h" |
| + | #include "curlx/timeval.h" |
| #include "http.h" | |
| #include "select.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "speedcheck.h" | |
| #include "conncache.h" | |
| #include "multihandle.h" | |
| @@ -237,7 +237,7 @@ struct Curl_multi *Curl_multi_handle(unsigned int xfer_table_size, | |
| Curl_uint_bset_init(&multi->pending); | |
| Curl_uint_bset_init(&multi->msgsent); | |
| Curl_hash_init(&multi->proto_hash, 23, | |
| - | Curl_hash_str, Curl_str_key_compare, ph_freeentry); |
| + | Curl_hash_str, curlx_str_key_compare, ph_freeentry); |
| Curl_llist_init(&multi->msglist, NULL); | |
| multi->multiplexing = TRUE; | |
| @@ -1633,22 +1633,22 @@ static bool multi_handle_timeout(struct Curl_easy *data, | |
| since = data->progress.t_startop; | |
| if(data->mstate == MSTATE_RESOLVING) | |
| failf(data, "Resolving timed out after %" FMT_TIMEDIFF_T | |
| - | " milliseconds", Curl_timediff(*now, since)); |
| + | " milliseconds", curlx_timediff(*now, since)); |
| else if(data->mstate == MSTATE_CONNECTING) | |
| failf(data, "Connection timed out after %" FMT_TIMEDIFF_T | |
| - | " milliseconds", Curl_timediff(*now, since)); |
| + | " milliseconds", curlx_timediff(*now, since)); |
| else { | |
| struct SingleRequest *k = &data->req; | |
| if(k->size != -1) { | |
| failf(data, "Operation timed out after %" FMT_TIMEDIFF_T | |
| " milliseconds with %" FMT_OFF_T " out of %" | |
| FMT_OFF_T " bytes received", | |
| - | Curl_timediff(*now, since), k->bytecount, k->size); |
| + | curlx_timediff(*now, since), k->bytecount, k->size); |
| } | |
| else { | |
| failf(data, "Operation timed out after %" FMT_TIMEDIFF_T | |
| " milliseconds with %" FMT_OFF_T " bytes received", | |
| - | Curl_timediff(*now, since), k->bytecount); |
| + | curlx_timediff(*now, since), k->bytecount); |
| } | |
| } | |
| *result = CURLE_OPERATION_TIMEDOUT; | |
| @@ -2650,7 +2650,7 @@ CURLMcode curl_multi_perform(CURLM *m, int *running_handles) | |
| { | |
| CURLMcode returncode = CURLM_OK; | |
| struct Curl_tree *t = NULL; | |
| - | struct curltime now = Curl_now(); |
| + | struct curltime now = curlx_now(); |
| struct Curl_multi *multi = m; | |
| unsigned int mid; | |
| SIGPIPE_VARIABLE(pipe_st); | |
| @@ -2897,7 +2897,7 @@ static CURLMcode add_next_timeout(struct curltime now, | |
| for(e = Curl_llist_head(list); e;) { | |
| struct Curl_llist_node *n = Curl_node_next(e); | |
| struct time_node *node = Curl_node_elem(e); | |
| - | timediff_t diff = Curl_timediff_us(node->time, now); |
| + | timediff_t diff = curlx_timediff_us(node->time, now); |
| if(diff <= 0) | |
| /* remove outdated entry */ | |
| Curl_node_remove(e); | |
| @@ -2990,7 +2990,7 @@ static CURLMcode multi_socket(struct Curl_multi *multi, | |
| (void)ev_bitmask; | |
| memset(&mrc, 0, sizeof(mrc)); | |
| mrc.multi = multi; | |
| - | mrc.now = Curl_now(); |
| + | mrc.now = curlx_now(); |
| sigpipe_init(&mrc.pipe_st); | |
| if(checkall) { | |
| @@ -3028,7 +3028,7 @@ static CURLMcode multi_socket(struct Curl_multi *multi, | |
| * to set a 0 timeout and call us again, we run them here. | |
| * Do that only once or it might be unfair to transfers on other | |
| * sockets. */ | |
| - | mrc.now = Curl_now(); |
| + | mrc.now = curlx_now(); |
| result = multi_run_expired(&mrc); | |
| } | |
| @@ -3170,7 +3170,7 @@ static CURLMcode multi_timeout(struct Curl_multi *multi, | |
| if(multi->timetree) { | |
| /* we have a tree of expire times */ | |
| - | struct curltime now = Curl_now(); |
| + | struct curltime now = curlx_now(); |
| /* splay the lowest to the bottom */ | |
| multi->timetree = Curl_splay(tv_zero, multi->timetree); | |
| @@ -3181,9 +3181,9 @@ static CURLMcode multi_timeout(struct Curl_multi *multi, | |
| /* 'multi->timetree' will be non-NULL here but the compilers sometimes | |
| yell at us if we assume so */ | |
| if(multi->timetree && | |
| - | Curl_timediff_us(multi->timetree->key, now) > 0) { |
| + | curlx_timediff_us(multi->timetree->key, now) > 0) { |
| /* some time left before expiration */ | |
| - | timediff_t diff = Curl_timediff_ceil(multi->timetree->key, now); |
| + | timediff_t diff = curlx_timediff_ceil(multi->timetree->key, now); |
| /* this should be safe even on 32-bit archs, as we do not use that | |
| overly long timeouts */ | |
| *timeout_ms = (long)diff; | |
| @@ -3256,7 +3256,7 @@ CURLMcode Curl_update_timer(struct Curl_multi *multi) | |
| #endif | |
| set_value = TRUE; | |
| } | |
| - | else if(Curl_timediff_us(multi->last_expire_ts, expire_ts)) { |
| + | else if(curlx_timediff_us(multi->last_expire_ts, expire_ts)) { |
| /* We had a timeout before and have one now, the absolute timestamp | |
| * differs. The relative timeout_ms may be the same, but the starting | |
| * point differs. Let the application restart its timer. */ | |
| @@ -3340,7 +3340,7 @@ multi_addtimeout(struct Curl_easy *data, | |
| /* find the correct spot in the list */ | |
| for(e = Curl_llist_head(timeoutlist); e; e = Curl_node_next(e)) { | |
| struct time_node *check = Curl_node_elem(e); | |
| - | timediff_t diff = Curl_timediff(check->time, node->time); |
| + | timediff_t diff = curlx_timediff(check->time, node->time); |
| if(diff > 0) | |
| break; | |
| prev = e; | |
| @@ -3389,7 +3389,7 @@ void Curl_expire_ex(struct Curl_easy *data, | |
| /* This means that the struct is added as a node in the splay tree. | |
| Compare if the new time is earlier, and only remove-old/add-new if it | |
| is. */ | |
| - | timediff_t diff = Curl_timediff(set, *curr_expire); |
| + | timediff_t diff = curlx_timediff(set, *curr_expire); |
| int rc; | |
| if(diff > 0) { | |
| @@ -3427,7 +3427,7 @@ void Curl_expire_ex(struct Curl_easy *data, | |
| */ | |
| void Curl_expire(struct Curl_easy *data, timediff_t milli, expire_id id) | |
| { | |
| - | struct curltime now = Curl_now(); |
| + | struct curltime now = curlx_now(); |
| Curl_expire_ex(data, &now, milli, id); | |
| } | |
| @@ -31,13 +31,13 @@ | |
| #include "cfilters.h" | |
| #include "curl_trc.h" | |
| #include "multiif.h" | |
| - | #include "timeval.h" |
| + | #include "curlx/timeval.h" |
| #include "multi_ev.h" | |
| #include "select.h" | |
| #include "uint-bset.h" | |
| #include "uint-spbset.h" | |
| #include "uint-table.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "multihandle.h" | |
| #include "socks.h" | |
| /* The last 3 #include files should be in this order */ | |
| @@ -39,7 +39,7 @@ | |
| #include "netrc.h" | |
| #include "strcase.h" | |
| #include "curl_get_line.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -78,18 +78,18 @@ static NETRCcode file2memory(const char *filename, struct dynbuf *filebuf) | |
| NETRCcode ret = NETRC_FILE_MISSING; /* if it cannot open the file */ | |
| FILE *file = fopen(filename, FOPEN_READTEXT); | |
| struct dynbuf linebuf; | |
| - | Curl_dyn_init(&linebuf, MAX_NETRC_LINE); |
| + | curlx_dyn_init(&linebuf, MAX_NETRC_LINE); |
| if(file) { | |
| ret = NETRC_OK; | |
| while(Curl_get_line(&linebuf, file)) { | |
| CURLcode result; | |
| - | const char *line = Curl_dyn_ptr(&linebuf); |
| + | const char *line = curlx_dyn_ptr(&linebuf); |
| /* skip comments on load */ | |
| - | Curl_str_passblanks(&line); |
| + | curlx_str_passblanks(&line); |
| if(*line == '#') | |
| continue; | |
| - | result = Curl_dyn_add(filebuf, line); |
| + | result = curlx_dyn_add(filebuf, line); |
| if(result) { | |
| ret = curl2netrc(result); | |
| goto done; | |
| @@ -97,7 +97,7 @@ static NETRCcode file2memory(const char *filename, struct dynbuf *filebuf) | |
| } | |
| } | |
| done: | |
| - | Curl_dyn_free(&linebuf); |
| + | curlx_dyn_free(&linebuf); |
| if(file) | |
| fclose(file); | |
| return ret; | |
| @@ -126,7 +126,7 @@ static NETRCcode parsenetrc(struct store_netrc *store, | |
| struct dynbuf token; | |
| struct dynbuf *filebuf = &store->filebuf; | |
| DEBUGASSERT(!*passwordp); | |
| - | Curl_dyn_init(&token, MAX_NETRC_TOKEN); |
| + | curlx_dyn_init(&token, MAX_NETRC_TOKEN); |
| if(!store->loaded) { | |
| NETRCcode ret = file2memory(netrcfile, filebuf); | |
| @@ -135,15 +135,15 @@ static NETRCcode parsenetrc(struct store_netrc *store, | |
| store->loaded = TRUE; | |
| } | |
| - | netrcbuffer = Curl_dyn_ptr(filebuf); |
| + | netrcbuffer = curlx_dyn_ptr(filebuf); |
| while(!done) { | |
| const char *tok = netrcbuffer; | |
| while(tok && !done) { | |
| const char *tok_end; | |
| bool quoted; | |
| - | Curl_dyn_reset(&token); |
| - | Curl_str_passblanks(&tok); |
| + | curlx_dyn_reset(&token); |
| + | curlx_str_passblanks(&tok); |
| /* tok is first non-space letter */ | |
| if(state == MACDEF) { | |
| if((*tok == '\n') || (*tok == '\r')) | |
| @@ -169,7 +169,7 @@ static NETRCcode parsenetrc(struct store_netrc *store, | |
| retcode = NETRC_SYNTAX_ERROR; | |
| goto out; | |
| } | |
| - | result = Curl_dyn_addn(&token, tok, len); |
| + | result = curlx_dyn_addn(&token, tok, len); |
| if(result) { | |
| retcode = curl2netrc(result); | |
| goto out; | |
| @@ -206,7 +206,7 @@ static NETRCcode parsenetrc(struct store_netrc *store, | |
| endquote = TRUE; | |
| break; | |
| } | |
| - | result = Curl_dyn_addn(&token, &s, 1); |
| + | result = curlx_dyn_addn(&token, &s, 1); |
| if(result) { | |
| retcode = curl2netrc(result); | |
| goto out; | |
| @@ -220,7 +220,7 @@ static NETRCcode parsenetrc(struct store_netrc *store, | |
| } | |
| } | |
| - | tok = Curl_dyn_ptr(&token); |
| + | tok = curlx_dyn_ptr(&token); |
| switch(state) { | |
| case NOTHING: | |
| @@ -332,7 +332,7 @@ static NETRCcode parsenetrc(struct store_netrc *store, | |
| } /* while !done */ | |
| out: | |
| - | Curl_dyn_free(&token); |
| + | curlx_dyn_free(&token); |
| if(!retcode) { | |
| if(!password && our_login) { | |
| /* success without a password, set a blank one */ | |
| @@ -351,7 +351,7 @@ out: | |
| *passwordp = password; | |
| } | |
| else { | |
| - | Curl_dyn_free(filebuf); |
| + | curlx_dyn_free(filebuf); |
| if(!specific_login) | |
| free(login); | |
| free(password); | |
| @@ -456,12 +456,12 @@ NETRCcode Curl_parsenetrc(struct store_netrc *store, const char *host, | |
| void Curl_netrc_init(struct store_netrc *s) | |
| { | |
| - | Curl_dyn_init(&s->filebuf, MAX_NETRC_FILE); |
| + | curlx_dyn_init(&s->filebuf, MAX_NETRC_FILE); |
| s->loaded = FALSE; | |
| } | |
| void Curl_netrc_cleanup(struct store_netrc *s) | |
| { | |
| - | Curl_dyn_free(&s->filebuf); |
| + | curlx_dyn_free(&s->filebuf); |
| s->loaded = FALSE; | |
| } | |
| #endif | |
| @@ -26,7 +26,7 @@ | |
| #include "curl_setup.h" | |
| #ifndef CURL_DISABLE_NETRC | |
| - | #include "dynbuf.h" |
| + | #include "curlx/dynbuf.h" |
| struct store_netrc { | |
| struct dynbuf filebuf; | |
| @@ -29,7 +29,7 @@ | |
| #include "inet_pton.h" | |
| #include "strcase.h" | |
| #include "noproxy.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| #ifdef HAVE_NETINET_IN_H | |
| #include <netinet/in.h> | |
| @@ -178,7 +178,7 @@ bool Curl_check_noproxy(const char *name, const char *no_proxy) | |
| bool match = FALSE; | |
| /* pass blanks */ | |
| - | Curl_str_passblanks(&p); |
| + | curlx_str_passblanks(&p); |
| token = p; | |
| /* pass over the pattern */ | |
| @@ -247,7 +247,7 @@ bool Curl_check_noproxy(const char *name, const char *no_proxy) | |
| return TRUE; | |
| } /* if(tokenlen) */ | |
| /* pass blanks after pattern */ | |
| - | Curl_str_passblanks(&p); |
| + | curlx_str_passblanks(&p); |
| /* if not a comma, this ends the loop */ | |
| if(*p != ',') | |
| break; | |
| @@ -47,7 +47,7 @@ | |
| #include "vtls/vtls.h" | |
| #include "transfer.h" | |
| #include "curl_ldap.h" | |
| - | #include "curl_base64.h" |
| + | #include "curlx/base64.h" |
| #include "cfilters.h" | |
| #include "connect.h" | |
| #include "curl_sasl.h" | |
| @@ -614,7 +614,7 @@ static CURLcode oldap_connect(struct Curl_easy *data, bool *done) | |
| if(do_trace < 0) { | |
| const char *env = getenv("CURL_OPENLDAP_TRACE"); | |
| curl_off_t e = 0; | |
| - | if(!Curl_str_number(&env, &e, INT_MAX)) |
| + | if(!curlx_str_number(&env, &e, INT_MAX)) |
| do_trace = e > 0; | |
| } | |
| if(do_trace) | |
| @@ -1165,8 +1165,8 @@ static ssize_t oldap_recv(struct Curl_easy *data, int sockindex, char *buf, | |
| /* Binary value, encode to base64. */ | |
| if(bvals[i].bv_len) | |
| - | result = Curl_base64_encode(bvals[i].bv_val, bvals[i].bv_len, |
| - | &val_b64, &val_b64_sz); |
| + | result = curlx_base64_encode(bvals[i].bv_val, bvals[i].bv_len, |
| + | &val_b64, &val_b64_sz); |
| if(!result) | |
| result = client_write(data, STRCONST(": "), val_b64, val_b64_sz, | |
| STRCONST("\n")); | |
| @@ -81,9 +81,9 @@ | |
| #include <curl/curl.h> | |
| #include "strcase.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "parsedate.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* | |
| * parsedate() | |
| @@ -423,7 +423,7 @@ static int parsedate(const char *date, time_t *output) | |
| curl_off_t lval; | |
| int num_digits = 0; | |
| const char *p = date; | |
| - | if(Curl_str_number(&p, &lval, 99999999)) |
| + | if(curlx_str_number(&p, &lval, 99999999)) |
| return PARSEDATE_FAIL; | |
| /* we know num_digits cannot be larger than 8 */ | |
| @@ -54,7 +54,7 @@ timediff_t Curl_pp_state_timeout(struct Curl_easy *data, | |
| timediff_t timeout_ms; /* in milliseconds */ | |
| timediff_t response_time = (data->set.server_response_timeout) ? | |
| data->set.server_response_timeout : pp->response_time; | |
| - | struct curltime now = Curl_now(); |
| + | struct curltime now = curlx_now(); |
| /* if CURLOPT_SERVER_RESPONSE_TIMEOUT is set, use that to determine | |
| remaining time, or use pp->response because SERVER_RESPONSE_TIMEOUT is | |
| @@ -63,7 +63,7 @@ timediff_t Curl_pp_state_timeout(struct Curl_easy *data, | |
| /* Without a requested timeout, we only wait 'response_time' seconds for the | |
| full response to arrive before we bail out */ | |
| - | timeout_ms = response_time - Curl_timediff(now, pp->response); |
| + | timeout_ms = response_time - curlx_timediff(now, pp->response); |
| if(data->set.timeout && !disconnecting) { | |
| /* if timeout is requested, find out how much overall remains */ | |
| @@ -127,7 +127,7 @@ CURLcode Curl_pp_statemach(struct Curl_easy *data, | |
| if(Curl_pgrsUpdate(data)) | |
| result = CURLE_ABORTED_BY_CALLBACK; | |
| else | |
| - | result = Curl_speedcheck(data, Curl_now()); |
| + | result = Curl_speedcheck(data, curlx_now()); |
| if(result) | |
| return result; | |
| @@ -150,10 +150,10 @@ void Curl_pp_init(struct pingpong *pp) | |
| { | |
| DEBUGASSERT(!pp->initialised); | |
| pp->nread_resp = 0; | |
| - | pp->response = Curl_now(); /* start response time-out now! */ |
| + | pp->response = curlx_now(); /* start response time-out now! */ |
| pp->pending_resp = TRUE; | |
| - | Curl_dyn_init(&pp->sendbuf, DYN_PINGPPONG_CMD); |
| - | Curl_dyn_init(&pp->recvbuf, DYN_PINGPPONG_CMD); |
| + | curlx_dyn_init(&pp->sendbuf, DYN_PINGPPONG_CMD); |
| + | curlx_dyn_init(&pp->recvbuf, DYN_PINGPPONG_CMD); |
| pp->initialised = TRUE; | |
| } | |
| @@ -190,19 +190,19 @@ CURLcode Curl_pp_vsendf(struct Curl_easy *data, | |
| /* cannot send without a connection! */ | |
| return CURLE_SEND_ERROR; | |
| - | Curl_dyn_reset(&pp->sendbuf); |
| - | result = Curl_dyn_vaddf(&pp->sendbuf, fmt, args); |
| + | curlx_dyn_reset(&pp->sendbuf); |
| + | result = curlx_dyn_vaddf(&pp->sendbuf, fmt, args); |
| if(result) | |
| return result; | |
| /* append CRLF */ | |
| - | result = Curl_dyn_addn(&pp->sendbuf, "\r\n", 2); |
| + | result = curlx_dyn_addn(&pp->sendbuf, "\r\n", 2); |
| if(result) | |
| return result; | |
| pp->pending_resp = TRUE; | |
| - | write_len = Curl_dyn_len(&pp->sendbuf); |
| - | s = Curl_dyn_ptr(&pp->sendbuf); |
| + | write_len = curlx_dyn_len(&pp->sendbuf); |
| + | s = curlx_dyn_ptr(&pp->sendbuf); |
| #ifdef HAVE_GSSAPI | |
| conn->data_prot = PROT_CMD; | |
| @@ -231,7 +231,7 @@ CURLcode Curl_pp_vsendf(struct Curl_easy *data, | |
| else { | |
| pp->sendthis = NULL; | |
| pp->sendleft = pp->sendsize = 0; | |
| - | pp->response = Curl_now(); |
| + | pp->response = curlx_now(); |
| } | |
| return CURLE_OK; | |
| @@ -305,10 +305,10 @@ CURLcode Curl_pp_readresp(struct Curl_easy *data, | |
| if(pp->nfinal) { | |
| /* a previous call left this many bytes in the beginning of the buffer as | |
| that was the final line; now ditch that */ | |
| - | size_t full = Curl_dyn_len(&pp->recvbuf); |
| + | size_t full = curlx_dyn_len(&pp->recvbuf); |
| /* trim off the "final" leading part */ | |
| - | Curl_dyn_tail(&pp->recvbuf, full - pp->nfinal); |
| + | curlx_dyn_tail(&pp->recvbuf, full - pp->nfinal); |
| pp->nfinal = 0; /* now gone */ | |
| } | |
| @@ -326,7 +326,7 @@ CURLcode Curl_pp_readresp(struct Curl_easy *data, | |
| return CURLE_RECV_ERROR; | |
| } | |
| - | result = Curl_dyn_addn(&pp->recvbuf, buffer, gotbytes); |
| + | result = curlx_dyn_addn(&pp->recvbuf, buffer, gotbytes); |
| if(result) | |
| return result; | |
| @@ -336,8 +336,8 @@ CURLcode Curl_pp_readresp(struct Curl_easy *data, | |
| } | |
| do { | |
| - | char *line = Curl_dyn_ptr(&pp->recvbuf); |
| - | char *nl = memchr(line, '\n', Curl_dyn_len(&pp->recvbuf)); |
| + | char *line = curlx_dyn_ptr(&pp->recvbuf); |
| + | char *nl = memchr(line, '\n', curlx_dyn_len(&pp->recvbuf)); |
| if(nl) { | |
| /* a newline is CRLF in pp-talk, so the CR is ignored as | |
| the line is not really terminated until the LF comes */ | |
| @@ -363,8 +363,8 @@ CURLcode Curl_pp_readresp(struct Curl_easy *data, | |
| parsers). Store the overflow counter to inform about additional | |
| data in this buffer after the endofresp line. */ | |
| pp->nfinal = length; | |
| - | if(Curl_dyn_len(&pp->recvbuf) > length) |
| - | pp->overflow = Curl_dyn_len(&pp->recvbuf) - length; |
| + | if(curlx_dyn_len(&pp->recvbuf) > length) |
| + | pp->overflow = curlx_dyn_len(&pp->recvbuf) - length; |
| else | |
| pp->overflow = 0; | |
| *size = pp->nread_resp; /* size of the response */ | |
| @@ -372,11 +372,11 @@ CURLcode Curl_pp_readresp(struct Curl_easy *data, | |
| gotbytes = 0; /* force break out of outer loop */ | |
| break; | |
| } | |
| - | if(Curl_dyn_len(&pp->recvbuf) > length) |
| + | if(curlx_dyn_len(&pp->recvbuf) > length) |
| /* keep the remaining piece */ | |
| - | Curl_dyn_tail((&pp->recvbuf), Curl_dyn_len(&pp->recvbuf) - length); |
| + | curlx_dyn_tail((&pp->recvbuf), curlx_dyn_len(&pp->recvbuf) - length); |
| else | |
| - | Curl_dyn_reset(&pp->recvbuf); |
| + | curlx_dyn_reset(&pp->recvbuf); |
| } | |
| else { | |
| /* without a newline, there is no overflow */ | |
| @@ -442,7 +442,7 @@ CURLcode Curl_pp_flushsend(struct Curl_easy *data, | |
| else { | |
| pp->sendthis = NULL; | |
| pp->sendleft = pp->sendsize = 0; | |
| - | pp->response = Curl_now(); |
| + | pp->response = curlx_now(); |
| } | |
| return CURLE_OK; | |
| } | |
| @@ -450,8 +450,8 @@ CURLcode Curl_pp_flushsend(struct Curl_easy *data, | |
| CURLcode Curl_pp_disconnect(struct pingpong *pp) | |
| { | |
| if(pp->initialised) { | |
| - | Curl_dyn_free(&pp->sendbuf); |
| - | Curl_dyn_free(&pp->recvbuf); |
| + | curlx_dyn_free(&pp->sendbuf); |
| + | curlx_dyn_free(&pp->recvbuf); |
| memset(pp, 0, sizeof(*pp)); | |
| } | |
| return CURLE_OK; | |
| @@ -459,7 +459,7 @@ CURLcode Curl_pp_disconnect(struct pingpong *pp) | |
| bool Curl_pp_moredata(struct pingpong *pp) | |
| { | |
| - | return !pp->sendleft && Curl_dyn_len(&pp->recvbuf) > pp->nfinal; |
| + | return !pp->sendleft && curlx_dyn_len(&pp->recvbuf) > pp->nfinal; |
| } | |
| #endif | |
| @@ -76,7 +76,7 @@ | |
| #include "bufref.h" | |
| #include "curl_sasl.h" | |
| #include "curl_md5.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "strdup.h" | |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -367,7 +367,7 @@ static CURLcode pop3_get_message(struct Curl_easy *data, struct bufref *out) | |
| if(!pop3c) | |
| return CURLE_FAILED_INIT; | |
| - | message = Curl_dyn_ptr(&pop3c->pp.recvbuf); |
| + | message = curlx_dyn_ptr(&pop3c->pp.recvbuf); |
| len = pop3c->pp.nfinal; | |
| if(len > 2) { | |
| /* Find the start of the message */ | |
| @@ -819,7 +819,7 @@ static CURLcode pop3_state_servergreet_resp(struct Curl_easy *data, | |
| if(!pop3c) | |
| return CURLE_FAILED_INIT; | |
| - | line = Curl_dyn_ptr(&pop3c->pp.recvbuf); |
| + | line = curlx_dyn_ptr(&pop3c->pp.recvbuf); |
| len = pop3c->pp.nfinal; | |
| if(pop3code != '+') { | |
| @@ -874,7 +874,7 @@ static CURLcode pop3_state_capa_resp(struct Curl_easy *data, int pop3code, | |
| if(!pop3c) | |
| return CURLE_FAILED_INIT; | |
| - | line = Curl_dyn_ptr(&pop3c->pp.recvbuf); |
| + | line = curlx_dyn_ptr(&pop3c->pp.recvbuf); |
| len = pop3c->pp.nfinal; | |
| /* Do we have a untagged continuation response? */ | |
| @@ -1128,18 +1128,18 @@ static CURLcode pop3_state_command_resp(struct Curl_easy *data, | |
| the body */ | |
| /* keep only the overflow */ | |
| - | Curl_dyn_tail(&pp->recvbuf, pp->overflow); |
| + | curlx_dyn_tail(&pp->recvbuf, pp->overflow); |
| pp->nfinal = 0; /* done */ | |
| if(!data->req.no_body) { | |
| - | result = pop3_write(data, Curl_dyn_ptr(&pp->recvbuf), |
| - | Curl_dyn_len(&pp->recvbuf), FALSE); |
| + | result = pop3_write(data, curlx_dyn_ptr(&pp->recvbuf), |
| + | curlx_dyn_len(&pp->recvbuf), FALSE); |
| if(result) | |
| return result; | |
| } | |
| /* reset the buffer */ | |
| - | Curl_dyn_reset(&pp->recvbuf); |
| + | curlx_dyn_reset(&pp->recvbuf); |
| pp->overflow = 0; | |
| } | |
| } | |
| @@ -28,7 +28,7 @@ | |
| #include "sendf.h" | |
| #include "multiif.h" | |
| #include "progress.h" | |
| - | #include "timeval.h" |
| + | #include "curlx/timeval.h" |
| #include "curl_printf.h" | |
| /* check rate limits within this many recent milliseconds, at minimum. */ | |
| @@ -181,7 +181,7 @@ void Curl_pgrsTimeWas(struct Curl_easy *data, timerid timer, | |
| case TIMER_POSTQUEUE: | |
| /* Queue time is accumulative from all involved redirects */ | |
| data->progress.t_postqueue += | |
| - | Curl_timediff_us(timestamp, data->progress.t_startqueue); |
| + | curlx_timediff_us(timestamp, data->progress.t_startqueue); |
| break; | |
| case TIMER_STARTACCEPT: | |
| data->progress.t_acceptdata = timestamp; | |
| @@ -217,13 +217,13 @@ void Curl_pgrsTimeWas(struct Curl_easy *data, timerid timer, | |
| delta = &data->progress.t_posttransfer; | |
| break; | |
| case TIMER_REDIRECT: | |
| - | data->progress.t_redirect = Curl_timediff_us(timestamp, |
| + | data->progress.t_redirect = curlx_timediff_us(timestamp, |
| data->progress.start); | |
| data->progress.t_startqueue = timestamp; | |
| break; | |
| } | |
| if(delta) { | |
| - | timediff_t us = Curl_timediff_us(timestamp, data->progress.t_startsingle); |
| + | timediff_t us = curlx_timediff_us(timestamp, data->progress.t_startsingle); |
| if(us < 1) | |
| us = 1; /* make sure at least one microsecond passed */ | |
| *delta += us; | |
| @@ -239,7 +239,7 @@ void Curl_pgrsTimeWas(struct Curl_easy *data, timerid timer, | |
| */ | |
| struct curltime Curl_pgrsTime(struct Curl_easy *data, timerid timer) | |
| { | |
| - | struct curltime now = Curl_now(); |
| + | struct curltime now = curlx_now(); |
| Curl_pgrsTimeWas(data, timer, now); | |
| return now; | |
| @@ -248,7 +248,7 @@ struct curltime Curl_pgrsTime(struct Curl_easy *data, timerid timer) | |
| void Curl_pgrsStartNow(struct Curl_easy *data) | |
| { | |
| data->progress.speeder_c = 0; /* reset the progress meter display */ | |
| - | data->progress.start = Curl_now(); |
| + | data->progress.start = curlx_now(); |
| data->progress.is_t_startransfer_set = FALSE; | |
| data->progress.ul.limit.start = data->progress.start; | |
| data->progress.dl.limit.start = data->progress.start; | |
| @@ -308,7 +308,7 @@ timediff_t Curl_pgrsLimitWaitTime(struct pgrs_dir *d, | |
| * 'actual' is the time in milliseconds it took to actually download the | |
| * last 'size' bytes. | |
| */ | |
| - | actual = Curl_timediff_ceil(now, d->limit.start); |
| + | actual = curlx_timediff_ceil(now, d->limit.start); |
| if(actual < minimum) { | |
| /* if it downloaded the data faster than the limit, make it wait the | |
| difference */ | |
| @@ -334,14 +334,14 @@ void Curl_ratelimit(struct Curl_easy *data, struct curltime now) | |
| { | |
| /* do not set a new stamp unless the time since last update is long enough */ | |
| if(data->set.max_recv_speed) { | |
| - | if(Curl_timediff(now, data->progress.dl.limit.start) >= |
| + | if(curlx_timediff(now, data->progress.dl.limit.start) >= |
| MIN_RATE_LIMIT_PERIOD) { | |
| data->progress.dl.limit.start = now; | |
| data->progress.dl.limit.start_size = data->progress.dl.cur_size; | |
| } | |
| } | |
| if(data->set.max_send_speed) { | |
| - | if(Curl_timediff(now, data->progress.ul.limit.start) >= |
| + | if(curlx_timediff(now, data->progress.ul.limit.start) >= |
| MIN_RATE_LIMIT_PERIOD) { | |
| data->progress.ul.limit.start = now; | |
| data->progress.ul.limit.start_size = data->progress.ul.cur_size; | |
| @@ -407,7 +407,7 @@ static bool progress_calc(struct Curl_easy *data, struct curltime now) | |
| struct Progress * const p = &data->progress; | |
| /* The time spent so far (from the start) in microseconds */ | |
| - | p->timespent = Curl_timediff_us(now, p->start); |
| + | p->timespent = curlx_timediff_us(now, p->start); |
| p->dl.speed = trspeed(p->dl.cur_size, p->timespent); | |
| p->ul.speed = trspeed(p->ul.cur_size, p->timespent); | |
| @@ -447,7 +447,7 @@ static bool progress_calc(struct Curl_easy *data, struct curltime now) | |
| 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]); |
| + | span_ms = curlx_timediff(now, p->speeder_time[checkindex]); |
| if(0 == span_ms) | |
| span_ms = 1; /* at least one millisecond MUST have passed */ | |
| @@ -636,7 +636,7 @@ static int pgrsupdate(struct Curl_easy *data, bool showprogress) | |
| int Curl_pgrsUpdate(struct Curl_easy *data) | |
| { | |
| - | struct curltime now = Curl_now(); /* what time is it */ |
| + | struct curltime now = curlx_now(); /* what time is it */ |
| bool showprogress = progress_calc(data, now); | |
| return pgrsupdate(data, showprogress); | |
| } | |
| @@ -646,6 +646,6 @@ int Curl_pgrsUpdate(struct Curl_easy *data) | |
| */ | |
| void Curl_pgrsUpdate_nometer(struct Curl_easy *data) | |
| { | |
| - | struct curltime now = Curl_now(); /* what time is it */ |
| + | struct curltime now = curlx_now(); /* what time is it */ |
| (void)progress_calc(data, now); | |
| } | |
| @@ -24,7 +24,7 @@ | |
| * | |
| ***************************************************************************/ | |
| - | #include "timeval.h" |
| + | #include "curlx/timeval.h" |
| typedef enum { | |
| @@ -48,7 +48,7 @@ void Curl_psl_destroy(struct PslCache *pslcache) | |
| static time_t now_seconds(void) | |
| { | |
| - | struct curltime now = Curl_now(); |
| + | struct curltime now = curlx_now(); |
| return now.tv_sec; | |
| } | |
| @@ -37,7 +37,7 @@ | |
| #include "urldata.h" | |
| #include "vtls/vtls.h" | |
| #include "sendf.h" | |
| - | #include "timeval.h" |
| + | #include "curlx/timeval.h" |
| #include "rand.h" | |
| #include "escape.h" | |
| @@ -130,7 +130,7 @@ static CURLcode weak_random(struct Curl_easy *data, | |
| static bool seeded = FALSE; | |
| unsigned int rnd; | |
| if(!seeded) { | |
| - | struct curltime now = Curl_now(); |
| + | struct curltime now = curlx_now(); |
| randseed += (unsigned int)now.tv_usec + (unsigned int)now.tv_sec; | |
| randseed = randseed * 1103515245 + 12345; | |
| randseed = randseed * 1103515245 + 12345; | |
| @@ -30,7 +30,7 @@ | |
| !defined(CURL_DISABLE_ALTSVC) | |
| #include "curl_multibyte.h" | |
| - | #include "timeval.h" |
| + | #include "curlx/timeval.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -45,7 +45,7 @@ int Curl_rename(const char *oldpath, const char *newpath) | |
| MoveFileEx() will overwrite and is usually atomic, however it fails | |
| when there are open handles to the file. */ | |
| const int max_wait_ms = 1000; | |
| - | struct curltime start = Curl_now(); |
| + | struct curltime start = curlx_now(); |
| TCHAR *tchar_oldpath = curlx_convert_UTF8_to_tchar(oldpath); | |
| TCHAR *tchar_newpath = curlx_convert_UTF8_to_tchar(newpath); | |
| for(;;) { | |
| @@ -55,7 +55,7 @@ int Curl_rename(const char *oldpath, const char *newpath) | |
| curlx_unicodefree(tchar_newpath); | |
| break; | |
| } | |
| - | diff = Curl_timediff(Curl_now(), start); |
| + | diff = curlx_timediff(curlx_now(), start); |
| if(diff < 0 || diff > max_wait_ms) { | |
| curlx_unicodefree(tchar_oldpath); | |
| curlx_unicodefree(tchar_newpath); | |
| @@ -26,7 +26,7 @@ | |
| #include "urldata.h" | |
| #include "cfilters.h" | |
| - | #include "dynbuf.h" |
| + | #include "curlx/dynbuf.h" |
| #include "doh.h" | |
| #include "multiif.h" | |
| #include "progress.h" | |
| @@ -34,7 +34,7 @@ | |
| #include "sendf.h" | |
| #include "transfer.h" | |
| #include "url.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -95,7 +95,7 @@ CURLcode Curl_req_soft_reset(struct SingleRequest *req, | |
| CURLcode Curl_req_start(struct SingleRequest *req, | |
| struct Curl_easy *data) | |
| { | |
| - | req->start = Curl_now(); |
| + | req->start = curlx_now(); |
| return Curl_req_soft_reset(req, data); | |
| } | |
| @@ -198,7 +198,7 @@ static CURLcode xfer_send(struct Curl_easy *data, | |
| const char *p = getenv("CURL_SMALLREQSEND"); | |
| if(p) { | |
| curl_off_t body_small; | |
| - | if(!Curl_str_number(&p, &body_small, body_len)) |
| + | if(!curlx_str_number(&p, &body_small, body_len)) |
| blen = hds_len + (size_t)body_small; | |
| } | |
| } | |
| @@ -387,8 +387,8 @@ CURLcode Curl_req_send(struct Curl_easy *data, struct dynbuf *req, | |
| return CURLE_FAILED_INIT; | |
| data->req.httpversion_sent = httpversion; | |
| - | buf = Curl_dyn_ptr(req); |
| - | blen = Curl_dyn_len(req); |
| + | buf = curlx_dyn_ptr(req); |
| + | blen = curlx_dyn_len(req); |
| if(!Curl_creader_total_length(data)) { | |
| /* Request without body. Try to send directly from the buf given. */ | |
| data->req.eos_read = TRUE; | |
| @@ -40,7 +40,7 @@ | |
| #include "connect.h" | |
| #include "cfilters.h" | |
| #include "strdup.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| #include "curl_memory.h" | |
| @@ -168,7 +168,7 @@ static void rtsp_conn_dtor(void *key, size_t klen, void *entry) | |
| struct rtsp_conn *rtspc = entry; | |
| (void)key; | |
| (void)klen; | |
| - | Curl_dyn_free(&rtspc->buf); |
| + | curlx_dyn_free(&rtspc->buf); |
| free(rtspc); | |
| } | |
| @@ -181,7 +181,7 @@ static CURLcode rtsp_setup_connection(struct Curl_easy *data, | |
| rtspc = calloc(1, sizeof(*rtspc)); | |
| if(!rtspc) | |
| return CURLE_OUT_OF_MEMORY; | |
| - | Curl_dyn_init(&rtspc->buf, MAX_RTP_BUFFERSIZE); |
| + | curlx_dyn_init(&rtspc->buf, MAX_RTP_BUFFERSIZE); |
| if(Curl_conn_meta_set(conn, CURL_META_RTSP_CONN, rtspc, rtsp_conn_dtor)) | |
| return CURLE_OUT_OF_MEMORY; | |
| @@ -302,7 +302,7 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) | |
| return CURLE_FAILED_INIT; | |
| /* Initialize a dynamic send buffer */ | |
| - | Curl_dyn_init(&req_buffer, DYN_RTSP_REQ_HEADER); |
| + | curlx_dyn_init(&req_buffer, DYN_RTSP_REQ_HEADER); |
| rtsp->CSeq_sent = data->state.rtsp_next_client_CSeq; | |
| rtsp->CSeq_recv = 0; | |
| @@ -501,10 +501,10 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) | |
| } | |
| result = | |
| - | Curl_dyn_addf(&req_buffer, |
| - | "%s %s RTSP/1.0\r\n" /* Request Stream-URI RTSP/1.0 */ |
| - | "CSeq: %ld\r\n", /* CSeq */ |
| - | p_request, p_stream_uri, rtsp->CSeq_sent); |
| + | curlx_dyn_addf(&req_buffer, |
| + | "%s %s RTSP/1.0\r\n" /* Request Stream-URI RTSP/1.0 */ |
| + | "CSeq: %ld\r\n", /* CSeq */ |
| + | p_request, p_stream_uri, rtsp->CSeq_sent); |
| if(result) | |
| goto out; | |
| @@ -513,7 +513,7 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) | |
| * to make comparison easier | |
| */ | |
| if(p_session_id) { | |
| - | result = Curl_dyn_addf(&req_buffer, "Session: %s\r\n", p_session_id); |
| + | result = curlx_dyn_addf(&req_buffer, "Session: %s\r\n", p_session_id); |
| if(result) | |
| goto out; | |
| } | |
| @@ -521,24 +521,24 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) | |
| /* | |
| * Shared HTTP-like options | |
| */ | |
| - | result = Curl_dyn_addf(&req_buffer, |
| - | "%s" /* transport */ |
| - | "%s" /* accept */ |
| - | "%s" /* accept-encoding */ |
| - | "%s" /* range */ |
| - | "%s" /* referrer */ |
| - | "%s" /* user-agent */ |
| - | "%s" /* proxyuserpwd */ |
| - | "%s" /* userpwd */ |
| - | , |
| - | p_transport ? p_transport : "", |
| - | p_accept ? p_accept : "", |
| - | p_accept_encoding ? p_accept_encoding : "", |
| - | p_range ? p_range : "", |
| - | p_referrer ? p_referrer : "", |
| - | p_uagent ? p_uagent : "", |
| - | p_proxyuserpwd ? p_proxyuserpwd : "", |
| - | p_userpwd ? p_userpwd : ""); |
| + | result = curlx_dyn_addf(&req_buffer, |
| + | "%s" /* transport */ |
| + | "%s" /* accept */ |
| + | "%s" /* accept-encoding */ |
| + | "%s" /* range */ |
| + | "%s" /* referrer */ |
| + | "%s" /* user-agent */ |
| + | "%s" /* proxyuserpwd */ |
| + | "%s" /* userpwd */ |
| + | , |
| + | p_transport ? p_transport : "", |
| + | p_accept ? p_accept : "", |
| + | p_accept_encoding ? p_accept_encoding : "", |
| + | p_range ? p_range : "", |
| + | p_referrer ? p_referrer : "", |
| + | p_uagent ? p_uagent : "", |
| + | p_proxyuserpwd ? p_proxyuserpwd : "", |
| + | p_userpwd ? p_userpwd : ""); |
| /* | |
| * Free userpwd now --- cannot reuse this for Negotiate and possibly NTLM | |
| @@ -594,8 +594,8 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) | |
| * actually set a custom Content-Length in the headers */ | |
| if(!Curl_checkheaders(data, STRCONST("Content-Length"))) { | |
| result = | |
| - | Curl_dyn_addf(&req_buffer, "Content-Length: %" FMT_OFF_T"\r\n", |
| - | req_clen); |
| + | curlx_dyn_addf(&req_buffer, "Content-Length: %" FMT_OFF_T"\r\n", |
| + | req_clen); |
| if(result) | |
| goto out; | |
| } | |
| @@ -603,9 +603,9 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) | |
| if(rtspreq == RTSPREQ_SET_PARAMETER || | |
| rtspreq == RTSPREQ_GET_PARAMETER) { | |
| if(!Curl_checkheaders(data, STRCONST("Content-Type"))) { | |
| - | result = Curl_dyn_addn(&req_buffer, |
| - | STRCONST("Content-Type: " |
| - | "text/parameters\r\n")); |
| + | result = curlx_dyn_addn(&req_buffer, |
| + | STRCONST("Content-Type: " |
| + | "text/parameters\r\n")); |
| if(result) | |
| goto out; | |
| } | |
| @@ -613,9 +613,9 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) | |
| if(rtspreq == RTSPREQ_ANNOUNCE) { | |
| if(!Curl_checkheaders(data, STRCONST("Content-Type"))) { | |
| - | result = Curl_dyn_addn(&req_buffer, |
| - | STRCONST("Content-Type: " |
| - | "application/sdp\r\n")); |
| + | result = curlx_dyn_addn(&req_buffer, |
| + | STRCONST("Content-Type: " |
| + | "application/sdp\r\n")); |
| if(result) | |
| goto out; | |
| } | |
| @@ -634,7 +634,7 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) | |
| } | |
| /* Finish the request buffer */ | |
| - | result = Curl_dyn_addn(&req_buffer, STRCONST("\r\n")); |
| + | result = curlx_dyn_addn(&req_buffer, STRCONST("\r\n")); |
| if(result) | |
| goto out; | |
| @@ -658,7 +658,7 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) | |
| result = CURLE_ABORTED_BY_CALLBACK; | |
| } | |
| out: | |
| - | Curl_dyn_free(&req_buffer); |
| + | curlx_dyn_free(&req_buffer); |
| return result; | |
| } | |
| @@ -703,7 +703,7 @@ static CURLcode rtsp_filter_rtp(struct Curl_easy *data, | |
| switch(rtspc->state) { | |
| case RTP_PARSE_SKIP: { | |
| - | DEBUGASSERT(Curl_dyn_len(&rtspc->buf) == 0); |
| + | DEBUGASSERT(curlx_dyn_len(&rtspc->buf) == 0); |
| while(blen && buf[0] != '$') { | |
| if(!in_body && buf[0] == 'R' && | |
| data->set.rtspreq != RTSPREQ_RECEIVE) { | |
| @@ -733,7 +733,7 @@ static CURLcode rtsp_filter_rtp(struct Curl_easy *data, | |
| if(result) | |
| goto out; | |
| } | |
| - | if(Curl_dyn_addn(&rtspc->buf, buf, 1)) { |
| + | if(curlx_dyn_addn(&rtspc->buf, buf, 1)) { |
| result = CURLE_OUT_OF_MEMORY; | |
| goto out; | |
| } | |
| @@ -748,7 +748,7 @@ static CURLcode rtsp_filter_rtp(struct Curl_easy *data, | |
| case RTP_PARSE_CHANNEL: { | |
| int idx = ((unsigned char)buf[0]) / 8; | |
| int off = ((unsigned char)buf[0]) % 8; | |
| - | DEBUGASSERT(Curl_dyn_len(&rtspc->buf) == 1); |
| + | DEBUGASSERT(curlx_dyn_len(&rtspc->buf) == 1); |
| if(!(data->state.rtp_channel_mask[idx] & (1 << off))) { | |
| /* invalid channel number, junk or BODY data */ | |
| rtspc->state = RTP_PARSE_SKIP; | |
| @@ -760,7 +760,7 @@ static CURLcode rtsp_filter_rtp(struct Curl_easy *data, | |
| * it from an earlier call. We cannot un-consume it and have | |
| * to write it directly as BODY data */ | |
| result = rtp_write_body_junk(data, rtspc, | |
| - | Curl_dyn_ptr(&rtspc->buf), 1); |
| + | curlx_dyn_ptr(&rtspc->buf), 1); |
| if(result) | |
| goto out; | |
| } | |
| @@ -768,12 +768,12 @@ static CURLcode rtsp_filter_rtp(struct Curl_easy *data, | |
| /* count the '$' as skip and continue */ | |
| skip_len = 1; | |
| } | |
| - | Curl_dyn_free(&rtspc->buf); |
| + | curlx_dyn_free(&rtspc->buf); |
| break; | |
| } | |
| /* a valid channel, so we expect this to be a real RTP message */ | |
| rtspc->rtp_channel = (unsigned char)buf[0]; | |
| - | if(Curl_dyn_addn(&rtspc->buf, buf, 1)) { |
| + | if(curlx_dyn_addn(&rtspc->buf, buf, 1)) { |
| result = CURLE_OUT_OF_MEMORY; | |
| goto out; | |
| } | |
| @@ -785,10 +785,10 @@ static CURLcode rtsp_filter_rtp(struct Curl_easy *data, | |
| } | |
| case RTP_PARSE_LEN: { | |
| - | size_t rtp_len = Curl_dyn_len(&rtspc->buf); |
| + | size_t rtp_len = curlx_dyn_len(&rtspc->buf); |
| const char *rtp_buf; | |
| DEBUGASSERT(rtp_len >= 2 && rtp_len < 4); | |
| - | if(Curl_dyn_addn(&rtspc->buf, buf, 1)) { |
| + | if(curlx_dyn_addn(&rtspc->buf, buf, 1)) { |
| result = CURLE_OUT_OF_MEMORY; | |
| goto out; | |
| } | |
| @@ -797,19 +797,19 @@ static CURLcode rtsp_filter_rtp(struct Curl_easy *data, | |
| --blen; | |
| if(rtp_len == 2) | |
| break; | |
| - | rtp_buf = Curl_dyn_ptr(&rtspc->buf); |
| + | rtp_buf = curlx_dyn_ptr(&rtspc->buf); |
| rtspc->rtp_len = RTP_PKT_LENGTH(rtp_buf) + 4; | |
| rtspc->state = RTP_PARSE_DATA; | |
| break; | |
| } | |
| case RTP_PARSE_DATA: { | |
| - | size_t rtp_len = Curl_dyn_len(&rtspc->buf); |
| + | size_t rtp_len = curlx_dyn_len(&rtspc->buf); |
| size_t needed; | |
| DEBUGASSERT(rtp_len < rtspc->rtp_len); | |
| needed = rtspc->rtp_len - rtp_len; | |
| if(needed <= blen) { | |
| - | if(Curl_dyn_addn(&rtspc->buf, buf, needed)) { |
| + | if(curlx_dyn_addn(&rtspc->buf, buf, needed)) { |
| result = CURLE_OUT_OF_MEMORY; | |
| goto out; | |
| } | |
| @@ -819,15 +819,15 @@ static CURLcode rtsp_filter_rtp(struct Curl_easy *data, | |
| /* complete RTP message in buffer */ | |
| DEBUGF(infof(data, "RTP write channel %d rtp_len %zu", | |
| rtspc->rtp_channel, rtspc->rtp_len)); | |
| - | result = rtp_client_write(data, Curl_dyn_ptr(&rtspc->buf), |
| + | result = rtp_client_write(data, curlx_dyn_ptr(&rtspc->buf), |
| rtspc->rtp_len); | |
| - | Curl_dyn_free(&rtspc->buf); |
| + | curlx_dyn_free(&rtspc->buf); |
| rtspc->state = RTP_PARSE_SKIP; | |
| if(result) | |
| goto out; | |
| } | |
| else { | |
| - | if(Curl_dyn_addn(&rtspc->buf, buf, blen)) { |
| + | if(curlx_dyn_addn(&rtspc->buf, buf, blen)) { |
| result = CURLE_OUT_OF_MEMORY; | |
| goto out; | |
| } | |
| @@ -987,8 +987,8 @@ CURLcode Curl_rtsp_parseheader(struct Curl_easy *data, const char *header) | |
| const char *p = &header[5]; | |
| if(!rtsp) | |
| return CURLE_FAILED_INIT; | |
| - | Curl_str_passblanks(&p); |
| - | if(Curl_str_number(&p, &CSeq, LONG_MAX)) { |
| + | curlx_str_passblanks(&p); |
| + | if(curlx_str_number(&p, &CSeq, LONG_MAX)) { |
| failf(data, "Unable to read the CSeq header: [%s]", header); | |
| return CURLE_RTSP_CSEQ_ERROR; | |
| } | |
| @@ -1001,7 +1001,7 @@ CURLcode Curl_rtsp_parseheader(struct Curl_easy *data, const char *header) | |
| /* Find the first non-space letter */ | |
| start = header + 8; | |
| - | Curl_str_passblanks(&start); |
| + | curlx_str_passblanks(&start); |
| if(!*start) { | |
| failf(data, "Got a blank Session ID"); | |
| @@ -1059,16 +1059,16 @@ CURLcode rtsp_parse_transport(struct Curl_easy *data, const char *transport) | |
| const char *start, *end; | |
| start = transport; | |
| while(start && *start) { | |
| - | Curl_str_passblanks(&start); |
| + | curlx_str_passblanks(&start); |
| end = strchr(start, ';'); | |
| if(checkprefix("interleaved=", start)) { | |
| curl_off_t chan1, chan2, chan; | |
| const char *p = start + 12; | |
| - | if(!Curl_str_number(&p, &chan1, 255)) { |
| + | if(!curlx_str_number(&p, &chan1, 255)) { |
| unsigned char *rtp_channel_mask = data->state.rtp_channel_mask; | |
| chan2 = chan1; | |
| - | if(!Curl_str_single(&p, '-')) { |
| - | if(Curl_str_number(&p, &chan2, 255)) { |
| + | if(!curlx_str_single(&p, '-')) { |
| + | if(curlx_str_number(&p, &chan2, 255)) { |
| infof(data, "Unable to read the interleaved parameter from " | |
| "Transport header: [%s]", transport); | |
| chan2 = chan1; | |
| @@ -45,8 +45,8 @@ | |
| #include "urldata.h" | |
| #include "connect.h" | |
| #include "select.h" | |
| - | #include "timediff.h" |
| - | #include "warnless.h" |
| + | #include "curlx/timediff.h" |
| + | #include "curlx/warnless.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| #include "curl_memory.h" | |
| @@ -197,7 +197,7 @@ int Curl_socket_check(curl_socket_t readfd0, /* two sockets to read from */ | |
| return Curl_wait_ms(timeout_ms); | |
| } | |
| - | /* Avoid initial timestamp, avoid Curl_now() call, when elapsed |
| + | /* Avoid initial timestamp, avoid curlx_now() call, when elapsed |
| time in this function does not need to be measured. This happens | |
| when function is called with a zero timeout or a negative timeout | |
| value indicating a blocking call should be performed. */ | |
| @@ -292,7 +292,7 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, timediff_t timeout_ms) | |
| return Curl_wait_ms(timeout_ms); | |
| } | |
| - | /* Avoid initial timestamp, avoid Curl_now() call, when elapsed |
| + | /* Avoid initial timestamp, avoid curlx_now() call, when elapsed |
| time in this function does not need to be measured. This happens | |
| when function is called with a zero timeout or a negative timeout | |
| value indicating a blocking call should be performed. */ | |
| @@ -52,7 +52,7 @@ | |
| #include "strdup.h" | |
| #include "http2.h" | |
| #include "progress.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "ws.h" | |
| /* The last 3 #include files should be in this order */ | |
| @@ -43,7 +43,7 @@ | |
| #include "strcase.h" | |
| #include "share.h" | |
| #include "vtls/vtls.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "sendf.h" | |
| #include "http2.h" | |
| #include "setopt.h" | |
| @@ -28,7 +28,7 @@ | |
| #if !defined(CURL_DISABLE_AWS) || !defined(CURL_DISABLE_DIGEST_AUTH) \ | |
| || defined(USE_LIBSSH2) || defined(USE_SSL) | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "curl_sha256.h" | |
| #include "curl_hmac.h" | |
| @@ -78,9 +78,9 @@ | |
| #include "curl_gethostname.h" | |
| #include "bufref.h" | |
| #include "curl_sasl.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "idn.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -220,7 +220,7 @@ static bool smtp_endofresp(struct Curl_easy *data, struct connectdata *conn, | |
| result = TRUE; | |
| memcpy(tmpline, line, (len == 5 ? 5 : 3)); | |
| tmpline[len == 5 ? 5 : 3 ] = 0; | |
| - | if(Curl_str_number(&p, &code, len == 5 ? 99999 : 999)) |
| + | if(curlx_str_number(&p, &code, len == 5 ? 99999 : 999)) |
| return FALSE; | |
| *resp = (int) code; | |
| @@ -246,7 +246,7 @@ static bool smtp_endofresp(struct Curl_easy *data, struct connectdata *conn, | |
| */ | |
| static CURLcode smtp_get_message(struct Curl_easy *data, struct bufref *out) | |
| { | |
| - | char *message = Curl_dyn_ptr(&data->conn->proto.smtpc.pp.recvbuf); |
| + | char *message = curlx_dyn_ptr(&data->conn->proto.smtpc.pp.recvbuf); |
| size_t len = data->conn->proto.smtpc.pp.nfinal; | |
| if(len > 4) { | |
| @@ -884,7 +884,7 @@ static CURLcode smtp_state_ehlo_resp(struct Curl_easy *data, | |
| { | |
| CURLcode result = CURLE_OK; | |
| struct smtp_conn *smtpc = &conn->proto.smtpc; | |
| - | const char *line = Curl_dyn_ptr(&smtpc->pp.recvbuf); |
| + | const char *line = curlx_dyn_ptr(&smtpc->pp.recvbuf); |
| size_t len = smtpc->pp.nfinal; | |
| (void)instate; /* no use for this yet */ | |
| @@ -1034,7 +1034,7 @@ static CURLcode smtp_state_command_resp(struct Curl_easy *data, int smtpcode, | |
| { | |
| CURLcode result = CURLE_OK; | |
| struct SMTP *smtp = data->req.p.smtp; | |
| - | char *line = Curl_dyn_ptr(&data->conn->proto.smtpc.pp.recvbuf); |
| + | char *line = curlx_dyn_ptr(&data->conn->proto.smtpc.pp.recvbuf); |
| size_t len = data->conn->proto.smtpc.pp.nfinal; | |
| (void)instate; /* no use for this yet */ | |
| @@ -129,7 +129,7 @@ int Curl_socketpair(int domain, int type, int protocol, | |
| #endif /* !_WIN32 */ | |
| #include "nonblock.h" /* for curlx_nonblock */ | |
| - | #include "timeval.h" /* needed before select.h */ |
| + | #include "curlx/timeval.h" /* needed before select.h */ |
| #include "select.h" /* for Curl_poll */ | |
| /* The last 3 #include files should be in this order */ | |
| @@ -203,7 +203,7 @@ int Curl_socketpair(int domain, int type, int protocol, | |
| if(socks[1] == CURL_SOCKET_BAD) | |
| goto error; | |
| else { | |
| - | struct curltime start = Curl_now(); |
| + | struct curltime start = curlx_now(); |
| char rnd[9]; | |
| char check[sizeof(rnd)]; | |
| char *p = &check[0]; | |
| @@ -227,7 +227,7 @@ int Curl_socketpair(int domain, int type, int protocol, | |
| if(nread == -1) { | |
| int sockerr = SOCKERRNO; | |
| /* Do not block forever */ | |
| - | if(Curl_timediff(Curl_now(), start) > (60 * 1000)) |
| + | if(curlx_timediff(curlx_now(), start) > (60 * 1000)) |
| goto error; | |
| if( | |
| #ifdef USE_WINSOCK | |
| @@ -38,7 +38,7 @@ | |
| #include "select.h" | |
| #include "cfilters.h" | |
| #include "connect.h" | |
| - | #include "timeval.h" |
| + | #include "curlx/timeval.h" |
| #include "socks.h" | |
| #include "multiif.h" /* for getsock macros */ | |
| #include "inet_pton.h" | |
| @@ -32,9 +32,9 @@ | |
| #include "sendf.h" | |
| #include "cfilters.h" | |
| #include "connect.h" | |
| - | #include "timeval.h" |
| + | #include "curlx/timeval.h" |
| #include "socks.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "strdup.h" | |
| /* The last 3 #include files should be in this order */ | |
| @@ -65,7 +65,7 @@ static int check_gss_err(struct Curl_easy *data, | |
| gss_buffer_desc status_string = GSS_C_EMPTY_BUFFER; | |
| struct dynbuf dbuf; | |
| - | Curl_dyn_init(&dbuf, MAX_GSS_LEN); |
| + | curlx_dyn_init(&dbuf, MAX_GSS_LEN); |
| msg_ctx = 0; | |
| while(!msg_ctx) { | |
| /* convert major status code (GSS-API error) to text */ | |
| @@ -74,7 +74,7 @@ static int check_gss_err(struct Curl_easy *data, | |
| GSS_C_NULL_OID, | |
| &msg_ctx, &status_string); | |
| if(maj_stat == GSS_S_COMPLETE) { | |
| - | if(Curl_dyn_addn(&dbuf, status_string.value, |
| + | if(curlx_dyn_addn(&dbuf, status_string.value, |
| status_string.length)) | |
| return 1; /* error */ | |
| gss_release_buffer(&min_stat, &status_string); | |
| @@ -82,7 +82,7 @@ static int check_gss_err(struct Curl_easy *data, | |
| } | |
| gss_release_buffer(&min_stat, &status_string); | |
| } | |
| - | if(Curl_dyn_addn(&dbuf, ".\n", 2)) |
| + | if(curlx_dyn_addn(&dbuf, ".\n", 2)) |
| return 1; /* error */ | |
| msg_ctx = 0; | |
| while(!msg_ctx) { | |
| @@ -92,7 +92,7 @@ static int check_gss_err(struct Curl_easy *data, | |
| GSS_C_NULL_OID, | |
| &msg_ctx, &status_string); | |
| if(maj_stat == GSS_S_COMPLETE) { | |
| - | if(Curl_dyn_addn(&dbuf, status_string.value, |
| + | if(curlx_dyn_addn(&dbuf, status_string.value, |
| status_string.length)) | |
| return 1; /* error */ | |
| gss_release_buffer(&min_stat, &status_string); | |
| @@ -100,8 +100,9 @@ static int check_gss_err(struct Curl_easy *data, | |
| } | |
| gss_release_buffer(&min_stat, &status_string); | |
| } | |
| - | failf(data, "GSS-API error: %s failed: %s", function, Curl_dyn_ptr(&dbuf)); |
| - | Curl_dyn_free(&dbuf); |
| + | failf(data, "GSS-API error: %s failed: %s", function, |
| + | curlx_dyn_ptr(&dbuf)); |
| + | curlx_dyn_free(&dbuf); |
| return 1; | |
| } | |
| @@ -32,11 +32,11 @@ | |
| #include "cfilters.h" | |
| #include "connect.h" | |
| #include "strerror.h" | |
| - | #include "timeval.h" |
| + | #include "curlx/timeval.h" |
| #include "socks.h" | |
| #include "curl_sspi.h" | |
| #include "curl_multibyte.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "strdup.h" | |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -52,7 +52,7 @@ CURLcode Curl_speedcheck(struct Curl_easy *data, | |
| data->state.keeps_speed = now; | |
| else { | |
| /* how long has it been under the limit */ | |
| - | timediff_t howlong = Curl_timediff(now, data->state.keeps_speed); |
| + | timediff_t howlong = curlx_timediff(now, data->state.keeps_speed); |
| if(howlong >= data->set.low_speed_time * 1000) { | |
| /* too long */ | |
| @@ -26,7 +26,7 @@ | |
| #include "curl_setup.h" | |
| - | #include "timeval.h" |
| + | #include "curlx/timeval.h" |
| struct Curl_easy; | |
| void Curl_speedinit(struct Curl_easy *data); | |
| CURLcode Curl_speedcheck(struct Curl_easy *data, | |
| @@ -24,7 +24,7 @@ | |
| #include "curl_setup.h" | |
| - | #include "timeval.h" |
| + | #include "curlx/timeval.h" |
| #include "splay.h" | |
| /* | |
| @@ -34,7 +34,7 @@ | |
| * zero : when i is equal to j | |
| * positive when : when i is larger than j | |
| */ | |
| - | #define compare(i,j) Curl_timediff_us(i,j) |
| + | #define compare(i,j) curlx_timediff_us(i,j) |
| /* | |
| * Splay using the key i (which may or may not be in the tree.) The starting | |
| @@ -24,7 +24,7 @@ | |
| * | |
| ***************************************************************************/ | |
| #include "curl_setup.h" | |
| - | #include "timeval.h" |
| + | #include "curlx/timeval.h" |
| /* only use function calls to access this struct */ | |
| struct Curl_tree { | |
| @@ -866,7 +866,7 @@ const char *Curl_strerror(int err, char *buf, size_t buflen) | |
| #ifndef UNDER_CE | |
| /* 'sys_nerr' is the maximum errno number, it is not widely portable */ | |
| if(err >= 0 && err < sys_nerr) | |
| - | msnprintf(buf, buflen, "%s", sys_errlist[err]); |
| + | curl_msnprintf(buf, buflen, "%s", sys_errlist[err]); |
| else | |
| #endif | |
| { | |
| @@ -875,7 +875,7 @@ const char *Curl_strerror(int err, char *buf, size_t buflen) | |
| !get_winsock_error(err, buf, buflen) && | |
| #endif | |
| !get_winapi_error(err, buf, buflen)) | |
| - | msnprintf(buf, buflen, "Unknown error %d (%#x)", err, err); |
| + | curl_msnprintf(buf, buflen, "Unknown error %d (%#x)", err, err); |
| } | |
| #else /* not Windows coming up */ | |
| @@ -887,7 +887,7 @@ const char *Curl_strerror(int err, char *buf, size_t buflen) | |
| */ | |
| if(0 != strerror_r(err, buf, buflen)) { | |
| if('\0' == buf[0]) | |
| - | msnprintf(buf, buflen, "Unknown error %d", err); |
| + | curl_msnprintf(buf, buflen, "Unknown error %d", err); |
| } | |
| #elif defined(HAVE_STRERROR_R) && defined(HAVE_GLIBC_STRERROR_R) | |
| /* | |
| @@ -899,18 +899,18 @@ const char *Curl_strerror(int err, char *buf, size_t buflen) | |
| char buffer[256]; | |
| char *msg = strerror_r(err, buffer, sizeof(buffer)); | |
| if(msg) | |
| - | msnprintf(buf, buflen, "%s", msg); |
| + | curl_msnprintf(buf, buflen, "%s", msg); |
| else | |
| - | msnprintf(buf, buflen, "Unknown error %d", err); |
| + | curl_msnprintf(buf, buflen, "Unknown error %d", err); |
| } | |
| #else | |
| { | |
| /* !checksrc! disable BANNEDFUNC 1 */ | |
| const char *msg = strerror(err); | |
| if(msg) | |
| - | msnprintf(buf, buflen, "%s", msg); |
| + | curl_msnprintf(buf, buflen, "%s", msg); |
| else | |
| - | msnprintf(buf, buflen, "Unknown error %d", err); |
| + | curl_msnprintf(buf, buflen, "Unknown error %d", err); |
| } | |
| #endif | |
| @@ -954,7 +954,7 @@ const char *curlx_winapi_strerror(DWORD err, char *buf, size_t buflen) | |
| #ifndef CURL_DISABLE_VERBOSE_STRINGS | |
| if(!get_winapi_error((int)err, buf, buflen)) { | |
| - | msnprintf(buf, buflen, "Unknown error %lu (0x%08lX)", err, err); |
| + | curl_msnprintf(buf, buflen, "Unknown error %lu (0x%08lX)", err, err); |
| } | |
| #else | |
| { | |
| @@ -1090,18 +1090,18 @@ const char *Curl_sspi_strerror(int err, char *buf, size_t buflen) | |
| } | |
| if(err == SEC_E_ILLEGAL_MESSAGE) { | |
| - | msnprintf(buf, buflen, |
| - | "SEC_E_ILLEGAL_MESSAGE (0x%08X) - This error usually occurs " |
| - | "when a fatal SSL/TLS alert is received (e.g. handshake failed)." |
| - | " More detail may be available in the Windows System event log.", |
| - | err); |
| + | curl_msnprintf(buf, buflen, |
| + | "SEC_E_ILLEGAL_MESSAGE (0x%08X) - This error usually " |
| + | "occurs when a fatal SSL/TLS alert is received (e.g. " |
| + | "handshake failed). More detail may be available in " |
| + | "the Windows System event log.", err); |
| } | |
| else { | |
| char msgbuf[256]; | |
| if(get_winapi_error(err, msgbuf, sizeof(msgbuf))) | |
| - | msnprintf(buf, buflen, "%s (0x%08X) - %s", txt, err, msgbuf); |
| + | curl_msnprintf(buf, buflen, "%s (0x%08X) - %s", txt, err, msgbuf); |
| else | |
| - | msnprintf(buf, buflen, "%s (0x%08X)", txt, err); |
| + | curl_msnprintf(buf, buflen, "%s (0x%08X)", txt, err); |
| } | |
| #else | |
| @@ -30,15 +30,12 @@ | |
| #include "system_win32.h" | |
| #include "version_win32.h" | |
| #include "curl_sspi.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| /* The last #include files should be: */ | |
| #include "curl_memory.h" | |
| #include "memdebug.h" | |
| - | LARGE_INTEGER Curl_freq; |
| - | bool Curl_isVistaOrGreater; |
| - | |
| /* Handle of iphlpapp.dll */ | |
| static HMODULE s_hIpHlpApiDll = NULL; | |
| @@ -57,8 +57,8 @@ | |
| #include "arpa_telnet.h" | |
| #include "select.h" | |
| #include "strcase.h" | |
| - | #include "warnless.h" |
| - | #include "strparse.h" |
| + | #include "curlx/warnless.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -208,7 +208,7 @@ CURLcode init_telnet(struct Curl_easy *data) | |
| if(!tn) | |
| return CURLE_OUT_OF_MEMORY; | |
| - | Curl_dyn_init(&tn->out, 0xffff); |
| + | curlx_dyn_init(&tn->out, 0xffff); |
| data->req.p.telnet = tn; /* make us known */ | |
| tn->telrcv_state = CURL_TS_DATA; | |
| @@ -866,9 +866,9 @@ static CURLcode check_telnet_options(struct Curl_easy *data) | |
| const char *p = arg; | |
| curl_off_t x = 0; | |
| curl_off_t y = 0; | |
| - | if(Curl_str_number(&p, &x, 0xffff) || |
| - | Curl_str_single(&p, 'x') || |
| - | Curl_str_number(&p, &y, 0xffff)) { |
| + | if(curlx_str_number(&p, &x, 0xffff) || |
| + | curlx_str_single(&p, 'x') || |
| + | curlx_str_number(&p, &y, 0xffff)) { |
| failf(data, "Syntax error in telnet option: %s", head->data); | |
| result = CURLE_SETOPT_OPTION_SYNTAX; | |
| } | |
| @@ -1236,17 +1236,17 @@ static CURLcode send_telnet_data(struct Curl_easy *data, | |
| if(memchr(buffer, CURL_IAC, nread)) { | |
| /* only use the escape buffer when necessary */ | |
| - | Curl_dyn_reset(&tn->out); |
| + | curlx_dyn_reset(&tn->out); |
| for(i = 0; i < (size_t)nread && !result; i++) { | |
| - | result = Curl_dyn_addn(&tn->out, &buffer[i], 1); |
| + | result = curlx_dyn_addn(&tn->out, &buffer[i], 1); |
| if(!result && ((unsigned char)buffer[i] == CURL_IAC)) | |
| /* IAC is FF in hex */ | |
| - | result = Curl_dyn_addn(&tn->out, "\xff", 1); |
| + | result = curlx_dyn_addn(&tn->out, "\xff", 1); |
| } | |
| - | outlen = Curl_dyn_len(&tn->out); |
| - | outbuf = Curl_dyn_uptr(&tn->out); |
| + | outlen = curlx_dyn_len(&tn->out); |
| + | outbuf = curlx_dyn_uptr(&tn->out); |
| } | |
| else { | |
| outlen = (size_t)nread; | |
| @@ -1286,7 +1286,7 @@ static CURLcode telnet_done(struct Curl_easy *data, | |
| curl_slist_free_all(tn->telnet_vars); | |
| tn->telnet_vars = NULL; | |
| - | Curl_dyn_free(&tn->out); |
| + | curlx_dyn_free(&tn->out); |
| return CURLE_OK; | |
| } | |
| @@ -1497,8 +1497,8 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) | |
| } | |
| if(data->set.timeout) { | |
| - | now = Curl_now(); |
| - | if(Curl_timediff(now, conn->created) >= data->set.timeout) { |
| + | now = curlx_now(); |
| + | if(curlx_timediff(now, conn->created) >= data->set.timeout) { |
| failf(data, "Time-out"); | |
| result = CURLE_OPERATION_TIMEDOUT; | |
| keepon = FALSE; | |
| @@ -1618,8 +1618,8 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done) | |
| } /* poll switch statement */ | |
| if(data->set.timeout) { | |
| - | now = Curl_now(); |
| - | if(Curl_timediff(now, conn->created) >= data->set.timeout) { |
| + | now = curlx_now(); |
| + | if(curlx_timediff(now, conn->created) >= data->set.timeout) { |
| failf(data, "Time-out"); | |
| result = CURLE_OPERATION_TIMEDOUT; | |
| keepon = FALSE; | |
| @@ -62,7 +62,7 @@ | |
| #include "speedcheck.h" | |
| #include "select.h" | |
| #include "escape.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -332,7 +332,7 @@ static CURLcode tftp_parse_option_ack(struct tftp_conn *state, | |
| if(checkprefix(TFTP_OPTION_BLKSIZE, option)) { | |
| curl_off_t blksize; | |
| - | if(Curl_str_number(&value, &blksize, TFTP_BLKSIZE_MAX)) { |
| + | if(curlx_str_number(&value, &blksize, TFTP_BLKSIZE_MAX)) { |
| failf(data, "%s (%d)", "blksize is larger than max supported", | |
| TFTP_BLKSIZE_MAX); | |
| return CURLE_TFTP_ILLEGAL; | |
| @@ -364,7 +364,7 @@ static CURLcode tftp_parse_option_ack(struct tftp_conn *state, | |
| /* tsize should be ignored on upload: Who cares about the size of the | |
| remote file? */ | |
| if(!data->state.upload && | |
| - | !Curl_str_number(&value, &tsize, CURL_OFF_T_MAX)) { |
| + | !curlx_str_number(&value, &tsize, CURL_OFF_T_MAX)) { |
| if(!tsize) { | |
| failf(data, "invalid tsize -:%s:- value in OACK packet", value); | |
| return CURLE_TFTP_ILLEGAL; | |
| @@ -1277,7 +1277,7 @@ static CURLcode tftp_doing(struct Curl_easy *data, bool *dophase_done) | |
| if(Curl_pgrsUpdate(data)) | |
| result = CURLE_ABORTED_BY_CALLBACK; | |
| else | |
| - | result = Curl_speedcheck(data, Curl_now()); |
| + | result = Curl_speedcheck(data, curlx_now()); |
| } | |
| return result; | |
| } | |
| @@ -470,13 +470,13 @@ CURLcode Curl_sendrecv(struct Curl_easy *data, struct curltime *nowp) | |
| failf(data, "Operation timed out after %" FMT_TIMEDIFF_T | |
| " milliseconds with %" FMT_OFF_T " out of %" | |
| FMT_OFF_T " bytes received", | |
| - | Curl_timediff(*nowp, data->progress.t_startsingle), |
| + | curlx_timediff(*nowp, data->progress.t_startsingle), |
| k->bytecount, k->size); | |
| } | |
| else { | |
| failf(data, "Operation timed out after %" FMT_TIMEDIFF_T | |
| " milliseconds with %" FMT_OFF_T " bytes received", | |
| - | Curl_timediff(*nowp, data->progress.t_startsingle), |
| + | curlx_timediff(*nowp, data->progress.t_startsingle), |
| k->bytecount); | |
| } | |
| result = CURLE_OPERATION_TIMEDOUT; | |
| @@ -83,7 +83,7 @@ | |
| #include "multiif.h" | |
| #include "easyif.h" | |
| #include "speedcheck.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| #include "getinfo.h" | |
| #include "pop3.h" | |
| #include "urlapi-int.h" | |
| @@ -118,9 +118,9 @@ | |
| #include "strdup.h" | |
| #include "setopt.h" | |
| #include "altsvc.h" | |
| - | #include "dynbuf.h" |
| + | #include "curlx/dynbuf.h" |
| #include "headers.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| #include "curl_memory.h" | |
| @@ -272,7 +272,7 @@ CURLcode Curl_close(struct Curl_easy **datap) | |
| data->state.referer = NULL; | |
| up_free(data); | |
| - | Curl_dyn_free(&data->state.headerb); |
| + | curlx_dyn_free(&data->state.headerb); |
| Curl_flush_cookies(data, TRUE); | |
| #ifndef CURL_DISABLE_ALTSVC | |
| Curl_altsvc_save(data, data->asi, data->set.str[STRING_ALTSVC]); | |
| @@ -533,8 +533,8 @@ CURLcode Curl_open(struct Curl_easy **curl) | |
| data->state.current_speed = -1; /* init to negative == impossible */ | |
| Curl_hash_init(&data->meta_hash, 23, | |
| - | Curl_hash_str, Curl_str_key_compare, easy_meta_freeentry); |
| - | Curl_dyn_init(&data->state.headerb, CURL_MAX_HTTP_HEADER); |
| + | Curl_hash_str, curlx_str_key_compare, easy_meta_freeentry); |
| + | curlx_dyn_init(&data->state.headerb, CURL_MAX_HTTP_HEADER); |
| Curl_req_init(&data->req); | |
| Curl_initinfo(data); | |
| #ifndef CURL_DISABLE_HTTP | |
| @@ -545,7 +545,7 @@ CURLcode Curl_open(struct Curl_easy **curl) | |
| result = Curl_init_userdefined(data); | |
| if(result) { | |
| - | Curl_dyn_free(&data->state.headerb); |
| + | curlx_dyn_free(&data->state.headerb); |
| Curl_freeset(data); | |
| Curl_req_free(&data->req, data); | |
| Curl_hash_destroy(&data->meta_hash); | |
| @@ -680,7 +680,7 @@ static bool conn_maxage(struct Curl_easy *data, | |
| { | |
| timediff_t idletime, lifetime; | |
| - | idletime = Curl_timediff(now, conn->lastused); |
| + | idletime = curlx_timediff(now, conn->lastused); |
| idletime /= 1000; /* integer seconds is fine */ | |
| if(idletime > data->set.maxage_conn) { | |
| @@ -689,7 +689,7 @@ static bool conn_maxage(struct Curl_easy *data, | |
| return TRUE; | |
| } | |
| - | lifetime = Curl_timediff(now, conn->created); |
| + | lifetime = curlx_timediff(now, conn->created); |
| lifetime /= 1000; /* integer seconds is fine */ | |
| if(data->set.maxlifetime_conn && lifetime > data->set.maxlifetime_conn) { | |
| @@ -717,7 +717,7 @@ bool Curl_conn_seems_dead(struct connectdata *conn, | |
| bool dead; | |
| struct curltime now; | |
| if(!pnow) { | |
| - | now = Curl_now(); |
| + | now = curlx_now(); |
| pnow = &now; | |
| } | |
| @@ -775,7 +775,7 @@ CURLcode Curl_conn_upkeep(struct Curl_easy *data, | |
| struct curltime *now) | |
| { | |
| CURLcode result = CURLE_OK; | |
| - | if(Curl_timediff(*now, conn->keepalive) <= data->set.upkeep_interval_ms) |
| + | if(curlx_timediff(*now, conn->keepalive) <= data->set.upkeep_interval_ms) |
| return result; | |
| /* briefly attach for action */ | |
| @@ -1321,7 +1321,7 @@ static struct connectdata *allocate_conn(struct Curl_easy *data) | |
| connclose(conn, "Default to force-close"); | |
| /* Store creation time to help future close decision making */ | |
| - | conn->created = Curl_now(); |
| + | conn->created = curlx_now(); |
| /* Store current time to give a baseline to keepalive connection times. */ | |
| conn->keepalive = conn->created; | |
| @@ -1677,7 +1677,7 @@ static void zonefrom_url(CURLU *uh, struct Curl_easy *data, | |
| if(!uc && zoneid) { | |
| const char *p = zoneid; | |
| curl_off_t scope; | |
| - | if(!Curl_str_number(&p, &scope, UINT_MAX)) |
| + | if(!curlx_str_number(&p, &scope, UINT_MAX)) |
| /* A plain number, use it directly as a scope id. */ | |
| conn->scope_id = (unsigned int)scope; | |
| #ifdef HAVE_IF_NAMETOINDEX | |
| @@ -1920,7 +1920,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, | |
| port = data->set.use_port; | |
| else { | |
| const char *p = data->state.up.port; | |
| - | if(Curl_str_number(&p, &port, 0xffff)) |
| + | if(curlx_str_number(&p, &port, 0xffff)) |
| valid = FALSE; | |
| } | |
| if(valid) | |
| @@ -2254,7 +2254,7 @@ static CURLcode parse_proxy(struct Curl_easy *data, | |
| if(portptr) { | |
| curl_off_t num; | |
| const char *p = portptr; | |
| - | if(!Curl_str_number(&p, &num, 0xffff)) |
| + | if(!curlx_str_number(&p, &num, 0xffff)) |
| port = (int)num; | |
| free(portptr); | |
| } | |
| @@ -2898,7 +2898,7 @@ static CURLcode parse_connect_to_host_port(struct Curl_easy *data, | |
| if(*host_portno) { | |
| curl_off_t portparse; | |
| const char *p = host_portno; | |
| - | if(Curl_str_number(&p, &portparse, 0xffff)) { |
| + | if(curlx_str_number(&p, &portparse, 0xffff)) { |
| failf(data, "No valid port number in connect to host string (%s)", | |
| host_portno); | |
| result = CURLE_SETOPT_OPTION_SYNTAX; | |
| @@ -2976,7 +2976,7 @@ static CURLcode parse_connect_to_string(struct Curl_easy *data, | |
| char *ptr_next = strchr(ptr, ':'); | |
| if(ptr_next) { | |
| curl_off_t port_to_match; | |
| - | if(!Curl_str_number(&ptr, &port_to_match, 0xffff) && |
| + | if(!curlx_str_number(&ptr, &port_to_match, 0xffff) && |
| (port_to_match == (curl_off_t)conn->remote_port)) | |
| port_match = TRUE; | |
| ptr = ptr_next + 1; | |
| @@ -3232,7 +3232,7 @@ static CURLcode resolve_server(struct Curl_easy *data, | |
| else if(result == CURLE_OPERATION_TIMEDOUT) { | |
| failf(data, "Failed to resolve %s '%s' with timeout after %" | |
| FMT_TIMEDIFF_T " ms", peertype, ehost->dispname, | |
| - | Curl_timediff(Curl_now(), data->progress.t_startsingle)); |
| + | curlx_timediff(curlx_now(), data->progress.t_startsingle)); |
| return CURLE_OPERATION_TIMEDOUT; | |
| } | |
| else if(result) { | |
| @@ -3383,7 +3383,7 @@ static CURLcode create_conn(struct Curl_easy *data, | |
| /* Do the unfailable inits first, before checks that may early return */ | |
| Curl_hash_init(&conn->meta_hash, 23, | |
| - | Curl_hash_str, Curl_str_key_compare, conn_meta_freeentry); |
| + | Curl_hash_str, curlx_str_key_compare, conn_meta_freeentry); |
| /* GSSAPI related inits */ | |
| Curl_sec_conn_init(conn); | |
| @@ -34,7 +34,7 @@ | |
| #include "inet_ntop.h" | |
| #include "strdup.h" | |
| #include "idn.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| #include "curl_memrchr.h" | |
| /* The last 3 #include files should be in this order */ | |
| @@ -151,24 +151,24 @@ static CURLUcode urlencode_str(struct dynbuf *o, const char *url, | |
| /* output the first piece as-is */ | |
| n = (const char *)host_sep - url; | |
| - | result = Curl_dyn_addn(o, url, n); |
| + | result = curlx_dyn_addn(o, url, n); |
| len -= n; | |
| } | |
| for(iptr = host_sep; len && !result; iptr++, len--) { | |
| if(*iptr == ' ') { | |
| if(left) | |
| - | result = Curl_dyn_addn(o, "%20", 3); |
| + | result = curlx_dyn_addn(o, "%20", 3); |
| else | |
| - | result = Curl_dyn_addn(o, "+", 1); |
| + | result = curlx_dyn_addn(o, "+", 1); |
| } | |
| else if((*iptr < ' ') || (*iptr >= 0x7f)) { | |
| unsigned char out[3]={'%'}; | |
| Curl_hexbyte(&out[1], *iptr, TRUE); | |
| - | result = Curl_dyn_addn(o, out, 3); |
| + | result = curlx_dyn_addn(o, out, 3); |
| } | |
| else { | |
| - | result = Curl_dyn_addn(o, iptr, 1); |
| + | result = curlx_dyn_addn(o, iptr, 1); |
| if(*iptr == '?') | |
| left = FALSE; | |
| } | |
| @@ -288,17 +288,17 @@ static CURLUcode redirect_url(const char *base, const char *relurl, | |
| prelen = cutoff ? (size_t)(cutoff - base) : strlen(base); | |
| /* build new URL */ | |
| - | Curl_dyn_init(&urlbuf, CURL_MAX_INPUT_LENGTH); |
| + | curlx_dyn_init(&urlbuf, CURL_MAX_INPUT_LENGTH); |
| - | if(!Curl_dyn_addn(&urlbuf, base, prelen) && |
| + | if(!curlx_dyn_addn(&urlbuf, base, prelen) && |
| !urlencode_str(&urlbuf, useurl, strlen(useurl), !host_changed, FALSE)) { | |
| - | uc = parseurl_and_replace(Curl_dyn_ptr(&urlbuf), u, |
| + | uc = parseurl_and_replace(curlx_dyn_ptr(&urlbuf), u, |
| flags & ~CURLU_PATH_AS_IS); | |
| } | |
| else | |
| uc = CURLUE_OUT_OF_MEMORY; | |
| - | Curl_dyn_free(&urlbuf); |
| + | curlx_dyn_free(&urlbuf); |
| return uc; | |
| } | |
| @@ -417,7 +417,7 @@ UNITTEST CURLUcode Curl_parse_port(struct Curl_URL *u, struct dynbuf *host, | |
| bool has_scheme) | |
| { | |
| const char *portptr; | |
| - | char *hostname = Curl_dyn_ptr(host); |
| + | char *hostname = curlx_dyn_ptr(host); |
| /* | |
| * Find the end of an IPv6 address on the ']' ending bracket. | |
| */ | |
| @@ -448,12 +448,12 @@ UNITTEST CURLUcode Curl_parse_port(struct Curl_URL *u, struct dynbuf *host, | |
| Do not do it if the URL has no scheme, to make something that looks like | |
| a scheme not work! | |
| */ | |
| - | Curl_dyn_setlen(host, keep); |
| + | curlx_dyn_setlen(host, keep); |
| portptr++; | |
| if(!*portptr) | |
| return has_scheme ? CURLUE_OK : CURLUE_BAD_PORT_NUMBER; | |
| - | if(Curl_str_number(&portptr, &port, 0xffff) || *portptr) |
| + | if(curlx_str_number(&portptr, &port, 0xffff) || *portptr) |
| return CURLUE_BAD_PORT_NUMBER; | |
| u->portnum = (unsigned short) port; | |
| @@ -565,7 +565,7 @@ static int ipv4_normalize(struct dynbuf *host) | |
| { | |
| bool done = FALSE; | |
| int n = 0; | |
| - | const char *c = Curl_dyn_ptr(host); |
| + | const char *c = curlx_dyn_ptr(host); |
| unsigned int parts[4] = {0, 0, 0, 0}; | |
| CURLcode result = CURLE_OK; | |
| @@ -578,13 +578,13 @@ static int ipv4_normalize(struct dynbuf *host) | |
| if(*c == '0') { | |
| if(c[1] == 'x') { | |
| c += 2; /* skip the prefix */ | |
| - | rc = Curl_str_hex(&c, &l, UINT_MAX); |
| + | rc = curlx_str_hex(&c, &l, UINT_MAX); |
| } | |
| else | |
| - | rc = Curl_str_octal(&c, &l, UINT_MAX); |
| + | rc = curlx_str_octal(&c, &l, UINT_MAX); |
| } | |
| else | |
| - | rc = Curl_str_number(&c, &l, UINT_MAX); |
| + | rc = curlx_str_number(&c, &l, UINT_MAX); |
| if(rc) | |
| return HOST_NAME; | |
| @@ -610,44 +610,44 @@ static int ipv4_normalize(struct dynbuf *host) | |
| switch(n) { | |
| case 0: /* a -- 32 bits */ | |
| - | Curl_dyn_reset(host); |
| + | curlx_dyn_reset(host); |
| - | result = Curl_dyn_addf(host, "%u.%u.%u.%u", |
| - | (parts[0] >> 24), |
| - | ((parts[0] >> 16) & 0xff), |
| - | ((parts[0] >> 8) & 0xff), |
| - | (parts[0] & 0xff)); |
| + | result = curlx_dyn_addf(host, "%u.%u.%u.%u", |
| + | (parts[0] >> 24), |
| + | ((parts[0] >> 16) & 0xff), |
| + | ((parts[0] >> 8) & 0xff), |
| + | (parts[0] & 0xff)); |
| break; | |
| case 1: /* a.b -- 8.24 bits */ | |
| if((parts[0] > 0xff) || (parts[1] > 0xffffff)) | |
| return HOST_NAME; | |
| - | Curl_dyn_reset(host); |
| - | result = Curl_dyn_addf(host, "%u.%u.%u.%u", |
| - | (parts[0]), |
| - | ((parts[1] >> 16) & 0xff), |
| - | ((parts[1] >> 8) & 0xff), |
| - | (parts[1] & 0xff)); |
| + | curlx_dyn_reset(host); |
| + | result = curlx_dyn_addf(host, "%u.%u.%u.%u", |
| + | (parts[0]), |
| + | ((parts[1] >> 16) & 0xff), |
| + | ((parts[1] >> 8) & 0xff), |
| + | (parts[1] & 0xff)); |
| break; | |
| case 2: /* a.b.c -- 8.8.16 bits */ | |
| if((parts[0] > 0xff) || (parts[1] > 0xff) || (parts[2] > 0xffff)) | |
| return HOST_NAME; | |
| - | Curl_dyn_reset(host); |
| - | result = Curl_dyn_addf(host, "%u.%u.%u.%u", |
| - | (parts[0]), |
| - | (parts[1]), |
| - | ((parts[2] >> 8) & 0xff), |
| - | (parts[2] & 0xff)); |
| + | curlx_dyn_reset(host); |
| + | result = curlx_dyn_addf(host, "%u.%u.%u.%u", |
| + | (parts[0]), |
| + | (parts[1]), |
| + | ((parts[2] >> 8) & 0xff), |
| + | (parts[2] & 0xff)); |
| break; | |
| case 3: /* a.b.c.d -- 8.8.8.8 bits */ | |
| if((parts[0] > 0xff) || (parts[1] > 0xff) || (parts[2] > 0xff) || | |
| (parts[3] > 0xff)) | |
| return HOST_NAME; | |
| - | Curl_dyn_reset(host); |
| - | result = Curl_dyn_addf(host, "%u.%u.%u.%u", |
| - | (parts[0]), |
| - | (parts[1]), |
| - | (parts[2]), |
| - | (parts[3])); |
| + | curlx_dyn_reset(host); |
| + | result = curlx_dyn_addf(host, "%u.%u.%u.%u", |
| + | (parts[0]), |
| + | (parts[1]), |
| + | (parts[2]), |
| + | (parts[3])); |
| break; | |
| } | |
| if(result) | |
| @@ -659,7 +659,7 @@ static int ipv4_normalize(struct dynbuf *host) | |
| static CURLUcode urldecode_host(struct dynbuf *host) | |
| { | |
| char *per = NULL; | |
| - | const char *hostname = Curl_dyn_ptr(host); |
| + | const char *hostname = curlx_dyn_ptr(host); |
| per = strchr(hostname, '%'); | |
| if(!per) | |
| /* nothing to decode */ | |
| @@ -672,8 +672,8 @@ static CURLUcode urldecode_host(struct dynbuf *host) | |
| REJECT_CTRL); | |
| if(result) | |
| return CURLUE_BAD_HOSTNAME; | |
| - | Curl_dyn_reset(host); |
| - | result = Curl_dyn_addn(host, decoded, dlen); |
| + | curlx_dyn_reset(host); |
| + | result = curlx_dyn_addn(host, decoded, dlen); |
| free(decoded); | |
| if(result) | |
| return cc2cu(result); | |
| @@ -699,7 +699,7 @@ static CURLUcode parse_authority(struct Curl_URL *u, | |
| if(uc) | |
| goto out; | |
| - | result = Curl_dyn_addn(host, auth + offset, authlen - offset); |
| + | result = curlx_dyn_addn(host, auth + offset, authlen - offset); |
| if(result) { | |
| uc = cc2cu(result); | |
| goto out; | |
| @@ -709,19 +709,19 @@ static CURLUcode parse_authority(struct Curl_URL *u, | |
| if(uc) | |
| goto out; | |
| - | if(!Curl_dyn_len(host)) |
| + | if(!curlx_dyn_len(host)) |
| return CURLUE_NO_HOST; | |
| switch(ipv4_normalize(host)) { | |
| case HOST_IPV4: | |
| break; | |
| case HOST_IPV6: | |
| - | uc = ipv6_parse(u, Curl_dyn_ptr(host), Curl_dyn_len(host)); |
| + | uc = ipv6_parse(u, curlx_dyn_ptr(host), curlx_dyn_len(host)); |
| break; | |
| case HOST_NAME: | |
| uc = urldecode_host(host); | |
| if(!uc) | |
| - | uc = hostname_check(u, Curl_dyn_ptr(host), Curl_dyn_len(host)); |
| + | uc = hostname_check(u, curlx_dyn_ptr(host), curlx_dyn_len(host)); |
| break; | |
| case HOST_ERROR: | |
| uc = CURLUE_OUT_OF_MEMORY; | |
| @@ -742,15 +742,15 @@ CURLUcode Curl_url_set_authority(CURLU *u, const char *authority) | |
| struct dynbuf host; | |
| DEBUGASSERT(authority); | |
| - | Curl_dyn_init(&host, CURL_MAX_INPUT_LENGTH); |
| + | curlx_dyn_init(&host, CURL_MAX_INPUT_LENGTH); |
| result = parse_authority(u, authority, strlen(authority), | |
| CURLU_DISALLOW_USER, &host, !!u->scheme); | |
| if(result) | |
| - | Curl_dyn_free(&host); |
| + | curlx_dyn_free(&host); |
| else { | |
| free(u->host); | |
| - | u->host = Curl_dyn_ptr(&host); |
| + | u->host = curlx_dyn_ptr(&host); |
| } | |
| return result; | |
| } | |
| @@ -804,7 +804,7 @@ UNITTEST int dedotdotify(const char *input, size_t clen, char **outp) | |
| if(clen < 2) | |
| return 0; | |
| - | Curl_dyn_init(&out, clen + 1); |
| + | curlx_dyn_init(&out, clen + 1); |
| /* A. If the input buffer begins with a prefix of "../" or "./", then | |
| remove that prefix from the input buffer; otherwise, */ | |
| @@ -844,7 +844,7 @@ UNITTEST int dedotdotify(const char *input, size_t clen, char **outp) | |
| the input buffer; otherwise, */ | |
| if(is_dot(&p, &blen)) { | |
| if(!blen) { /* /. */ | |
| - | result = Curl_dyn_addn(&out, "/", 1); |
| + | result = curlx_dyn_addn(&out, "/", 1); |
| break; | |
| } | |
| else if(ISSLASH(*p)) { /* /./ */ | |
| @@ -859,13 +859,13 @@ UNITTEST int dedotdotify(const char *input, size_t clen, char **outp) | |
| preceding "/" (if any) from the output buffer; otherwise, */ | |
| else if(is_dot(&p, &blen) && (ISSLASH(*p) || !blen)) { | |
| /* remove the last segment from the output buffer */ | |
| - | size_t len = Curl_dyn_len(&out); |
| + | size_t len = curlx_dyn_len(&out); |
| if(len) { | |
| - | char *ptr = Curl_dyn_ptr(&out); |
| + | char *ptr = curlx_dyn_ptr(&out); |
| char *last = memrchr(ptr, '/', len); | |
| if(last) | |
| /* trim the output at the slash */ | |
| - | Curl_dyn_setlen(&out, last - ptr); |
| + | curlx_dyn_setlen(&out, last - ptr); |
| } | |
| if(blen) { /* /../ */ | |
| @@ -873,7 +873,7 @@ UNITTEST int dedotdotify(const char *input, size_t clen, char **outp) | |
| clen = blen; | |
| continue; | |
| } | |
| - | result = Curl_dyn_addn(&out, "/", 1); |
| + | result = curlx_dyn_addn(&out, "/", 1); |
| break; | |
| } | |
| } | |
| @@ -884,14 +884,14 @@ UNITTEST int dedotdotify(const char *input, size_t clen, char **outp) | |
| any subsequent characters up to, but not including, the next "/" | |
| character or the end of the input buffer. */ | |
| - | result = Curl_dyn_addn(&out, input, 1); |
| + | result = curlx_dyn_addn(&out, input, 1); |
| input++; | |
| clen--; | |
| } | |
| end: | |
| if(!result) { | |
| - | if(Curl_dyn_len(&out)) |
| - | *outp = Curl_dyn_ptr(&out); |
| + | if(curlx_dyn_len(&out)) |
| + | *outp = curlx_dyn_ptr(&out); |
| else { | |
| *outp = strdup(""); | |
| if(!*outp) | |
| @@ -916,7 +916,7 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) | |
| DEBUGASSERT(url); | |
| - | Curl_dyn_init(&host, CURL_MAX_INPUT_LENGTH); |
| + | curlx_dyn_init(&host, CURL_MAX_INPUT_LENGTH); |
| result = Curl_junkscan(url, &urllen, !!(flags & CURLU_ALLOW_SPACE)); | |
| if(result) | |
| @@ -996,7 +996,7 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) | |
| len = path - ptr; | |
| if(len) { | |
| - | CURLcode code = Curl_dyn_addn(&host, ptr, len); |
| + | CURLcode code = curlx_dyn_addn(&host, ptr, len); |
| if(code) { | |
| result = cc2cu(code); | |
| goto fail; | |
| @@ -1020,7 +1020,7 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) | |
| if(!uncpath) | |
| /* no host for file: URLs by default */ | |
| - | Curl_dyn_reset(&host); |
| + | curlx_dyn_reset(&host); |
| #if !defined(_WIN32) && !defined(MSDOS) && !defined(__CYGWIN__) | |
| /* Do not allow Windows drive letters when not in Windows. | |
| @@ -1106,7 +1106,7 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) | |
| goto fail; | |
| if((flags & CURLU_GUESS_SCHEME) && !schemep) { | |
| - | const char *hostname = Curl_dyn_ptr(&host); |
| + | const char *hostname = curlx_dyn_ptr(&host); |
| /* legacy curl-style guess based on hostname */ | |
| if(checkprefix("ftp.", hostname)) | |
| schemep = "ftp"; | |
| @@ -1133,7 +1133,7 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) | |
| } | |
| else if(flags & CURLU_NO_AUTHORITY) { | |
| /* allowed to be empty. */ | |
| - | if(Curl_dyn_add(&host, "")) { |
| + | if(curlx_dyn_add(&host, "")) { |
| result = CURLUE_OUT_OF_MEMORY; | |
| goto fail; | |
| } | |
| @@ -1152,11 +1152,11 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) | |
| /* skip the leading '#' in the copy but include the terminating null */ | |
| if(flags & CURLU_URLENCODE) { | |
| struct dynbuf enc; | |
| - | Curl_dyn_init(&enc, CURL_MAX_INPUT_LENGTH); |
| + | curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH); |
| result = urlencode_str(&enc, fragment + 1, fraglen - 1, TRUE, FALSE); | |
| if(result) | |
| goto fail; | |
| - | u->fragment = Curl_dyn_ptr(&enc); |
| + | u->fragment = curlx_dyn_ptr(&enc); |
| } | |
| else { | |
| u->fragment = Curl_memdup0(fragment + 1, fraglen - 1); | |
| @@ -1179,12 +1179,12 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) | |
| if(qlen > 1) { | |
| if(flags & CURLU_URLENCODE) { | |
| struct dynbuf enc; | |
| - | Curl_dyn_init(&enc, CURL_MAX_INPUT_LENGTH); |
| + | curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH); |
| /* skip the leading question mark */ | |
| result = urlencode_str(&enc, query + 1, qlen - 1, TRUE, TRUE); | |
| if(result) | |
| goto fail; | |
| - | u->query = Curl_dyn_ptr(&enc); |
| + | u->query = curlx_dyn_ptr(&enc); |
| } | |
| else { | |
| u->query = Curl_memdup0(query + 1, qlen - 1); | |
| @@ -1206,12 +1206,12 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) | |
| if(pathlen && (flags & CURLU_URLENCODE)) { | |
| struct dynbuf enc; | |
| - | Curl_dyn_init(&enc, CURL_MAX_INPUT_LENGTH); |
| + | curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH); |
| result = urlencode_str(&enc, path, pathlen, TRUE, FALSE); | |
| if(result) | |
| goto fail; | |
| - | pathlen = Curl_dyn_len(&enc); |
| - | path = u->path = Curl_dyn_ptr(&enc); |
| + | pathlen = curlx_dyn_len(&enc); |
| + | path = u->path = curlx_dyn_ptr(&enc); |
| } | |
| if(pathlen <= 1) { | |
| @@ -1246,11 +1246,11 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags) | |
| } | |
| } | |
| - | u->host = Curl_dyn_ptr(&host); |
| + | u->host = curlx_dyn_ptr(&host); |
| return result; | |
| fail: | |
| - | Curl_dyn_free(&host); |
| + | curlx_dyn_free(&host); |
| free_urlhandle(u); | |
| return result; | |
| } | |
| @@ -1468,11 +1468,11 @@ CURLUcode curl_url_get(const CURLU *u, CURLUPart what, | |
| /* make it '[ host %25 zoneid ]' */ | |
| struct dynbuf enc; | |
| size_t hostlen = strlen(u->host); | |
| - | Curl_dyn_init(&enc, CURL_MAX_INPUT_LENGTH); |
| - | if(Curl_dyn_addf(&enc, "%.*s%%25%s]", (int)hostlen - 1, u->host, |
| - | u->zoneid)) |
| + | curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH); |
| + | if(curlx_dyn_addf(&enc, "%.*s%%25%s]", (int)hostlen - 1, u->host, |
| + | u->zoneid)) |
| return CURLUE_OUT_OF_MEMORY; | |
| - | allochost = Curl_dyn_ptr(&enc); |
| + | allochost = curlx_dyn_ptr(&enc); |
| } | |
| } | |
| else if(urlencode) { | |
| @@ -1569,12 +1569,12 @@ CURLUcode curl_url_get(const CURLU *u, CURLUPart what, | |
| if(urlencode) { | |
| struct dynbuf enc; | |
| CURLUcode uc; | |
| - | Curl_dyn_init(&enc, CURL_MAX_INPUT_LENGTH); |
| + | curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH); |
| uc = urlencode_str(&enc, *part, partlen, TRUE, what == CURLUPART_QUERY); | |
| if(uc) | |
| return uc; | |
| free(*part); | |
| - | *part = Curl_dyn_ptr(&enc); |
| + | *part = curlx_dyn_ptr(&enc); |
| } | |
| else if(punycode) { | |
| if(!Curl_is_ASCII_name(u->host)) { | |
| @@ -1733,7 +1733,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, | |
| else { | |
| char *tmp; | |
| curl_off_t port; | |
| - | if(Curl_str_number(&part, &port, 0xffff) || *part) |
| + | if(curlx_str_number(&part, &port, 0xffff) || *part) |
| /* weirdly provided number, not good! */ | |
| return CURLUE_BAD_PORT_NUMBER; | |
| tmp = aprintf("%" CURL_FORMAT_CURL_OFF_T, port); | |
| @@ -1802,10 +1802,10 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, | |
| { | |
| const char *newp; | |
| struct dynbuf enc; | |
| - | Curl_dyn_init(&enc, nalloc * 3 + 1 + leadingslash); |
| + | curlx_dyn_init(&enc, nalloc * 3 + 1 + leadingslash); |
| if(leadingslash && (part[0] != '/')) { | |
| - | CURLcode result = Curl_dyn_addn(&enc, "/", 1); |
| + | CURLcode result = curlx_dyn_addn(&enc, "/", 1); |
| if(result) | |
| return cc2cu(result); | |
| } | |
| @@ -1815,7 +1815,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, | |
| for(i = (const unsigned char *)part; *i; i++) { | |
| CURLcode result; | |
| if((*i == ' ') && plusencode) { | |
| - | result = Curl_dyn_addn(&enc, "+", 1); |
| + | result = curlx_dyn_addn(&enc, "+", 1); |
| if(result) | |
| return CURLUE_OUT_OF_MEMORY; | |
| } | |
| @@ -1825,14 +1825,14 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, | |
| if((*i == '=') && equalsencode) | |
| /* only skip the first equals sign */ | |
| equalsencode = FALSE; | |
| - | result = Curl_dyn_addn(&enc, i, 1); |
| + | result = curlx_dyn_addn(&enc, i, 1); |
| if(result) | |
| return cc2cu(result); | |
| } | |
| else { | |
| unsigned char out[3]={'%'}; | |
| Curl_hexbyte(&out[1], *i, TRUE); | |
| - | result = Curl_dyn_addn(&enc, out, 3); |
| + | result = curlx_dyn_addn(&enc, out, 3); |
| if(result) | |
| return cc2cu(result); | |
| } | |
| @@ -1840,10 +1840,10 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, | |
| } | |
| else { | |
| char *p; | |
| - | CURLcode result = Curl_dyn_add(&enc, part); |
| + | CURLcode result = curlx_dyn_add(&enc, part); |
| if(result) | |
| return cc2cu(result); | |
| - | p = Curl_dyn_ptr(&enc); |
| + | p = curlx_dyn_ptr(&enc); |
| while(*p) { | |
| /* make sure percent encoded are lower case */ | |
| if((*p == '%') && ISXDIGIT(p[1]) && ISXDIGIT(p[2]) && | |
| @@ -1856,7 +1856,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, | |
| p++; | |
| } | |
| } | |
| - | newp = Curl_dyn_ptr(&enc); |
| + | newp = curlx_dyn_ptr(&enc); |
| if(appendquery && newp) { | |
| /* Append the 'newp' string onto the old query. Add a '&' separator if | |
| @@ -1866,29 +1866,29 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, | |
| bool addamperand = querylen && (u->query[querylen -1] != '&'); | |
| if(querylen) { | |
| struct dynbuf qbuf; | |
| - | Curl_dyn_init(&qbuf, CURL_MAX_INPUT_LENGTH); |
| + | curlx_dyn_init(&qbuf, CURL_MAX_INPUT_LENGTH); |
| - | if(Curl_dyn_addn(&qbuf, u->query, querylen)) /* add original query */ |
| + | if(curlx_dyn_addn(&qbuf, u->query, querylen)) /* add original query */ |
| goto nomem; | |
| if(addamperand) { | |
| - | if(Curl_dyn_addn(&qbuf, "&", 1)) |
| + | if(curlx_dyn_addn(&qbuf, "&", 1)) |
| goto nomem; | |
| } | |
| - | if(Curl_dyn_add(&qbuf, newp)) |
| + | if(curlx_dyn_add(&qbuf, newp)) |
| goto nomem; | |
| - | Curl_dyn_free(&enc); |
| + | curlx_dyn_free(&enc); |
| free(*storep); | |
| - | *storep = Curl_dyn_ptr(&qbuf); |
| + | *storep = curlx_dyn_ptr(&qbuf); |
| return CURLUE_OK; | |
| nomem: | |
| - | Curl_dyn_free(&enc); |
| + | curlx_dyn_free(&enc); |
| return CURLUE_OUT_OF_MEMORY; | |
| } | |
| } | |
| else if(what == CURLUPART_HOST) { | |
| - | size_t n = Curl_dyn_len(&enc); |
| + | size_t n = curlx_dyn_len(&enc); |
| if(!n && (flags & CURLU_NO_AUTHORITY)) { | |
| /* Skip hostname check, it is allowed to be empty. */ | |
| } | |
| @@ -1910,7 +1910,7 @@ nomem: | |
| else if(hostname_check(u, (char *)CURL_UNCONST(newp), n)) | |
| bad = TRUE; | |
| if(bad) { | |
| - | Curl_dyn_free(&enc); |
| + | curlx_dyn_free(&enc); |
| return CURLUE_BAD_HOSTNAME; | |
| } | |
| } | |
| @@ -145,7 +145,7 @@ typedef unsigned int curl_prot_t; | |
| #include <netinet/in6.h> | |
| #endif | |
| - | #include "timeval.h" |
| + | #include "curlx/timeval.h" |
| #include <curl/curl.h> | |
| @@ -153,7 +153,7 @@ typedef unsigned int curl_prot_t; | |
| #include "hostip.h" | |
| #include "hash.h" | |
| #include "splay.h" | |
| - | #include "dynbuf.h" |
| + | #include "curlx/dynbuf.h" |
| #include "dynhds.h" | |
| #include "request.h" | |
| #include "netrc.h" | |
| @@ -35,7 +35,7 @@ | |
| #include "../urldata.h" | |
| #include "vauth.h" | |
| - | #include "../warnless.h" |
| + | #include "../curlx/warnless.h" |
| #include "../sendf.h" | |
| #include "../curl_printf.h" | |
| @@ -34,7 +34,7 @@ | |
| #include "vauth.h" | |
| #include "../curl_hmac.h" | |
| #include "../curl_md5.h" | |
| - | #include "../warnless.h" |
| + | #include "../curlx/warnless.h" |
| #include "../curl_printf.h" | |
| /* The last #include files should be: */ | |
| @@ -34,14 +34,14 @@ | |
| #include "vauth.h" | |
| #include "digest.h" | |
| #include "../urldata.h" | |
| - | #include "../curl_base64.h" |
| + | #include "../curlx/base64.h" |
| #include "../curl_hmac.h" | |
| #include "../curl_md5.h" | |
| #include "../curl_sha256.h" | |
| #include "../curl_sha512_256.h" | |
| #include "../vtls/vtls.h" | |
| - | #include "../warnless.h" |
| - | #include "../strparse.h" |
| + | #include "../curlx/warnless.h" |
| + | #include "../curlx/strparse.h" |
| #include "../strcase.h" | |
| #include "../curl_printf.h" | |
| #include "../rand.h" | |
| @@ -223,14 +223,14 @@ static CURLcode auth_digest_get_qop_values(const char *options, int *value) | |
| /* Initialise the output */ | |
| *value = 0; | |
| - | while(!Curl_str_until(&options, &out, 32, ',')) { |
| - | if(Curl_str_casecompare(&out, DIGEST_QOP_VALUE_STRING_AUTH)) |
| + | while(!curlx_str_until(&options, &out, 32, ',')) { |
| + | if(curlx_str_casecompare(&out, DIGEST_QOP_VALUE_STRING_AUTH)) |
| *value |= DIGEST_QOP_VALUE_AUTH; | |
| - | else if(Curl_str_casecompare(&out, DIGEST_QOP_VALUE_STRING_AUTH_INT)) |
| + | else if(curlx_str_casecompare(&out, DIGEST_QOP_VALUE_STRING_AUTH_INT)) |
| *value |= DIGEST_QOP_VALUE_AUTH_INT; | |
| - | else if(Curl_str_casecompare(&out, DIGEST_QOP_VALUE_STRING_AUTH_CONF)) |
| + | else if(curlx_str_casecompare(&out, DIGEST_QOP_VALUE_STRING_AUTH_CONF)) |
| *value |= DIGEST_QOP_VALUE_AUTH_CONF; | |
| - | if(Curl_str_single(&options, ',')) |
| + | if(curlx_str_single(&options, ',')) |
| break; | |
| } | |
| @@ -542,13 +542,13 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg, | |
| /* Pass leading spaces */ | |
| while(*token && ISBLANK(*token)) | |
| token++; | |
| - | while(!Curl_str_until(&token, &out, 32, ',')) { |
| - | if(Curl_str_casecompare(&out, DIGEST_QOP_VALUE_STRING_AUTH)) |
| + | while(!curlx_str_until(&token, &out, 32, ',')) { |
| + | if(curlx_str_casecompare(&out, DIGEST_QOP_VALUE_STRING_AUTH)) |
| foundAuth = TRUE; | |
| - | else if(Curl_str_casecompare(&out, |
| + | else if(curlx_str_casecompare(&out, |
| DIGEST_QOP_VALUE_STRING_AUTH_INT)) | |
| foundAuthInt = TRUE; | |
| - | if(Curl_str_single(&token, ',')) |
| + | if(curlx_str_single(&token, ',')) |
| break; | |
| while(*token && ISBLANK(*token)) | |
| token++; | |
| @@ -699,8 +699,8 @@ static CURLcode auth_create_digest_http_message( | |
| if(result) | |
| return result; | |
| - | result = Curl_base64_encode(cnoncebuf, sizeof(cnoncebuf), |
| - | &cnonce, &cnonce_sz); |
| + | result = curlx_base64_encode(cnoncebuf, sizeof(cnoncebuf), |
| + | &cnonce, &cnonce_sz); |
| if(result) | |
| return result; | |
| @@ -34,7 +34,7 @@ | |
| #include "vauth.h" | |
| #include "digest.h" | |
| #include "../urldata.h" | |
| - | #include "../warnless.h" |
| + | #include "../curlx/warnless.h" |
| #include "../curl_multibyte.h" | |
| #include "../sendf.h" | |
| #include "../strdup.h" | |
| @@ -32,7 +32,7 @@ | |
| #include "vauth.h" | |
| #include "../urldata.h" | |
| - | #include "../warnless.h" |
| + | #include "../curlx/warnless.h" |
| #include "../curl_multibyte.h" | |
| #include "../sendf.h" | |
| @@ -41,7 +41,7 @@ | |
| #include "../curl_gethostname.h" | |
| #include "../curl_multibyte.h" | |
| #include "../curl_md5.h" | |
| - | #include "../warnless.h" |
| + | #include "../curlx/warnless.h" |
| #include "../rand.h" | |
| #include "../vtls/vtls.h" | |
| #include "../strdup.h" | |
| @@ -31,7 +31,7 @@ | |
| #include "vauth.h" | |
| #include "../urldata.h" | |
| #include "../curl_ntlm_core.h" | |
| - | #include "../warnless.h" |
| + | #include "../curlx/warnless.h" |
| #include "../curl_multibyte.h" | |
| #include "../sendf.h" | |
| #include "../strdup.h" | |
| @@ -34,7 +34,7 @@ | |
| #include "../urldata.h" | |
| #include "vauth.h" | |
| - | #include "../warnless.h" |
| + | #include "../curlx/warnless.h" |
| #include "../curl_printf.h" | |
| /* The last #include files should be: */ | |
| @@ -32,9 +32,9 @@ | |
| #include "vauth.h" | |
| #include "../urldata.h" | |
| - | #include "../curl_base64.h" |
| + | #include "../curlx/base64.h" |
| #include "../curl_gssapi.h" | |
| - | #include "../warnless.h" |
| + | #include "../curlx/warnless.h" |
| #include "../curl_multibyte.h" | |
| #include "../sendf.h" | |
| @@ -139,7 +139,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, | |
| if(chlg64 && *chlg64) { | |
| /* Decode the base-64 encoded challenge message */ | |
| if(*chlg64 != '=') { | |
| - | result = Curl_base64_decode(chlg64, &chlg, &chlglen); |
| + | result = curlx_base64_decode(chlg64, &chlg, &chlglen); |
| if(result) | |
| return result; | |
| } | |
| @@ -156,10 +156,10 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, | |
| } | |
| /* Set channel binding data if available */ | |
| - | if(Curl_dyn_len(&nego->channel_binding_data)) { |
| + | if(curlx_dyn_len(&nego->channel_binding_data)) { |
| memset(&chan, 0, sizeof(struct gss_channel_bindings_struct)); | |
| - | chan.application_data.length = Curl_dyn_len(&nego->channel_binding_data); |
| - | chan.application_data.value = Curl_dyn_ptr(&nego->channel_binding_data); |
| + | chan.application_data.length = curlx_dyn_len(&nego->channel_binding_data); |
| + | chan.application_data.value = curlx_dyn_ptr(&nego->channel_binding_data); |
| chan_bindings = &chan; | |
| } | |
| @@ -228,9 +228,9 @@ CURLcode Curl_auth_create_spnego_message(struct negotiatedata *nego, | |
| OM_uint32 minor_status; | |
| /* Base64 encode the already generated response */ | |
| - | result = Curl_base64_encode(nego->output_token.value, |
| - | nego->output_token.length, |
| - | outptr, outlen); |
| + | result = curlx_base64_encode(nego->output_token.value, |
| + | nego->output_token.length, |
| + | outptr, outlen); |
| if(result) { | |
| gss_release_buffer(&minor_status, &nego->output_token); | |
| @@ -32,8 +32,8 @@ | |
| #include "vauth.h" | |
| #include "../urldata.h" | |
| - | #include "../curl_base64.h" |
| - | #include "../warnless.h" |
| + | #include "../curlx/base64.h" |
| + | #include "../curlx/warnless.h" |
| #include "../curl_multibyte.h" | |
| #include "../sendf.h" | |
| #include "../strerror.h" | |
| @@ -186,7 +186,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, | |
| if(chlg64 && *chlg64) { | |
| /* Decode the base-64 encoded challenge message */ | |
| if(*chlg64 != '=') { | |
| - | result = Curl_base64_decode(chlg64, &chlg, &chlglen); |
| + | result = curlx_base64_decode(chlg64, &chlg, &chlglen); |
| if(result) | |
| return result; | |
| } | |
| @@ -308,9 +308,9 @@ CURLcode Curl_auth_create_spnego_message(struct negotiatedata *nego, | |
| char **outptr, size_t *outlen) | |
| { | |
| /* Base64 encode the already generated response */ | |
| - | CURLcode result = Curl_base64_encode((const char *) nego->output_token, |
| - | nego->output_token_length, outptr, |
| - | outlen); |
| + | CURLcode result = curlx_base64_encode((const char *) nego->output_token, |
| + | nego->output_token_length, outptr, |
| + | outlen); |
| if(!result && (!*outptr || !*outlen)) { | |
| free(*outptr); | |
| result = CURLE_REMOTE_ACCESS_DENIED; | |
| @@ -28,12 +28,10 @@ | |
| #include <curl/curl.h> | |
| #include "version_win32.h" | |
| - | #include "warnless.h" |
| + | #include "curlx/warnless.h" |
| /* The last 2 #include files should be in this order */ | |
| - | #ifdef BUILDING_LIBCURL |
| #include "curl_memory.h" | |
| - | #endif |
| #include "memdebug.h" | |
| /* This Unicode version struct works for VerifyVersionInfoW (OSVERSIONINFOEXW) | |
| @@ -29,7 +29,7 @@ | |
| #include "../urldata.h" | |
| #include "../hash.h" | |
| #include "../uint-hash.h" | |
| - | #include "../timeval.h" |
| + | #include "../curlx/timeval.h" |
| #include "../multiif.h" | |
| #include "../sendf.h" | |
| #include "../curl_trc.h" | |
| @@ -901,14 +901,14 @@ static CURLcode cf_msh3_connect(struct Curl_cfilter *cf, | |
| *done = FALSE; | |
| if(!ctx->qconn) { | |
| - | ctx->connect_started = Curl_now(); |
| + | ctx->connect_started = curlx_now(); |
| result = cf_connect_start(cf, data); | |
| if(result) | |
| goto out; | |
| } | |
| if(ctx->handshake_complete) { | |
| - | ctx->handshake_at = Curl_now(); |
| + | ctx->handshake_at = curlx_now(); |
| if(ctx->handshake_succeeded) { | |
| CURL_TRC_CF(data, cf, "handshake succeeded"); | |
| cf->conn->bits.multiplex = TRUE; /* at least potentially multiplexed */ | |
| @@ -58,7 +58,7 @@ | |
| #include "../connect.h" | |
| #include "../progress.h" | |
| #include "../strerror.h" | |
| - | #include "../dynbuf.h" |
| + | #include "../curlx/dynbuf.h" |
| #include "../http1.h" | |
| #include "../select.h" | |
| #include "../inet_pton.h" | |
| @@ -71,7 +71,7 @@ | |
| #include "../vtls/vtls_scache.h" | |
| #include "curl_ngtcp2.h" | |
| - | #include "../warnless.h" |
| + | #include "../curlx/warnless.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "../curl_printf.h" | |
| @@ -170,7 +170,7 @@ static void cf_ngtcp2_ctx_init(struct cf_ngtcp2_ctx *ctx) | |
| ctx->max_stream_window = H3_STREAM_WINDOW_SIZE; | |
| Curl_bufcp_init(&ctx->stream_bufcp, H3_STREAM_CHUNK_SIZE, | |
| H3_STREAM_POOL_SPARES); | |
| - | Curl_dyn_init(&ctx->scratch, CURL_MAX_HTTP_HEADER); |
| + | curlx_dyn_init(&ctx->scratch, CURL_MAX_HTTP_HEADER); |
| Curl_uint_hash_init(&ctx->streams, 63, h3_stream_hash_free); | |
| ctx->initialized = TRUE; | |
| } | |
| @@ -181,7 +181,7 @@ static void cf_ngtcp2_ctx_free(struct cf_ngtcp2_ctx *ctx) | |
| Curl_vquic_tls_cleanup(&ctx->tls); | |
| vquic_ctx_free(&ctx->q); | |
| Curl_bufcp_free(&ctx->stream_bufcp); | |
| - | Curl_dyn_free(&ctx->scratch); |
| + | curlx_dyn_free(&ctx->scratch); |
| Curl_uint_hash_destroy(&ctx->streams); | |
| Curl_ssl_peer_cleanup(&ctx->peer); | |
| } | |
| @@ -478,14 +478,14 @@ static int cf_ngtcp2_handshake_completed(ngtcp2_conn *tconn, void *user_data) | |
| if(!ctx || !data) | |
| return NGHTTP3_ERR_CALLBACK_FAILURE; | |
| - | ctx->handshake_at = Curl_now(); |
| + | ctx->handshake_at = curlx_now(); |
| ctx->tls_handshake_complete = TRUE; | |
| cf->conn->bits.multiplex = TRUE; /* at least potentially multiplexed */ | |
| ctx->tls_vrfy_result = Curl_vquic_tls_verify_peer(&ctx->tls, cf, | |
| data, &ctx->peer); | |
| CURL_TRC_CF(data, cf, "handshake complete after %dms", | |
| - | (int)Curl_timediff(ctx->handshake_at, ctx->started_at)); |
| + | (int)curlx_timediff(ctx->handshake_at, ctx->started_at)); |
| /* In case of earlydata, where we simulate being connected, update | |
| * the handshake time when we really did connect */ | |
| if(ctx->use_earlydata) | |
| @@ -1101,18 +1101,18 @@ static int cb_h3_recv_header(nghttp3_conn *conn, int64_t sid, | |
| (const char *)h3val.base, h3val.len); | |
| if(result) | |
| return -1; | |
| - | Curl_dyn_reset(&ctx->scratch); |
| - | result = Curl_dyn_addn(&ctx->scratch, STRCONST("HTTP/3 ")); |
| + | curlx_dyn_reset(&ctx->scratch); |
| + | result = curlx_dyn_addn(&ctx->scratch, STRCONST("HTTP/3 ")); |
| if(!result) | |
| - | result = Curl_dyn_addn(&ctx->scratch, |
| - | (const char *)h3val.base, h3val.len); |
| + | result = curlx_dyn_addn(&ctx->scratch, |
| + | (const char *)h3val.base, h3val.len); |
| if(!result) | |
| - | result = Curl_dyn_addn(&ctx->scratch, STRCONST(" \r\n")); |
| + | result = curlx_dyn_addn(&ctx->scratch, STRCONST(" \r\n")); |
| if(!result) | |
| - | h3_xfer_write_resp_hd(cf, data, stream, Curl_dyn_ptr(&ctx->scratch), |
| - | Curl_dyn_len(&ctx->scratch), FALSE); |
| + | h3_xfer_write_resp_hd(cf, data, stream, curlx_dyn_ptr(&ctx->scratch), |
| + | curlx_dyn_len(&ctx->scratch), FALSE); |
| CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] status: %s", | |
| - | stream_id, Curl_dyn_ptr(&ctx->scratch)); |
| + | stream_id, curlx_dyn_ptr(&ctx->scratch)); |
| if(result) { | |
| return -1; | |
| } | |
| @@ -1122,19 +1122,19 @@ static int cb_h3_recv_header(nghttp3_conn *conn, int64_t sid, | |
| CURL_TRC_CF(data, cf, "[%" FMT_PRId64 "] header: %.*s: %.*s", | |
| stream_id, (int)h3name.len, h3name.base, | |
| (int)h3val.len, h3val.base); | |
| - | Curl_dyn_reset(&ctx->scratch); |
| - | result = Curl_dyn_addn(&ctx->scratch, |
| - | (const char *)h3name.base, h3name.len); |
| + | curlx_dyn_reset(&ctx->scratch); |
| + | result = curlx_dyn_addn(&ctx->scratch, |
| + | (const char *)h3name.base, h3name.len); |
| if(!result) | |
| - | result = Curl_dyn_addn(&ctx->scratch, STRCONST(": ")); |
| + | result = curlx_dyn_addn(&ctx->scratch, STRCONST(": ")); |
| if(!result) | |
| - | result = Curl_dyn_addn(&ctx->scratch, |
| - | (const char *)h3val.base, h3val.len); |
| + | result = curlx_dyn_addn(&ctx->scratch, |
| + | (const char *)h3val.base, h3val.len); |
| if(!result) | |
| - | result = Curl_dyn_addn(&ctx->scratch, STRCONST("\r\n")); |
| + | result = curlx_dyn_addn(&ctx->scratch, STRCONST("\r\n")); |
| if(!result) | |
| - | h3_xfer_write_resp_hd(cf, data, stream, Curl_dyn_ptr(&ctx->scratch), |
| - | Curl_dyn_len(&ctx->scratch), FALSE); |
| + | h3_xfer_write_resp_hd(cf, data, stream, curlx_dyn_ptr(&ctx->scratch), |
| + | curlx_dyn_len(&ctx->scratch), FALSE); |
| } | |
| return 0; | |
| } | |
| @@ -2566,7 +2566,7 @@ static CURLcode cf_ngtcp2_connect(struct Curl_cfilter *cf, | |
| } | |
| *done = FALSE; | |
| - | now = Curl_now(); |
| + | now = curlx_now(); |
| pktx_init(&pktx, cf, data); | |
| CF_DATA_SAVE(save, cf, data); | |
| @@ -2669,7 +2669,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); |
| + | timediff_t ms = curlx_timediff(ctx->q.first_byte_at, ctx->started_at); |
| *pres1 = (ms < INT_MAX) ? (int)ms : INT_MAX; | |
| } | |
| else | |
| @@ -2716,7 +2716,7 @@ static bool cf_ngtcp2_conn_is_alive(struct Curl_cfilter *cf, | |
| * it will close the connection when it expires. */ | |
| rp = ngtcp2_conn_get_remote_transport_params(ctx->qconn); | |
| if(rp && rp->max_idle_timeout) { | |
| - | timediff_t idletime = Curl_timediff(Curl_now(), ctx->q.last_io); |
| + | timediff_t idletime = curlx_timediff(curlx_now(), ctx->q.last_io); |
| if(idletime > 0 && (uint64_t)idletime > rp->max_idle_timeout) | |
| goto out; | |
| } | |
| @@ -43,7 +43,7 @@ | |
| #include "../connect.h" | |
| #include "../progress.h" | |
| #include "../strerror.h" | |
| - | #include "../dynbuf.h" |
| + | #include "../curlx/dynbuf.h" |
| #include "../http1.h" | |
| #include "../select.h" | |
| #include "../inet_pton.h" | |
| @@ -55,8 +55,7 @@ | |
| #include "../vtls/vtls.h" | |
| #include "../vtls/openssl.h" | |
| #include "curl_osslq.h" | |
| - | |
| - | #include "../warnless.h" |
| + | #include "../curlx/warnless.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "../curl_printf.h" | |
| @@ -1665,7 +1664,7 @@ static CURLcode h3_send_streams(struct Curl_cfilter *cf, | |
| if(acked_len > 0 || (eos && !s->send_blocked)) { | |
| /* Since QUIC buffers the data written internally, we can tell | |
| * nghttp3 that it can move forward on it */ | |
| - | ctx->q.last_io = Curl_now(); |
| + | ctx->q.last_io = curlx_now(); |
| rv = nghttp3_conn_add_write_offset(ctx->h3.conn, s->id, acked_len); | |
| if(rv && rv != NGHTTP3_ERR_STREAM_NOT_FOUND) { | |
| failf(data, "nghttp3_conn_add_write_offset returned error: %s\n", | |
| @@ -1779,7 +1778,7 @@ static CURLcode cf_osslq_connect(struct Curl_cfilter *cf, | |
| } | |
| *done = FALSE; | |
| - | now = Curl_now(); |
| + | now = curlx_now(); |
| CF_DATA_SAVE(save, cf, data); | |
| if(!ctx->tls.ossl.ssl) { | |
| @@ -1793,7 +1792,7 @@ static CURLcode cf_osslq_connect(struct Curl_cfilter *cf, | |
| int readable = SOCKET_READABLE(ctx->q.sockfd, 0); | |
| if(readable > 0 && (readable & CURL_CSELECT_IN)) { | |
| ctx->got_first_byte = TRUE; | |
| - | ctx->first_byte_at = Curl_now(); |
| + | ctx->first_byte_at = curlx_now(); |
| } | |
| } | |
| @@ -1813,7 +1812,7 @@ static CURLcode cf_osslq_connect(struct Curl_cfilter *cf, | |
| ctx->handshake_at = now; | |
| ctx->q.last_io = now; | |
| CURL_TRC_CF(data, cf, "handshake complete after %dms", | |
| - | (int)Curl_timediff(now, ctx->started_at)); |
| + | (int)curlx_timediff(now, ctx->started_at)); |
| result = cf_osslq_verify_peer(cf, data); | |
| if(!result) { | |
| CURL_TRC_CF(data, cf, "peer verified"); | |
| @@ -2289,7 +2288,7 @@ static bool cf_osslq_conn_is_alive(struct Curl_cfilter *cf, | |
| goto out; | |
| } | |
| CURL_TRC_CF(data, cf, "negotiated idle timeout: %zums", (size_t)idle_ms); | |
| - | idletime = Curl_timediff(Curl_now(), ctx->q.last_io); |
| + | idletime = curlx_timediff(curlx_now(), ctx->q.last_io); |
| if(idletime > 0 && (uint64_t)idletime > idle_ms) | |
| goto out; | |
| } | |
| @@ -2376,7 +2375,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); |
| + | timediff_t ms = curlx_timediff(ctx->first_byte_at, ctx->started_at); |
| *pres1 = (ms < INT_MAX) ? (int)ms : INT_MAX; | |
| } | |
| else | |
| @@ -1452,7 +1452,7 @@ static CURLcode cf_quiche_connect(struct Curl_cfilter *cf, | |
| if(quiche_conn_is_established(ctx->qconn)) { | |
| ctx->handshake_at = ctx->q.last_op; | |
| CURL_TRC_CF(data, cf, "handshake complete after %dms", | |
| - | (int)Curl_timediff(ctx->handshake_at, ctx->started_at)); |
| + | (int)curlx_timediff(ctx->handshake_at, ctx->started_at)); |
| result = cf_quiche_verify_peer(cf, data); | |
| if(!result) { | |
| CURL_TRC_CF(data, cf, "peer verified"); | |
| @@ -1580,7 +1580,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); |
| + | timediff_t ms = curlx_timediff(ctx->q.first_byte_at, ctx->started_at); |
| *pres1 = (ms < INT_MAX) ? (int)ms : INT_MAX; | |
| } | |
| else | |
| @@ -32,7 +32,7 @@ | |
| #endif | |
| #include "../urldata.h" | |
| #include "../bufq.h" | |
| - | #include "../dynbuf.h" |
| + | #include "../curlx/dynbuf.h" |
| #include "../cfilters.h" | |
| #include "../curl_trc.h" | |
| #include "curl_msh3.h" | |
| @@ -44,7 +44,7 @@ | |
| #include "vquic.h" | |
| #include "vquic_int.h" | |
| #include "../strerror.h" | |
| - | #include "../strparse.h" |
| + | #include "../curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "../curl_printf.h" | |
| @@ -95,7 +95,7 @@ CURLcode vquic_ctx_init(struct cf_quic_ctx *qctx) | |
| const char *p = getenv("CURL_DBG_QUIC_WBLOCK"); | |
| if(p) { | |
| curl_off_t l; | |
| - | if(!Curl_str_number(&p, &l, 100)) |
| + | if(!curlx_str_number(&p, &l, 100)) |
| qctx->wblock_percent = (int)l; | |
| } | |
| } | |
| @@ -112,7 +112,7 @@ void vquic_ctx_free(struct cf_quic_ctx *qctx) | |
| void vquic_ctx_update_time(struct cf_quic_ctx *qctx) | |
| { | |
| - | qctx->last_op = Curl_now(); |
| + | qctx->last_op = curlx_now(); |
| } | |
| static CURLcode send_packet_no_gso(struct Curl_cfilter *cf, | |
| @@ -651,25 +651,25 @@ CURLcode Curl_qlogdir(struct Curl_easy *data, | |
| struct dynbuf fname; | |
| CURLcode result; | |
| unsigned int i; | |
| - | Curl_dyn_init(&fname, DYN_QLOG_NAME); |
| - | result = Curl_dyn_add(&fname, qlog_dir); |
| + | curlx_dyn_init(&fname, DYN_QLOG_NAME); |
| + | result = curlx_dyn_add(&fname, qlog_dir); |
| if(!result) | |
| - | result = Curl_dyn_add(&fname, "/"); |
| + | result = curlx_dyn_add(&fname, "/"); |
| for(i = 0; (i < scidlen) && !result; i++) { | |
| char hex[3]; | |
| msnprintf(hex, 3, "%02x", scid[i]); | |
| - | result = Curl_dyn_add(&fname, hex); |
| + | result = curlx_dyn_add(&fname, hex); |
| } | |
| if(!result) | |
| - | result = Curl_dyn_add(&fname, ".sqlog"); |
| + | result = curlx_dyn_add(&fname, ".sqlog"); |
| if(!result) { | |
| - | int qlogfd = open(Curl_dyn_ptr(&fname), O_WRONLY|O_CREAT|CURL_O_BINARY, |
| + | int qlogfd = open(curlx_dyn_ptr(&fname), O_WRONLY|O_CREAT|CURL_O_BINARY, |
| data->set.new_file_perms); | |
| if(qlogfd != -1) | |
| *qlogfdp = qlogfd; | |
| } | |
| - | Curl_dyn_free(&fname); |
| + | curlx_dyn_free(&fname); |
| if(result) | |
| return result; | |
| } | |
| @@ -50,13 +50,13 @@ CURLcode Curl_getworkingpath(struct Curl_easy *data, | |
| return result; | |
| /* new path to switch to in case we need to */ | |
| - | Curl_dyn_init(&npath, MAX_SSHPATH_LEN); |
| + | curlx_dyn_init(&npath, MAX_SSHPATH_LEN); |
| /* Check for /~/, indicating relative to the user's home directory */ | |
| if((data->conn->handler->protocol & CURLPROTO_SCP) && | |
| (working_path_len > 3) && (!memcmp(working_path, "/~/", 3))) { | |
| /* It is referenced to the home directory, so strip the leading '/~/' */ | |
| - | if(Curl_dyn_addn(&npath, &working_path[3], working_path_len - 3)) { |
| + | if(curlx_dyn_addn(&npath, &working_path[3], working_path_len - 3)) { |
| free(working_path); | |
| return CURLE_OUT_OF_MEMORY; | |
| } | |
| @@ -64,7 +64,7 @@ CURLcode Curl_getworkingpath(struct Curl_easy *data, | |
| else if((data->conn->handler->protocol & CURLPROTO_SFTP) && | |
| (!strcmp("/~", working_path) || | |
| ((working_path_len > 2) && !memcmp(working_path, "/~/", 3)))) { | |
| - | if(Curl_dyn_add(&npath, homedir)) { |
| + | if(curlx_dyn_add(&npath, homedir)) { |
| free(working_path); | |
| return CURLE_OUT_OF_MEMORY; | |
| } | |
| @@ -73,24 +73,24 @@ CURLcode Curl_getworkingpath(struct Curl_easy *data, | |
| const char *p; | |
| int copyfrom = 3; | |
| /* Copy a separating '/' if homedir does not end with one */ | |
| - | len = Curl_dyn_len(&npath); |
| - | p = Curl_dyn_ptr(&npath); |
| + | len = curlx_dyn_len(&npath); |
| + | p = curlx_dyn_ptr(&npath); |
| if(len && (p[len-1] != '/')) | |
| copyfrom = 2; | |
| - | if(Curl_dyn_addn(&npath, |
| - | &working_path[copyfrom], working_path_len - copyfrom)) { |
| + | if(curlx_dyn_addn(&npath, &working_path[copyfrom], |
| + | working_path_len - copyfrom)) { |
| free(working_path); | |
| return CURLE_OUT_OF_MEMORY; | |
| } | |
| } | |
| } | |
| - | if(Curl_dyn_len(&npath)) { |
| + | if(curlx_dyn_len(&npath)) { |
| free(working_path); | |
| /* store the pointer for the caller to receive */ | |
| - | *path = Curl_dyn_ptr(&npath); |
| + | *path = curlx_dyn_ptr(&npath); |
| } | |
| else | |
| *path = working_path; | |
| @@ -133,7 +133,7 @@ CURLcode Curl_get_pathname(const char **cpp, char **path, const char *homedir) | |
| if(!*cp || !homedir) | |
| return CURLE_QUOTE_ERROR; | |
| - | Curl_dyn_init(&out, MAX_PATHLENGTH); |
| + | curlx_dyn_init(&out, MAX_PATHLENGTH); |
| /* Ignore leading whitespace */ | |
| cp += strspn(cp, WHITESPACE); | |
| @@ -158,12 +158,12 @@ CURLcode Curl_get_pathname(const char **cpp, char **path, const char *homedir) | |
| goto fail; | |
| } | |
| } | |
| - | result = Curl_dyn_addn(&out, &cp[i], 1); |
| + | result = curlx_dyn_addn(&out, &cp[i], 1); |
| if(result) | |
| return result; | |
| } | |
| - | if(!Curl_dyn_len(&out)) |
| + | if(!curlx_dyn_len(&out)) |
| goto fail; | |
| /* return pointer to second parameter if it exists */ | |
| @@ -180,23 +180,23 @@ CURLcode Curl_get_pathname(const char **cpp, char **path, const char *homedir) | |
| /* Handling for relative path - prepend home directory */ | |
| if(cp[0] == '/' && cp[1] == '~' && cp[2] == '/') { | |
| - | result = Curl_dyn_add(&out, homedir); |
| + | result = curlx_dyn_add(&out, homedir); |
| if(!result) | |
| - | result = Curl_dyn_addn(&out, "/", 1); |
| + | result = curlx_dyn_addn(&out, "/", 1); |
| if(result) | |
| return result; | |
| cp += 3; | |
| } | |
| /* Copy path name up until first "whitespace" */ | |
| - | result = Curl_dyn_addn(&out, cp, (end - cp)); |
| + | result = curlx_dyn_addn(&out, cp, (end - cp)); |
| if(result) | |
| return result; | |
| } | |
| - | *path = Curl_dyn_ptr(&out); |
| + | *path = curlx_dyn_ptr(&out); |
| return CURLE_OK; | |
| fail: | |
| - | Curl_dyn_free(&out); |
| + | curlx_dyn_free(&out); |
| return CURLE_QUOTE_ERROR; | |
| } | |
| @@ -65,10 +65,10 @@ | |
| #include "../inet_ntop.h" | |
| #include "../parsedate.h" /* for the week day and month names */ | |
| #include "../sockaddr.h" /* required for Curl_sockaddr_storage */ | |
| - | #include "../strparse.h" |
| + | #include "../curlx/strparse.h" |
| #include "../multiif.h" | |
| #include "../select.h" | |
| - | #include "../warnless.h" |
| + | #include "../curlx/warnless.h" |
| #include "curl_path.h" | |
| #ifdef HAVE_SYS_STAT_H | |
| @@ -1417,7 +1417,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) | |
| break; | |
| case SSH_SFTP_READDIR: | |
| - | Curl_dyn_reset(&sshc->readdir_buf); |
| + | curlx_dyn_reset(&sshc->readdir_buf); |
| if(sshc->readdir_attrs) | |
| sftp_attributes_free(sshc->readdir_attrs); | |
| @@ -1447,7 +1447,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) | |
| } | |
| else { | |
| - | if(Curl_dyn_add(&sshc->readdir_buf, sshc->readdir_longentry)) { |
| + | if(curlx_dyn_add(&sshc->readdir_buf, sshc->readdir_longentry)) { |
| sshc->actualcode = CURLE_OUT_OF_MEMORY; | |
| state(data, SSH_STOP); | |
| break; | |
| @@ -1515,8 +1515,8 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) | |
| Curl_safefree(sshc->readdir_linkPath); | |
| - | if(Curl_dyn_addf(&sshc->readdir_buf, " -> %s", |
| - | sshc->readdir_filename)) { |
| + | if(curlx_dyn_addf(&sshc->readdir_buf, " -> %s", |
| + | sshc->readdir_filename)) { |
| sshc->actualcode = CURLE_OUT_OF_MEMORY; | |
| break; | |
| } | |
| @@ -1529,12 +1529,12 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) | |
| state(data, SSH_SFTP_READDIR_BOTTOM); | |
| FALLTHROUGH(); | |
| case SSH_SFTP_READDIR_BOTTOM: | |
| - | if(Curl_dyn_addn(&sshc->readdir_buf, "\n", 1)) |
| + | if(curlx_dyn_addn(&sshc->readdir_buf, "\n", 1)) |
| result = CURLE_OUT_OF_MEMORY; | |
| else | |
| result = Curl_client_write(data, CLIENTWRITE_BODY, | |
| - | Curl_dyn_ptr(&sshc->readdir_buf), |
| - | Curl_dyn_len(&sshc->readdir_buf)); |
| + | curlx_dyn_ptr(&sshc->readdir_buf), |
| + | curlx_dyn_len(&sshc->readdir_buf)); |
| ssh_string_free_char(sshc->readdir_tmp); | |
| sshc->readdir_tmp = NULL; | |
| @@ -1609,13 +1609,13 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, bool *block) | |
| const char *p = data->state.range; | |
| int from_t, to_t; | |
| - | from_t = Curl_str_number(&p, &from, CURL_OFF_T_MAX); |
| + | from_t = curlx_str_number(&p, &from, CURL_OFF_T_MAX); |
| if(from_t == STRE_OVERFLOW) | |
| return CURLE_RANGE_ERROR; | |
| - | Curl_str_passblanks(&p); |
| - | (void)Curl_str_single(&p, '-'); |
| + | curlx_str_passblanks(&p); |
| + | (void)curlx_str_single(&p, '-'); |
| - | to_t = Curl_str_numblanks(&p, &to); |
| + | to_t = curlx_str_numblanks(&p, &to); |
| if(to_t == STRE_OVERFLOW) | |
| return CURLE_RANGE_ERROR; | |
| @@ -2044,7 +2044,7 @@ static CURLcode myssh_block_statemach(struct Curl_easy *data, | |
| while((sshc->state != SSH_STOP) && !result) { | |
| bool block; | |
| timediff_t left = 1000; | |
| - | struct curltime now = Curl_now(); |
| + | struct curltime now = curlx_now(); |
| result = myssh_statemach_act(data, &block); | |
| if(result) | |
| @@ -2087,7 +2087,7 @@ static CURLcode myssh_setup_connection(struct Curl_easy *data, | |
| struct ssh_conn *sshc = &conn->proto.sshc; | |
| if(!sshc->initialised) { | |
| - | Curl_dyn_init(&sshc->readdir_buf, CURL_PATH_MAX * 2); |
| + | curlx_dyn_init(&sshc->readdir_buf, CURL_PATH_MAX * 2); |
| sshc->initialised = TRUE; | |
| } | |
| @@ -2338,7 +2338,7 @@ static void sshc_cleanup(struct ssh_conn *sshc, struct Curl_easy *data) | |
| Curl_safefree(sshc->rsa); | |
| Curl_safefree(sshc->quote_path1); | |
| Curl_safefree(sshc->quote_path2); | |
| - | Curl_dyn_free(&sshc->readdir_buf); |
| + | curlx_dyn_free(&sshc->readdir_buf); |
| Curl_safefree(sshc->readdir_linkPath); | |
| SSH_STRING_FREE_CHAR(sshc->homedir); | |
| sshc->initialised = FALSE; | |
| @@ -2893,7 +2893,7 @@ static void sftp_quote_stat(struct Curl_easy *data) | |
| if(!strncmp(cmd, "chgrp", 5)) { | |
| const char *p = sshc->quote_path1; | |
| curl_off_t gid; | |
| - | (void)Curl_str_number(&p, &gid, UINT_MAX); |
| + | (void)curlx_str_number(&p, &gid, UINT_MAX); |
| sshc->quote_attrs->gid = (uint32_t)gid; | |
| if(sshc->quote_attrs->gid == 0 && !ISDIGIT(sshc->quote_path1[0]) && | |
| !sshc->acceptfail) { | |
| @@ -2910,7 +2910,7 @@ static void sftp_quote_stat(struct Curl_easy *data) | |
| else if(!strncmp(cmd, "chmod", 5)) { | |
| curl_off_t perms; | |
| const char *p = sshc->quote_path1; | |
| - | if(Curl_str_octal(&p, &perms, 07777)) { |
| + | if(curlx_str_octal(&p, &perms, 07777)) { |
| Curl_safefree(sshc->quote_path1); | |
| Curl_safefree(sshc->quote_path2); | |
| failf(data, "Syntax error: chmod permissions not a number"); | |
| @@ -2925,7 +2925,7 @@ static void sftp_quote_stat(struct Curl_easy *data) | |
| else if(!strncmp(cmd, "chown", 5)) { | |
| const char *p = sshc->quote_path1; | |
| curl_off_t uid; | |
| - | (void)Curl_str_number(&p, &uid, UINT_MAX); |
| + | (void)curlx_str_number(&p, &uid, UINT_MAX); |
| if(sshc->quote_attrs->uid == 0 && !ISDIGIT(sshc->quote_path1[0]) && | |
| !sshc->acceptfail) { | |
| Curl_safefree(sshc->quote_path1); | |
| @@ -70,10 +70,10 @@ | |
| #include "../sockaddr.h" /* required for Curl_sockaddr_storage */ | |
| #include "../multiif.h" | |
| #include "../select.h" | |
| - | #include "../warnless.h" |
| + | #include "../curlx/warnless.h" |
| #include "curl_path.h" | |
| - | #include "../strparse.h" |
| - | #include "../curl_base64.h" /* for base64 encoding/decoding */ |
| + | #include "../curlx/strparse.h" |
| + | #include "../curlx/base64.h" /* for base64 encoding/decoding */ |
| #include "../curl_sha256.h" | |
| /* The last 3 #include files should be in this order */ | |
| @@ -635,8 +635,8 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data) | |
| /* The length of fingerprint is 32 bytes for SHA256. | |
| * See libssh2_hostkey_hash documentation. */ | |
| - | if(Curl_base64_encode(fingerprint, 32, &fingerprint_b64, |
| - | &fingerprint_b64_len) != CURLE_OK) { |
| + | if(curlx_base64_encode(fingerprint, 32, &fingerprint_b64, |
| + | &fingerprint_b64_len) != CURLE_OK) { |
| state(data, SSH_SESSION_FREE); | |
| sshc->actualcode = CURLE_PEER_FAILED_VERIFICATION; | |
| return sshc->actualcode; | |
| @@ -1371,7 +1371,7 @@ sftp_quote_stat(struct Curl_easy *data, | |
| if(!strncmp(cmd, "chgrp", 5)) { | |
| const char *p = sshc->quote_path1; | |
| curl_off_t gid; | |
| - | (void)Curl_str_number(&p, &gid, ULONG_MAX); |
| + | (void)curlx_str_number(&p, &gid, ULONG_MAX); |
| sshp->quote_attrs.gid = (unsigned long)gid; | |
| sshp->quote_attrs.flags = LIBSSH2_SFTP_ATTR_UIDGID; | |
| if(sshp->quote_attrs.gid == 0 && !ISDIGIT(sshc->quote_path1[0]) && | |
| @@ -1384,7 +1384,7 @@ sftp_quote_stat(struct Curl_easy *data, | |
| curl_off_t perms; | |
| const char *p = sshc->quote_path1; | |
| /* permissions are octal */ | |
| - | if(Curl_str_octal(&p, &perms, 07777)) { |
| + | if(curlx_str_octal(&p, &perms, 07777)) { |
| failf(data, "Syntax error: chmod permissions not a number"); | |
| goto fail; | |
| } | |
| @@ -1395,7 +1395,7 @@ sftp_quote_stat(struct Curl_easy *data, | |
| else if(!strncmp(cmd, "chown", 5)) { | |
| const char *p = sshc->quote_path1; | |
| curl_off_t uid; | |
| - | (void)Curl_str_number(&p, &uid, ULONG_MAX); |
| + | (void)curlx_str_number(&p, &uid, ULONG_MAX); |
| sshp->quote_attrs.uid = (unsigned long)uid; | |
| sshp->quote_attrs.flags = LIBSSH2_SFTP_ATTR_UIDGID; | |
| if(sshp->quote_attrs.uid == 0 && !ISDIGIT(sshc->quote_path1[0]) && | |
| @@ -1478,13 +1478,13 @@ sftp_download_stat(struct Curl_easy *data, | |
| const char *p = data->state.range; | |
| int to_t, from_t; | |
| - | from_t = Curl_str_number(&p, &from, CURL_OFF_T_MAX); |
| + | from_t = curlx_str_number(&p, &from, CURL_OFF_T_MAX); |
| if(from_t == STRE_OVERFLOW) | |
| return CURLE_RANGE_ERROR; | |
| - | Curl_str_passblanks(&p); |
| - | (void)Curl_str_single(&p, '-'); |
| + | curlx_str_passblanks(&p); |
| + | (void)curlx_str_single(&p, '-'); |
| - | to_t = Curl_str_numblanks(&p, &to); |
| + | to_t = curlx_str_numblanks(&p, &to); |
| if(to_t == STRE_OVERFLOW) | |
| return CURLE_RANGE_ERROR; | |
| if((to_t == STRE_NO_NUM) /* no "to" value given */ | |
| @@ -1598,14 +1598,14 @@ static CURLcode sftp_readdir(struct Curl_easy *data, | |
| return result; | |
| } | |
| else { | |
| - | result = Curl_dyn_add(&sshp->readdir, sshp->readdir_longentry); |
| + | result = curlx_dyn_add(&sshp->readdir, sshp->readdir_longentry); |
| if(!result) { | |
| if((sshp->readdir_attrs.flags & LIBSSH2_SFTP_ATTR_PERMISSIONS) && | |
| ((sshp->readdir_attrs.permissions & LIBSSH2_SFTP_S_IFMT) == | |
| LIBSSH2_SFTP_S_IFLNK)) { | |
| - | result = Curl_dyn_addf(&sshp->readdir_link, "%s%s", sshp->path, |
| - | sshp->readdir_filename); |
| + | result = curlx_dyn_addf(&sshp->readdir_link, "%s%s", sshp->path, |
| + | sshp->readdir_filename); |
| state(data, SSH_SFTP_READDIR_LINK); | |
| } | |
| else { | |
| @@ -2440,18 +2440,19 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, bool *block) | |
| case SSH_SFTP_READDIR_LINK: | |
| rc = | |
| libssh2_sftp_symlink_ex(sshc->sftp_session, | |
| - | Curl_dyn_ptr(&sshp->readdir_link), |
| + | curlx_dyn_ptr(&sshp->readdir_link), |
| (unsigned int) | |
| - | Curl_dyn_len(&sshp->readdir_link), |
| + | curlx_dyn_len(&sshp->readdir_link), |
| sshp->readdir_filename, | |
| CURL_PATH_MAX, LIBSSH2_SFTP_READLINK); | |
| if(rc == LIBSSH2_ERROR_EAGAIN) { | |
| break; | |
| } | |
| - | Curl_dyn_free(&sshp->readdir_link); |
| + | curlx_dyn_free(&sshp->readdir_link); |
| /* append filename and extra output */ | |
| - | result = Curl_dyn_addf(&sshp->readdir, " -> %s", sshp->readdir_filename); |
| + | result = curlx_dyn_addf(&sshp->readdir, " -> %s", |
| + | sshp->readdir_filename); |
| if(result) { | |
| state(data, SSH_SFTP_CLOSE); | |
| @@ -2463,18 +2464,18 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, bool *block) | |
| break; | |
| case SSH_SFTP_READDIR_BOTTOM: | |
| - | result = Curl_dyn_addn(&sshp->readdir, "\n", 1); |
| + | result = curlx_dyn_addn(&sshp->readdir, "\n", 1); |
| if(!result) | |
| result = Curl_client_write(data, CLIENTWRITE_BODY, | |
| - | Curl_dyn_ptr(&sshp->readdir), |
| - | Curl_dyn_len(&sshp->readdir)); |
| + | curlx_dyn_ptr(&sshp->readdir), |
| + | curlx_dyn_len(&sshp->readdir)); |
| if(result) { | |
| - | Curl_dyn_free(&sshp->readdir); |
| + | curlx_dyn_free(&sshp->readdir); |
| state(data, SSH_STOP); | |
| } | |
| else { | |
| - | Curl_dyn_reset(&sshp->readdir); |
| + | curlx_dyn_reset(&sshp->readdir); |
| state(data, SSH_SFTP_READDIR); | |
| } | |
| break; | |
| @@ -2963,12 +2964,12 @@ static CURLcode ssh_block_statemach(struct Curl_easy *data, | |
| { | |
| struct ssh_conn *sshc = &conn->proto.sshc; | |
| CURLcode result = CURLE_OK; | |
| - | struct curltime dis = Curl_now(); |
| + | struct curltime dis = curlx_now(); |
| while((sshc->state != SSH_STOP) && !result) { | |
| bool block; | |
| timediff_t left = 1000; | |
| - | struct curltime now = Curl_now(); |
| + | struct curltime now = curlx_now(); |
| result = ssh_statemachine(data, &block); | |
| if(result) | |
| @@ -2988,7 +2989,7 @@ static CURLcode ssh_block_statemach(struct Curl_easy *data, | |
| return CURLE_OPERATION_TIMEDOUT; | |
| } | |
| } | |
| - | else if(Curl_timediff(now, dis) > 1000) { |
| + | else if(curlx_timediff(now, dis) > 1000) { |
| /* disconnect timeout */ | |
| failf(data, "Disconnect timed out"); | |
| result = CURLE_OK; | |
| @@ -3033,8 +3034,8 @@ static CURLcode ssh_setup_connection(struct Curl_easy *data, | |
| if(!ssh) | |
| return CURLE_OUT_OF_MEMORY; | |
| - | Curl_dyn_init(&ssh->readdir, CURL_PATH_MAX * 2); |
| - | Curl_dyn_init(&ssh->readdir_link, CURL_PATH_MAX); |
| + | curlx_dyn_init(&ssh->readdir, CURL_PATH_MAX * 2); |
| + | curlx_dyn_init(&ssh->readdir_link, CURL_PATH_MAX); |
| return CURLE_OK; | |
| } | |
| @@ -3460,8 +3461,8 @@ static CURLcode ssh_done(struct Curl_easy *data, CURLcode status) | |
| result = status; | |
| Curl_safefree(sshp->path); | |
| - | Curl_dyn_free(&sshp->readdir); |
| - | Curl_dyn_free(&sshp->readdir_link); |
| + | curlx_dyn_free(&sshp->readdir); |
| + | curlx_dyn_free(&sshp->readdir_link); |
| if(Curl_pgrsDone(data)) | |
| return CURLE_ABORTED_BY_CALLBACK; | |
| @@ -38,7 +38,7 @@ | |
| #include "../speedcheck.h" | |
| #include "../select.h" | |
| #include "../multiif.h" | |
| - | #include "../warnless.h" |
| + | #include "../curlx/warnless.h" |
| #include "../strdup.h" | |
| /* The last 3 #include files should be in this order */ | |
| @@ -998,7 +998,7 @@ static CURLcode wssh_block_statemach(struct Curl_easy *data, | |
| while((sshc->state != SSH_STOP) && !result) { | |
| bool block; | |
| timediff_t left = 1000; | |
| - | struct curltime now = Curl_now(); |
| + | struct curltime now = curlx_now(); |
| result = wssh_statemach_act(data, &block); | |
| if(result) | |
| @@ -55,7 +55,7 @@ | |
| #include "../select.h" | |
| #include "../strcase.h" | |
| #include "../strdup.h" | |
| - | #include "../warnless.h" |
| + | #include "../curlx/warnless.h" |
| #include "x509asn1.h" | |
| #include "../multiif.h" | |
| #include "../curl_printf.h" | |
| @@ -426,7 +426,7 @@ CURLcode Curl_gtls_shared_creds_create(struct Curl_easy *data, | |
| } | |
| shared->refcount = 1; | |
| - | shared->time = Curl_now(); |
| + | shared->time = curlx_now(); |
| *pcreds = shared; | |
| return CURLE_OK; | |
| } | |
| @@ -540,8 +540,8 @@ static bool gtls_shared_creds_expired(const struct Curl_easy *data, | |
| const struct gtls_shared_creds *sc) | |
| { | |
| const struct ssl_general_config *cfg = &data->set.general_ssl; | |
| - | struct curltime now = Curl_now(); |
| - | timediff_t elapsed_ms = Curl_timediff(now, sc->time); |
| + | struct curltime now = curlx_now(); |
| + | timediff_t elapsed_ms = curlx_timediff(now, sc->time); |
| timediff_t timeout_ms = cfg->ca_cache_timeout * (timediff_t)1000; | |
| if(timeout_ms < 0) | |
| @@ -794,18 +794,18 @@ static CURLcode gtls_set_priority(struct Curl_cfilter *cf, | |
| CURLcode result = CURLE_OK; | |
| int rc; | |
| - | Curl_dyn_init(&buf, 4096); |
| + | curlx_dyn_init(&buf, 4096); |
| #ifdef USE_GNUTLS_SRP | |
| if(conn_config->username) { | |
| /* Only add SRP to the cipher list if SRP is requested. Otherwise | |
| * GnuTLS will disable TLS 1.3 support. */ | |
| - | result = Curl_dyn_add(&buf, priority); |
| + | result = curlx_dyn_add(&buf, priority); |
| if(!result) | |
| - | result = Curl_dyn_add(&buf, ":" GNUTLS_SRP); |
| + | result = curlx_dyn_add(&buf, ":" GNUTLS_SRP); |
| if(result) | |
| goto out; | |
| - | priority = Curl_dyn_ptr(&buf); |
| + | priority = curlx_dyn_ptr(&buf); |
| } | |
| #endif | |
| @@ -814,15 +814,15 @@ static CURLcode gtls_set_priority(struct Curl_cfilter *cf, | |
| (conn_config->cipher_list[0] == '-') || | |
| (conn_config->cipher_list[0] == '!')) { | |
| /* add it to out own */ | |
| - | if(!Curl_dyn_len(&buf)) { /* not added yet */ |
| - | result = Curl_dyn_add(&buf, priority); |
| + | if(!curlx_dyn_len(&buf)) { /* not added yet */ |
| + | result = curlx_dyn_add(&buf, priority); |
| if(result) | |
| goto out; | |
| } | |
| - | result = Curl_dyn_addf(&buf, ":%s", conn_config->cipher_list); |
| + | result = curlx_dyn_addf(&buf, ":%s", conn_config->cipher_list); |
| if(result) | |
| goto out; | |
| - | priority = Curl_dyn_ptr(&buf); |
| + | priority = curlx_dyn_ptr(&buf); |
| } | |
| else /* replace our own completely */ | |
| priority = conn_config->cipher_list; | |
| @@ -836,7 +836,7 @@ static CURLcode gtls_set_priority(struct Curl_cfilter *cf, | |
| } | |
| out: | |
| - | Curl_dyn_free(&buf); |
| + | curlx_dyn_free(&buf); |
| return result; | |
| } | |
| @@ -30,7 +30,7 @@ | |
| #ifdef USE_GNUTLS | |
| #include <gnutls/gnutls.h> | |
| - | #include "../timeval.h" |
| + | #include "../curlx/timeval.h" |
| #ifdef HAVE_GNUTLS_SRP | |
| /* the function exists */ | |
| @@ -62,7 +62,7 @@ | |
| #include "../strcase.h" | |
| #include "hostcheck.h" | |
| #include "../multiif.h" | |
| - | #include "../strparse.h" |
| + | #include "../curlx/strparse.h" |
| #include "../strdup.h" | |
| #include "../strerror.h" | |
| #include "../curl_printf.h" | |
| @@ -122,7 +122,7 @@ | |
| static void ossl_provider_cleanup(struct Curl_easy *data); | |
| #endif | |
| - | #include "../warnless.h" |
| + | #include "../curlx/warnless.h" |
| /* The last #include files should be: */ | |
| #include "../curl_memory.h" | |
| @@ -992,13 +992,13 @@ static CURLcode ossl_seed(struct Curl_easy *data) | |
| size_t len = sizeof(randb); | |
| size_t i, i_max; | |
| for(i = 0, i_max = len / sizeof(struct curltime); i < i_max; ++i) { | |
| - | struct curltime tv = Curl_now(); |
| + | struct curltime tv = curlx_now(); |
| Curl_wait_ms(1); | |
| tv.tv_sec *= (time_t)i + 1; | |
| tv.tv_usec *= (int)i + 2; | |
| - | tv.tv_sec ^= ((Curl_now().tv_sec + (time_t)Curl_now().tv_usec) * |
| + | tv.tv_sec ^= ((curlx_now().tv_sec + (time_t)curlx_now().tv_usec) * |
| (time_t)(i + 3)) << 8; | |
| - | tv.tv_usec ^= (int) ((Curl_now().tv_sec + (time_t)Curl_now().tv_usec) * |
| + | tv.tv_usec ^= (int) ((curlx_now().tv_sec + (time_t)curlx_now().tv_usec) * |
| (time_t)(i + 4)) << 16; | |
| memcpy(&randb[i * sizeof(struct curltime)], &tv, | |
| sizeof(struct curltime)); | |
| @@ -1774,11 +1774,11 @@ static CURLcode x509_name_oneline(X509_NAME *a, struct dynbuf *d) | |
| CURLcode result = CURLE_OUT_OF_MEMORY; | |
| if(bio_out) { | |
| - | Curl_dyn_reset(d); |
| + | curlx_dyn_reset(d); |
| rc = X509_NAME_print_ex(bio_out, a, 0, XN_FLAG_SEP_SPLUS_SPC); | |
| if(rc != -1) { | |
| BIO_get_mem_ptr(bio_out, &biomem); | |
| - | result = Curl_dyn_addn(d, biomem->data, biomem->length); |
| + | result = curlx_dyn_addn(d, biomem->data, biomem->length); |
| BIO_free(bio_out); | |
| } | |
| } | |
| @@ -1992,16 +1992,16 @@ static CURLcode ossl_set_provider(struct Curl_easy *data, const char *iname) | |
| ossl_provider_cleanup(data); | |
| return CURLE_OK; | |
| } | |
| - | if(Curl_str_until(&iname, &prov, MAX_PROVIDER_LEN, ':')) |
| + | if(curlx_str_until(&iname, &prov, MAX_PROVIDER_LEN, ':')) |
| return CURLE_BAD_FUNCTION_ARGUMENT; | |
| - | if(!Curl_str_single(&iname, ':')) |
| + | if(!curlx_str_single(&iname, ':')) |
| /* there was a colon, get the propq until the end of string */ | |
| propq = iname; | |
| /* we need the name in a buffer, null-terminated */ | |
| - | memcpy(name, Curl_str(&prov), Curl_strlen(&prov)); |
| - | name[Curl_strlen(&prov)] = 0; |
| + | memcpy(name, curlx_str(&prov), curlx_strlen(&prov)); |
| + | name[curlx_strlen(&prov)] = 0; |
| if(!data->state.libctx) { | |
| OSSL_LIB_CTX *libctx = OSSL_LIB_CTX_new(); | |
| @@ -3479,8 +3479,8 @@ ossl_cached_x509_store_expired(const struct Curl_easy *data, | |
| if(cfg->ca_cache_timeout < 0) | |
| return FALSE; | |
| else { | |
| - | struct curltime now = Curl_now(); |
| - | timediff_t elapsed_ms = Curl_timediff(now, mb->time); |
| + | struct curltime now = curlx_now(); |
| + | timediff_t elapsed_ms = curlx_timediff(now, mb->time); |
| timediff_t timeout_ms = cfg->ca_cache_timeout * (timediff_t)1000; | |
| return elapsed_ms >= timeout_ms; | |
| @@ -3562,7 +3562,7 @@ static void ossl_set_cached_x509_store(struct Curl_cfilter *cf, | |
| free(share->CAfile); | |
| } | |
| - | share->time = Curl_now(); |
| + | share->time = curlx_now(); |
| share->store = store; | |
| share->CAfile = CAfile; | |
| } | |
| @@ -4023,7 +4023,7 @@ CURLcode Curl_ossl_ctx_init(struct ossl_ctx *octx, | |
| return CURLE_SSL_CONNECT_ERROR; | |
| } | |
| ech_config_len = 2 * strlen(b64); | |
| - | result = Curl_base64_decode(b64, &ech_config, &ech_config_len); |
| + | result = curlx_base64_decode(b64, &ech_config, &ech_config_len); |
| if(result || !ech_config) { | |
| infof(data, "ECH: cannot base64 decode ECHConfig from command line"); | |
| if(data->set.tls_ech & CURLECH_HARD) | |
| @@ -4312,7 +4312,7 @@ static void ossl_trace_ech_retry_configs(struct Curl_easy *data, SSL* ssl, | |
| char *b64str = NULL; | |
| size_t blen = 0; | |
| - | result = Curl_base64_encode((const char *)rcs, rcl, &b64str, &blen); |
| + | result = curlx_base64_encode((const char *)rcs, rcl, &b64str, &blen); |
| if(!result && b64str) { | |
| infof(data, "ECH: retry_configs %s", b64str); | |
| free(b64str); | |
| @@ -4743,7 +4743,7 @@ CURLcode Curl_oss_check_peer_cert(struct Curl_cfilter *cf, | |
| DEBUGASSERT(octx); | |
| - | Curl_dyn_init(&dname, MAX_CERT_NAME_LENGTH); |
| + | curlx_dyn_init(&dname, MAX_CERT_NAME_LENGTH); |
| if(!mem) { | |
| failf(data, | |
| @@ -4773,7 +4773,7 @@ CURLcode Curl_oss_check_peer_cert(struct Curl_cfilter *cf, | |
| result = x509_name_oneline(X509_get_subject_name(octx->server_cert), | |
| &dname); | |
| - | infof(data, " subject: %s", result ? "[NONE]" : Curl_dyn_ptr(&dname)); |
| + | infof(data, " subject: %s", result ? "[NONE]" : curlx_dyn_ptr(&dname)); |
| #ifndef CURL_DISABLE_VERBOSE_STRINGS | |
| { | |
| @@ -4798,7 +4798,7 @@ CURLcode Curl_oss_check_peer_cert(struct Curl_cfilter *cf, | |
| if(result) { | |
| X509_free(octx->server_cert); | |
| octx->server_cert = NULL; | |
| - | Curl_dyn_free(&dname); |
| + | curlx_dyn_free(&dname); |
| return result; | |
| } | |
| } | |
| @@ -4811,8 +4811,8 @@ CURLcode Curl_oss_check_peer_cert(struct Curl_cfilter *cf, | |
| result = CURLE_PEER_FAILED_VERIFICATION; | |
| } | |
| else { | |
| - | infof(data, " issuer: %s", Curl_dyn_ptr(&dname)); |
| - | Curl_dyn_free(&dname); |
| + | infof(data, " issuer: %s", curlx_dyn_ptr(&dname)); |
| + | curlx_dyn_free(&dname); |
| /* We could do all sorts of certificate verification stuff here before | |
| deallocating the certificate. */ | |
| @@ -5395,10 +5395,10 @@ static CURLcode ossl_get_channel_binding(struct Curl_easy *data, int sockindex, | |
| } | |
| /* Append "tls-server-end-point:" */ | |
| - | if(Curl_dyn_addn(binding, prefix, sizeof(prefix) - 1) != CURLE_OK) |
| + | if(curlx_dyn_addn(binding, prefix, sizeof(prefix) - 1) != CURLE_OK) |
| return CURLE_OUT_OF_MEMORY; | |
| /* Append digest */ | |
| - | if(Curl_dyn_addn(binding, buf, length)) |
| + | if(curlx_dyn_addn(binding, buf, length)) |
| return CURLE_OUT_OF_MEMORY; | |
| return CURLE_OK; | |
| @@ -417,7 +417,7 @@ read_file_into(const char *filename, | |
| uint8_t buf[256]; | |
| const size_t rr = fread(buf, 1, sizeof(buf), f); | |
| if(rr == 0 || | |
| - | CURLE_OK != Curl_dyn_addn(out, buf, rr)) { |
| + | CURLE_OK != curlx_dyn_addn(out, buf, rr)) { |
| fclose(f); | |
| return 0; | |
| } | |
| @@ -692,7 +692,7 @@ init_config_builder_verifier_crl( | |
| struct dynbuf crl_contents; | |
| rustls_result rr; | |
| - | Curl_dyn_init(&crl_contents, DYN_CRLFILE_SIZE); |
| + | curlx_dyn_init(&crl_contents, DYN_CRLFILE_SIZE); |
| if(!read_file_into(conn_config->CRLfile, &crl_contents)) { | |
| failf(data, "rustls: failed to read revocation list file"); | |
| result = CURLE_SSL_CRL_BADFILE; | |
| @@ -701,8 +701,8 @@ init_config_builder_verifier_crl( | |
| rr = rustls_web_pki_server_cert_verifier_builder_add_crl( | |
| builder, | |
| - | Curl_dyn_uptr(&crl_contents), |
| - | Curl_dyn_len(&crl_contents)); |
| + | curlx_dyn_uptr(&crl_contents), |
| + | curlx_dyn_len(&crl_contents)); |
| if(rr != RUSTLS_RESULT_OK) { | |
| rustls_failf(data, rr, "failed to parse revocation list"); | |
| result = CURLE_SSL_CRL_BADFILE; | |
| @@ -710,7 +710,7 @@ init_config_builder_verifier_crl( | |
| } | |
| cleanup: | |
| - | Curl_dyn_free(&crl_contents); |
| + | curlx_dyn_free(&crl_contents); |
| return result; | |
| } | |
| @@ -868,8 +868,8 @@ init_config_builder_client_auth(struct Curl_easy *data, | |
| return CURLE_SSL_CERTPROBLEM; | |
| } | |
| - | Curl_dyn_init(&cert_contents, DYN_CERTFILE_SIZE); |
| - | Curl_dyn_init(&key_contents, DYN_KEYFILE_SIZE); |
| + | curlx_dyn_init(&cert_contents, DYN_CERTFILE_SIZE); |
| + | curlx_dyn_init(&key_contents, DYN_KEYFILE_SIZE); |
| if(!read_file_into(conn_config->clientcert, &cert_contents)) { | |
| failf(data, "rustls: failed to read client certificate file: '%s'", | |
| @@ -884,10 +884,10 @@ init_config_builder_client_auth(struct Curl_easy *data, | |
| goto cleanup; | |
| } | |
| - | rr = rustls_certified_key_build(Curl_dyn_uptr(&cert_contents), |
| - | Curl_dyn_len(&cert_contents), |
| - | Curl_dyn_uptr(&key_contents), |
| - | Curl_dyn_len(&key_contents), |
| + | rr = rustls_certified_key_build(curlx_dyn_uptr(&cert_contents), |
| + | curlx_dyn_len(&cert_contents), |
| + | curlx_dyn_uptr(&key_contents), |
| + | curlx_dyn_len(&key_contents), |
| &certified_key); | |
| if(rr != RUSTLS_RESULT_OK) { | |
| rustls_failf(data, rr, "rustls: failed to build certified key"); | |
| @@ -915,8 +915,8 @@ init_config_builder_client_auth(struct Curl_easy *data, | |
| } | |
| cleanup: | |
| - | Curl_dyn_free(&cert_contents); |
| - | Curl_dyn_free(&key_contents); |
| + | curlx_dyn_free(&cert_contents); |
| + | curlx_dyn_free(&key_contents); |
| if(certified_key) { | |
| rustls_certified_key_free(certified_key); | |
| } | |
| @@ -970,7 +970,7 @@ init_config_builder_ech(struct Curl_easy *data, | |
| goto cleanup; | |
| } | |
| /* rustls-ffi expects the raw TLS encoded ECHConfigList bytes */ | |
| - | decode_result = Curl_base64_decode(b64, &ech_config, &ech_config_len); |
| + | decode_result = curlx_base64_decode(b64, &ech_config, &ech_config_len); |
| if(decode_result || !ech_config) { | |
| infof(data, "rustls: cannot base64 decode ECHConfig from command line"); | |
| result = CURLE_SSL_CONNECT_ERROR; | |
| @@ -49,14 +49,14 @@ | |
| #include "../select.h" /* for the socket readiness */ | |
| #include "../inet_pton.h" /* for IP addr SNI check */ | |
| #include "../curl_multibyte.h" | |
| - | #include "../warnless.h" |
| + | #include "../curlx/warnless.h" |
| #include "x509asn1.h" | |
| #include "../curl_printf.h" | |
| #include "../multiif.h" | |
| #include "../system_win32.h" | |
| #include "../version_win32.h" | |
| #include "../rand.h" | |
| - | #include "../strparse.h" |
| + | #include "../curlx/strparse.h" |
| /* The last #include file should be: */ | |
| #include "../curl_memory.h" | |
| @@ -381,7 +381,7 @@ set_ssl_ciphers(SCHANNEL_CRED *schannel_cred, char *ciphers, | |
| int algCount = 0; | |
| while(startCur && (0 != *startCur) && (algCount < NUM_CIPHERS)) { | |
| curl_off_t alg; | |
| - | if(Curl_str_number(&startCur, &alg, INT_MAX) || !alg) |
| + | if(curlx_str_number(&startCur, &alg, INT_MAX) || !alg) |
| alg = get_alg_id_by_name(startCur); | |
| if(alg) | |
| @@ -2632,8 +2632,8 @@ HCERTSTORE Curl_schannel_get_cached_cert_store(struct Curl_cfilter *cf, | |
| negative timeout means retain forever. */ | |
| timeout_ms = cfg->ca_cache_timeout * (timediff_t)1000; | |
| if(timeout_ms >= 0) { | |
| - | now = Curl_now(); |
| - | elapsed_ms = Curl_timediff(now, share->time); |
| + | now = curlx_now(); |
| + | elapsed_ms = curlx_timediff(now, share->time); |
| if(elapsed_ms >= timeout_ms) { | |
| return NULL; | |
| } | |
| @@ -2732,7 +2732,7 @@ bool Curl_schannel_set_cached_cert_store(struct Curl_cfilter *cf, | |
| } | |
| free(share->CAfile); | |
| - | share->time = Curl_now(); |
| + | share->time = curlx_now(); |
| share->cert_store = cert_store; | |
| share->CAinfo_blob_size = CAinfo_blob_size; | |
| share->CAfile = CAfile; | |
| @@ -33,8 +33,8 @@ | |
| #ifdef USE_SECTRANSP | |
| #include "../urldata.h" /* for the Curl_easy definition */ | |
| - | #include "../curl_base64.h" |
| - | #include "../strparse.h" |
| + | #include "../curlx/base64.h" |
| + | #include "../curlx/strparse.h" |
| #include "../multiif.h" | |
| #include "../strcase.h" | |
| #include "x509asn1.h" | |
| @@ -352,9 +352,9 @@ CF_INLINE void GetDarwinVersionNumber(int *major, int *minor) | |
| curl_off_t fnum; | |
| curl_off_t snum; | |
| /* Parse the version: */ | |
| - | if(!Curl_str_number(&os, &fnum, INT_MAX) && |
| - | !Curl_str_single(&os, '.') && |
| - | !Curl_str_number(&os, &snum, INT_MAX)) { |
| + | if(!curlx_str_number(&os, &fnum, INT_MAX) && |
| + | !curlx_str_single(&os, '.') && |
| + | !curlx_str_number(&os, &snum, INT_MAX)) { |
| *major = (int)fnum; | |
| *minor = (int)snum; | |
| } | |
| @@ -1435,7 +1435,7 @@ static long pem_to_der(const char *in, unsigned char **out, size_t *outlen) | |
| } | |
| b64[j] = '\0'; | |
| - | err = Curl_base64_decode((const char *)b64, out, outlen); |
| + | err = curlx_base64_decode((const char *)b64, out, outlen); |
| free(b64); | |
| if(err) { | |
| free(*out); | |
| @@ -1454,7 +1454,7 @@ static int read_cert(const char *file, unsigned char **out, size_t *outlen) | |
| unsigned char buf[512]; | |
| struct dynbuf certs; | |
| - | Curl_dyn_init(&certs, MAX_CERTS_SIZE); |
| + | curlx_dyn_init(&certs, MAX_CERTS_SIZE); |
| fd = open(file, 0); | |
| if(fd < 0) | |
| @@ -1466,18 +1466,18 @@ static int read_cert(const char *file, unsigned char **out, size_t *outlen) | |
| break; | |
| if(n < 0) { | |
| close(fd); | |
| - | Curl_dyn_free(&certs); |
| + | curlx_dyn_free(&certs); |
| return -1; | |
| } | |
| - | if(Curl_dyn_addn(&certs, buf, n)) { |
| + | if(curlx_dyn_addn(&certs, buf, n)) { |
| close(fd); | |
| return -1; | |
| } | |
| } | |
| close(fd); | |
| - | *out = Curl_dyn_uptr(&certs); |
| - | *outlen = Curl_dyn_len(&certs); |
| + | *out = curlx_dyn_uptr(&certs); |
| + | *outlen = curlx_dyn_len(&certs); |
| return 0; | |
| } | |
| @@ -73,11 +73,11 @@ | |
| #include "../progress.h" | |
| #include "../share.h" | |
| #include "../multiif.h" | |
| - | #include "../timeval.h" |
| + | #include "../curlx/timeval.h" |
| #include "../curl_md5.h" | |
| #include "../curl_sha256.h" | |
| - | #include "../warnless.h" |
| - | #include "../curl_base64.h" |
| + | #include "../curlx/warnless.h" |
| + | #include "../curlx/base64.h" |
| #include "../curl_printf.h" | |
| #include "../inet_pton.h" | |
| #include "../connect.h" | |
| @@ -616,17 +616,17 @@ CURLcode Curl_ssl_push_certinfo_len(struct Curl_easy *data, | |
| DEBUGASSERT(certnum < ci->num_of_certs); | |
| - | Curl_dyn_init(&build, CURL_X509_STR_MAX); |
| + | curlx_dyn_init(&build, CURL_X509_STR_MAX); |
| - | if(Curl_dyn_add(&build, label) || |
| - | Curl_dyn_addn(&build, ":", 1) || |
| - | Curl_dyn_addn(&build, value, valuelen)) |
| + | if(curlx_dyn_add(&build, label) || |
| + | curlx_dyn_addn(&build, ":", 1) || |
| + | curlx_dyn_addn(&build, value, valuelen)) |
| return CURLE_OUT_OF_MEMORY; | |
| nl = Curl_slist_append_nodup(ci->certinfo[certnum], | |
| - | Curl_dyn_ptr(&build)); |
| + | curlx_dyn_ptr(&build)); |
| if(!nl) { | |
| - | Curl_dyn_free(&build); |
| + | curlx_dyn_free(&build); |
| curl_slist_free_all(ci->certinfo[certnum]); | |
| result = CURLE_OUT_OF_MEMORY; | |
| } | |
| @@ -663,7 +663,7 @@ static CURLcode pubkey_pem_to_der(const char *pem, | |
| if(!pem) | |
| return CURLE_BAD_CONTENT_ENCODING; | |
| - | Curl_dyn_init(&pbuf, MAX_PINNED_PUBKEY_SIZE); |
| + | curlx_dyn_init(&pbuf, MAX_PINNED_PUBKEY_SIZE); |
| begin_pos = strstr(pem, "-----BEGIN PUBLIC KEY-----"); | |
| if(!begin_pos) | |
| @@ -691,16 +691,16 @@ static CURLcode pubkey_pem_to_der(const char *pem, | |
| */ | |
| while(pem_count < pem_len) { | |
| if('\n' != pem[pem_count] && '\r' != pem[pem_count]) { | |
| - | result = Curl_dyn_addn(&pbuf, &pem[pem_count], 1); |
| + | result = curlx_dyn_addn(&pbuf, &pem[pem_count], 1); |
| if(result) | |
| return result; | |
| } | |
| ++pem_count; | |
| } | |
| - | result = Curl_base64_decode(Curl_dyn_ptr(&pbuf), der, der_len); |
| + | result = curlx_base64_decode(curlx_dyn_ptr(&pbuf), der, der_len); |
| - | Curl_dyn_free(&pbuf); |
| + | curlx_dyn_free(&pbuf); |
| return result; | |
| } | |
| @@ -744,9 +744,9 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, | |
| sha256sumdigest, CURL_SHA256_DIGEST_LENGTH); | |
| if(!encode) | |
| - | encode = Curl_base64_encode((char *)sha256sumdigest, |
| - | CURL_SHA256_DIGEST_LENGTH, &encoded, |
| - | &encodedlen); |
| + | encode = curlx_base64_encode((char *)sha256sumdigest, |
| + | CURL_SHA256_DIGEST_LENGTH, &encoded, |
| + | &encodedlen); |
| Curl_safefree(sha256sumdigest); | |
| if(encode) | |
| @@ -801,7 +801,7 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, | |
| if(!fp) | |
| return result; | |
| - | Curl_dyn_init(&buf, MAX_PINNED_PUBKEY_SIZE); |
| + | curlx_dyn_init(&buf, MAX_PINNED_PUBKEY_SIZE); |
| /* Determine the file's size */ | |
| if(fseek(fp, 0, SEEK_END)) | |
| @@ -829,14 +829,14 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, | |
| size_t want = left > sizeof(buffer) ? sizeof(buffer) : left; | |
| if(want != fread(buffer, 1, want, fp)) | |
| goto end; | |
| - | if(Curl_dyn_addn(&buf, buffer, want)) |
| + | if(curlx_dyn_addn(&buf, buffer, want)) |
| goto end; | |
| left -= want; | |
| } while(left); | |
| /* If the sizes are the same, it cannot be base64 encoded, must be der */ | |
| if(pubkeylen == size) { | |
| - | if(!memcmp(pubkey, Curl_dyn_ptr(&buf), pubkeylen)) |
| + | if(!memcmp(pubkey, curlx_dyn_ptr(&buf), pubkeylen)) |
| result = CURLE_OK; | |
| goto end; | |
| } | |
| @@ -845,7 +845,7 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, | |
| * Otherwise we will assume it is PEM and try to decode it | |
| * after placing null terminator | |
| */ | |
| - | pem_read = pubkey_pem_to_der(Curl_dyn_ptr(&buf), &pem_ptr, &pem_len); |
| + | pem_read = pubkey_pem_to_der(curlx_dyn_ptr(&buf), &pem_ptr, &pem_len); |
| /* if it was not read successfully, exit */ | |
| if(pem_read) | |
| goto end; | |
| @@ -857,7 +857,7 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, | |
| if(pubkeylen == pem_len && !memcmp(pubkey, pem_ptr, pubkeylen)) | |
| result = CURLE_OK; | |
| end: | |
| - | Curl_dyn_free(&buf); |
| + | curlx_dyn_free(&buf); |
| Curl_safefree(pem_ptr); | |
| fclose(fp); | |
| } | |
| @@ -1351,7 +1351,7 @@ static CURLcode ssl_cf_connect(struct Curl_cfilter *cf, | |
| if(!result && *done) { | |
| cf->connected = TRUE; | |
| if(connssl->state == ssl_connection_complete) | |
| - | connssl->handshake_done = Curl_now(); |
| + | connssl->handshake_done = curlx_now(); |
| /* Connection can be deferred when sending early data */ | |
| DEBUGASSERT(connssl->state == ssl_connection_complete || | |
| connssl->state == ssl_connection_deferred); | |
| @@ -45,7 +45,7 @@ struct dynbuf; | |
| #define SSLSUPP_SIGNATURE_ALGORITHMS (1<<10) /* supports TLS sigalgs */ | |
| #ifdef USE_ECH | |
| - | # include "../curl_base64.h" |
| + | # include "../curlx/base64.h" |
| # define ECH_ENABLED(__data__) \ | |
| (__data__->set.tls_ech && \ | |
| !(__data__->set.tls_ech & CURLECH_DISABLE)\ | |
| @@ -51,7 +51,7 @@ | |
| #include "../curl_trc.h" | |
| #include "../curl_sha256.h" | |
| #include "../rand.h" | |
| - | #include "../warnless.h" |
| + | #include "../curlx/warnless.h" |
| #include "../curl_printf.h" | |
| #include "../strdup.h" | |
| @@ -387,24 +387,24 @@ static CURLcode cf_ssl_peer_key_add_path(struct dynbuf *buf, | |
| * the path as is. */ | |
| #ifdef UNDER_CE | |
| (void)is_local; | |
| - | return Curl_dyn_addf(buf, ":%s-%s", name, path); |
| + | return curlx_dyn_addf(buf, ":%s-%s", name, path); |
| #elif defined(_WIN32) | |
| char abspath[_MAX_PATH]; | |
| if(_fullpath(abspath, path, _MAX_PATH)) | |
| - | return Curl_dyn_addf(buf, ":%s-%s", name, abspath); |
| + | return curlx_dyn_addf(buf, ":%s-%s", name, abspath); |
| *is_local = TRUE; | |
| #elif defined(HAVE_REALPATH) | |
| if(path[0] != '/') { | |
| char *abspath = realpath(path, NULL); | |
| if(abspath) { | |
| - | CURLcode r = Curl_dyn_addf(buf, ":%s-%s", name, abspath); |
| + | CURLcode r = curlx_dyn_addf(buf, ":%s-%s", name, abspath); |
| (free)(abspath); /* allocated by libc, free without memdebug */ | |
| return r; | |
| } | |
| *is_local = TRUE; | |
| } | |
| #endif | |
| - | return Curl_dyn_addf(buf, ":%s-%s", name, path); |
| + | return curlx_dyn_addf(buf, ":%s-%s", name, path); |
| } | |
| return CURLE_OK; | |
| } | |
| @@ -418,14 +418,14 @@ static CURLcode cf_ssl_peer_key_add_hash(struct dynbuf *buf, | |
| unsigned char hash[CURL_SHA256_DIGEST_LENGTH]; | |
| size_t i; | |
| - | r = Curl_dyn_addf(buf, ":%s-", name); |
| + | r = curlx_dyn_addf(buf, ":%s-", name); |
| if(r) | |
| goto out; | |
| r = Curl_sha256it(hash, blob->data, blob->len); | |
| if(r) | |
| goto out; | |
| for(i = 0; i < CURL_SHA256_DIGEST_LENGTH; ++i) { | |
| - | r = Curl_dyn_addf(buf, "%02x", hash[i]); |
| + | r = curlx_dyn_addf(buf, "%02x", hash[i]); |
| if(r) | |
| goto out; | |
| } | |
| @@ -457,9 +457,9 @@ CURLcode Curl_ssl_peer_key_make(struct Curl_cfilter *cf, | |
| CURLcode r; | |
| *ppeer_key = NULL; | |
| - | Curl_dyn_init(&buf, 10 * 1024); |
| + | curlx_dyn_init(&buf, 10 * 1024); |
| - | r = Curl_dyn_addf(&buf, "%s:%d", peer->hostname, peer->port); |
| + | r = curlx_dyn_addf(&buf, "%s:%d", peer->hostname, peer->port); |
| if(r) | |
| goto out; | |
| @@ -467,72 +467,72 @@ CURLcode Curl_ssl_peer_key_make(struct Curl_cfilter *cf, | |
| case TRNSPRT_TCP: | |
| break; | |
| case TRNSPRT_UDP: | |
| - | r = Curl_dyn_add(&buf, ":UDP"); |
| + | r = curlx_dyn_add(&buf, ":UDP"); |
| break; | |
| case TRNSPRT_QUIC: | |
| - | r = Curl_dyn_add(&buf, ":QUIC"); |
| + | r = curlx_dyn_add(&buf, ":QUIC"); |
| break; | |
| case TRNSPRT_UNIX: | |
| - | r = Curl_dyn_add(&buf, ":UNIX"); |
| + | r = curlx_dyn_add(&buf, ":UNIX"); |
| break; | |
| default: | |
| - | r = Curl_dyn_addf(&buf, ":TRNSPRT-%d", peer->transport); |
| + | r = curlx_dyn_addf(&buf, ":TRNSPRT-%d", peer->transport); |
| break; | |
| } | |
| if(r) | |
| goto out; | |
| if(!ssl->verifypeer) { | |
| - | r = Curl_dyn_add(&buf, ":NO-VRFY-PEER"); |
| + | r = curlx_dyn_add(&buf, ":NO-VRFY-PEER"); |
| if(r) | |
| goto out; | |
| } | |
| if(!ssl->verifyhost) { | |
| - | r = Curl_dyn_add(&buf, ":NO-VRFY-HOST"); |
| + | r = curlx_dyn_add(&buf, ":NO-VRFY-HOST"); |
| if(r) | |
| goto out; | |
| } | |
| if(ssl->verifystatus) { | |
| - | r = Curl_dyn_add(&buf, ":VRFY-STATUS"); |
| + | r = curlx_dyn_add(&buf, ":VRFY-STATUS"); |
| if(r) | |
| goto out; | |
| } | |
| if(!ssl->verifypeer || !ssl->verifyhost) { | |
| if(cf->conn->bits.conn_to_host) { | |
| - | r = Curl_dyn_addf(&buf, ":CHOST-%s", cf->conn->conn_to_host.name); |
| + | r = curlx_dyn_addf(&buf, ":CHOST-%s", cf->conn->conn_to_host.name); |
| if(r) | |
| goto out; | |
| } | |
| if(cf->conn->bits.conn_to_port) { | |
| - | r = Curl_dyn_addf(&buf, ":CPORT-%d", cf->conn->conn_to_port); |
| + | r = curlx_dyn_addf(&buf, ":CPORT-%d", cf->conn->conn_to_port); |
| if(r) | |
| goto out; | |
| } | |
| } | |
| if(ssl->version || ssl->version_max) { | |
| - | r = Curl_dyn_addf(&buf, ":TLSVER-%d-%d", ssl->version, |
| + | r = curlx_dyn_addf(&buf, ":TLSVER-%d-%d", ssl->version, |
| (ssl->version_max >> 16)); | |
| if(r) | |
| goto out; | |
| } | |
| if(ssl->ssl_options) { | |
| - | r = Curl_dyn_addf(&buf, ":TLSOPT-%x", ssl->ssl_options); |
| + | r = curlx_dyn_addf(&buf, ":TLSOPT-%x", ssl->ssl_options); |
| if(r) | |
| goto out; | |
| } | |
| if(ssl->cipher_list) { | |
| - | r = Curl_dyn_addf(&buf, ":CIPHER-%s", ssl->cipher_list); |
| + | r = curlx_dyn_addf(&buf, ":CIPHER-%s", ssl->cipher_list); |
| if(r) | |
| goto out; | |
| } | |
| if(ssl->cipher_list13) { | |
| - | r = Curl_dyn_addf(&buf, ":CIPHER13-%s", ssl->cipher_list13); |
| + | r = curlx_dyn_addf(&buf, ":CIPHER13-%s", ssl->cipher_list13); |
| if(r) | |
| goto out; | |
| } | |
| if(ssl->curves) { | |
| - | r = Curl_dyn_addf(&buf, ":CURVES-%s", ssl->curves); |
| + | r = curlx_dyn_addf(&buf, ":CURVES-%s", ssl->curves); |
| if(r) | |
| goto out; | |
| } | |
| @@ -566,19 +566,19 @@ CURLcode Curl_ssl_peer_key_make(struct Curl_cfilter *cf, | |
| } | |
| } | |
| if(ssl->pinned_key && ssl->pinned_key[0]) { | |
| - | r = Curl_dyn_addf(&buf, ":Pinned-%s", ssl->pinned_key); |
| + | r = curlx_dyn_addf(&buf, ":Pinned-%s", ssl->pinned_key); |
| if(r) | |
| goto out; | |
| } | |
| if(ssl->clientcert && ssl->clientcert[0]) { | |
| - | r = Curl_dyn_add(&buf, ":CCERT"); |
| + | r = curlx_dyn_add(&buf, ":CCERT"); |
| if(r) | |
| goto out; | |
| } | |
| #ifdef USE_TLS_SRP | |
| if(ssl->username || ssl->password) { | |
| - | r = Curl_dyn_add(&buf, ":SRP-AUTH"); |
| + | r = curlx_dyn_add(&buf, ":SRP-AUTH"); |
| if(r) | |
| goto out; | |
| } | |
| @@ -588,22 +588,22 @@ CURLcode Curl_ssl_peer_key_make(struct Curl_cfilter *cf, | |
| r = CURLE_FAILED_INIT; | |
| goto out; | |
| } | |
| - | r = Curl_dyn_addf(&buf, ":IMPL-%s", tls_id); |
| + | r = curlx_dyn_addf(&buf, ":IMPL-%s", tls_id); |
| if(r) | |
| goto out; | |
| - | r = Curl_dyn_addf(&buf, is_local ? |
| - | CURL_SSLS_LOCAL_SUFFIX : CURL_SSLS_GLOBAL_SUFFIX); |
| + | r = curlx_dyn_addf(&buf, is_local ? |
| + | CURL_SSLS_LOCAL_SUFFIX : CURL_SSLS_GLOBAL_SUFFIX); |
| if(r) | |
| goto out; | |
| - | *ppeer_key = Curl_dyn_take(&buf, &key_len); |
| + | *ppeer_key = curlx_dyn_take(&buf, &key_len); |
| /* we just added printable char, and dynbuf always 0 terminates, | |
| * no need to track length */ | |
| out: | |
| - | Curl_dyn_free(&buf); |
| + | curlx_dyn_free(&buf); |
| return r; | |
| } | |
| @@ -1173,8 +1173,8 @@ CURLcode Curl_ssl_session_export(struct Curl_easy *data, | |
| Curl_ssl_scache_lock(data); | |
| - | Curl_dyn_init(&hbuf, (CURL_SHA256_DIGEST_LENGTH * 2) + 1); |
| - | Curl_dyn_init(&sbuf, CURL_SSL_TICKET_MAX); |
| + | curlx_dyn_init(&hbuf, (CURL_SHA256_DIGEST_LENGTH * 2) + 1); |
| + | curlx_dyn_init(&sbuf, CURL_SSL_TICKET_MAX); |
| for(i = 0; scache && i < scache->peer_count; i++) { | |
| peer = &scache->peers[i]; | |
| @@ -1183,7 +1183,7 @@ CURLcode Curl_ssl_session_export(struct Curl_easy *data, | |
| if(!peer->exportable) | |
| continue; | |
| - | Curl_dyn_reset(&hbuf); |
| + | curlx_dyn_reset(&hbuf); |
| cf_scache_peer_remove_expired(peer, now); | |
| n = Curl_llist_head(&peer->sessions); | |
| if(n) | |
| @@ -1195,22 +1195,22 @@ CURLcode Curl_ssl_session_export(struct Curl_easy *data, | |
| if(r) | |
| goto out; | |
| } | |
| - | if(!Curl_dyn_len(&hbuf)) { |
| - | r = Curl_dyn_addn(&hbuf, peer->key_salt, sizeof(peer->key_salt)); |
| + | if(!curlx_dyn_len(&hbuf)) { |
| + | r = curlx_dyn_addn(&hbuf, peer->key_salt, sizeof(peer->key_salt)); |
| if(r) | |
| goto out; | |
| - | r = Curl_dyn_addn(&hbuf, peer->key_hmac, sizeof(peer->key_hmac)); |
| + | r = curlx_dyn_addn(&hbuf, peer->key_hmac, sizeof(peer->key_hmac)); |
| if(r) | |
| goto out; | |
| } | |
| - | Curl_dyn_reset(&sbuf); |
| + | curlx_dyn_reset(&sbuf); |
| r = Curl_ssl_session_pack(data, s, &sbuf); | |
| if(r) | |
| goto out; | |
| r = export_fn(data, userptr, peer->ssl_peer_key, | |
| - | Curl_dyn_uptr(&hbuf), Curl_dyn_len(&hbuf), |
| - | Curl_dyn_uptr(&sbuf), Curl_dyn_len(&sbuf), |
| + | curlx_dyn_uptr(&hbuf), curlx_dyn_len(&hbuf), |
| + | curlx_dyn_uptr(&sbuf), curlx_dyn_len(&sbuf), |
| s->valid_until, s->ietf_tls_id, | |
| s->alpn, s->earlydata_max); | |
| if(r) | |
| @@ -1226,8 +1226,8 @@ CURLcode Curl_ssl_session_export(struct Curl_easy *data, | |
| out: | |
| Curl_ssl_scache_unlock(data); | |
| - | Curl_dyn_free(&hbuf); |
| - | Curl_dyn_free(&sbuf); |
| + | curlx_dyn_free(&hbuf); |
| + | curlx_dyn_free(&sbuf); |
| return r; | |
| } | |
| @@ -64,7 +64,7 @@ typedef unsigned __int64 uint64_t; | |
| static CURLcode spack_enc8(struct dynbuf *buf, uint8_t b) | |
| { | |
| - | return Curl_dyn_addn(buf, &b, 1); |
| + | return curlx_dyn_addn(buf, &b, 1); |
| } | |
| static CURLcode | |
| @@ -82,7 +82,7 @@ static CURLcode spack_enc16(struct dynbuf *buf, uint16_t val) | |
| uint8_t nval[2]; | |
| nval[0] = (uint8_t)(val >> 8); | |
| nval[1] = (uint8_t)val; | |
| - | return Curl_dyn_addn(buf, nval, sizeof(nval)); |
| + | return curlx_dyn_addn(buf, nval, sizeof(nval)); |
| } | |
| static CURLcode | |
| @@ -102,7 +102,7 @@ static CURLcode spack_enc32(struct dynbuf *buf, uint32_t val) | |
| nval[1] = (uint8_t)(val >> 16); | |
| nval[2] = (uint8_t)(val >> 8); | |
| nval[3] = (uint8_t)val; | |
| - | return Curl_dyn_addn(buf, nval, sizeof(nval)); |
| + | return curlx_dyn_addn(buf, nval, sizeof(nval)); |
| } | |
| static CURLcode | |
| @@ -127,7 +127,7 @@ static CURLcode spack_enc64(struct dynbuf *buf, uint64_t val) | |
| nval[5] = (uint8_t)(val >> 16); | |
| nval[6] = (uint8_t)(val >> 8); | |
| nval[7] = (uint8_t)val; | |
| - | return Curl_dyn_addn(buf, nval, sizeof(nval)); |
| + | return curlx_dyn_addn(buf, nval, sizeof(nval)); |
| } | |
| static CURLcode | |
| @@ -151,7 +151,7 @@ static CURLcode spack_encstr16(struct dynbuf *buf, const char *s) | |
| return CURLE_BAD_FUNCTION_ARGUMENT; | |
| r = spack_enc16(buf, (uint16_t)slen); | |
| if(!r) { | |
| - | r = Curl_dyn_addn(buf, s, slen); |
| + | r = curlx_dyn_addn(buf, s, slen); |
| } | |
| return r; | |
| } | |
| @@ -181,7 +181,7 @@ static CURLcode spack_encdata16(struct dynbuf *buf, | |
| return CURLE_BAD_FUNCTION_ARGUMENT; | |
| r = spack_enc16(buf, (uint16_t)data_len); | |
| if(!r) { | |
| - | r = Curl_dyn_addn(buf, data, data_len); |
| + | r = curlx_dyn_addn(buf, data, data_len); |
| } | |
| return r; | |
| } | |
| @@ -714,8 +714,8 @@ wssl_cached_x509_store_expired(const struct Curl_easy *data, | |
| const struct wssl_x509_share *mb) | |
| { | |
| const struct ssl_general_config *cfg = &data->set.general_ssl; | |
| - | struct curltime now = Curl_now(); |
| - | timediff_t elapsed_ms = Curl_timediff(now, mb->time); |
| + | struct curltime now = curlx_now(); |
| + | timediff_t elapsed_ms = curlx_timediff(now, mb->time); |
| timediff_t timeout_ms = cfg->ca_cache_timeout * (timediff_t)1000; | |
| if(timeout_ms < 0) | |
| @@ -799,7 +799,7 @@ static void wssl_set_cached_x509_store(struct Curl_cfilter *cf, | |
| free(share->CAfile); | |
| } | |
| - | share->time = Curl_now(); |
| + | share->time = curlx_now(); |
| share->store = store; | |
| share->CAfile = CAfile; | |
| } | |
| @@ -871,14 +871,14 @@ wssl_add_default_ciphers(bool tls13, struct dynbuf *buf) | |
| continue; | |
| /* if there already is data in the string, add colon separator */ | |
| - | if(Curl_dyn_len(buf)) { |
| - | CURLcode result = Curl_dyn_addn(buf, ":", 1); |
| + | if(curlx_dyn_len(buf)) { |
| + | CURLcode result = curlx_dyn_addn(buf, ":", 1); |
| if(result) | |
| return result; | |
| } | |
| n = strlen(str); | |
| - | if(Curl_dyn_addn(buf, str, n)) |
| + | if(curlx_dyn_addn(buf, str, n)) |
| return CURLE_OUT_OF_MEMORY; | |
| } | |
| @@ -1067,19 +1067,19 @@ CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx, | |
| const char *ciphers12 = conn_config->cipher_list; | |
| const char *ciphers13 = conn_config->cipher_list13; | |
| struct dynbuf c; | |
| - | Curl_dyn_init(&c, MAX_CIPHER_LEN); |
| + | curlx_dyn_init(&c, MAX_CIPHER_LEN); |
| if(ciphers13) | |
| - | result = Curl_dyn_add(&c, ciphers13); |
| + | result = curlx_dyn_add(&c, ciphers13); |
| else | |
| result = wssl_add_default_ciphers(TRUE, &c); | |
| if(!result) { | |
| if(ciphers12) { | |
| - | if(Curl_dyn_len(&c)) |
| - | result = Curl_dyn_addn(&c, ":", 1); |
| + | if(curlx_dyn_len(&c)) |
| + | result = curlx_dyn_addn(&c, ":", 1); |
| if(!result) | |
| - | result = Curl_dyn_add(&c, ciphers12); |
| + | result = curlx_dyn_add(&c, ciphers12); |
| } | |
| else | |
| result = wssl_add_default_ciphers(FALSE, &c); | |
| @@ -1087,14 +1087,14 @@ CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx, | |
| if(result) | |
| goto out; | |
| - | if(!wolfSSL_CTX_set_cipher_list(wctx->ssl_ctx, Curl_dyn_ptr(&c))) { |
| - | failf(data, "failed setting cipher list: %s", Curl_dyn_ptr(&c)); |
| - | Curl_dyn_free(&c); |
| + | if(!wolfSSL_CTX_set_cipher_list(wctx->ssl_ctx, curlx_dyn_ptr(&c))) { |
| + | failf(data, "failed setting cipher list: %s", curlx_dyn_ptr(&c)); |
| + | curlx_dyn_free(&c); |
| result = CURLE_SSL_CIPHER; | |
| goto out; | |
| } | |
| - | infof(data, "Cipher selection: %s", Curl_dyn_ptr(&c)); |
| - | Curl_dyn_free(&c); |
| + | infof(data, "Cipher selection: %s", curlx_dyn_ptr(&c)); |
| + | curlx_dyn_free(&c); |
| } | |
| #endif | |
| @@ -1769,8 +1769,8 @@ static CURLcode wssl_handshake(struct Curl_cfilter *cf, | |
| char *b64str = NULL; | |
| size_t blen = 0; | |
| - | result = Curl_base64_encode((const char *)echConfigs, echConfigsLen, |
| - | &b64str, &blen); |
| + | result = curlx_base64_encode((const char *)echConfigs, echConfigsLen, |
| + | &b64str, &blen); |
| if(!result && b64str) | |
| infof(data, "ECH: (not yet) retry_configs %s", b64str); | |
| free(b64str); | |
| @@ -47,9 +47,9 @@ | |
| #include "vtls_int.h" | |
| #include "../sendf.h" | |
| #include "../inet_pton.h" | |
| - | #include "../curl_base64.h" |
| + | #include "../curlx/base64.h" |
| #include "x509asn1.h" | |
| - | #include "../dynbuf.h" |
| + | #include "../curlx/dynbuf.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "../curl_printf.h" | |
| @@ -291,7 +291,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 curlx_dyn_add(store, *beg ? "TRUE": "FALSE"); |
| } | |
| /* | |
| @@ -305,7 +305,7 @@ static CURLcode octet2str(struct dynbuf *store, | |
| CURLcode result = CURLE_OK; | |
| while(!result && beg < end) | |
| - | result = Curl_dyn_addf(store, "%02x:", (unsigned char) *beg++); |
| + | result = curlx_dyn_addf(store, "%02x:", (unsigned char) *beg++); |
| return result; | |
| } | |
| @@ -344,7 +344,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 curlx_dyn_addf(store, "%s%x", val >= 10 ? "0x" : "", val); |
| } | |
| /* | |
| @@ -387,7 +387,7 @@ utf8asn1str(struct dynbuf *to, int type, const char *from, const char *end) | |
| if(type == CURL_ASN1_UTF8_STRING) { | |
| /* Just copy. */ | |
| if(inlength) | |
| - | result = Curl_dyn_addn(to, from, inlength); |
| + | result = curlx_dyn_addn(to, from, inlength); |
| } | |
| else { | |
| while(!result && (from < end)) { | |
| @@ -426,7 +426,7 @@ utf8asn1str(struct dynbuf *to, int type, const char *from, const char *end) | |
| charsize++; | |
| } | |
| buf[0] = (char) wc; | |
| - | result = Curl_dyn_addn(to, buf, charsize); |
| + | result = curlx_dyn_addn(to, buf, charsize); |
| } | |
| } | |
| return result; | |
| @@ -449,7 +449,7 @@ static CURLcode encodeOID(struct dynbuf *store, | |
| x = y / 40; | |
| y -= x * 40; | |
| - | result = Curl_dyn_addf(store, "%u.%u", x, y); |
| + | result = curlx_dyn_addf(store, "%u.%u", x, y); |
| if(result) | |
| return result; | |
| @@ -462,7 +462,7 @@ static CURLcode encodeOID(struct dynbuf *store, | |
| y = *(const unsigned char *) beg++; | |
| x = (x << 7) | (y & 0x7F); | |
| } while(y & 0x80); | |
| - | result = Curl_dyn_addf(store, ".%u", x); |
| + | result = curlx_dyn_addf(store, ".%u", x); |
| } | |
| return result; | |
| } | |
| @@ -480,16 +480,16 @@ static CURLcode OID2str(struct dynbuf *store, | |
| if(beg < end) { | |
| if(symbolic) { | |
| struct dynbuf buf; | |
| - | Curl_dyn_init(&buf, CURL_X509_STR_MAX); |
| + | curlx_dyn_init(&buf, CURL_X509_STR_MAX); |
| result = encodeOID(&buf, beg, end); | |
| if(!result) { | |
| - | const struct Curl_OID *op = searchOID(Curl_dyn_ptr(&buf)); |
| + | const struct Curl_OID *op = searchOID(curlx_dyn_ptr(&buf)); |
| if(op) | |
| - | result = Curl_dyn_add(store, op->textoid); |
| + | result = curlx_dyn_add(store, op->textoid); |
| else | |
| - | result = Curl_dyn_add(store, Curl_dyn_ptr(&buf)); |
| - | Curl_dyn_free(&buf); |
| + | result = curlx_dyn_add(store, curlx_dyn_ptr(&buf)); |
| + | curlx_dyn_free(&buf); |
| } | |
| } | |
| else | |
| @@ -568,12 +568,12 @@ static CURLcode GTime2str(struct dynbuf *store, | |
| tzl = end - tzp; | |
| } | |
| - | return Curl_dyn_addf(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, |
| - | sep, (int)tzl, tzp); |
| + | return curlx_dyn_addf(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, |
| + | sep, (int)tzl, tzp); |
| } | |
| #ifdef UNITTESTS | |
| @@ -622,10 +622,10 @@ static CURLcode UTime2str(struct dynbuf *store, | |
| tzp++; | |
| tzl = end - tzp; | |
| - | return Curl_dyn_addf(store, "%u%.2s-%.2s-%.2s %.2s:%.2s:%.2s %.*s", |
| - | 20 - (*beg >= '5'), beg, beg + 2, beg + 4, |
| - | beg + 6, beg + 8, sec, |
| - | (int)tzl, tzp); |
| + | return curlx_dyn_addf(store, "%u%.2s-%.2s-%.2s %.2s:%.2s:%.2s %.*s", |
| + | 20 - (*beg >= '5'), beg, beg + 2, beg + 4, |
| + | beg + 6, beg + 8, sec, |
| + | (int)tzl, tzp); |
| } | |
| /* | |
| @@ -658,7 +658,7 @@ static CURLcode ASN1tostr(struct dynbuf *store, | |
| result = octet2str(store, elem->beg, elem->end); | |
| break; | |
| case CURL_ASN1_NULL: | |
| - | result = Curl_dyn_addn(store, "", 1); |
| + | result = curlx_dyn_addn(store, "", 1); |
| break; | |
| case CURL_ASN1_OBJECT_IDENTIFIER: | |
| result = OID2str(store, elem->beg, elem->end, TRUE); | |
| @@ -702,7 +702,7 @@ static CURLcode encodeDN(struct dynbuf *store, struct Curl_asn1Element *dn) | |
| CURLcode result = CURLE_OK; | |
| bool added = FALSE; | |
| struct dynbuf temp; | |
| - | Curl_dyn_init(&temp, CURL_X509_STR_MAX); |
| + | curlx_dyn_init(&temp, CURL_X509_STR_MAX); |
| for(p1 = dn->beg; p1 < dn->end;) { | |
| p1 = getASN1Element(&rdn, p1, dn->end); | |
| @@ -725,12 +725,12 @@ static CURLcode encodeDN(struct dynbuf *store, struct Curl_asn1Element *dn) | |
| result = CURLE_BAD_FUNCTION_ARGUMENT; | |
| goto error; | |
| } | |
| - | Curl_dyn_reset(&temp); |
| + | curlx_dyn_reset(&temp); |
| result = ASN1tostr(&temp, &oid, 0); | |
| if(result) | |
| goto error; | |
| - | str = Curl_dyn_ptr(&temp); |
| + | str = curlx_dyn_ptr(&temp); |
| if(!str) { | |
| result = CURLE_BAD_FUNCTION_ARGUMENT; | |
| @@ -743,20 +743,20 @@ static CURLcode encodeDN(struct dynbuf *store, struct Curl_asn1Element *dn) | |
| ; | |
| if(added) { | |
| if(p3 - str > 2) | |
| - | result = Curl_dyn_addn(store, "/", 1); |
| + | result = curlx_dyn_addn(store, "/", 1); |
| else | |
| - | result = Curl_dyn_addn(store, ", ", 2); |
| + | result = curlx_dyn_addn(store, ", ", 2); |
| if(result) | |
| goto error; | |
| } | |
| /* Encode attribute name. */ | |
| - | result = Curl_dyn_add(store, str); |
| + | result = curlx_dyn_add(store, str); |
| if(result) | |
| goto error; | |
| /* Generate equal sign. */ | |
| - | result = Curl_dyn_addn(store, "=", 1); |
| + | result = curlx_dyn_addn(store, "=", 1); |
| if(result) | |
| goto error; | |
| @@ -764,12 +764,12 @@ static CURLcode encodeDN(struct dynbuf *store, struct Curl_asn1Element *dn) | |
| result = ASN1tostr(store, &value, 0); | |
| if(result) | |
| goto error; | |
| - | Curl_dyn_reset(&temp); |
| + | curlx_dyn_reset(&temp); |
| added = TRUE; /* use separator for next */ | |
| } | |
| } | |
| error: | |
| - | Curl_dyn_free(&temp); |
| + | curlx_dyn_free(&temp); |
| return result; | |
| } | |
| @@ -947,8 +947,8 @@ static CURLcode ssl_push_certinfo_dyn(struct Curl_easy *data, | |
| const char *label, | |
| struct dynbuf *ptr) | |
| { | |
| - | size_t valuelen = Curl_dyn_len(ptr); |
| - | char *value = Curl_dyn_ptr(ptr); |
| + | size_t valuelen = curlx_dyn_len(ptr); |
| + | char *value = curlx_dyn_ptr(ptr); |
| CURLcode result = Curl_ssl_push_certinfo_len(data, certnum, label, | |
| value, valuelen); | |
| @@ -966,7 +966,7 @@ static CURLcode do_pubkey_field(struct Curl_easy *data, int certnum, | |
| CURLcode result; | |
| struct dynbuf out; | |
| - | Curl_dyn_init(&out, CURL_X509_STR_MAX); |
| + | curlx_dyn_init(&out, CURL_X509_STR_MAX); |
| /* Generate a certificate information record for the public key. */ | |
| @@ -974,7 +974,7 @@ static CURLcode do_pubkey_field(struct Curl_easy *data, int certnum, | |
| if(!result) { | |
| if(data->set.ssl.certinfo) | |
| result = ssl_push_certinfo_dyn(data, certnum, label, &out); | |
| - | Curl_dyn_free(&out); |
| + | curlx_dyn_free(&out); |
| } | |
| return result; | |
| } | |
| @@ -1110,7 +1110,7 @@ CURLcode Curl_extract_certinfo(struct Curl_easy *data, | |
| if(certnum) | |
| return CURLE_OK; | |
| - | Curl_dyn_init(&out, CURL_X509_STR_MAX); |
| + | curlx_dyn_init(&out, CURL_X509_STR_MAX); |
| /* Prepare the certificate information for curl_easy_getinfo(). */ | |
| /* Extract the certificate ASN.1 elements. */ | |
| @@ -1126,7 +1126,7 @@ CURLcode Curl_extract_certinfo(struct Curl_easy *data, | |
| if(result) | |
| goto done; | |
| } | |
| - | Curl_dyn_reset(&out); |
| + | curlx_dyn_reset(&out); |
| /* Issuer. */ | |
| result = DNtostr(&out, &cert.issuer); | |
| @@ -1137,20 +1137,20 @@ CURLcode Curl_extract_certinfo(struct Curl_easy *data, | |
| if(result) | |
| goto done; | |
| } | |
| - | Curl_dyn_reset(&out); |
| + | curlx_dyn_reset(&out); |
| /* Version (always fits in less than 32 bits). */ | |
| version = 0; | |
| for(ptr = cert.version.beg; ptr < cert.version.end; ptr++) | |
| version = (version << 8) | *(const unsigned char *) ptr; | |
| if(data->set.ssl.certinfo) { | |
| - | result = Curl_dyn_addf(&out, "%x", version); |
| + | result = curlx_dyn_addf(&out, "%x", version); |
| if(result) | |
| goto done; | |
| result = ssl_push_certinfo_dyn(data, certnum, "Version", &out); | |
| if(result) | |
| goto done; | |
| - | Curl_dyn_reset(&out); |
| + | curlx_dyn_reset(&out); |
| } | |
| /* Serial number. */ | |
| @@ -1162,7 +1162,7 @@ CURLcode Curl_extract_certinfo(struct Curl_easy *data, | |
| if(result) | |
| goto done; | |
| } | |
| - | Curl_dyn_reset(&out); |
| + | curlx_dyn_reset(&out); |
| /* Signature algorithm .*/ | |
| result = dumpAlgo(&out, ¶m, cert.signatureAlgorithm.beg, | |
| @@ -1175,7 +1175,7 @@ CURLcode Curl_extract_certinfo(struct Curl_easy *data, | |
| if(result) | |
| goto done; | |
| } | |
| - | Curl_dyn_reset(&out); |
| + | curlx_dyn_reset(&out); |
| /* Start Date. */ | |
| result = ASN1tostr(&out, &cert.notBefore, 0); | |
| @@ -1186,7 +1186,7 @@ CURLcode Curl_extract_certinfo(struct Curl_easy *data, | |
| if(result) | |
| goto done; | |
| } | |
| - | Curl_dyn_reset(&out); |
| + | curlx_dyn_reset(&out); |
| /* Expire Date. */ | |
| result = ASN1tostr(&out, &cert.notAfter, 0); | |
| @@ -1197,7 +1197,7 @@ CURLcode Curl_extract_certinfo(struct Curl_easy *data, | |
| if(result) | |
| goto done; | |
| } | |
| - | Curl_dyn_reset(&out); |
| + | curlx_dyn_reset(&out); |
| /* Public Key Algorithm. */ | |
| result = dumpAlgo(&out, ¶m, cert.subjectPublicKeyAlgorithm.beg, | |
| @@ -1211,13 +1211,13 @@ CURLcode Curl_extract_certinfo(struct Curl_easy *data, | |
| goto done; | |
| } | |
| - | rc = do_pubkey(data, certnum, Curl_dyn_ptr(&out), |
| + | rc = do_pubkey(data, certnum, curlx_dyn_ptr(&out), |
| ¶m, &cert.subjectPublicKey); | |
| if(rc) { | |
| result = CURLE_OUT_OF_MEMORY; /* the most likely error */ | |
| goto done; | |
| } | |
| - | Curl_dyn_reset(&out); |
| + | curlx_dyn_reset(&out); |
| /* Signature. */ | |
| result = ASN1tostr(&out, &cert.signature, 0); | |
| @@ -1228,12 +1228,12 @@ CURLcode Curl_extract_certinfo(struct Curl_easy *data, | |
| if(result) | |
| goto done; | |
| } | |
| - | Curl_dyn_reset(&out); |
| + | curlx_dyn_reset(&out); |
| /* Generate PEM certificate. */ | |
| - | result = Curl_base64_encode(cert.certificate.beg, |
| - | cert.certificate.end - cert.certificate.beg, |
| - | &certptr, &clen); |
| + | result = curlx_base64_encode(cert.certificate.beg, |
| + | cert.certificate.end - cert.certificate.beg, |
| + | &certptr, &clen); |
| if(result) | |
| goto done; | |
| @@ -1246,22 +1246,22 @@ CURLcode Curl_extract_certinfo(struct Curl_easy *data, | |
| -----END CERTIFICATE-----\n | |
| */ | |
| - | Curl_dyn_reset(&out); |
| + | curlx_dyn_reset(&out); |
| /* Build the certificate string. */ | |
| - | result = Curl_dyn_add(&out, "-----BEGIN CERTIFICATE-----\n"); |
| + | result = curlx_dyn_add(&out, "-----BEGIN CERTIFICATE-----\n"); |
| if(!result) { | |
| size_t j = 0; | |
| while(!result && (j < clen)) { | |
| size_t chunksize = (clen - j) > 64 ? 64 : (clen - j); | |
| - | result = Curl_dyn_addn(&out, &certptr[j], chunksize); |
| + | result = curlx_dyn_addn(&out, &certptr[j], chunksize); |
| if(!result) | |
| - | result = Curl_dyn_addn(&out, "\n", 1); |
| + | result = curlx_dyn_addn(&out, "\n", 1); |
| j += chunksize; | |
| } | |
| if(!result) | |
| - | result = Curl_dyn_add(&out, "-----END CERTIFICATE-----\n"); |
| + | result = curlx_dyn_add(&out, "-----END CERTIFICATE-----\n"); |
| } | |
| free(certptr); | |
| if(!result) | |
| @@ -1271,7 +1271,7 @@ CURLcode Curl_extract_certinfo(struct Curl_easy *data, | |
| done: | |
| if(result) | |
| failf(data, "Failed extracting certificate chain"); | |
| - | Curl_dyn_free(&out); |
| + | curlx_dyn_free(&out); |
| return result; | |
| } | |
| @@ -29,9 +29,9 @@ | |
| #include "urldata.h" | |
| #include "url.h" | |
| #include "bufq.h" | |
| - | #include "dynbuf.h" |
| + | #include "curlx/dynbuf.h" |
| #include "rand.h" | |
| - | #include "curl_base64.h" |
| + | #include "curlx/base64.h" |
| #include "connect.h" | |
| #include "sendf.h" | |
| #include "multiif.h" | |
| @@ -40,7 +40,7 @@ | |
| #include "transfer.h" | |
| #include "select.h" | |
| #include "nonblock.h" | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -851,7 +851,7 @@ CURLcode Curl_ws_request(struct Curl_easy *data, struct dynbuf *req) | |
| result = Curl_rand(data, (unsigned char *)rand, sizeof(rand)); | |
| if(result) | |
| return result; | |
| - | result = Curl_base64_encode((char *)rand, sizeof(rand), &randstr, &randlen); |
| + | result = curlx_base64_encode((char *)rand, sizeof(rand), &randstr, &randlen); |
| if(result) | |
| return result; | |
| DEBUGASSERT(randlen < sizeof(keyval)); | |
| @@ -863,8 +863,8 @@ CURLcode Curl_ws_request(struct Curl_easy *data, struct dynbuf *req) | |
| free(randstr); | |
| for(i = 0; !result && (i < CURL_ARRAYSIZE(heads)); i++) { | |
| if(!Curl_checkheaders(data, heads[i].name, strlen(heads[i].name))) { | |
| - | result = Curl_dyn_addf(req, "%s: %s\r\n", heads[i].name, |
| - | heads[i].val); |
| + | result = curlx_dyn_addf(req, "%s: %s\r\n", heads[i].name, |
| + | heads[i].val); |
| } | |
| } | |
| k->upgr101 = UPGR101_WS; | |
| @@ -905,7 +905,7 @@ CURLcode Curl_ws_accept(struct Curl_easy *data, | |
| const char *p = getenv("CURL_WS_CHUNK_SIZE"); | |
| if(p) { | |
| curl_off_t l; | |
| - | if(!Curl_str_number(&p, &l, 1*1024*1024)) |
| + | if(!curlx_str_number(&p, &l, 1*1024*1024)) |
| chunk_size = (size_t)l; | |
| } | |
| } | |
| @@ -1164,7 +1164,7 @@ static CURLcode ws_flush(struct Curl_easy *data, struct websocket *ws, | |
| const char *p = getenv("CURL_WS_CHUNK_EAGAIN"); | |
| if(p) { | |
| curl_off_t l; | |
| - | if(!Curl_str_number(&p, &l, 1*1024*1024)) |
| + | if(!curlx_str_number(&p, &l, 1*1024*1024)) |
| chunk_egain = (size_t)l; | |
| } | |
| #endif | |
| @@ -1984,6 +1984,7 @@ | |
| </ItemDefinitionGroup> | |
| <ItemGroup> | |
| CURL_LIB_C_FILES | |
| + | CURL_LIB_CURLX_C_FILES |
| CURL_LIB_VAUTH_C_FILES | |
| CURL_LIB_VQUIC_C_FILES | |
| CURL_LIB_VSSH_C_FILES | |
| @@ -1991,6 +1992,7 @@ CURL_LIB_VTLS_C_FILES | |
| </ItemGroup> | |
| <ItemGroup> | |
| CURL_LIB_H_FILES | |
| + | CURL_LIB_CURLX_H_FILES |
| CURL_LIB_VAUTH_H_FILES | |
| CURL_LIB_VQUIC_H_FILES | |
| CURL_LIB_VSSH_H_FILES | |
| @@ -791,7 +791,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -821,7 +821,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -850,7 +850,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -880,7 +880,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -908,7 +908,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -940,7 +940,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -971,7 +971,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1003,7 +1003,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1034,7 +1034,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1066,7 +1066,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1097,7 +1097,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1128,7 +1128,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1160,7 +1160,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1192,7 +1192,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1224,7 +1224,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1254,7 +1254,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1283,7 +1283,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1312,7 +1312,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1342,7 +1342,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1372,7 +1372,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1400,7 +1400,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1432,7 +1432,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1464,7 +1464,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1494,7 +1494,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1522,7 +1522,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1554,7 +1554,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1586,7 +1586,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1616,7 +1616,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1644,7 +1644,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1676,7 +1676,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1708,7 +1708,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1738,7 +1738,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1766,7 +1766,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1798,7 +1798,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1830,7 +1830,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1860,7 +1860,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1888,7 +1888,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1920,7 +1920,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1952,7 +1952,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1982,7 +1982,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -2010,7 +2010,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -2041,7 +2041,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -2073,7 +2073,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -2105,7 +2105,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -2137,7 +2137,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -2166,7 +2166,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -2196,7 +2196,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -2226,7 +2226,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -2247,10 +2247,12 @@ | |
| </Link> | |
| </ItemDefinitionGroup> | |
| <ItemGroup> | |
| + | CURL_LIB_CURLX_C_FILES |
| CURL_SRC_X_C_FILES | |
| CURL_SRC_C_FILES | |
| </ItemGroup> | |
| <ItemGroup> | |
| + | CURL_LIB_CURLX_H_FILES |
| CURL_SRC_X_H_FILES | |
| CURL_SRC_H_FILES | |
| </ItemGroup> | |
| @@ -2032,6 +2032,7 @@ | |
| </ItemDefinitionGroup> | |
| <ItemGroup> | |
| CURL_LIB_C_FILES | |
| + | CURL_LIB_CURLX_C_FILES |
| CURL_LIB_VAUTH_C_FILES | |
| CURL_LIB_VQUIC_C_FILES | |
| CURL_LIB_VSSH_C_FILES | |
| @@ -2039,6 +2040,7 @@ CURL_LIB_VTLS_C_FILES | |
| </ItemGroup> | |
| <ItemGroup> | |
| CURL_LIB_H_FILES | |
| + | CURL_LIB_CURLX_H_FILES |
| CURL_LIB_VAUTH_H_FILES | |
| CURL_LIB_VQUIC_H_FILES | |
| CURL_LIB_VSSH_H_FILES | |
| @@ -839,7 +839,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -869,7 +869,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -898,7 +898,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -928,7 +928,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -956,7 +956,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -988,7 +988,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1019,7 +1019,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1051,7 +1051,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1082,7 +1082,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1114,7 +1114,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1145,7 +1145,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1176,7 +1176,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1208,7 +1208,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1240,7 +1240,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1272,7 +1272,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1302,7 +1302,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1331,7 +1331,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1360,7 +1360,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1390,7 +1390,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1420,7 +1420,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1448,7 +1448,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1480,7 +1480,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1512,7 +1512,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1542,7 +1542,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1570,7 +1570,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1602,7 +1602,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1634,7 +1634,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1664,7 +1664,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1692,7 +1692,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1724,7 +1724,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1756,7 +1756,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1786,7 +1786,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1814,7 +1814,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1846,7 +1846,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1878,7 +1878,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1908,7 +1908,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1936,7 +1936,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1968,7 +1968,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -2000,7 +2000,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -2030,7 +2030,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -2058,7 +2058,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -2089,7 +2089,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -2121,7 +2121,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -2153,7 +2153,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -2185,7 +2185,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -2214,7 +2214,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -2244,7 +2244,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -2274,7 +2274,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -2295,10 +2295,12 @@ | |
| </Link> | |
| </ItemDefinitionGroup> | |
| <ItemGroup> | |
| + | CURL_LIB_CURLX_C_FILES |
| CURL_SRC_X_C_FILES | |
| CURL_SRC_C_FILES | |
| </ItemGroup> | |
| <ItemGroup> | |
| + | CURL_LIB_CURLX_H_FILES |
| CURL_SRC_X_H_FILES | |
| CURL_SRC_H_FILES | |
| </ItemGroup> | |
| @@ -2032,6 +2032,7 @@ | |
| </ItemDefinitionGroup> | |
| <ItemGroup> | |
| CURL_LIB_C_FILES | |
| + | CURL_LIB_CURLX_C_FILES |
| CURL_LIB_VAUTH_C_FILES | |
| CURL_LIB_VQUIC_C_FILES | |
| CURL_LIB_VSSH_C_FILES | |
| @@ -2039,6 +2040,7 @@ CURL_LIB_VTLS_C_FILES | |
| </ItemGroup> | |
| <ItemGroup> | |
| CURL_LIB_H_FILES | |
| + | CURL_LIB_CURLX_H_FILES |
| CURL_LIB_VAUTH_H_FILES | |
| CURL_LIB_VQUIC_H_FILES | |
| CURL_LIB_VSSH_H_FILES | |
| @@ -839,7 +839,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -869,7 +869,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -898,7 +898,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -928,7 +928,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -956,7 +956,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -988,7 +988,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1019,7 +1019,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1051,7 +1051,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1082,7 +1082,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1114,7 +1114,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1145,7 +1145,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1176,7 +1176,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1208,7 +1208,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1240,7 +1240,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1272,7 +1272,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1302,7 +1302,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1331,7 +1331,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1360,7 +1360,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1390,7 +1390,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1420,7 +1420,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1448,7 +1448,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1480,7 +1480,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1512,7 +1512,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1542,7 +1542,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1570,7 +1570,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1602,7 +1602,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1634,7 +1634,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1664,7 +1664,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1692,7 +1692,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1724,7 +1724,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1756,7 +1756,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1786,7 +1786,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1814,7 +1814,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1846,7 +1846,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1878,7 +1878,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1908,7 +1908,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -1936,7 +1936,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -1968,7 +1968,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -2000,7 +2000,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -2030,7 +2030,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -2058,7 +2058,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -2089,7 +2089,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -2121,7 +2121,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -2153,7 +2153,7 @@ | |
| </Midl> | |
| <ClCompile> | |
| <Optimization>Disabled</Optimization> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>_DEBUG;_CONSOLE;DEBUGBUILD;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <MinimalRebuild>true</MinimalRebuild> | |
| <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
| @@ -2185,7 +2185,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -2214,7 +2214,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -2244,7 +2244,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -2274,7 +2274,7 @@ | |
| <ClCompile> | |
| <Optimization>MaxSpeed</Optimization> | |
| <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
| - | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| + | <AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\lib;..\..\..\..\lib\curlx;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| <PreprocessorDefinitions>NDEBUG;_CONSOLE;CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <StringPooling>true</StringPooling> | |
| <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
| @@ -2295,10 +2295,12 @@ | |
| </Link> | |
| </ItemDefinitionGroup> | |
| <ItemGroup> | |
| + | CURL_LIB_CURLX_C_FILES |
| CURL_SRC_X_C_FILES | |
| CURL_SRC_C_FILES | |
| </ItemGroup> | |
| <ItemGroup> | |
| + | CURL_LIB_CURLX_H_FILES |
| CURL_SRC_X_H_FILES | |
| CURL_SRC_H_FILES | |
| </ItemGroup> | |
| @@ -153,28 +153,18 @@ rem | |
| ) else if "!var!" == "CURL_SRC_RC_FILES" ( | |
| for /f "delims=" %%r in ('dir /b ..\src\*.rc') do call :element %1 src "%%r" %3 | |
| ) else if "!var!" == "CURL_SRC_X_C_FILES" ( | |
| - | call :element %1 lib "strparse.c" %3 |
| call :element %1 lib "strcase.c" %3 | |
| - | call :element %1 lib "timeval.c" %3 |
| call :element %1 lib "nonblock.c" %3 | |
| - | call :element %1 lib "warnless.c" %3 |
| call :element %1 lib "curl_multibyte.c" %3 | |
| call :element %1 lib "version_win32.c" %3 | |
| - | call :element %1 lib "dynbuf.c" %3 |
| - | call :element %1 lib "base64.c" %3 |
| ) else if "!var!" == "CURL_SRC_X_H_FILES" ( | |
| call :element %1 lib "config-win32.h" %3 | |
| call :element %1 lib "curl_setup.h" %3 | |
| - | call :element %1 lib "strparse.h" %3 |
| call :element %1 lib "strcase.h" %3 | |
| - | call :element %1 lib "timeval.h" %3 |
| call :element %1 lib "nonblock.h" %3 | |
| - | call :element %1 lib "warnless.h" %3 |
| call :element %1 lib "curl_ctype.h" %3 | |
| call :element %1 lib "curl_multibyte.h" %3 | |
| call :element %1 lib "version_win32.h" %3 | |
| - | call :element %1 lib "dynbuf.h" %3 |
| - | call :element %1 lib "curl_base64.h" %3 |
| ) else if "!var!" == "CURL_LIB_C_FILES" ( | |
| for /f "delims=" %%c in ('dir /b ..\lib\*.c') do call :element %1 lib "%%c" %3 | |
| ) else if "!var!" == "CURL_LIB_H_FILES" ( | |
| @@ -182,6 +172,10 @@ rem | |
| for /f "delims=" %%h in ('dir /b ..\lib\*.h') do call :element %1 lib "%%h" %3 | |
| ) else if "!var!" == "CURL_LIB_RC_FILES" ( | |
| for /f "delims=" %%r in ('dir /b ..\lib\*.rc') do call :element %1 lib "%%r" %3 | |
| + | ) else if "!var!" == "CURL_LIB_CURLX_C_FILES" ( |
| + | for /f "delims=" %%c in ('dir /b ..\lib\curlx\*.c') do call :element %1 lib\curlx "%%c" %3 |
| + | ) else if "!var!" == "CURL_LIB_CURLX_H_FILES" ( |
| + | for /f "delims=" %%h in ('dir /b ..\lib\curlx\*.h') do call :element %1 lib\curlx "%%h" %3 |
| ) else if "!var!" == "CURL_LIB_VAUTH_C_FILES" ( | |
| for /f "delims=" %%c in ('dir /b ..\lib\vauth\*.c') do call :element %1 lib\vauth "%%c" %3 | |
| ) else if "!var!" == "CURL_LIB_VAUTH_H_FILES" ( | |
| @@ -223,6 +217,8 @@ rem | |
| set "TABS= " | |
| ) else if "%2" == "lib\vtls" ( | |
| set "TABS= " | |
| + | ) else if "%2" == "lib\curlx" ( |
| + | set "TABS= " |
| ) else ( | |
| set "TABS= " | |
| ) | |
| @@ -65,7 +65,7 @@ if(CURL_CA_EMBED_SET) | |
| endif() | |
| endif() | |
| - | # Get 'CURL_CFILES', 'CURLX_CFILES', 'CURL_HFILES', 'CURLTOOL_LIBCURL_CFILES' variables |
| + | # Get 'CURL_CFILES', 'CURLX_CFILES', 'CURL_HFILES' variables |
| curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") | |
| include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") | |
| @@ -74,12 +74,13 @@ if(WIN32) | |
| endif() | |
| if(BUILD_STATIC_CURL) | |
| - | set(CURLX_CFILES ${CURLTOOL_LIBCURL_CFILES}) |
| + | set(CURLX_CFILES "") |
| endif() | |
| set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES | |
| "${PROJECT_BINARY_DIR}/lib" # for "curl_config.h" | |
| "${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h" | |
| + | "${PROJECT_SOURCE_DIR}/lib/curlx" # for curlx functions |
| # This is needed as tool_hugehelp.c is generated in the binary dir | |
| "${PROJECT_SOURCE_DIR}/src" # for "tool_hugehelp.h" | |
| ) | |
| @@ -102,7 +103,7 @@ add_library( | |
| curltool # special libcurltool library just for unittests | |
| STATIC | |
| EXCLUDE_FROM_ALL | |
| - | ${CURL_CFILES} ${CURLTOOL_LIBCURL_CFILES} ${CURL_HFILES} |
| + | ${CURL_CFILES} ${CURL_HFILES} |
| ) | |
| target_compile_definitions(curltool PUBLIC "CURL_STATICLIB" "UNITTESTS") | |
| target_link_libraries(curltool PRIVATE ${CURL_LIBS}) | |
| @@ -44,6 +44,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \ | |
| -I$(top_builddir)/lib \ | |
| -I$(top_builddir)/src \ | |
| -I$(top_srcdir)/lib \ | |
| + | -I$(top_srcdir)/lib/curlx \ |
| -I$(top_srcdir)/src | |
| bin_PROGRAMS = curl | |
| @@ -74,7 +75,7 @@ CLEANFILES = | |
| if USE_UNITY | |
| if USE_CPPFLAG_CURL_STATICLIB | |
| - | curl_CURLX = $(CURLTOOL_LIBCURL_CFILES) |
| + | curl_CURLX = |
| else | |
| curl_CURLX = $(CURLX_CFILES) | |
| endif | |
| @@ -110,8 +111,8 @@ libcurltool_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS | |
| libcurltool_la_CFLAGS = | |
| libcurltool_la_LDFLAGS = -static $(LINKFLAGS) | |
| if USE_UNITY | |
| - | libcurltool_unity.c: $(top_srcdir)/scripts/mk-unity.pl $(CURL_CFILES) $(CURLTOOL_LIBCURL_CFILES) |
| - | @PERL@ $(top_srcdir)/scripts/mk-unity.pl $(srcdir) $(CURL_CFILES) $(CURLTOOL_LIBCURL_CFILES) > libcurltool_unity.c |
| + | libcurltool_unity.c: $(top_srcdir)/scripts/mk-unity.pl $(CURL_CFILES) $(curl_CURLX) |
| + | @PERL@ $(top_srcdir)/scripts/mk-unity.pl $(srcdir) $(CURL_CFILES) $(curl_CURLX) > libcurltool_unity.c |
| nodist_libcurltool_la_SOURCES = libcurltool_unity.c | |
| libcurltool_la_SOURCES = | |
| @@ -29,38 +29,32 @@ | |
| # CSRC2 = file4.c file5.c file6.c | |
| # CSOURCES = $(CSRC1) $(CSRC2) | |
| - | # libcurl sources to include in curltool lib we use for test binaries |
| - | CURLTOOL_LIBCURL_CFILES = \ |
| - | ../lib/base64.c \ |
| - | ../lib/dynbuf.c \ |
| - | ../lib/timeval.c |
| - | |
| # libcurl has sources that provide functions named curlx_* that are not part of | |
| # the official API, but we reuse the code here to avoid duplication. | |
| CURLX_CFILES = \ | |
| - | ../lib/base64.c \ |
| + | ../lib/curlx/base64.c \ |
| ../lib/curl_multibyte.c \ | |
| - | ../lib/dynbuf.c \ |
| + | ../lib/curlx/dynbuf.c \ |
| ../lib/nonblock.c \ | |
| - | ../lib/strparse.c \ |
| + | ../lib/curlx/strparse.c \ |
| ../lib/strcase.c \ | |
| - | ../lib/timediff.c \ |
| - | ../lib/timeval.c \ |
| + | ../lib/curlx/timediff.c \ |
| + | ../lib/curlx/timeval.c \ |
| ../lib/version_win32.c \ | |
| - | ../lib/warnless.c |
| + | ../lib/curlx/warnless.c |
| CURLX_HFILES = \ | |
| ../lib/curl_ctype.h \ | |
| ../lib/curl_multibyte.h \ | |
| ../lib/curl_setup.h \ | |
| - | ../lib/dynbuf.h \ |
| + | ../lib/curlx/dynbuf.h \ |
| ../lib/nonblock.h \ | |
| - | ../lib/strparse.h \ |
| + | ../lib/curlx/strparse.h \ |
| ../lib/strcase.h \ | |
| - | ../lib/timediff.h \ |
| - | ../lib/timeval.h \ |
| + | ../lib/curlx/timediff.h \ |
| + | ../lib/curlx/timeval.h \ |
| ../lib/version_win32.h \ | |
| - | ../lib/warnless.h |
| + | ../lib/curlx/warnless.h |
| CURL_CFILES = \ | |
| slist_wc.c \ | |
| @@ -28,9 +28,8 @@ | |
| #endif | |
| #include "terminal.h" | |
| - | #include "curlx.h" |
| - | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <curlx.h> |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| #ifdef HAVE_TERMIOS_H | |
| # include <termios.h> | |
| @@ -23,14 +23,14 @@ | |
| ***************************************************************************/ | |
| #include "tool_setup.h" | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_msgs.h" | |
| #include "tool_cb_dbg.h" | |
| #include "tool_util.h" | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| static void dump(const char *timebuf, const char *idsbuf, const char *text, | |
| FILE *stream, const unsigned char *ptr, size_t size, | |
| @@ -23,12 +23,11 @@ | |
| ***************************************************************************/ | |
| #include "tool_setup.h" | |
| - | #include "strcase.h" |
| #ifdef HAVE_UNISTD_H | |
| #include <unistd.h> | |
| #endif | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_doswin.h" | |
| @@ -38,7 +37,7 @@ | |
| #include "tool_operate.h" | |
| #include "tool_libinfo.h" | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| static char *parse_filename(const char *ptr, size_t len); | |
| @@ -23,7 +23,7 @@ | |
| ***************************************************************************/ | |
| #include "tool_setup.h" | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_cb_prg.h" | |
| @@ -31,7 +31,7 @@ | |
| #include "tool_operate.h" | |
| #include "terminal.h" | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| #define MAX_BARLENGTH 400 | |
| #define MIN_BARLENGTH 20 | |
| @@ -27,7 +27,7 @@ | |
| #include <sys/select.h> | |
| #endif | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_cb_rea.h" | |
| @@ -36,7 +36,7 @@ | |
| #include "tool_msgs.h" | |
| #include "tool_sleep.h" | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| /* | |
| ** callback for CURLOPT_READFUNCTION | |
| @@ -23,13 +23,13 @@ | |
| ***************************************************************************/ | |
| #include "tool_setup.h" | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_operate.h" | |
| #include "tool_cb_see.h" | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| /* | |
| ** callback for CURLOPT_SEEKFUNCTION | |
| @@ -30,14 +30,14 @@ | |
| #include <sys/stat.h> | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_msgs.h" | |
| #include "tool_cb_wrt.h" | |
| #include "tool_operate.h" | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| #ifdef _WIN32 | |
| #define OPENMODE S_IREAD | S_IWRITE | |
| @@ -27,9 +27,8 @@ | |
| #include "tool_formparse.h" | |
| #include "tool_paramhlp.h" | |
| #include "tool_main.h" | |
| - | #include "curlx.h" |
| - | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <curlx.h> |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| void config_init(struct OperationConfig *config) | |
| { | |
| @@ -23,6 +23,8 @@ | |
| * SPDX-License-Identifier: curl | |
| * | |
| ***************************************************************************/ | |
| + | |
| + | #include <curl/mprintf.h> |
| #include "tool_setup.h" | |
| #include "tool_sdecls.h" | |
| #include "tool_urlglob.h" | |
| @@ -37,6 +39,26 @@ | |
| #endif | |
| #endif | |
| + | /* make the tool use the libcurl *printf family */ |
| + | # undef printf |
| + | # undef fprintf |
| + | # undef msnprintf |
| + | # undef vprintf |
| + | # undef vfprintf |
| + | # undef mvsnprintf |
| + | # undef aprintf |
| + | # undef vaprintf |
| + | # define printf curl_mprintf |
| + | # define fprintf curl_mfprintf |
| + | # define msnprintf curl_msnprintf |
| + | # define vprintf curl_mvprintf |
| + | # define vfprintf curl_mvfprintf |
| + | # define mvsnprintf curl_mvsnprintf |
| + | # define aprintf curl_maprintf |
| + | # define vaprintf curl_mvaprintf |
| + | |
| + | #define checkprefix(a,b) curl_strnequal(b, STRCONST(a)) |
| + | |
| struct GlobalConfig; | |
| struct State { | |
| @@ -55,7 +77,7 @@ struct State { | |
| struct OperationConfig { | |
| struct State state; /* for create_transfer() */ | |
| - | struct curlx_dynbuf postdata; |
| + | struct dynbuf postdata; |
| char *useragent; | |
| struct curl_slist *cookies; /* cookies to serialize into a single line */ | |
| char *cookiejar; /* write to this file */ | |
| @@ -29,13 +29,12 @@ | |
| # include <direct.h> | |
| #endif | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "tool_dirhie.h" | |
| #include "tool_msgs.h" | |
| - | #include "dynbuf.h" |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| #if defined(_WIN32) || (defined(MSDOS) && !defined(__DJGPP__)) | |
| # define mkdir(x,y) (mkdir)((x)) | |
| @@ -99,7 +98,7 @@ CURLcode create_dir_hierarchy(const char *outfile, struct GlobalConfig *global) | |
| { | |
| CURLcode result = CURLE_OK; | |
| size_t outlen = strlen(outfile); | |
| - | struct curlx_dynbuf dirbuf; |
| + | struct dynbuf dirbuf; |
| curlx_dyn_init(&dirbuf, outlen + 1); | |
| @@ -39,8 +39,8 @@ | |
| #include "tool_bname.h" | |
| #include "tool_doswin.h" | |
| - | #include "curlx.h" |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <curlx.h> |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| #ifdef _WIN32 | |
| # undef PATH_MAX | |
| @@ -27,13 +27,13 @@ | |
| #ifndef CURL_DISABLE_LIBCURL_OPTION | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_easysrc.h" | |
| #include "tool_msgs.h" | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| /* global variable definitions, for easy-interface source code generation */ | |
| @@ -24,7 +24,7 @@ | |
| #include "tool_filetime.h" | |
| #include "tool_cfgable.h" | |
| #include "tool_msgs.h" | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #ifdef HAVE_UTIME_H | |
| # include <utime.h> | |
| @@ -39,6 +39,7 @@ | |
| #include <curlx.h> | |
| #include "tool_findfile.h" | |
| + | #include "tool_cfgable.h" |
| #include "memdebug.h" /* keep this as LAST include */ | |
| @@ -23,9 +23,7 @@ | |
| ***************************************************************************/ | |
| #include "tool_setup.h" | |
| - | #include "strcase.h" |
| - | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_msgs.h" | |
| @@ -34,7 +32,7 @@ | |
| #include "tool_paramhlp.h" | |
| #include "tool_formparse.h" | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| /* tool_mime functions. */ | |
| static struct tool_mime *tool_mime_new(struct tool_mime *parent, | |
| @@ -23,10 +23,7 @@ | |
| ***************************************************************************/ | |
| #include "tool_setup.h" | |
| - | #include "strcase.h" |
| - | |
| - | #include "curlx.h" |
| - | |
| + | #include <curlx.h> |
| #include "tool_binmode.h" | |
| #include "tool_cfgable.h" | |
| #include "tool_cb_prg.h" | |
| @@ -39,11 +36,10 @@ | |
| #include "tool_paramhlp.h" | |
| #include "tool_parsecfg.h" | |
| #include "tool_main.h" | |
| - | #include "dynbuf.h" |
| #include "tool_stderr.h" | |
| #include "var.h" | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| #define ALLOW_BLANK TRUE | |
| #define DENY_BLANK FALSE | |
| @@ -668,7 +664,7 @@ static ParameterError data_urlencode(struct GlobalConfig *global, | |
| char *n; | |
| replace_url_encoded_space_by_plus(enc); | |
| if(nlen > 0) { /* only append '=' if we have a name */ | |
| - | struct curlx_dynbuf dyn; |
| + | struct dynbuf dyn; |
| curlx_dyn_init(&dyn, MAX_DATAURLENCODE); | |
| if(curlx_dyn_addn(&dyn, nextarg, nlen) || | |
| curlx_dyn_addn(&dyn, "=", 1) || | |
| @@ -740,17 +736,17 @@ static CURLcode set_trace_config(struct GlobalConfig *global, | |
| break; | |
| } | |
| - | if((len == 3) && strncasecompare(name, "all", 3)) { |
| + | if((len == 3) && curl_strnequal(name, "all", 3)) { |
| global->traceids = toggle; | |
| global->tracetime = toggle; | |
| result = curl_global_trace(token); | |
| if(result) | |
| goto out; | |
| } | |
| - | else if((len == 3) && strncasecompare(name, "ids", 3)) { |
| + | else if((len == 3) && curl_strnequal(name, "ids", 3)) { |
| global->traceids = toggle; | |
| } | |
| - | else if((len == 4) && strncasecompare(name, "time", 4)) { |
| + | else if((len == 4) && curl_strnequal(name, "time", 4)) { |
| global->tracetime = toggle; | |
| } | |
| else { | |
| @@ -853,7 +849,7 @@ static ParameterError url_query(const char *nextarg, | |
| size_t size = 0; | |
| ParameterError err = PARAM_OK; | |
| char *query; | |
| - | struct curlx_dynbuf dyn; |
| + | struct dynbuf dyn; |
| curlx_dyn_init(&dyn, MAX_QUERY_LEN); | |
| if(*nextarg == '+') { | |
| @@ -1093,7 +1089,7 @@ static ParameterError parse_url(struct GlobalConfig *global, | |
| { | |
| if(nextarg && (nextarg[0] == '@')) { | |
| /* read URLs from a file, treat all as -O */ | |
| - | struct curlx_dynbuf line; |
| + | struct dynbuf line; |
| ParameterError err = PARAM_OK; | |
| bool error = FALSE; | |
| bool fromstdin = !strcmp("-", &nextarg[1]); | |
| @@ -1199,11 +1195,11 @@ static ParameterError parse_ech(struct GlobalConfig *global, | |
| ParameterError err = PARAM_OK; | |
| if(!feature_ech) | |
| err = PARAM_LIBCURL_DOESNT_SUPPORT; | |
| - | else if(strlen(nextarg) > 4 && strncasecompare("pn:", nextarg, 3)) { |
| + | else if(strlen(nextarg) > 4 && curl_strnequal("pn:", nextarg, 3)) { |
| /* a public_name */ | |
| err = getstr(&config->ech_public, nextarg, DENY_BLANK); | |
| } | |
| - | else if(strlen(nextarg) > 5 && strncasecompare("ecl:", nextarg, 4)) { |
| + | else if(strlen(nextarg) > 5 && curl_strnequal("ecl:", nextarg, 4)) { |
| /* an ECHConfigList */ | |
| if('@' != *(nextarg + 4)) { | |
| err = getstr(&config->ech_config, nextarg, DENY_BLANK); | |
| @@ -1744,7 +1740,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ | |
| goto error; | |
| } | |
| else if(expand && nextarg) { | |
| - | struct curlx_dynbuf nbuf; |
| + | struct dynbuf nbuf; |
| bool replaced; | |
| if((ARGTYPE(a->desc) != ARG_STRG) && | |
| @@ -23,7 +23,7 @@ | |
| ***************************************************************************/ | |
| #include "tool_setup.h" | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "tool_help.h" | |
| #include "tool_libinfo.h" | |
| @@ -32,9 +32,10 @@ | |
| #include "tool_cb_prg.h" | |
| #include "tool_hugehelp.h" | |
| #include "tool_getparam.h" | |
| + | #include "tool_cfgable.h" |
| #include "terminal.h" | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| struct category_descriptors { | |
| const char *opt; | |
| @@ -23,16 +23,13 @@ | |
| ***************************************************************************/ | |
| #include "tool_setup.h" | |
| - | #include "strcase.h" |
| - | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_msgs.h" | |
| #include "tool_getparam.h" | |
| #include "tool_helpers.h" | |
| - | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| /* | |
| ** Helper functions that are used from more than one source file. | |
| @@ -24,14 +24,12 @@ | |
| #include "tool_setup.h" | |
| #ifndef CURL_DISABLE_IPFS | |
| - | #include "curlx.h" |
| - | #include "dynbuf.h" |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_msgs.h" | |
| #include "tool_ipfs.h" | |
| - | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| /* ensure input ends in slash */ | |
| static CURLcode ensure_trailing_slash(char **input) | |
| @@ -39,7 +37,7 @@ static CURLcode ensure_trailing_slash(char **input) | |
| if(*input && **input) { | |
| size_t len = strlen(*input); | |
| if(((*input)[len - 1] != '/')) { | |
| - | struct curlx_dynbuf dyn; |
| + | struct dynbuf dyn; |
| curlx_dyn_init(&dyn, len + 2); | |
| if(curlx_dyn_addn(&dyn, *input, len)) { | |
| @@ -96,7 +94,7 @@ static char *ipfs_gateway(void) | |
| if(gateway_file) { | |
| int c; | |
| - | struct curlx_dynbuf dyn; |
| + | struct dynbuf dyn; |
| curlx_dyn_init(&dyn, MAX_GATEWAY_URL_LEN); | |
| /* get the first line of the gateway file, ignore the rest */ | |
| @@ -23,13 +23,9 @@ | |
| ***************************************************************************/ | |
| #include "tool_setup.h" | |
| - | #include "strcase.h" |
| - | |
| - | #include "curlx.h" |
| - | |
| + | #include <curlx.h> |
| #include "tool_libinfo.h" | |
| - | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| /* global variable definitions, for libcurl runtime info */ | |
| @@ -37,7 +37,7 @@ | |
| #include <fcntl.h> | |
| #endif | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_doswin.h" | |
| @@ -53,7 +53,7 @@ | |
| * the library level code from this client-side is ugly, but we do this | |
| * anyway for convenience. | |
| */ | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| #ifdef __VMS | |
| /* | |
| @@ -23,14 +23,14 @@ | |
| ***************************************************************************/ | |
| #include "tool_setup.h" | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_msgs.h" | |
| #include "tool_cb_prg.h" | |
| #include "terminal.h" | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| #define WARN_PREFIX "Warning: " | |
| #define NOTE_PREFIX "Note: " | |
| @@ -54,7 +54,7 @@ | |
| #include <uv.h> | |
| #endif | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "tool_binmode.h" | |
| #include "tool_cfgable.h" | |
| @@ -91,7 +91,7 @@ | |
| #include "tool_hugehelp.h" | |
| #include "tool_progress.h" | |
| #include "tool_ipfs.h" | |
| - | #include "dynbuf.h" |
| + | |
| #ifdef DEBUGBUILD | |
| /* libcurl's debug-only curl_easy_perform_ev() */ | |
| CURL_EXTERN CURLcode curl_easy_perform_ev(CURL *easy); | |
| @@ -1352,7 +1352,7 @@ static CURLcode config2setopts(struct GlobalConfig *global, | |
| my_setopt_slist(curl, CURLOPT_PREQUOTE, config->prequote); | |
| if(config->cookies) { | |
| - | struct curlx_dynbuf cookies; |
| + | struct dynbuf cookies; |
| struct curl_slist *cl; | |
| /* The maximum size needs to match MAX_NAME in cookie.h */ | |
| @@ -24,16 +24,12 @@ | |
| #include "tool_setup.h" | |
| #include "tool_operate.h" | |
| - | #include "strcase.h" |
| - | |
| - | #include "curlx.h" |
| - | |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_doswin.h" | |
| #include "tool_operhlp.h" | |
| #include "tool_msgs.h" | |
| - | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| void clean_getout(struct OperationConfig *config) | |
| { | |
| @@ -23,8 +23,7 @@ | |
| ***************************************************************************/ | |
| #include "tool_setup.h" | |
| - | #include "strcase.h" |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_getparam.h" | |
| @@ -34,9 +33,8 @@ | |
| #include "tool_libinfo.h" | |
| #include "tool_util.h" | |
| #include "tool_version.h" | |
| - | #include "dynbuf.h" |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| struct getout *new_getout(struct OperationConfig *config) | |
| { | |
| @@ -91,7 +89,7 @@ static size_t memcrlf(char *orig, | |
| ParameterError file2string(char **bufp, FILE *file) | |
| { | |
| - | struct curlx_dynbuf dyn; |
| + | struct dynbuf dyn; |
| curlx_dyn_init(&dyn, MAX_FILE2STRING); | |
| if(file) { | |
| do { | |
| @@ -141,7 +139,7 @@ ParameterError file2memory_range(char **bufp, size_t *size, FILE *file, | |
| { | |
| if(file) { | |
| size_t nread; | |
| - | struct curlx_dynbuf dyn; |
| + | struct dynbuf dyn; |
| curl_off_t offset = 0; | |
| curl_off_t throwaway = 0; | |
| @@ -413,7 +411,7 @@ ParameterError proto2num(struct OperationConfig *config, | |
| const char * const *val, char **ostr, const char *str) | |
| { | |
| const char **protoset; | |
| - | struct curlx_dynbuf obuf; |
| + | struct dynbuf obuf; |
| size_t proto; | |
| CURLcode result; | |
| @@ -581,7 +579,7 @@ static CURLcode checkpasswd(const char *kind, /* for what purpose */ | |
| /* no password present, prompt for one */ | |
| char passwd[2048] = ""; | |
| char prompt[256]; | |
| - | struct curlx_dynbuf dyn; |
| + | struct dynbuf dyn; |
| curlx_dyn_init(&dyn, MAX_USERPWDLENGTH); | |
| if(osep) | |
| @@ -23,8 +23,7 @@ | |
| ***************************************************************************/ | |
| #include "tool_setup.h" | |
| - | #include "curlx.h" |
| - | |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_getparam.h" | |
| #include "tool_helpers.h" | |
| @@ -32,9 +31,7 @@ | |
| #include "tool_msgs.h" | |
| #include "tool_parsecfg.h" | |
| #include "tool_util.h" | |
| - | #include "dynbuf.h" |
| - | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| /* only acknowledge colon or equals as separators if the option was not | |
| specified with an initial dash! */ | |
| @@ -90,7 +87,7 @@ int parseconfig(const char *filename, struct GlobalConfig *global) | |
| char *param; | |
| int lineno = 0; | |
| bool dashed_option; | |
| - | struct curlx_dynbuf buf; |
| + | struct dynbuf buf; |
| bool fileerror = FALSE; | |
| curlx_dyn_init(&buf, MAX_CONFIG_LINE_LENGTH); | |
| DEBUGASSERT(filename); | |
| @@ -27,6 +27,6 @@ | |
| int parseconfig(const char *filename, struct GlobalConfig *config); | |
| - | bool my_get_line(FILE *fp, struct curlx_dynbuf *db, bool *error); |
| + | bool my_get_line(FILE *fp, struct dynbuf *db, bool *error); |
| #endif /* HEADER_CURL_TOOL_PARSECFG_H */ | |
| @@ -25,8 +25,7 @@ | |
| #include "tool_operate.h" | |
| #include "tool_progress.h" | |
| #include "tool_util.h" | |
| - | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| /* The point of this function would be to return a string of the input data, | |
| but never longer than 5 columns (+ one zero byte). | |
| @@ -25,15 +25,12 @@ | |
| #ifndef CURL_DISABLE_LIBCURL_OPTION | |
| - | #include "curlx.h" |
| - | |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_easysrc.h" | |
| #include "tool_setopt.h" | |
| #include "tool_msgs.h" | |
| - | #include "dynbuf.h" |
| - | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| /* Lookup tables for converting setopt values back to symbols */ | |
| /* For enums, values may be in any order. */ | |
| @@ -177,7 +174,7 @@ static char *c_escape(const char *str, curl_off_t len) | |
| const char *s; | |
| unsigned int cutoff = 0; | |
| CURLcode result; | |
| - | struct curlx_dynbuf escaped; |
| + | struct dynbuf escaped; |
| curlx_dyn_init(&escaped, 4 * MAX_STRING_LENGTH_OUTPUT + 3); | |
| @@ -23,14 +23,12 @@ | |
| ***************************************************************************/ | |
| #include "tool_setup.h" | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_cb_dbg.h" | |
| #include "tool_msgs.h" | |
| #include "tool_setopt.h" | |
| #include "tool_ssls.h" | |
| - | #include "dynbuf.h" |
| - | #include "curl_base64.h" |
| #include "tool_parsecfg.h" | |
| /* The maximum line length for an ecoded session ticket */ | |
| @@ -23,14 +23,12 @@ | |
| ***************************************************************************/ | |
| #include "tool_setup.h" | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_doswin.h" | |
| #include "tool_urlglob.h" | |
| #include "tool_vms.h" | |
| - | #include "dynbuf.h" |
| - | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| #define GLOBERROR(string, column, code) \ | |
| glob->error = string, glob->pos = column, code | |
| @@ -611,7 +609,7 @@ CURLcode glob_match_url(char **result, const char *filename, | |
| char numbuf[18]; | |
| const char *appendthis = ""; | |
| size_t appendlen = 0; | |
| - | struct curlx_dynbuf dyn; |
| + | struct dynbuf dyn; |
| *result = NULL; | |
| @@ -24,9 +24,8 @@ | |
| #include "tool_setup.h" | |
| #include "tool_util.h" | |
| - | |
| - | #include "curlx.h" |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <curlx.h> |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| #ifdef _WIN32 | |
| @@ -127,7 +126,7 @@ FILE *tool_execpath(const char *filename, char **pathp) | |
| /* If we have enough space, build the RC filename */ | |
| remaining = sizeof(filebuffer) - strlen(filebuffer); | |
| if(strlen(filename) < remaining - 1) { | |
| - | msnprintf(lastdirchar, remaining, "%s%s", DIR_CHAR, filename); |
| + | curl_msnprintf(lastdirchar, remaining, "%s%s", DIR_CHAR, filename); |
| *pathp = filebuffer; | |
| return fopen(filebuffer, FOPEN_READTEXT); | |
| } | |
| @@ -30,12 +30,10 @@ | |
| #include <unixlib.h> | |
| #endif | |
| - | #include "curlx.h" |
| - | |
| + | #include <curlx.h> |
| #include "curlmsg_vms.h" | |
| #include "tool_vms.h" | |
| - | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| void decc$__posix_exit(int __status); | |
| void decc$exit(int __status); | |
| @@ -23,13 +23,11 @@ | |
| ***************************************************************************/ | |
| #include "tool_setup.h" | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_writeout.h" | |
| #include "tool_writeout_json.h" | |
| - | #include "dynbuf.h" |
| - | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| static int writeTime(FILE *stream, const struct writeoutvar *wovar, | |
| struct per_transfer *per, CURLcode per_result, | |
| @@ -23,7 +23,7 @@ | |
| ***************************************************************************/ | |
| #include "tool_setup.h" | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_writeout_json.h" | |
| #include "tool_writeout.h" | |
| @@ -36,7 +36,7 @@ | |
| Return 0 on success, non-zero on error. | |
| */ | |
| int jsonquoted(const char *in, size_t len, | |
| - | struct curlx_dynbuf *out, bool lowercase) |
| + | struct dynbuf *out, bool lowercase) |
| { | |
| const unsigned char *i = (const unsigned char *)in; | |
| const unsigned char *in_end = &i[len]; | |
| @@ -85,7 +85,7 @@ int jsonquoted(const char *in, size_t len, | |
| void jsonWriteString(FILE *stream, const char *in, bool lowercase) | |
| { | |
| - | struct curlx_dynbuf out; |
| + | struct dynbuf out; |
| curlx_dyn_init(&out, MAX_JSON_STRING); | |
| if(!jsonquoted(in, strlen(in), &out, lowercase)) { | |
| @@ -27,7 +27,7 @@ | |
| #include "tool_writeout.h" | |
| int jsonquoted(const char *in, size_t len, | |
| - | struct curlx_dynbuf *out, bool lowercase); |
| + | struct dynbuf *out, bool lowercase); |
| void ourWriteOutJSON(FILE *stream, const struct writeoutvar mappings[], | |
| size_t nentries, | |
| @@ -23,21 +23,17 @@ | |
| ***************************************************************************/ | |
| #include "tool_setup.h" | |
| - | #include "curlx.h" |
| - | |
| + | #include <curlx.h> |
| #include "tool_cfgable.h" | |
| #include "tool_getparam.h" | |
| #include "tool_helpers.h" | |
| #include "tool_findfile.h" | |
| #include "tool_msgs.h" | |
| #include "tool_parsecfg.h" | |
| - | #include "dynbuf.h" |
| - | #include "curl_base64.h" |
| #include "tool_paramhlp.h" | |
| #include "tool_writeout_json.h" | |
| #include "var.h" | |
| - | |
| - | #include "memdebug.h" /* keep this as LAST include */ |
| + | #include <memdebug.h> /* keep this as LAST include */ |
| #define MAX_EXPAND_CONTENT 10000000 | |
| #define MAX_VAR_LEN 128 /* max length of a name */ | |
| @@ -99,7 +95,7 @@ static ParameterError varfunc(struct GlobalConfig *global, | |
| size_t clen, /* content length */ | |
| char *f, /* functions */ | |
| size_t flen, /* function string length */ | |
| - | struct curlx_dynbuf *out) |
| + | struct dynbuf *out) |
| { | |
| bool alloc = FALSE; | |
| ParameterError err = PARAM_OK; | |
| @@ -228,7 +224,7 @@ static ParameterError varfunc(struct GlobalConfig *global, | |
| } | |
| ParameterError varexpand(struct GlobalConfig *global, | |
| - | const char *line, struct curlx_dynbuf *out, |
| + | const char *line, struct dynbuf *out, |
| bool *replaced) | |
| { | |
| CURLcode result; | |
| @@ -307,7 +303,7 @@ ParameterError varexpand(struct GlobalConfig *global, | |
| else { | |
| char *value; | |
| size_t vlen = 0; | |
| - | struct curlx_dynbuf buf; |
| + | struct dynbuf buf; |
| const struct tool_var *v = varcontent(global, name, nlen); | |
| if(v) { | |
| value = (char *)CURL_UNCONST(v->content); | |
| @@ -25,7 +25,7 @@ | |
| ***************************************************************************/ | |
| #include "tool_getparam.h" | |
| - | #include "dynbuf.h" |
| + | #include <curlx.h> |
| struct tool_var { | |
| struct tool_var *next; | |
| @@ -38,7 +38,7 @@ struct GlobalConfig; | |
| ParameterError setvariable(struct GlobalConfig *global, const char *input); | |
| ParameterError varexpand(struct GlobalConfig *global, | |
| - | const char *line, struct curlx_dynbuf *out, |
| + | const char *line, struct dynbuf *out, |
| bool *replaced); | |
| /* free everything */ | |
| @@ -23,7 +23,7 @@ unit tests for strparse.c string parsing functions | |
| <verify> | |
| <stdout> | |
| - | Curl_str_word |
| + | curlx_str_word |
| 0: ("word") 0, "word" [4], line 4 | |
| 1: ("word ") 0, "word" [4], line 4 | |
| 2: (" word ") 2, "" [0], line 0 | |
| @@ -33,7 +33,7 @@ Curl_str_word | |
| 6: ("perfect") 0, "perfect" [7], line 7 | |
| 7: ("") 2, "" [0], line 0 | |
| 8: ("longerth") 1, "" [0], line 0 | |
| - | Curl_str_until |
| + | curlx_str_until |
| 0: ("word") 0, "wor" [3], line 3 | |
| 1: ("word ") 0, "wor" [3], line 3 | |
| 2: (" word ") 0, " wor" [4], line 4 | |
| @@ -43,7 +43,7 @@ Curl_str_until | |
| 6: ("perfect") 0, "perfect" [7], line 7 | |
| 7: ("") 2, "" [0], line 0 | |
| 8: ("longerth") 1, "" [0], line 0 | |
| - | Curl_str_quotedword |
| + | curlx_str_quotedword |
| 0: (""word"") 0, "word" [4], line 6 | |
| 1: (""word") 4, "" [0], line 0 | |
| 2: ("word"") 3, "" [0], line 0 | |
| @@ -56,7 +56,7 @@ Curl_str_quotedword | |
| 9: ("""") 0, "" [0], line 2 | |
| 10: ("") 3, "" [0], line 0 | |
| 11: (""longerth"") 1, "" [0], line 0 | |
| - | Curl_str_single |
| + | curlx_str_single |
| 0: ("a") 0, line 1 | |
| 1: ("aa") 0, line 1 | |
| 2: ("A") 5, line 0 | |
| @@ -64,7 +64,7 @@ Curl_str_single | |
| 4: ("\") 5, line 0 | |
| 5: (" ") 5, line 0 | |
| 6: ("") 5, line 0 | |
| - | Curl_str_singlespace |
| + | curlx_str_singlespace |
| 0: ("a") 5, line 0 | |
| 1: ("aa") 5, line 0 | |
| 2: ("A") 5, line 0 | |
| @@ -75,7 +75,7 @@ Curl_str_singlespace | |
| 7: (" | |
| ") 5, line 0 | |
| 8: ("") 5, line 0 | |
| - | Curl_str_single |
| + | curlx_str_single |
| 0: ("a") 0, line 1 | |
| 1: ("aa") 0, line 1 | |
| 2: ("A") 5, line 0 | |
| @@ -83,7 +83,7 @@ Curl_str_single | |
| 4: ("\") 5, line 0 | |
| 5: (" ") 5, line 0 | |
| 6: ("") 5, line 0 | |
| - | Curl_str_number |
| + | curlx_str_number |
| 0: ("1") 0, [1] line 1 | |
| 1: ("10000") 7, [0] line 0 | |
| 2: ("1234") 0, [1234] line 4 | |
| @@ -96,7 +96,7 @@ Curl_str_number | |
| 9: ("-12") 8, [0] line 0 | |
| 10: (" 123") 8, [0] line 0 | |
| 11: ("") 8, [0] line 0 | |
| - | Curl_str_number varying max |
| + | curlx_str_number varying max |
| 0: ("00") max 8 == 0, [0] | |
| 1: ("1") max 8 == 0, [1] | |
| 2: ("1") max 1 == 0, [1] | |
| @@ -110,7 +110,7 @@ Curl_str_number varying max | |
| 10: ("10") max 10 == 0, [10] | |
| 11: ("11") max 10 == 7, [0] | |
| 12: ("12") max 10 == 7, [0] | |
| - | Curl_str_hex varying max |
| + | curlx_str_hex varying max |
| 0: ("00") max 8 == 0, [0] | |
| 1: ("1") max 8 == 0, [1] | |
| 2: ("1") max 1 == 0, [1] | |
| @@ -131,7 +131,7 @@ Curl_str_hex varying max | |
| 17: ("10") max 16 == 0, [16] | |
| 18: ("11") max 16 == 7, [0] | |
| 19: ("12") max 16 == 7, [0] | |
| - | Curl_str_octal varying max |
| + | curlx_str_octal varying max |
| 0: ("00") max 4 == 0, [0] | |
| 1: ("1") max 4 == 0, [1] | |
| 2: ("1") max 4 == 0, [1] | |
| @@ -147,7 +147,7 @@ Curl_str_octal varying max | |
| 12: ("12") max 9 == 7, [0] | |
| 13: ("13") max 9 == 7, [0] | |
| 14: ("8") max 10 == 8, [0] | |
| - | Curl_str_number / max |
| + | curlx_str_number / max |
| 0: ("9223372036854775807") 0, [9223372036854775807] line 19 | |
| 1: ("9223372036854775808") 7, [0] line 0 | |
| 2: ("18446744073709551615") 7, [0] line 0 | |
| @@ -167,7 +167,7 @@ Curl_str_number / max | |
| 16: ("7777777777777777777") 0, [7777777777777777777] line 19 | |
| 17: ("8888888888888888888") 0, [8888888888888888888] line 19 | |
| 18: ("999999999999999999") 0, [999999999999999999] line 18 | |
| - | Curl_str_newline |
| + | curlx_str_newline |
| 0: (%61) 6, line 0 | |
| 1: (%61) 6, line 0 | |
| 2: (%41) 6, line 0 | |
| @@ -179,7 +179,7 @@ Curl_str_newline | |
| 8: (%0d) 0, line 1 | |
| 9: (%0c) 6, line 0 | |
| 10: (%00) 6, line 0 | |
| - | Curl_str_hex |
| + | curlx_str_hex |
| 0: ("1") 0, [1] line 1 | |
| 1: ("1000") 0, [4096] line 4 | |
| 2: ("1234") 0, [4660] line 4 | |
| @@ -192,7 +192,7 @@ Curl_str_hex | |
| 9: ("-12") 8, [0] line 0 | |
| 10: (" 123") 8, [0] line 0 | |
| 11: ("") 8, [0] line 0 | |
| - | Curl_str_octal |
| + | curlx_str_octal |
| 0: ("1") 0, [1] line 1 | |
| 1: ("1000") 0, [512] line 4 | |
| 2: ("1234") 0, [668] line 4 | |
| @@ -205,7 +205,7 @@ Curl_str_octal | |
| 9: ("-12") 8, [0] line 0 | |
| 10: (" 123") 8, [0] line 0 | |
| 11: ("") 8, [0] line 0 | |
| - | Curl_str_octal / max |
| + | curlx_str_octal / max |
| 0: ("777777777777777777777") 0, [9223372036854775807] line 21 | |
| 1: ("1000000000000000000000") 7, [0] line 0 | |
| 2: ("111111111111111111111") 0, [1317624576693539401] line 21 | |
| @@ -214,7 +214,7 @@ Curl_str_octal / max | |
| 5: ("444444444444444444444") 0, [5270498306774157604] line 21 | |
| 6: ("555555555555555555555") 0, [6588122883467697005] line 21 | |
| 7: ("666666666666666666666") 0, [7905747460161236406] line 21 | |
| - | Curl_str_hex / max |
| + | curlx_str_hex / max |
| 0: ("7FFFFFFFFFFFFFFF") 0, [9223372036854775807] line 16 | |
| 1: ("8000000000000000") 7, [0] line 0 | |
| 2: ("1111111111111111") 0, [1229782938247303441] line 16 | |
| @@ -22,7 +22,7 @@ | |
| # | |
| ########################################################################### | |
| - | # Get 'LIBTESTPROGS', '*_SOURCES', 'TESTUTIL', 'TSTTRACE', 'WARNLESS', 'MULTIBYTE', 'INET_PTON', 'TIMEDIFF', 'THREADS', |
| + | # Get 'LIBTESTPROGS', '*_SOURCES', 'TESTUTIL', 'TSTTRACE', 'WARNLESS', 'MULTIBYTE', 'INET_PTON', 'TIMEDIFF', 'THREADS', 'MEMPTR' |
| # 'FIRSTFILES' variables | |
| curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") | |
| include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") | |
| @@ -49,7 +49,7 @@ if(CURL_TEST_BUNDLES) | |
| list(APPEND libtests_SOURCES ${TESTUTIL} ${TSTTRACE}) | |
| if(LIB_SELECTED STREQUAL LIB_SHARED) | |
| # These are part of the libcurl static lib. Add them here when linking shared. | |
| - | list(APPEND libtests_SOURCES ${WARNLESS} ${MULTIBYTE} ${INET_PTON} ${TIMEDIFF} ${THREADS}) |
| + | list(APPEND libtests_SOURCES ${WARNLESS} ${MULTIBYTE} ${INET_PTON} ${TIMEDIFF} ${THREADS} ${MEMPTR}) |
| endif() | |
| endif() | |
| @@ -73,6 +73,7 @@ foreach(_target IN LISTS LIBTESTPROGS) | |
| target_include_directories(${_target_name} PRIVATE | |
| "${PROJECT_BINARY_DIR}/lib" # for "curl_config.h" | |
| "${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h" | |
| + | "${PROJECT_SOURCE_DIR}/lib/curlx" # for curlx |
| "${PROJECT_SOURCE_DIR}/src" # for "tool_binmode.h" | |
| "${PROJECT_SOURCE_DIR}/tests/libtest" # to be able to build generated tests | |
| "${PROJECT_SOURCE_DIR}/tests/unit" # for curlcheck.h | |
| @@ -35,6 +35,7 @@ AUTOMAKE_OPTIONS = foreign nostdinc | |
| AM_CPPFLAGS = -I$(top_srcdir)/include \ | |
| -I$(top_builddir)/lib \ | |
| -I$(top_srcdir)/lib \ | |
| + | -I$(top_srcdir)/lib/curlx \ |
| -I$(top_srcdir)/src \ | |
| -I$(top_srcdir)/tests/libtest \ | |
| -I$(top_srcdir)/tests/unit | |
| @@ -111,7 +112,7 @@ CLEANFILES += libtest_bundle.c | |
| if USE_CPPFLAG_CURL_STATICLIB | |
| else | |
| # These are part of the libcurl static lib. Add them here when linking shared. | |
| - | libtests_SOURCES += $(WARNLESS) $(MULTIBYTE) $(INET_PTON) $(TIMEDIFF) $(THREADS) |
| + | libtests_SOURCES += $(WARNLESS) $(MULTIBYTE) $(INET_PTON) $(TIMEDIFF) $(THREADS) $(MEMPTR) |
| endif | |
| else | |
| noinst_PROGRAMS = $(LIBTESTPROGS) | |
| @@ -24,12 +24,13 @@ | |
| # files used only in some libcurl test programs | |
| TESTUTIL = testutil.c testutil.h | |
| TSTTRACE = testtrace.c testtrace.h | |
| - | WARNLESS = ../../lib/warnless.c ../../lib/warnless.h |
| + | WARNLESS = ../../lib/curlx/warnless.c ../../lib/curlx/warnless.h |
| MULTIBYTE = ../../lib/curl_multibyte.c ../../lib/curl_multibyte.h | |
| THREADS = ../../lib/curl_threads.c ../../lib/curl_threads.h | |
| + | MEMPTR = memptr.c |
| # these files are used in every single test program below | |
| - | TIMEDIFF = ../../lib/timediff.c ../../lib/timediff.h |
| + | TIMEDIFF = ../../lib/curlx/timediff.c ../../lib/curlx/timediff.h |
| FIRSTFILES = first.c first.h | |
| SUPPORTFILES = $(TIMEDIFF) $(FIRSTFILES) test.h | |
| @@ -756,7 +757,7 @@ lib3104_SOURCES = lib3104.c $(SUPPORTFILES) | |
| lib3105_SOURCES = lib3105.c $(SUPPORTFILES) | |
| - | lib3207_SOURCES = lib3207.c $(SUPPORTFILES) $(TESTUTIL) $(THREADS) $(WARNLESS) $(MULTIBYTE) |
| + | lib3207_SOURCES = lib3207.c $(SUPPORTFILES) $(TESTUTIL) $(THREADS) $(WARNLESS) $(MULTIBYTE) $(MEMPTR) |
| lib3207_LDADD = $(TESTUTIL_LIBS) | |
| lib3208_SOURCES = lib3208.c $(SUPPORTFILES) $(TESTUTIL) | |
| @@ -29,7 +29,7 @@ | |
| #endif | |
| #include "memdebug.h" | |
| - | #include "timediff.h" |
| + | #include "curlx/timediff.h" |
| #include "tool_binmode.h" | |
| int select_wrapper(int nfds, fd_set *rd, fd_set *wr, fd_set *exc, | |
| @@ -110,7 +110,7 @@ char *hexdump(const unsigned char *buf, size_t len) | |
| if(len > 200) | |
| return NULL; | |
| for(i = 0; i < len; i++, p += 3) | |
| - | msnprintf(p, 4, "%02x ", buf[i]); |
| + | curl_msnprintf(p, 4, "%02x ", buf[i]); |
| return dump; | |
| } | |
| @@ -148,7 +148,7 @@ int main(int argc, char **argv) | |
| basearg = 2; | |
| if(argc < (basearg + 1)) { | |
| - | fprintf(stderr, "Pass testname and URL as arguments please\n"); |
| + | curl_mfprintf(stderr, "Pass testname and URL as arguments please\n"); |
| return 1; | |
| } | |
| @@ -165,7 +165,7 @@ int main(int argc, char **argv) | |
| } | |
| if(!test_func) { | |
| - | fprintf(stderr, "Test '%s' not found.\n", test_name); |
| + | curl_mfprintf(stderr, "Test '%s' not found.\n", test_name); |
| return 1; | |
| } | |
| } | |
| @@ -173,7 +173,7 @@ int main(int argc, char **argv) | |
| basearg = 1; | |
| if(argc < (basearg + 1)) { | |
| - | fprintf(stderr, "Pass URL as argument please\n"); |
| + | curl_mfprintf(stderr, "Pass URL as argument please\n"); |
| return 1; | |
| } | |
| @@ -191,10 +191,10 @@ int main(int argc, char **argv) | |
| URL = argv[basearg]; /* provide this to the rest */ | |
| - | fprintf(stderr, "URL: %s\n", URL); |
| + | curl_mfprintf(stderr, "URL: %s\n", URL); |
| result = test_func(URL); | |
| - | fprintf(stderr, "Test ended with result %d\n", result); |
| + | curl_mfprintf(stderr, "Test ended with result %d\n", result); |
| #ifdef _WIN32 | |
| /* flush buffers of all streams regardless of mode */ | |
| @@ -93,7 +93,7 @@ static int onetest(CURL *curl, const char *url, const struct testparams *p, | |
| replyselector = (p->flags & F_CONTENTRANGE) ? 1 : 0; | |
| if(p->flags & F_HTTP416) | |
| replyselector += 2; | |
| - | msnprintf(urlbuf, sizeof(urlbuf), "%s%04u", url, replyselector); |
| + | curl_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) ? 3L : 0L); | |
| @@ -103,22 +103,22 @@ static int onetest(CURL *curl, const char *url, const struct testparams *p, | |
| 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->result); |
| + | curl_mprintf("%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->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"); |
| + | curl_mprintf("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"); |
| return 1; | |
| } | |
| return 0; | |
| @@ -139,14 +139,14 @@ CURLcode test(char *URL) | |
| int status = 0; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| for(i = 0; i < CURL_ARRAYSIZE(testparams); i++) { | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -161,7 +161,7 @@ CURLcode test(char *URL) | |
| } | |
| curl_global_cleanup(); | |
| - | printf("%d\n", status); |
| + | curl_mprintf("%d\n", status); |
| return (CURLcode)status; | |
| test_cleanup: | |
| @@ -50,26 +50,27 @@ static size_t header_callback(char *ptr, size_t size, size_t nmemb, | |
| long httpcode = 0; | |
| /* end of a response */ | |
| result = curl_easy_getinfo(st->easy, CURLINFO_RESPONSE_CODE, &httpcode); | |
| - | fprintf(stderr, "header_callback, get status: %ld, %d\n", |
| - | httpcode, result); |
| + | curl_mfprintf(stderr, "header_callback, get status: %ld, %d\n", |
| + | httpcode, result); |
| if(httpcode < 100 || httpcode >= 1000) { | |
| - | fprintf(stderr, "header_callback, invalid status: %ld, %d\n", |
| - | httpcode, result); |
| + | curl_mfprintf(stderr, "header_callback, invalid status: %ld, %d\n", |
| + | httpcode, result); |
| return CURLE_WRITE_ERROR; | |
| } | |
| st->http_status = (int)httpcode; | |
| if(st->http_status >= 200 && st->http_status < 300) { | |
| result = curl_easy_getinfo(st->easy, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, | |
| &clen); | |
| - | fprintf(stderr, "header_callback, info Content-Length: %ld, %d\n", |
| - | (long)clen, result); |
| + | curl_mfprintf(stderr, "header_callback, info Content-Length: %ld, %d\n", |
| + | (long)clen, result); |
| if(result) { | |
| st->result = result; | |
| return CURLE_WRITE_ERROR; | |
| } | |
| if(clen < 0) { | |
| - | fprintf(stderr, "header_callback, expected known Content-Length, " |
| - | "got: %ld\n", (long)clen); |
| + | curl_mfprintf(stderr, |
| + | "header_callback, expected known Content-Length, " |
| + | "got: %ld\n", (long)clen); |
| return CURLE_WRITE_ERROR; | |
| } | |
| } | |
| @@ -60,7 +60,7 @@ CURLcode test(char *URL) | |
| int num; | |
| mres = curl_multi_wait(multi, NULL, 0, TEST_HANG_TIMEOUT, &num); | |
| if(mres != CURLM_OK) { | |
| - | printf("curl_multi_wait() returned %d\n", mres); |
| + | curl_mprintf("curl_multi_wait() returned %d\n", mres); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -84,7 +84,7 @@ CURLcode test(char *URL) | |
| abort_on_test_timeout(); | |
| - | fprintf(stderr, "ping\n"); |
| + | curl_mfprintf(stderr, "ping\n"); |
| before = tutil_tvnow(); | |
| multi_perform(mhandle, &still_running); | |
| @@ -93,7 +93,7 @@ CURLcode test(char *URL) | |
| after = tutil_tvnow(); | |
| e = tutil_tvdiff(after, before); | |
| - | fprintf(stderr, "pong = %ld\n", e); |
| + | curl_mfprintf(stderr, "pong = %ld\n", e); |
| if(e > MAX_BLOCKED_TIME_MS) { | |
| res = CURLE_TOO_LARGE; | |
| @@ -57,14 +57,14 @@ CURLcode test(char *URL) | |
| return res; | |
| } | |
| - | msnprintf(redirect, sizeof(redirect), "google.com:%s:%s", libtest_arg2, |
| - | libtest_arg3); |
| + | curl_msnprintf(redirect, sizeof(redirect), "google.com:%s:%s", libtest_arg2, |
| + | libtest_arg3); |
| start_test_timing(); | |
| dns_cache_list = curl_slist_append(NULL, redirect); | |
| if(!dns_cache_list) { | |
| - | fprintf(stderr, "curl_slist_append() failed\n"); |
| + | curl_mfprintf(stderr, "curl_slist_append() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -48,12 +48,12 @@ CURLcode test(char *URL) | |
| /* Create fake DNS entries for serverX.example.com for all handles */ | |
| for(i = 0; i < NUM_HANDLES; i++) { | |
| - | msnprintf(dnsentry, sizeof(dnsentry), "server%d.example.com:%s:%s", |
| - | i + 1, port, address); |
| - | printf("%s\n", dnsentry); |
| + | curl_msnprintf(dnsentry, sizeof(dnsentry), "server%d.example.com:%s:%s", |
| + | i + 1, port, address); |
| + | curl_mprintf("%s\n", dnsentry); |
| slist2 = curl_slist_append(slist, dnsentry); | |
| if(!slist2) { | |
| - | fprintf(stderr, "curl_slist_append() failed\n"); |
| + | curl_mfprintf(stderr, "curl_slist_append() failed\n"); |
| goto test_cleanup; | |
| } | |
| slist = slist2; | |
| @@ -72,9 +72,9 @@ CURLcode test(char *URL) | |
| /* get an easy handle */ | |
| easy_init(curl[i]); | |
| /* specify target */ | |
| - | msnprintf(target_url, sizeof(target_url), |
| - | "http://server%d.example.com:%s/path/1506%04i", |
| - | i + 1, port, i + 1); |
| + | curl_msnprintf(target_url, sizeof(target_url), |
| + | "http://server%d.example.com:%s/path/1506%04i", |
| + | i + 1, port, i + 1); |
| target_url[sizeof(target_url) - 1] = '\0'; | |
| easy_setopt(curl[i], CURLOPT_URL, target_url); | |
| /* go verbose */ | |
| @@ -85,7 +85,7 @@ CURLcode test(char *URL) | |
| easy_setopt(curl[i], CURLOPT_RESOLVE, slist); | |
| } | |
| - | fprintf(stderr, "Start at URL 0\n"); |
| + | curl_mfprintf(stderr, "Start at URL 0\n"); |
| for(i = 0; i < NUM_HANDLES; i++) { | |
| /* add handle to multi */ | |
| @@ -124,8 +124,8 @@ CURLcode test(char *URL) | |
| rc = select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout); | |
| if(tutil_tvdiff(tutil_tvnow(), mp_start) > MULTI_PERFORM_HANG_TIMEOUT) { | |
| - | fprintf(stderr, "ABORTING TEST, since it seems " |
| - | "that it would have run forever.\n"); |
| + | curl_mfprintf(stderr, "ABORTING TEST, since it seems " |
| + | "that it would have run forever.\n"); |
| break; | |
| } | |
| @@ -45,7 +45,7 @@ test_cleanup: | |
| curl_multi_cleanup(m); | |
| curl_global_cleanup(); | |
| - | printf("We are done\n"); |
| + | curl_mprintf("We are done\n"); |
| return res; | |
| } | |
| @@ -55,24 +55,24 @@ CURLcode test(char *URL) | |
| code = curl_easy_perform(curl); | |
| if(CURLE_OK != code) { | |
| - | fprintf(stderr, "%s:%d curl_easy_perform() failed, " |
| - | "with code %d (%s)\n", |
| - | __FILE__, __LINE__, code, curl_easy_strerror(code)); |
| + | curl_mfprintf(stderr, "%s:%d curl_easy_perform() failed, " |
| + | "with code %d (%s)\n", |
| + | __FILE__, __LINE__, code, curl_easy_strerror(code)); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| code = curl_easy_getinfo(curl, CURLINFO_HEADER_SIZE, &headerSize); | |
| if(CURLE_OK != code) { | |
| - | fprintf(stderr, "%s:%d curl_easy_getinfo() failed, " |
| - | "with code %d (%s)\n", |
| - | __FILE__, __LINE__, code, curl_easy_strerror(code)); |
| + | curl_mfprintf(stderr, "%s:%d curl_easy_getinfo() failed, " |
| + | "with code %d (%s)\n", |
| + | __FILE__, __LINE__, code, curl_easy_strerror(code)); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| - | printf("header length is ........: %ld\n", headerSize); |
| - | printf("header length should be..: %lu\n", realHeaderSize); |
| + | curl_mprintf("header length is ........: %ld\n", headerSize); |
| + | curl_mprintf("header length should be..: %lu\n", realHeaderSize); |
| test_cleanup: | |
| @@ -46,12 +46,12 @@ CURLcode test(char *URL) | |
| /* Create fake DNS entries for serverX.example.com for all handles */ | |
| for(i = 0; i < NUM_URLS; i++) { | |
| - | msnprintf(dnsentry, sizeof(dnsentry), "server%d.example.com:%s:%s", i + 1, |
| - | port, address); |
| - | printf("%s\n", dnsentry); |
| + | curl_msnprintf(dnsentry, sizeof(dnsentry), |
| + | "server%d.example.com:%s:%s", i + 1, port, address); |
| + | curl_mprintf("%s\n", dnsentry); |
| slist2 = curl_slist_append(slist, dnsentry); | |
| if(!slist2) { | |
| - | fprintf(stderr, "curl_slist_append() failed\n"); |
| + | curl_mfprintf(stderr, "curl_slist_append() failed\n"); |
| goto test_cleanup; | |
| } | |
| slist = slist2; | |
| @@ -76,9 +76,9 @@ CURLcode test(char *URL) | |
| /* get NUM_HANDLES easy handles */ | |
| for(i = 0; i < NUM_URLS; i++) { | |
| /* specify target */ | |
| - | msnprintf(target_url, sizeof(target_url), |
| - | "http://server%d.example.com:%s/path/1510%04i", |
| - | i + 1, port, i + 1); |
| + | curl_msnprintf(target_url, sizeof(target_url), |
| + | "http://server%d.example.com:%s/path/1510%04i", |
| + | i + 1, port, i + 1); |
| target_url[sizeof(target_url) - 1] = '\0'; | |
| easy_setopt(curl, CURLOPT_URL, target_url); | |
| @@ -47,13 +47,13 @@ CURLcode test(char *URL) | |
| (void)URL; /* URL is setup in the code */ | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| - | msnprintf(dnsentry, sizeof(dnsentry), "server.example.curl:%s:%s", |
| - | port, address); |
| - | printf("%s\n", dnsentry); |
| + | curl_msnprintf(dnsentry, sizeof(dnsentry), "server.example.curl:%s:%s", |
| + | port, address); |
| + | curl_mprintf("%s\n", dnsentry); |
| slist = curl_slist_append(slist, dnsentry); | |
| /* get NUM_HANDLES easy handles */ | |
| @@ -61,9 +61,9 @@ CURLcode test(char *URL) | |
| /* get an easy handle */ | |
| easy_init(curl[i]); | |
| /* specify target */ | |
| - | msnprintf(target_url, sizeof(target_url), |
| - | "http://server.example.curl:%s/path/1512%04i", |
| - | port, i + 1); |
| + | curl_msnprintf(target_url, sizeof(target_url), |
| + | "http://server.example.curl:%s/path/1512%04i", |
| + | port, i + 1); |
| target_url[sizeof(target_url) - 1] = '\0'; | |
| easy_setopt(curl[i], CURLOPT_URL, target_url); | |
| /* go verbose */ | |
| @@ -43,7 +43,7 @@ static int progressKiller(void *arg, | |
| (void)dlnow; | |
| (void)ultotal; | |
| (void)ulnow; | |
| - | printf("PROGRESSFUNCTION called\n"); |
| + | curl_mprintf("PROGRESSFUNCTION called\n"); |
| return 1; | |
| } | |
| @@ -114,8 +114,8 @@ CURLcode test(char *URL) | |
| int i; | |
| int count = 2; | |
| - | msnprintf(dns_entry, sizeof(dns_entry), "testserver.example.com:%s:%s", |
| - | port, address); |
| + | curl_msnprintf(dns_entry, sizeof(dns_entry), "testserver.example.com:%s:%s", |
| + | port, address); |
| start_test_timing(); | |
| @@ -125,13 +125,13 @@ CURLcode test(char *URL) | |
| for(i = 1; i <= count; i++) { | |
| char target_url[256]; | |
| - | msnprintf(target_url, sizeof(target_url), |
| - | "http://testserver.example.com:%s/%s%04d", port, path, i); |
| + | curl_msnprintf(target_url, sizeof(target_url), |
| + | "http://testserver.example.com:%s/%s%04d", port, path, i); |
| /* second request must succeed like the first one */ | |
| res = do_one_request(multi, target_url, dns_entry); | |
| if(res != CURLE_OK) { | |
| - | fprintf(stderr, "request %s failed with %d\n", target_url, res); |
| + | curl_mfprintf(stderr, "request %s failed with %d\n", target_url, res); |
| goto test_cleanup; | |
| } | |
| @@ -62,8 +62,8 @@ CURLcode test(char *URL) | |
| if(!strcmp(URL, "check")) { | |
| #if (defined(_WIN32) || defined(__CYGWIN__)) | |
| - | printf("Windows TCP does not deliver response data but reports " |
| - | "CONNABORTED\n"); |
| + | curl_mprintf("Windows TCP does not deliver response data but reports " |
| + | "CONNABORTED\n"); |
| return TEST_ERR_FAILURE; /* skip since it fails on Windows without | |
| workaround */ | |
| #else | |
| @@ -75,13 +75,13 @@ CURLcode test(char *URL) | |
| pooh.sizeleft = strlen(testdata); | |
| if(curl_global_init(CURL_GLOBAL_ALL)) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -50,7 +50,7 @@ CURLcode test(char *URL) | |
| #endif | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -85,16 +85,16 @@ CURLcode test(char *URL) | |
| curl_easy_getinfo(curl, CURLINFO_REDIRECT_URL, &redirectUrl); | |
| test_setopt(curl, CURLOPT_WRITEFUNCTION, writecb); | |
| - | printf("res %d\n" |
| - | "status %ld\n" |
| - | "redirects %ld\n" |
| - | "effectiveurl %s\n" |
| - | "redirecturl %s\n", |
| - | res, |
| - | curlResponseCode, |
| - | curlRedirectCount, |
| - | effectiveUrl, |
| - | redirectUrl ? redirectUrl : "blank"); |
| + | curl_mprintf("res %d\n" |
| + | "status %ld\n" |
| + | "redirects %ld\n" |
| + | "effectiveurl %s\n" |
| + | "redirecturl %s\n", |
| + | res, |
| + | curlResponseCode, |
| + | curlRedirectCount, |
| + | effectiveUrl, |
| + | redirectUrl ? redirectUrl : "blank"); |
| test_cleanup: | |
| @@ -79,13 +79,13 @@ CURLcode test(char *URL) | |
| struct upload_status upload_ctx = {0}; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -79,18 +79,18 @@ CURLcode test(char *URL) | |
| curl_off_t uploadSize; | |
| curl_easy_getinfo(curl, CURLINFO_SIZE_UPLOAD_T, &uploadSize); | |
| - | printf("uploadSize = %ld\n", (long)uploadSize); |
| + | curl_mprintf("uploadSize = %ld\n", (long)uploadSize); |
| if((size_t) uploadSize == sizeof(g_Data)) { | |
| - | printf("!!!!!!!!!! PASS\n"); |
| + | curl_mprintf("!!!!!!!!!! PASS\n"); |
| } | |
| else { | |
| - | printf("sent %d, libcurl says %d\n", |
| - | (int)sizeof(g_Data), (int)uploadSize); |
| + | curl_mprintf("sent %d, libcurl says %d\n", |
| + | (int)sizeof(g_Data), (int)uploadSize); |
| } | |
| } | |
| else { | |
| - | printf("curl_easy_perform() failed. e = %d\n", code); |
| + | curl_mprintf("curl_easy_perform() failed. e = %d\n", code); |
| } | |
| test_cleanup: | |
| curl_slist_free_all(pHeaderList); | |
| @@ -70,11 +70,11 @@ CURLcode test(char *URL) | |
| ret = run(hnd, 1, 2); | |
| if(ret) | |
| - | fprintf(stderr, "error (%d) %s\n", ret, buffer); |
| + | curl_mfprintf(stderr, "error (%d) %s\n", ret, buffer); |
| ret = run(hnd, 12000, 1); | |
| if(ret != CURLE_OPERATION_TIMEDOUT) | |
| - | fprintf(stderr, "error (%d) %s\n", ret, buffer); |
| + | curl_mfprintf(stderr, "error (%d) %s\n", ret, buffer); |
| else | |
| ret = CURLE_OK; | |
| @@ -54,13 +54,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *hhl = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -52,13 +52,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *hhl = NULL, *phl = NULL, *tmp = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -53,13 +53,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *hhl = NULL, *tmp = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -35,13 +35,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *phl = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -31,17 +31,17 @@ CURLcode test(char *URL) | |
| CURL *curl = NULL; | |
| CURLcode res = CURLE_FAILED_INIT; | |
| char bURL[512]; | |
| - | msnprintf(bURL, sizeof(bURL), |
| - | "%s HTTP/1.1\r\nGET http://1529.com/1529", URL); |
| + | curl_msnprintf(bURL, sizeof(bURL), |
| + | "%s HTTP/1.1\r\nGET http://1529.com/1529", URL); |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -33,7 +33,7 @@ static curl_socket_t opensocket(void *clientp, | |
| (void)purpose; | |
| (void)address; | |
| (void)clientp; | |
| - | fprintf(stderr, "opensocket() returns CURL_SOCKET_BAD\n"); |
| + | curl_mfprintf(stderr, "opensocket() returns CURL_SOCKET_BAD\n"); |
| return CURL_SOCKET_BAD; | |
| } | |
| @@ -44,13 +44,13 @@ CURLcode test(char *URL) | |
| (void)URL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -98,7 +98,7 @@ CURLcode test(char *URL) | |
| mc = curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd); | |
| if(mc != CURLM_OK) { | |
| - | fprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc); |
| + | curl_mfprintf(stderr, "curl_multi_fdset() failed, code %d.\n", mc); |
| break; | |
| } | |
| @@ -142,7 +142,8 @@ CURLcode test(char *URL) | |
| do { | |
| msg = curl_multi_info_read(multi_handle, &msgs_left); | |
| if(msg && msg->msg == CURLMSG_DONE) { | |
| - | printf("HTTP transfer completed with status %d\n", msg->data.result); |
| + | curl_mprintf("HTTP transfer completed with status %d\n", |
| + | msg->data.result); |
| break; | |
| } | |
| @@ -41,20 +41,22 @@ CURLcode test(char *URL) | |
| res = curl_easy_perform(curl); | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_perform() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_perform() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| res = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &httpcode); | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| if(httpcode != 200) { | |
| - | fprintf(stderr, "%s:%d unexpected response code %ld\n", |
| - | __FILE__, __LINE__, httpcode); |
| + | curl_mfprintf(stderr, "%s:%d unexpected response code %ld\n", |
| + | __FILE__, __LINE__, httpcode); |
| res = CURLE_HTTP_RETURNED_ERROR; | |
| goto test_cleanup; | |
| } | |
| @@ -64,13 +66,16 @@ CURLcode test(char *URL) | |
| res = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &httpcode); | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| if(httpcode) { | |
| - | fprintf(stderr, "%s:%d curl_easy_reset failed to zero the response code\n" |
| - | "possible regression of github bug 1017\n", __FILE__, __LINE__); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_reset failed to zero the response code\n" |
| + | "possible regression of github bug 1017\n", |
| + | __FILE__, __LINE__); |
| res = CURLE_HTTP_RETURNED_ERROR; | |
| goto test_cleanup; | |
| } | |
| @@ -107,18 +107,19 @@ static CURLcode perform_and_check_connections(CURL *curl, | |
| res = curl_easy_perform(curl); | |
| if(res != CURLE_OK) { | |
| - | fprintf(stderr, "curl_easy_perform() failed with %d\n", res); |
| + | curl_mfprintf(stderr, "curl_easy_perform() failed with %d\n", res); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| res = curl_easy_getinfo(curl, CURLINFO_NUM_CONNECTS, &connections); | |
| if(res != CURLE_OK) { | |
| - | fprintf(stderr, "curl_easy_getinfo() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_getinfo() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| - | fprintf(stderr, "%s: expected: %ld connections; actual: %ld connections\n", |
| - | description, expected_connections, connections); |
| + | curl_mfprintf(stderr, |
| + | "%s: expected: %ld connections; actual: %ld connections\n", |
| + | description, expected_connections, connections); |
| if(connections != expected_connections) { | |
| return TEST_ERR_FAILURE; | |
| @@ -136,13 +137,13 @@ CURLcode test(char *URL) | |
| CURLcode result; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -42,13 +42,15 @@ CURLcode test(char *URL) | |
| res = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime); | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| if(filetime != -1) { | |
| - | fprintf(stderr, "%s:%d filetime init failed; expected -1 but is %ld\n", |
| - | __FILE__, __LINE__, filetime); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d filetime init failed; expected -1 but is %ld\n", |
| + | __FILE__, __LINE__, filetime); |
| res = CURLE_FAILED_INIT; | |
| goto test_cleanup; | |
| } | |
| @@ -58,8 +60,9 @@ CURLcode test(char *URL) | |
| res = curl_easy_perform(curl); | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_perform() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_perform() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| @@ -68,14 +71,15 @@ CURLcode test(char *URL) | |
| res = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime); | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| if(filetime != 30) { | |
| - | fprintf(stderr, "%s:%d filetime of http resource is incorrect; " |
| - | "expected 30 but is %ld\n", |
| - | __FILE__, __LINE__, filetime); |
| + | curl_mfprintf(stderr, "%s:%d filetime of http resource is incorrect; " |
| + | "expected 30 but is %ld\n", |
| + | __FILE__, __LINE__, filetime); |
| res = CURLE_HTTP_RETURNED_ERROR; | |
| goto test_cleanup; | |
| } | |
| @@ -85,21 +89,23 @@ CURLcode test(char *URL) | |
| dupe = curl_easy_duphandle(curl); | |
| if(!dupe) { | |
| - | fprintf(stderr, "%s:%d curl_easy_duphandle() failed\n", |
| - | __FILE__, __LINE__); |
| + | curl_mfprintf(stderr, "%s:%d curl_easy_duphandle() failed\n", |
| + | __FILE__, __LINE__); |
| res = CURLE_FAILED_INIT; | |
| goto test_cleanup; | |
| } | |
| res = curl_easy_getinfo(dupe, CURLINFO_FILETIME, &filetime); | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| if(filetime != -1) { | |
| - | fprintf(stderr, "%s:%d filetime init failed; expected -1 but is %ld\n", |
| - | __FILE__, __LINE__, filetime); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d filetime init failed; expected -1 but is %ld\n", |
| + | __FILE__, __LINE__, filetime); |
| res = CURLE_FAILED_INIT; | |
| goto test_cleanup; | |
| } | |
| @@ -112,13 +118,15 @@ CURLcode test(char *URL) | |
| res = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime); | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| if(filetime != -1) { | |
| - | fprintf(stderr, "%s:%d filetime init failed; expected -1 but is %ld\n", |
| - | __FILE__, __LINE__, filetime); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d filetime init failed; expected -1 but is %ld\n", |
| + | __FILE__, __LINE__, filetime); |
| res = CURLE_FAILED_INIT; | |
| goto test_cleanup; | |
| } | |
| @@ -44,13 +44,15 @@ CURLcode test(char *URL) | |
| res = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol); | |
| ) | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| if(protocol) { | |
| - | fprintf(stderr, "%s:%d protocol init failed; expected 0 but is %ld\n", |
| - | __FILE__, __LINE__, protocol); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d protocol init failed; expected 0 but is %ld\n", |
| + | __FILE__, __LINE__, protocol); |
| res = CURLE_FAILED_INIT; | |
| goto test_cleanup; | |
| } | |
| @@ -59,8 +61,9 @@ CURLcode test(char *URL) | |
| res = curl_easy_perform(curl); | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_perform() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_perform() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| @@ -71,14 +74,16 @@ CURLcode test(char *URL) | |
| res = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol); | |
| ) | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| if(protocol != CURLPROTO_HTTP) { | |
| - | fprintf(stderr, "%s:%d protocol of http resource is incorrect; " |
| - | "expected %d but is %ld\n", |
| - | __FILE__, __LINE__, CURLPROTO_HTTP, protocol); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d protocol of http resource is incorrect; " |
| + | "expected %d but is %ld\n", |
| + | __FILE__, __LINE__, CURLPROTO_HTTP, protocol); |
| res = CURLE_HTTP_RETURNED_ERROR; | |
| goto test_cleanup; | |
| } | |
| @@ -88,8 +93,8 @@ CURLcode test(char *URL) | |
| dupe = curl_easy_duphandle(curl); | |
| if(!dupe) { | |
| - | fprintf(stderr, "%s:%d curl_easy_duphandle() failed\n", |
| - | __FILE__, __LINE__); |
| + | curl_mfprintf(stderr, "%s:%d curl_easy_duphandle() failed\n", |
| + | __FILE__, __LINE__); |
| res = CURLE_FAILED_INIT; | |
| goto test_cleanup; | |
| } | |
| @@ -98,13 +103,15 @@ CURLcode test(char *URL) | |
| res = curl_easy_getinfo(dupe, CURLINFO_PROTOCOL, &protocol); | |
| ) | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| if(protocol) { | |
| - | fprintf(stderr, "%s:%d protocol init failed; expected 0 but is %ld\n", |
| - | __FILE__, __LINE__, protocol); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d protocol init failed; expected 0 but is %ld\n", |
| + | __FILE__, __LINE__, protocol); |
| res = CURLE_FAILED_INIT; | |
| goto test_cleanup; | |
| } | |
| @@ -119,13 +126,15 @@ CURLcode test(char *URL) | |
| res = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol); | |
| ) | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| if(protocol) { | |
| - | fprintf(stderr, "%s:%d protocol init failed; expected 0 but is %ld\n", |
| - | __FILE__, __LINE__, protocol); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d protocol init failed; expected 0 but is %ld\n", |
| + | __FILE__, __LINE__, protocol); |
| res = CURLE_FAILED_INIT; | |
| goto test_cleanup; | |
| } | |
| @@ -42,13 +42,15 @@ CURLcode test(char *URL) | |
| res = curl_easy_getinfo(curl, CURLINFO_SCHEME, &scheme); | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| if(scheme) { | |
| - | fprintf(stderr, "%s:%d scheme init failed; expected NULL\n", |
| - | __FILE__, __LINE__); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d scheme init failed; expected NULL\n", |
| + | __FILE__, __LINE__); |
| res = CURLE_FAILED_INIT; | |
| goto test_cleanup; | |
| } | |
| @@ -57,8 +59,9 @@ CURLcode test(char *URL) | |
| res = curl_easy_perform(curl); | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_perform() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_perform() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| @@ -67,15 +70,16 @@ CURLcode test(char *URL) | |
| res = curl_easy_getinfo(curl, CURLINFO_SCHEME, &scheme); | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| if(!scheme || memcmp(scheme, "http", 5) != 0) { | |
| - | fprintf(stderr, "%s:%d scheme of http resource is incorrect; " |
| - | "expected 'http' but is %s\n", |
| - | __FILE__, __LINE__, |
| - | (scheme == NULL ? "NULL" : "invalid")); |
| + | curl_mfprintf(stderr, "%s:%d scheme of http resource is incorrect; " |
| + | "expected 'http' but is %s\n", |
| + | __FILE__, __LINE__, |
| + | (scheme == NULL ? "NULL" : "invalid")); |
| res = CURLE_HTTP_RETURNED_ERROR; | |
| goto test_cleanup; | |
| } | |
| @@ -85,21 +89,22 @@ CURLcode test(char *URL) | |
| dupe = curl_easy_duphandle(curl); | |
| if(!dupe) { | |
| - | fprintf(stderr, "%s:%d curl_easy_duphandle() failed\n", |
| - | __FILE__, __LINE__); |
| + | curl_mfprintf(stderr, "%s:%d curl_easy_duphandle() failed\n", |
| + | __FILE__, __LINE__); |
| res = CURLE_FAILED_INIT; | |
| goto test_cleanup; | |
| } | |
| res = curl_easy_getinfo(dupe, CURLINFO_SCHEME, &scheme); | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| if(scheme) { | |
| - | fprintf(stderr, "%s:%d scheme init failed; expected NULL\n", |
| - | __FILE__, __LINE__); |
| + | curl_mfprintf(stderr, "%s:%d scheme init failed; expected NULL\n", |
| + | __FILE__, __LINE__); |
| res = CURLE_FAILED_INIT; | |
| goto test_cleanup; | |
| } | |
| @@ -112,13 +117,14 @@ CURLcode test(char *URL) | |
| res = curl_easy_getinfo(curl, CURLINFO_SCHEME, &scheme); | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_getinfo() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| if(scheme) { | |
| - | fprintf(stderr, "%s:%d scheme init failed; expected NULL\n", |
| - | __FILE__, __LINE__); |
| + | curl_mfprintf(stderr, "%s:%d scheme init failed; expected NULL\n", |
| + | __FILE__, __LINE__); |
| res = CURLE_FAILED_INIT; | |
| goto test_cleanup; | |
| } | |
| @@ -38,13 +38,13 @@ CURLcode test(char *URL) | |
| (void)URL; /* we don't use this */ | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| asize = (int)sizeof(a); | |
| ptr = curl_easy_escape(NULL, (const char *)a, asize); | |
| - | printf("%s\n", ptr); |
| + | curl_mprintf("%s\n", ptr); |
| curl_free(ptr); | |
| /* deprecated API */ | |
| @@ -53,12 +53,12 @@ CURLcode test(char *URL) | |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| - | printf("%s\n", ptr); |
| + | curl_mprintf("%s\n", ptr); |
| raw = curl_easy_unescape(NULL, ptr, (int)strlen(ptr), &outlen); | |
| - | printf("outlen == %d\n", outlen); |
| - | printf("unescape == original? %s\n", |
| - | memcmp(raw, a, outlen) ? "no" : "YES"); |
| + | curl_mprintf("outlen == %d\n", outlen); |
| + | curl_mprintf("unescape == original? %s\n", |
| + | memcmp(raw, a, outlen) ? "no" : "YES"); |
| curl_free(raw); | |
| /* deprecated API */ | |
| @@ -68,20 +68,20 @@ CURLcode test(char *URL) | |
| goto test_cleanup; | |
| } | |
| outlen = (int)strlen(raw); | |
| - | printf("[old] outlen == %d\n", outlen); |
| - | printf("[old] unescape == original? %s\n", |
| - | memcmp(raw, a, outlen) ? "no" : "YES"); |
| + | curl_mprintf("[old] outlen == %d\n", outlen); |
| + | curl_mprintf("[old] unescape == original? %s\n", |
| + | memcmp(raw, a, outlen) ? "no" : "YES"); |
| curl_free(raw); | |
| curl_free(ptr); | |
| /* weird input length */ | |
| ptr = curl_easy_escape(NULL, (const char *)a, -1); | |
| - | printf("escape -1 length: %s\n", ptr); |
| + | curl_mprintf("escape -1 length: %s\n", ptr); |
| /* weird input length */ | |
| outlen = 2017; /* just a value */ | |
| ptr = curl_easy_unescape(NULL, "moahahaha", -1, &outlen); | |
| - | printf("unescape -1 length: %s %d\n", ptr, outlen); |
| + | curl_mprintf("unescape -1 length: %s %d\n", ptr, outlen); |
| test_cleanup: | |
| curl_free(ptr); | |
| @@ -45,17 +45,17 @@ CURLcode test(char *URL) | |
| curl_url_strerror((CURLUcode)-INT_MAX); | |
| /* NOLINTEND(clang-analyzer-optin.core.EnumCastOutOfRange) */ | |
| for(easyret = CURLE_OK; easyret <= CURL_LAST; easyret++) { | |
| - | printf("e%d: %s\n", (int)easyret, curl_easy_strerror(easyret)); |
| + | curl_mprintf("e%d: %s\n", (int)easyret, curl_easy_strerror(easyret)); |
| } | |
| for(multiret = CURLM_CALL_MULTI_PERFORM; multiret <= CURLM_LAST; | |
| multiret++) { | |
| - | printf("m%d: %s\n", (int)multiret, curl_multi_strerror(multiret)); |
| + | curl_mprintf("m%d: %s\n", (int)multiret, curl_multi_strerror(multiret)); |
| } | |
| for(shareret = CURLSHE_OK; shareret <= CURLSHE_LAST; shareret++) { | |
| - | printf("s%d: %s\n", (int)shareret, curl_share_strerror(shareret)); |
| + | curl_mprintf("s%d: %s\n", (int)shareret, curl_share_strerror(shareret)); |
| } | |
| for(urlret = CURLUE_OK; urlret <= CURLUE_LAST; urlret++) { | |
| - | printf("u%d: %s\n", (int)urlret, curl_url_strerror(urlret)); |
| + | curl_mprintf("u%d: %s\n", (int)urlret, curl_url_strerror(urlret)); |
| } | |
| return res; | |
| @@ -53,7 +53,7 @@ static int please_continue(void *userp, | |
| curl_easy_pause(st->easy, CURLPAUSE_CONT); | |
| } | |
| } | |
| - | fprintf(stderr, "xferinfo: paused %d\n", st->halted); |
| + | curl_mfprintf(stderr, "xferinfo: paused %d\n", st->halted); |
| return 0; /* go on */ | |
| } | |
| @@ -78,7 +78,7 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb, void *userp) | |
| return len; | |
| } | |
| if(len) | |
| - | printf("Got bytes but pausing!\n"); |
| + | curl_mprintf("Got bytes but pausing!\n"); |
| st->halted = 1; | |
| return CURL_WRITEFUNC_PAUSE; | |
| } | |
| @@ -38,8 +38,8 @@ struct transfer_status { | |
| static int geterr(const char *name, CURLcode val, int lineno) | |
| { | |
| - | printf("CURLINFO_%s returned %d, \"%s\" on line %d\n", |
| - | name, val, curl_easy_strerror(val), lineno); |
| + | curl_mprintf("CURLINFO_%s returned %d, \"%s\" on line %d\n", |
| + | name, val, curl_easy_strerror(val), lineno); |
| return (int)val; | |
| } | |
| @@ -47,10 +47,10 @@ static void report_time(const char *key, const char *where, curl_off_t time, | |
| bool ok) | |
| { | |
| if(ok) | |
| - | printf("%s on %s is OK\n", key, where); |
| + | curl_mprintf("%s on %s is OK\n", key, where); |
| else | |
| - | printf("%s on %s is WRONG: %" CURL_FORMAT_CURL_OFF_T "\n", |
| - | key, where, time); |
| + | curl_mprintf("%s on %s is WRONG: %" CURL_FORMAT_CURL_OFF_T "\n", |
| + | key, where, time); |
| } | |
| static void check_time(CURL *easy, int key, const char *name, | |
| @@ -42,7 +42,7 @@ CURLcode test(char *URL) | |
| if(res) | |
| goto test_cleanup; | |
| - | fprintf(stderr, "****************************** Do it again\n"); |
| + | curl_mfprintf(stderr, "****************************** Do it again\n"); |
| res = curl_easy_perform(curl); | |
| } | |
| @@ -63,7 +63,7 @@ CURLcode test(char *URL) | |
| int num; | |
| mres = curl_multi_wait(multi, NULL, 0, TEST_HANG_TIMEOUT, &num); | |
| if(mres != CURLM_OK) { | |
| - | printf("curl_multi_wait() returned %d\n", mres); |
| + | curl_mprintf("curl_multi_wait() returned %d\n", mres); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -39,7 +39,7 @@ static int xferinfo(void *p, | |
| (void)dltotal; | |
| (void)ulnow; | |
| (void)ultotal; | |
| - | fprintf(stderr, "xferinfo fail!\n"); |
| + | curl_mfprintf(stderr, "xferinfo fail!\n"); |
| return 1; /* fail as fast as we can */ | |
| } | |
| @@ -92,7 +92,7 @@ CURLcode test(char *URL) | |
| int num; | |
| mres = curl_multi_wait(multi, NULL, 0, TEST_HANG_TIMEOUT, &num); | |
| if(mres != CURLM_OK) { | |
| - | printf("curl_multi_wait() returned %d\n", mres); |
| + | curl_mprintf("curl_multi_wait() returned %d\n", mres); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -43,7 +43,7 @@ static void test_lock(CURL *handle, curl_lock_data data, | |
| (void)data; | |
| (void)laccess; | |
| (void)useptr; | |
| - | printf("-> Mutex lock %s\n", ldata_names[data]); |
| + | curl_mprintf("-> Mutex lock %s\n", ldata_names[data]); |
| } | |
| static void test_unlock(CURL *handle, curl_lock_data data, void *useptr) | |
| @@ -51,7 +51,7 @@ static void test_unlock(CURL *handle, curl_lock_data data, void *useptr) | |
| (void)handle; | |
| (void)data; | |
| (void)useptr; | |
| - | printf("<- Mutex unlock %s\n", ldata_names[data]); |
| + | curl_mprintf("<- Mutex unlock %s\n", ldata_names[data]); |
| } | |
| /* test function */ | |
| @@ -65,7 +65,7 @@ CURLcode test(char *URL) | |
| share = curl_share_init(); | |
| if(!share) { | |
| - | fprintf(stderr, "curl_share_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_share_init() failed\n"); |
| goto test_cleanup; | |
| } | |
| @@ -92,8 +92,8 @@ CURLcode test(char *URL) | |
| /* Check for errors */ | |
| if(res != CURLE_OK) { | |
| - | fprintf(stderr, "curl_easy_perform() failed: %s\n", |
| - | curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, "curl_easy_perform() failed: %s\n", |
| + | curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| } | |
| @@ -46,9 +46,9 @@ static int progressCallback(void *arg, | |
| (void)ultotal; | |
| (void)ulnow; | |
| res = curl_easy_recv(curl, buffer, 256, &n); | |
| - | printf("curl_easy_recv returned %d\n", res); |
| + | curl_mprintf("curl_easy_recv returned %d\n", res); |
| res = curl_easy_send(curl, buffer, n, &n); | |
| - | printf("curl_easy_send returned %d\n", res); |
| + | curl_mprintf("curl_easy_send returned %d\n", res); |
| return 1; | |
| } | |
| @@ -62,14 +62,14 @@ CURLcode test(char *URL) | |
| code = curl_easy_perform(curl); | |
| if(CURLE_OK != code) { | |
| - | fprintf(stderr, "%s:%d curl_easy_perform() failed, " |
| - | "with code %d (%s)\n", |
| - | __FILE__, __LINE__, code, curl_easy_strerror(code)); |
| + | curl_mfprintf(stderr, "%s:%d curl_easy_perform() failed, " |
| + | "with code %d (%s)\n", |
| + | __FILE__, __LINE__, code, curl_easy_strerror(code)); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| - | printf("Max = %ld\n", (long)info.largest); |
| + | curl_mprintf("Max = %ld\n", (long)info.largest); |
| test_cleanup: | |
| @@ -39,8 +39,8 @@ CURLcode test(char *URL) | |
| easy_setopt(curl, CURLOPT_URL, URL); | |
| res = curl_easy_perform(curl); | |
| if(res) { | |
| - | fprintf(stderr, "curl_easy_perform() returned %d (%s)\n", |
| - | res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, "curl_easy_perform() returned %d (%s)\n", |
| + | res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| @@ -48,12 +48,12 @@ CURLcode test(char *URL) | |
| res = curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol); | |
| ) | |
| if(res) { | |
| - | fprintf(stderr, "curl_easy_getinfo() returned %d (%s)\n", |
| - | res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, "curl_easy_getinfo() returned %d (%s)\n", |
| + | res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| - | printf("Protocol: %lx\n", protocol); |
| + | curl_mprintf("Protocol: %lx\n", protocol); |
| curl_easy_cleanup(curl); | |
| curl_global_cleanup(); | |
| @@ -49,24 +49,24 @@ CURLcode test(char *URL) | |
| longurl[EXCESSIVE-1] = 0; | |
| res = curl_easy_setopt(curl, CURLOPT_URL, longurl); | |
| - | printf("CURLOPT_URL %d bytes URL == %d\n", |
| - | EXCESSIVE, res); |
| + | curl_mprintf("CURLOPT_URL %d bytes URL == %d\n", |
| + | EXCESSIVE, res); |
| res = curl_easy_setopt(curl, CURLOPT_POSTFIELDS, longurl); | |
| - | printf("CURLOPT_POSTFIELDS %d bytes data == %d\n", |
| - | EXCESSIVE, res); |
| + | curl_mprintf("CURLOPT_POSTFIELDS %d bytes data == %d\n", |
| + | EXCESSIVE, res); |
| u = curl_url(); | |
| if(u) { | |
| CURLUcode uc = curl_url_set(u, CURLUPART_URL, longurl, 0); | |
| - | printf("CURLUPART_URL %d bytes URL == %d (%s)\n", |
| - | EXCESSIVE, (int)uc, curl_url_strerror(uc)); |
| + | curl_mprintf("CURLUPART_URL %d bytes URL == %d (%s)\n", |
| + | EXCESSIVE, (int)uc, curl_url_strerror(uc)); |
| uc = curl_url_set(u, CURLUPART_SCHEME, longurl, CURLU_NON_SUPPORT_SCHEME); | |
| - | printf("CURLUPART_SCHEME %d bytes scheme == %d (%s)\n", |
| - | EXCESSIVE, (int)uc, curl_url_strerror(uc)); |
| + | curl_mprintf("CURLUPART_SCHEME %d bytes scheme == %d (%s)\n", |
| + | EXCESSIVE, (int)uc, curl_url_strerror(uc)); |
| uc = curl_url_set(u, CURLUPART_USER, longurl, 0); | |
| - | printf("CURLUPART_USER %d bytes user == %d (%s)\n", |
| - | EXCESSIVE, (int)uc, curl_url_strerror(uc)); |
| + | curl_mprintf("CURLUPART_USER %d bytes user == %d (%s)\n", |
| + | EXCESSIVE, (int)uc, curl_url_strerror(uc)); |
| curl_url_cleanup(u); | |
| } | |
| @@ -72,10 +72,10 @@ static int checkparts(CURLU *u, const char *in, const char *wanted, | |
| size_t n; | |
| rc = curl_url_get(u, parts[i].part, &p, getflags); | |
| if(!rc && p) { | |
| - | msnprintf(bufp, len, "%s%s", buf[0]?" | ":"", p); |
| + | curl_msnprintf(bufp, len, "%s%s", buf[0]?" | ":"", p); |
| } | |
| else | |
| - | msnprintf(bufp, len, "%s[%d]", buf[0]?" | ":"", (int)rc); |
| + | curl_msnprintf(bufp, len, "%s[%d]", buf[0]?" | ":"", (int)rc); |
| n = strlen(bufp); | |
| bufp += n; | |
| @@ -83,7 +83,7 @@ static int checkparts(CURLU *u, const char *in, const char *wanted, | |
| curl_free(p); | |
| } | |
| if(strcmp(buf, wanted)) { | |
| - | fprintf(stderr, "in: %s\nwanted: %s\ngot: %s\n", in, wanted, buf); |
| + | curl_mfprintf(stderr, "in: %s\nwanted: %s\ngot: %s\n", in, wanted, buf); |
| return 1; | |
| } | |
| return 0; | |
| @@ -830,11 +830,11 @@ static const struct urltestcase get_url_list[] = { | |
| static int checkurl(const char *org, const char *url, const char *out) | |
| { | |
| if(strcmp(out, url)) { | |
| - | fprintf(stderr, |
| - | "Org: %s\n" |
| - | "Wanted: %s\n" |
| - | "Got : %s\n", |
| - | org, out, url); |
| + | curl_mfprintf(stderr, |
| + | "Org: %s\n" |
| + | "Wanted: %s\n" |
| + | "Got : %s\n", |
| + | org, out, url); |
| return 1; | |
| } | |
| return 0; | |
| @@ -1178,10 +1178,10 @@ static CURLUcode updateurl(CURLU *u, const char *cmd, unsigned int setflags) | |
| CURLUPart what = part2id(part); | |
| #if 0 | |
| /* for debugging this */ | |
| - | fprintf(stderr, "%s = \"%s\" [%d]\n", part, value, (int)what); |
| + | curl_mfprintf(stderr, "%s = \"%s\" [%d]\n", part, value, (int)what); |
| #endif | |
| if(what > CURLUPART_ZONEID) | |
| - | fprintf(stderr, "UNKNOWN part '%s'\n", part); |
| + | curl_mfprintf(stderr, "UNKNOWN part '%s'\n", part); |
| if(!strcmp("NULL", value)) | |
| uc = curl_url_set(u, what, NULL, setflags); | |
| @@ -1373,17 +1373,17 @@ static int set_url(void) | |
| rc = curl_url_set(urlp, CURLUPART_URL, set_url_list[i].set, | |
| set_url_list[i].setflags); | |
| if(rc) { | |
| - | fprintf(stderr, "%s:%d Set URL %s returned %d (%s)\n", |
| - | __FILE__, __LINE__, set_url_list[i].set, |
| - | (int)rc, curl_url_strerror(rc)); |
| + | curl_mfprintf(stderr, "%s:%d Set URL %s returned %d (%s)\n", |
| + | __FILE__, __LINE__, set_url_list[i].set, |
| + | (int)rc, curl_url_strerror(rc)); |
| error++; | |
| } | |
| else { | |
| char *url = NULL; | |
| rc = curl_url_get(urlp, CURLUPART_URL, &url, 0); | |
| if(rc) { | |
| - | fprintf(stderr, "%s:%d Get URL returned %d (%s)\n", |
| - | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| + | curl_mfprintf(stderr, "%s:%d Get URL returned %d (%s)\n", |
| + | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| error++; | |
| } | |
| else { | |
| @@ -1395,8 +1395,8 @@ static int set_url(void) | |
| } | |
| } | |
| else if(rc != set_url_list[i].ucode) { | |
| - | fprintf(stderr, "Set URL\nin: %s\nreturned %d (expected %d)\n", |
| - | set_url_list[i].in, (int)rc, set_url_list[i].ucode); |
| + | curl_mfprintf(stderr, "Set URL\nin: %s\nreturned %d (expected %d)\n", |
| + | set_url_list[i].in, (int)rc, set_url_list[i].ucode); |
| error++; | |
| } | |
| curl_url_cleanup(urlp); | |
| @@ -1431,8 +1431,9 @@ static int setget_parts(void) | |
| setget_parts_list[i].setflags); | |
| if(uc != setget_parts_list[i].pcode) { | |
| - | fprintf(stderr, "updateurl\nin: %s\nreturned %d (expected %d)\n", |
| - | setget_parts_list[i].set, (int)uc, setget_parts_list[i].pcode); |
| + | curl_mfprintf(stderr, "updateurl\nin: %s\nreturned %d (expected %d)\n", |
| + | setget_parts_list[i].set, |
| + | (int)uc, setget_parts_list[i].pcode); |
| error++; | |
| } | |
| if(!uc) { | |
| @@ -1443,8 +1444,8 @@ static int setget_parts(void) | |
| curl_free(url); | |
| } | |
| else if(rc != CURLUE_OK) { | |
| - | fprintf(stderr, "Set parts\nin: %s\nreturned %d (expected %d)\n", |
| - | setget_parts_list[i].in, (int)rc, 0); |
| + | curl_mfprintf(stderr, "Set parts\nin: %s\nreturned %d (expected %d)\n", |
| + | setget_parts_list[i].in, (int)rc, 0); |
| error++; | |
| } | |
| curl_url_cleanup(urlp); | |
| @@ -1475,8 +1476,8 @@ static int set_parts(void) | |
| set_parts_list[i].setflags); | |
| if(uc != set_parts_list[i].pcode) { | |
| - | fprintf(stderr, "updateurl\nin: %s\nreturned %d (expected %d)\n", |
| - | set_parts_list[i].set, (int)uc, set_parts_list[i].pcode); |
| + | curl_mfprintf(stderr, "updateurl\nin: %s\nreturned %d (expected %d)\n", |
| + | set_parts_list[i].set, (int)uc, set_parts_list[i].pcode); |
| error++; | |
| } | |
| if(!uc) { | |
| @@ -1484,8 +1485,8 @@ static int set_parts(void) | |
| rc = curl_url_get(urlp, CURLUPART_URL, &url, 0); | |
| if(rc) { | |
| - | fprintf(stderr, "%s:%d Get URL returned %d (%s)\n", |
| - | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| + | curl_mfprintf(stderr, "%s:%d Get URL returned %d (%s)\n", |
| + | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| error++; | |
| } | |
| else if(checkurl(set_parts_list[i].in, url, set_parts_list[i].out)) { | |
| @@ -1495,8 +1496,8 @@ static int set_parts(void) | |
| curl_free(url); | |
| } | |
| else if(rc != set_parts_list[i].ucode) { | |
| - | fprintf(stderr, "Set parts\nin: %s\nreturned %d (expected %d)\n", |
| - | set_parts_list[i].in, (int)rc, set_parts_list[i].ucode); |
| + | curl_mfprintf(stderr, "Set parts\nin: %s\nreturned %d (expected %d)\n", |
| + | set_parts_list[i].in, (int)rc, set_parts_list[i].ucode); |
| error++; | |
| } | |
| curl_url_cleanup(urlp); | |
| @@ -1522,9 +1523,9 @@ static int get_url(void) | |
| rc = curl_url_get(urlp, CURLUPART_URL, &url, get_url_list[i].getflags); | |
| if(rc) { | |
| - | fprintf(stderr, "%s:%d returned %d (%s). URL: '%s'\n", |
| - | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc), |
| - | get_url_list[i].in); |
| + | curl_mfprintf(stderr, "%s:%d returned %d (%s). URL: '%s'\n", |
| + | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc), |
| + | get_url_list[i].in); |
| error++; | |
| } | |
| else { | |
| @@ -1535,8 +1536,8 @@ static int get_url(void) | |
| curl_free(url); | |
| } | |
| if(rc != get_url_list[i].ucode) { | |
| - | fprintf(stderr, "Get URL\nin: %s\nreturned %d (expected %d)\n", |
| - | get_url_list[i].in, (int)rc, get_url_list[i].ucode); |
| + | curl_mfprintf(stderr, "Get URL\nin: %s\nreturned %d (expected %d)\n", |
| + | get_url_list[i].in, (int)rc, get_url_list[i].ucode); |
| error++; | |
| } | |
| curl_url_cleanup(urlp); | |
| @@ -1559,8 +1560,8 @@ static int get_parts(void) | |
| get_parts_list[i].in, | |
| get_parts_list[i].urlflags); | |
| if(rc != get_parts_list[i].ucode) { | |
| - | fprintf(stderr, "Get parts\nin: %s\nreturned %d (expected %d)\n", |
| - | get_parts_list[i].in, (int)rc, get_parts_list[i].ucode); |
| + | curl_mfprintf(stderr, "Get parts\nin: %s\nreturned %d (expected %d)\n", |
| + | get_parts_list[i].in, (int)rc, get_parts_list[i].ucode); |
| error++; | |
| } | |
| else if(get_parts_list[i].ucode) { | |
| @@ -1615,8 +1616,8 @@ static int append(void) | |
| if(error) | |
| ; | |
| else if(rc != append_list[i].ucode) { | |
| - | fprintf(stderr, "Append\nin: %s\nreturned %d (expected %d)\n", |
| - | append_list[i].in, (int)rc, append_list[i].ucode); |
| + | curl_mfprintf(stderr, "Append\nin: %s\nreturned %d (expected %d)\n", |
| + | append_list[i].in, (int)rc, append_list[i].ucode); |
| error++; | |
| } | |
| else if(append_list[i].ucode) { | |
| @@ -1626,8 +1627,8 @@ static int append(void) | |
| char *url; | |
| rc = curl_url_get(urlp, CURLUPART_URL, &url, 0); | |
| if(rc) { | |
| - | fprintf(stderr, "%s:%d Get URL returned %d (%s)\n", |
| - | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| + | curl_mfprintf(stderr, "%s:%d Get URL returned %d (%s)\n", |
| + | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| error++; | |
| } | |
| else { | |
| @@ -1652,15 +1653,16 @@ static int scopeid(void) | |
| rc = curl_url_set(u, CURLUPART_URL, | |
| "https://[fe80::20c:29ff:fe9c:409b%25eth0]/hello.html", 0); | |
| if(rc != CURLUE_OK) { | |
| - | fprintf(stderr, "%s:%d curl_url_set returned %d (%s)\n", |
| - | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| + | curl_mfprintf(stderr, "%s:%d curl_url_set returned %d (%s)\n", |
| + | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| error++; | |
| } | |
| rc = curl_url_get(u, CURLUPART_HOST, &url, 0); | |
| if(rc != CURLUE_OK) { | |
| - | fprintf(stderr, "%s:%d curl_url_get CURLUPART_HOST returned %d (%s)\n", |
| - | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_url_get CURLUPART_HOST returned %d (%s)\n", |
| + | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| error++; | |
| } | |
| else { | |
| @@ -1669,15 +1671,17 @@ static int scopeid(void) | |
| rc = curl_url_set(u, CURLUPART_HOST, "[::1]", 0); | |
| if(rc != CURLUE_OK) { | |
| - | fprintf(stderr, "%s:%d curl_url_set CURLUPART_HOST returned %d (%s)\n", |
| - | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_url_set CURLUPART_HOST returned %d (%s)\n", |
| + | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| error++; | |
| } | |
| rc = curl_url_get(u, CURLUPART_URL, &url, 0); | |
| if(rc != CURLUE_OK) { | |
| - | fprintf(stderr, "%s:%d curl_url_get CURLUPART_URL returned %d (%s)\n", |
| - | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_url_get CURLUPART_URL returned %d (%s)\n", |
| + | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| error++; | |
| } | |
| else { | |
| @@ -1686,15 +1690,17 @@ static int scopeid(void) | |
| rc = curl_url_set(u, CURLUPART_HOST, "example.com", 0); | |
| if(rc != CURLUE_OK) { | |
| - | fprintf(stderr, "%s:%d curl_url_set CURLUPART_HOST returned %d (%s)\n", |
| - | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_url_set CURLUPART_HOST returned %d (%s)\n", |
| + | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| error++; | |
| } | |
| rc = curl_url_get(u, CURLUPART_URL, &url, 0); | |
| if(rc != CURLUE_OK) { | |
| - | fprintf(stderr, "%s:%d curl_url_get CURLUPART_URL returned %d (%s)\n", |
| - | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_url_get CURLUPART_URL returned %d (%s)\n", |
| + | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| error++; | |
| } | |
| else { | |
| @@ -1704,15 +1710,17 @@ static int scopeid(void) | |
| rc = curl_url_set(u, CURLUPART_HOST, | |
| "[fe80::20c:29ff:fe9c:409b%25eth0]", 0); | |
| if(rc != CURLUE_OK) { | |
| - | fprintf(stderr, "%s:%d curl_url_set CURLUPART_HOST returned %d (%s)\n", |
| - | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_url_set CURLUPART_HOST returned %d (%s)\n", |
| + | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| error++; | |
| } | |
| rc = curl_url_get(u, CURLUPART_URL, &url, 0); | |
| if(rc != CURLUE_OK) { | |
| - | fprintf(stderr, "%s:%d curl_url_get CURLUPART_URL returned %d (%s)\n", |
| - | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_url_get CURLUPART_URL returned %d (%s)\n", |
| + | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| error++; | |
| } | |
| else { | |
| @@ -1721,8 +1729,9 @@ static int scopeid(void) | |
| rc = curl_url_get(u, CURLUPART_HOST, &url, 0); | |
| if(rc != CURLUE_OK) { | |
| - | fprintf(stderr, "%s:%d curl_url_get CURLUPART_HOST returned %d (%s)\n", |
| - | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_url_get CURLUPART_HOST returned %d (%s)\n", |
| + | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| error++; | |
| } | |
| else { | |
| @@ -1731,8 +1740,9 @@ static int scopeid(void) | |
| rc = curl_url_get(u, CURLUPART_ZONEID, &url, 0); | |
| if(rc != CURLUE_OK) { | |
| - | fprintf(stderr, "%s:%d curl_url_get CURLUPART_ZONEID returned %d (%s)\n", |
| - | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_url_get CURLUPART_ZONEID returned %d (%s)\n", |
| + | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| error++; | |
| } | |
| else { | |
| @@ -1741,15 +1751,17 @@ static int scopeid(void) | |
| rc = curl_url_set(u, CURLUPART_ZONEID, "clown", 0); | |
| if(rc != CURLUE_OK) { | |
| - | fprintf(stderr, "%s:%d curl_url_set CURLUPART_ZONEID returned %d (%s)\n", |
| - | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_url_set CURLUPART_ZONEID returned %d (%s)\n", |
| + | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| error++; | |
| } | |
| rc = curl_url_get(u, CURLUPART_URL, &url, 0); | |
| if(rc != CURLUE_OK) { | |
| - | fprintf(stderr, "%s:%d curl_url_get CURLUPART_URL returned %d (%s)\n", |
| - | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_url_get CURLUPART_URL returned %d (%s)\n", |
| + | __FILE__, __LINE__, (int)rc, curl_url_strerror(rc)); |
| error++; | |
| } | |
| else { | |
| @@ -1770,41 +1782,41 @@ static int get_nothing(void) | |
| rc = curl_url_get(u, CURLUPART_SCHEME, &p, 0); | |
| if(rc != CURLUE_NO_SCHEME) | |
| - | fprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| + | curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| rc = curl_url_get(u, CURLUPART_HOST, &p, 0); | |
| if(rc != CURLUE_NO_HOST) | |
| - | fprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| + | curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| rc = curl_url_get(u, CURLUPART_USER, &p, 0); | |
| if(rc != CURLUE_NO_USER) | |
| - | fprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| + | curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| rc = curl_url_get(u, CURLUPART_PASSWORD, &p, 0); | |
| if(rc != CURLUE_NO_PASSWORD) | |
| - | fprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| + | curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| rc = curl_url_get(u, CURLUPART_OPTIONS, &p, 0); | |
| if(rc != CURLUE_NO_OPTIONS) | |
| - | fprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| + | curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| rc = curl_url_get(u, CURLUPART_PATH, &p, 0); | |
| if(rc != CURLUE_OK) | |
| - | fprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| + | curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| else | |
| curl_free(p); | |
| rc = curl_url_get(u, CURLUPART_QUERY, &p, 0); | |
| if(rc != CURLUE_NO_QUERY) | |
| - | fprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| + | curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| rc = curl_url_get(u, CURLUPART_FRAGMENT, &p, 0); | |
| if(rc != CURLUE_NO_FRAGMENT) | |
| - | fprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| + | curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| rc = curl_url_get(u, CURLUPART_ZONEID, &p, 0); | |
| if(rc != CURLUE_NO_ZONEID) | |
| - | fprintf(stderr, "unexpected return code %u on line %u\n", (int)rc, |
| + | curl_mfprintf(stderr, "unexpected return code %u on line %u\n", (int)rc, |
| __LINE__); | |
| curl_url_cleanup(u); | |
| @@ -1837,17 +1849,17 @@ static int clear_url(void) | |
| for(i = 0; clear_url_list[i].in && !error; i++) { | |
| rc = curl_url_set(u, clear_url_list[i].part, clear_url_list[i].in, 0); | |
| if(rc != CURLUE_OK) | |
| - | fprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| + | curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| rc = curl_url_set(u, CURLUPART_URL, NULL, 0); | |
| if(rc != CURLUE_OK) | |
| - | fprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| + | curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| rc = curl_url_get(u, clear_url_list[i].part, &p, 0); | |
| if(rc != clear_url_list[i].ucode || (clear_url_list[i].out && | |
| 0 != strcmp(p, clear_url_list[i].out))) { | |
| - | fprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| + | curl_mfprintf(stderr, "unexpected return code line %u\n", __LINE__); |
| error++; | |
| } | |
| if(rc == CURLUE_OK) | |
| @@ -1890,19 +1902,19 @@ static int huge(void) | |
| for(i = 0; i < 7; i++) { | |
| 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); |
| + | curl_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); |
| rc = curl_url_set(urlp, CURLUPART_URL, total, CURLU_NON_SUPPORT_SCHEME); | |
| if((!i && (rc != CURLUE_BAD_SCHEME)) || | |
| (i && rc)) { | |
| - | printf("URL %u: failed to parse [%s]\n", i, total); |
| + | curl_mprintf("URL %u: failed to parse [%s]\n", i, total); |
| error++; | |
| } | |
| @@ -1910,7 +1922,7 @@ static int huge(void) | |
| if(!rc) { | |
| curl_url_get(urlp, part[i], &partp, 0); | |
| if(!partp || strcmp(partp, &bigpart[1 - (i == 4)])) { | |
| - | printf("URL %u part %u: failure\n", i, part[i]); |
| + | curl_mprintf("URL %u part %u: failure\n", i, part[i]); |
| error++; | |
| } | |
| curl_free(partp); | |
| @@ -1963,8 +1975,8 @@ static int urldup(void) | |
| goto err; | |
| if(strcmp(h_str, copy_str)) { | |
| - | printf("Original: %s\nParsed: %s\nCopy: %s\n", |
| - | url[i], h_str, copy_str); |
| + | curl_mprintf("Original: %s\nParsed: %s\nCopy: %s\n", |
| + | url[i], h_str, copy_str); |
| goto err; | |
| } | |
| curl_free(copy_str); | |
| @@ -2021,6 +2033,6 @@ CURLcode test(char *URL) | |
| if(clear_url()) | |
| return (CURLcode)8; | |
| - | printf("success\n"); |
| + | curl_mprintf("success\n"); |
| return CURLE_OK; | |
| } | |
| @@ -53,8 +53,8 @@ CURLcode test(char *URL) | |
| time_after_wait = tutil_tvnow(); | |
| if(tutil_tvdiff(time_after_wait, time_before_wait) < 500) { | |
| - | fprintf(stderr, "%s:%d curl_multi_poll returned too early\n", |
| - | __FILE__, __LINE__); |
| + | curl_mfprintf(stderr, "%s:%d curl_multi_poll returned too early\n", |
| + | __FILE__, __LINE__); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -70,8 +70,8 @@ CURLcode test(char *URL) | |
| time_after_wait = tutil_tvnow(); | |
| if(tutil_tvdiff(time_after_wait, time_before_wait) > 500) { | |
| - | fprintf(stderr, "%s:%d curl_multi_poll returned too late\n", |
| - | __FILE__, __LINE__); |
| + | curl_mfprintf(stderr, "%s:%d curl_multi_poll returned too late\n", |
| + | __FILE__, __LINE__); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -85,8 +85,8 @@ CURLcode test(char *URL) | |
| time_after_wait = tutil_tvnow(); | |
| if(tutil_tvdiff(time_after_wait, time_before_wait) < 500) { | |
| - | fprintf(stderr, "%s:%d curl_multi_poll returned too early\n", |
| - | __FILE__, __LINE__); |
| + | curl_mfprintf(stderr, "%s:%d curl_multi_poll returned too early\n", |
| + | __FILE__, __LINE__); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -103,8 +103,8 @@ CURLcode test(char *URL) | |
| time_after_wait = tutil_tvnow(); | |
| if(tutil_tvdiff(time_after_wait, time_before_wait) > 500) { | |
| - | fprintf(stderr, "%s:%d curl_multi_poll returned too late\n", |
| - | __FILE__, __LINE__); |
| + | curl_mfprintf(stderr, "%s:%d curl_multi_poll returned too late\n", |
| + | __FILE__, __LINE__); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -118,8 +118,8 @@ CURLcode test(char *URL) | |
| time_after_wait = tutil_tvnow(); | |
| if(tutil_tvdiff(time_after_wait, time_before_wait) < 500) { | |
| - | fprintf(stderr, "%s:%d curl_multi_poll returned too early\n", |
| - | __FILE__, __LINE__); |
| + | curl_mfprintf(stderr, "%s:%d curl_multi_poll returned too early\n", |
| + | __FILE__, __LINE__); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -115,8 +115,8 @@ CURLcode test(char *URL) | |
| if(!result) | |
| tid_valid = true; | |
| else { | |
| - | fprintf(stderr, "%s:%d Couldn't create thread, errno %d\n", |
| - | __FILE__, __LINE__, result); |
| + | curl_mfprintf(stderr, "%s:%d Couldn't create thread, errno %d\n", |
| + | __FILE__, __LINE__, result); |
| goto test_cleanup; | |
| } | |
| @@ -134,8 +134,9 @@ CURLcode test(char *URL) | |
| finished_num++; | |
| } | |
| else { | |
| - | fprintf(stderr, "%s:%d Got an unexpected message from curl: %i\n", |
| - | __FILE__, __LINE__, (int)message->msg); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d Got an unexpected message from curl: %i\n", |
| + | __FILE__, __LINE__, (int)message->msg); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -170,14 +171,14 @@ CURLcode test(char *URL) | |
| } | |
| if(CONN_NUM != started_num) { | |
| - | fprintf(stderr, "%s:%d Not all connections started: %d of %d\n", |
| - | __FILE__, __LINE__, started_num, CONN_NUM); |
| + | curl_mfprintf(stderr, "%s:%d Not all connections started: %d of %d\n", |
| + | __FILE__, __LINE__, started_num, CONN_NUM); |
| goto test_cleanup; | |
| } | |
| if(CONN_NUM != finished_num) { | |
| - | fprintf(stderr, "%s:%d Not all connections finished: %d of %d\n", |
| - | __FILE__, __LINE__, started_num, CONN_NUM); |
| + | curl_mfprintf(stderr, "%s:%d Not all connections finished: %d of %d\n", |
| + | __FILE__, __LINE__, started_num, CONN_NUM); |
| goto test_cleanup; | |
| } | |
| @@ -46,7 +46,7 @@ CURLcode test(char *URL) | |
| if(res) | |
| goto test_cleanup; | |
| - | fprintf(stderr, "****************************** Do it again\n"); |
| + | curl_mfprintf(stderr, "****************************** Do it again\n"); |
| res = curl_easy_perform(curl); | |
| } | |
| } | |
| @@ -32,13 +32,13 @@ CURLcode test(char *URL) | |
| int testno = atoi(libtest_arg2); | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -55,13 +55,13 @@ CURLcode test(char *URL) | |
| int testno = atoi(libtest_arg2); | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -81,14 +81,14 @@ CURLcode test(char *URL) | |
| struct curl_slist *hhl = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -79,9 +79,9 @@ CURLcode test(char *URL) | |
| all because we haven't been able to configure the resolver to use an | |
| non-responsive DNS server. At least we exercise the flow. | |
| */ | |
| - | fprintf(stderr, |
| - | "CURLOPT_DNS_SERVERS not supported; " |
| - | "assuming curl_multi_remove_handle() will block\n"); |
| + | curl_mfprintf(stderr, |
| + | "CURLOPT_DNS_SERVERS not supported; " |
| + | "assuming curl_multi_remove_handle() will block\n"); |
| timeout = TEST_HANG_TIMEOUT / 2; | |
| } | |
| @@ -94,20 +94,21 @@ CURLcode test(char *URL) | |
| multi_add_handle(multiHandle, curl); | |
| /* This should move the handle from INIT => CONNECT => WAITRESOLVE. */ | |
| - | fprintf(stderr, "curl_multi_perform()...\n"); |
| + | curl_mfprintf(stderr, "curl_multi_perform()...\n"); |
| multi_perform(multiHandle, &stillRunning); | |
| - | fprintf(stderr, "curl_multi_perform() succeeded\n"); |
| + | curl_mfprintf(stderr, "curl_multi_perform() succeeded\n"); |
| /* Start measuring how long it takes to remove the handle. */ | |
| - | fprintf(stderr, "curl_multi_remove_handle()...\n"); |
| + | curl_mfprintf(stderr, "curl_multi_remove_handle()...\n"); |
| start_test_timing(); | |
| mres = curl_multi_remove_handle(multiHandle, curl); | |
| if(mres) { | |
| - | fprintf(stderr, "curl_multi_remove_handle() failed, with code %d\n", mres); |
| + | curl_mfprintf(stderr, |
| + | "curl_multi_remove_handle() failed, with code %d\n", mres); |
| res = TEST_ERR_MULTI; | |
| goto test_cleanup; | |
| } | |
| - | fprintf(stderr, "curl_multi_remove_handle() succeeded\n"); |
| + | curl_mfprintf(stderr, "curl_multi_remove_handle() succeeded\n"); |
| /* Fail the test if it took too long to remove. This happens after the fact, | |
| and says "it seems that it would have run forever", which isn't true, but | |
| @@ -49,7 +49,7 @@ CURLcode test(char *URL) | |
| if(res) | |
| goto test_cleanup; | |
| - | printf("Retry-After %" CURL_FORMAT_CURL_OFF_T "\n", retry); |
| + | curl_mprintf("Retry-After %" CURL_FORMAT_CURL_OFF_T "\n", retry); |
| test_cleanup: | |
| @@ -87,7 +87,7 @@ CURLcode test(char *URL) | |
| res = TEST_ERR_FAILURE; | |
| goto test_cleanup; | |
| } | |
| - | n += msnprintf(protolist + n, sizeof(protolist) - n, ",%s", *proto); |
| + | n += curl_msnprintf(protolist + n, sizeof(protolist) - n, ",%s", *proto); |
| if(curl_strequal(*proto, "http")) | |
| httpcode = CURLE_OK; | |
| if(curl_strequal(*proto, "https")) | |
| @@ -98,11 +98,11 @@ CURLcode test(char *URL) | |
| for(i = 0; prots[i].in; i++) { | |
| res = curl_easy_setopt(curl, CURLOPT_PROTOCOLS_STR, prots[i].in); | |
| if(res != *prots[i].exp) { | |
| - | printf("unexpectedly '%s' returned %d\n", prots[i].in, res); |
| + | curl_mprintf("unexpectedly '%s' returned %d\n", prots[i].in, res); |
| break; | |
| } | |
| } | |
| - | printf("Tested %u strings\n", i); |
| + | curl_mprintf("Tested %u strings\n", i); |
| test_cleanup: | |
| curl_easy_cleanup(curl); | |
| @@ -62,14 +62,14 @@ CURLcode test(char *URL) | |
| struct curl_slist *hhl = NULL, *list; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -47,9 +47,9 @@ CURLcode test(char *URL) | |
| easy_setopt(curl, CURLOPT_PORT, 1L); | |
| res = curl_easy_perform(curl); | |
| if(res != CURLE_COULDNT_CONNECT && res != CURLE_OPERATION_TIMEDOUT) { | |
| - | fprintf(stderr, "failure expected, " |
| - | "curl_easy_perform returned %d: <%s>, <%s>\n", |
| - | res, curl_easy_strerror(res), error_buffer); |
| + | curl_mfprintf(stderr, "failure expected, " |
| + | "curl_easy_perform returned %d: <%s>, <%s>\n", |
| + | res, curl_easy_strerror(res), error_buffer); |
| if(res == CURLE_OK) | |
| res = TEST_ERR_MAJOR_BAD; /* force an error return */ | |
| goto test_cleanup; | |
| @@ -58,7 +58,7 @@ CURLcode test(char *URL) | |
| /* print the used url */ | |
| curl_url_get(curlu, CURLUPART_URL, &url_after, 0); | |
| - | fprintf(stderr, "curlu now: <%s>\n", url_after); |
| + | curl_mfprintf(stderr, "curlu now: <%s>\n", url_after); |
| curl_free(url_after); | |
| url_after = NULL; | |
| @@ -67,13 +67,13 @@ CURLcode test(char *URL) | |
| res = curl_easy_perform(curl); | |
| if(res) | |
| - | fprintf(stderr, "success expected, " |
| - | "curl_easy_perform returned %d: <%s>, <%s>\n", |
| - | res, curl_easy_strerror(res), error_buffer); |
| + | curl_mfprintf(stderr, "success expected, " |
| + | "curl_easy_perform returned %d: <%s>, <%s>\n", |
| + | res, curl_easy_strerror(res), error_buffer); |
| /* print url */ | |
| curl_url_get(curlu, CURLUPART_URL, &url_after, 0); | |
| - | fprintf(stderr, "curlu now: <%s>\n", url_after); |
| + | curl_mfprintf(stderr, "curlu now: <%s>\n", url_after); |
| test_cleanup: | |
| curl_free(url_after); | |
| @@ -41,13 +41,13 @@ CURLcode test(char *URL) | |
| curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); | |
| res = curl_easy_perform(curl); | |
| if(!res) | |
| - | fprintf(stderr, "failure expected, " |
| - | "curl_easy_perform returned %ld: <%s>, <%s>\n", |
| - | (long) res, curl_easy_strerror(res), error_buffer); |
| + | curl_mfprintf(stderr, "failure expected, " |
| + | "curl_easy_perform returned %ld: <%s>, <%s>\n", |
| + | (long) res, curl_easy_strerror(res), error_buffer); |
| /* print the used url */ | |
| if(!curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &url_after)) | |
| - | printf("Effective URL: %s\n", url_after); |
| + | curl_mprintf("Effective URL: %s\n", url_after); |
| curl_easy_cleanup(curl); | |
| curl_global_cleanup(); | |
| @@ -51,7 +51,7 @@ CURLcode test(char *URL) | |
| memset(testbuf, 'A', MAX_INPUT_LENGTH + 1); | |
| testbuf[MAX_INPUT_LENGTH + 1] = 0; | |
| - | printf("string length: %d\n", (int)strlen(testbuf)); |
| + | curl_mprintf("string length: %d\n", (int)strlen(testbuf)); |
| for(o = curl_easy_option_next(NULL); | |
| o; | |
| @@ -85,8 +85,8 @@ CURLcode test(char *URL) | |
| break; | |
| default: | |
| /* all other return codes are unexpected */ | |
| - | fprintf(stderr, "curl_easy_setopt(%s...) returned %d\n", |
| - | o->name, result); |
| + | curl_mfprintf(stderr, "curl_easy_setopt(%s...) returned %d\n", |
| + | o->name, result); |
| error++; | |
| break; | |
| } | |
| @@ -27,8 +27,9 @@ | |
| #include "warnless.h" | |
| #include "memdebug.h" | |
| - | #define print_err(name, exp) \ |
| - | fprintf(stderr, "Type mismatch for CURLOPT_%s (expected %s)\n", name, exp); |
| + | #define print_err(name, exp) \ |
| + | curl_mfprintf(stderr, "Type mismatch for CURLOPT_%s (expected %s)\n", \ |
| + | name, exp); |
| CURLcode test(char *URL) | |
| { | |
| @@ -66,7 +66,7 @@ static CURLSTScode hstsread(CURL *easy, struct curl_hstsentry *e, | |
| strcpy(e->name, host); | |
| e->includeSubDomains = FALSE; | |
| strcpy(e->expire, expire); | |
| - | fprintf(stderr, "add '%s'\n", host); |
| + | curl_mfprintf(stderr, "add '%s'\n", host); |
| } | |
| else | |
| return CURLSTS_DONE; | |
| @@ -89,7 +89,7 @@ static CURLSTScode hstswrite(CURL *easy, struct curl_hstsentry *e, | |
| { | |
| (void)easy; | |
| (void)userp; | |
| - | printf("[%zu/%zu] %s %s\n", i->index, i->total, e->name, e->expire); |
| + | curl_mprintf("[%zu/%zu] %s %s\n", i->index, i->total, e->name, e->expire); |
| return CURLSTS_OK; | |
| } | |
| @@ -124,7 +124,7 @@ CURLcode test(char *URL) | |
| hnd = NULL; | |
| if(res == CURLE_OPERATION_TIMEDOUT) /* we expect that on Windows */ | |
| res = CURLE_COULDNT_CONNECT; | |
| - | printf("First request returned %d\n", res); |
| + | curl_mprintf("First request returned %d\n", res); |
| res = CURLE_OK; | |
| easy_init(hnd); | |
| @@ -141,7 +141,7 @@ CURLcode test(char *URL) | |
| res = curl_easy_perform(hnd); | |
| curl_easy_cleanup(hnd); | |
| hnd = NULL; | |
| - | printf("Second request returned %d\n", res); |
| + | curl_mprintf("Second request returned %d\n", res); |
| test_cleanup: | |
| curl_easy_cleanup(hnd); | |
| @@ -32,7 +32,7 @@ CURLcode test(char *URL) | |
| CURLcode res = CURLE_OK; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -47,7 +47,7 @@ CURLcode test(char *URL) | |
| #endif | |
| res = curl_easy_perform(curl); | |
| if(res) { | |
| - | printf("res: %d\n", res); |
| + | curl_mprintf("res: %d\n", res); |
| } | |
| curl_easy_cleanup(curl); | |
| } | |
| @@ -43,12 +43,12 @@ CURLcode test(char *URL) | |
| curl_easy_option_by_id(o->id); | |
| if(ename->id != o->id) { | |
| - | printf("name lookup id %d doesn't match %d\n", |
| - | ename->id, o->id); |
| + | curl_mprintf("name lookup id %d doesn't match %d\n", |
| + | ename->id, o->id); |
| } | |
| else if(eid->id != o->id) { | |
| - | printf("ID lookup %d doesn't match %d\n", |
| - | ename->id, o->id); |
| + | curl_mprintf("ID lookup %d doesn't match %d\n", |
| + | ename->id, o->id); |
| } | |
| } | |
| curl_global_cleanup(); | |
| @@ -33,13 +33,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *list = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -33,13 +33,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *list = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -33,13 +33,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *list = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -33,13 +33,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *list = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -34,13 +34,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *list = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -35,13 +35,13 @@ CURLcode test(char *URL) | |
| unsigned char data[] = {0x70, 0x6f, 0x73, 0x74, 0, 0x44, 0x61, 0x74, 0x61}; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -59,7 +59,7 @@ CURLcode test(char *URL) | |
| m = curl_multi_perform(multi, &running_handles); | |
| if(m) | |
| - | fprintf(stderr, "curl_multi_perform failed\n"); |
| + | curl_mfprintf(stderr, "curl_multi_perform failed\n"); |
| } | |
| /* Close the easy handle *before* the multi handle. Doing it the other | |
| way around avoids the issue. */ | |
| @@ -58,8 +58,8 @@ static void showem(CURL *easy, unsigned int type) | |
| size_t index = 0; | |
| size_t amount = header->amount; | |
| do { | |
| - | printf("- %s == %s (%u/%u)\n", header->name, header->value, |
| - | (int)index, (int)amount); |
| + | curl_mprintf("- %s == %s (%u/%u)\n", header->name, header->value, |
| + | (int)index, (int)amount); |
| if(++index == amount) | |
| break; | |
| @@ -70,7 +70,7 @@ static void showem(CURL *easy, unsigned int type) | |
| } | |
| else { | |
| /* only one of this */ | |
| - | printf(" %s == %s\n", header->name, header->value); |
| + | curl_mprintf(" %s == %s\n", header->name, header->value); |
| } | |
| } | |
| } | |
| @@ -33,8 +33,8 @@ static void showem(CURL *easy, unsigned int type) | |
| /* !checksrc! disable EQUALSNULL 1 */ | |
| while((header = curl_easy_nextheader(easy, type, 0, prev)) != NULL) { | |
| - | printf(" %s == %s (%u/%u)\n", header->name, header->value, |
| - | (int)header->index, (int)header->amount); |
| + | curl_mprintf(" %s == %s (%u/%u)\n", header->name, header->value, |
| + | (int)header->index, (int)header->amount); |
| prev = header; | |
| } | |
| } | |
| @@ -67,7 +67,7 @@ CURLcode test(char *URL) | |
| } | |
| res = curl_easy_perform(easy); | |
| if(res) { | |
| - | printf("badness: %d\n", res); |
| + | curl_mprintf("badness: %d\n", res); |
| } | |
| showem(easy, CURLH_CONNECT|CURLH_HEADER|CURLH_TRAILER|CURLH_1XX); | |
| @@ -51,8 +51,8 @@ CURLcode test(char *URL) | |
| easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); | |
| res = curl_easy_perform(curl); | |
| if(res) { | |
| - | fprintf(stderr, "curl_easy_perform() failed: %s\n", |
| - | curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, "curl_easy_perform() failed: %s\n", |
| + | curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| @@ -65,14 +65,14 @@ CURLcode test(char *URL) | |
| if(h) | |
| count++; | |
| } while(h); | |
| - | printf("count = %u\n", count); |
| + | curl_mprintf("count = %u\n", count); |
| /* perform another request - without redirect */ | |
| easy_setopt(curl, CURLOPT_URL, libtest_arg2); | |
| res = curl_easy_perform(curl); | |
| if(res) { | |
| - | fprintf(stderr, "curl_easy_perform() failed: %s\n", |
| - | curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, "curl_easy_perform() failed: %s\n", |
| + | curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| @@ -83,7 +83,7 @@ CURLcode test(char *URL) | |
| if(h) | |
| count++; | |
| } while(h); | |
| - | printf("count = %u\n", count); |
| + | curl_mprintf("count = %u\n", count); |
| test_cleanup: | |
| curl_easy_cleanup(curl); | |
| @@ -33,13 +33,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *connect_to = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -33,13 +33,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *connect_to = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -33,13 +33,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *connect_to = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -33,13 +33,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *connect_to = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -33,13 +33,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *connect_to = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -90,7 +90,7 @@ CURLcode test(char *URL) | |
| port = (unsigned short)atoi(libtest_arg3); | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -101,7 +101,7 @@ CURLcode test(char *URL) | |
| */ | |
| client_fd = socket(AF_INET, SOCK_STREAM, 0); | |
| if(client_fd == CURL_SOCKET_BAD) { | |
| - | fprintf(stderr, "socket creation error\n"); |
| + | curl_mfprintf(stderr, "socket creation error\n"); |
| goto test_cleanup; | |
| } | |
| @@ -109,19 +109,19 @@ CURLcode test(char *URL) | |
| serv_addr.sin_port = htons(port); | |
| if(my_inet_pton(AF_INET, libtest_arg2, &serv_addr.sin_addr) <= 0) { | |
| - | fprintf(stderr, "inet_pton failed\n"); |
| + | curl_mfprintf(stderr, "inet_pton failed\n"); |
| goto test_cleanup; | |
| } | |
| status = connect(client_fd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)); | |
| if(status < 0) { | |
| - | fprintf(stderr, "connection failed\n"); |
| + | curl_mfprintf(stderr, "connection failed\n"); |
| goto test_cleanup; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| goto test_cleanup; | |
| } | |
| @@ -150,7 +150,7 @@ test_cleanup: | |
| CURLcode test(char *URL) | |
| { | |
| (void)URL; | |
| - | printf("lacks inet_pton\n"); |
| + | curl_mprintf("lacks inet_pton\n"); |
| return CURLE_OK; | |
| } | |
| #endif | |
| @@ -33,13 +33,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *connect_to = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -43,13 +43,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *connect_to = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -35,13 +35,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *connect_to = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -33,13 +33,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *connect_to = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -32,13 +32,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *connect_to = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -43,13 +43,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *connect_to = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -50,7 +50,7 @@ CURLcode test(char *URL) | |
| res = curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &effective); | |
| if(res) | |
| goto test_cleanup; | |
| - | printf("effective URL: %s\n", effective); |
| + | curl_mprintf("effective URL: %s\n", effective); |
| /* second transfer: set URL + query in the second CURLU handle */ | |
| @@ -66,7 +66,7 @@ CURLcode test(char *URL) | |
| res = curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &effective); | |
| if(res) | |
| goto test_cleanup; | |
| - | printf("effective URL: %s\n", effective); |
| + | curl_mprintf("effective URL: %s\n", effective); |
| /* third transfer: append extra query in the second CURLU handle, but do not | |
| @@ -83,7 +83,7 @@ CURLcode test(char *URL) | |
| res = curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &effective); | |
| if(res) | |
| goto test_cleanup; | |
| - | printf("effective URL: %s\n", effective); |
| + | curl_mprintf("effective URL: %s\n", effective); |
| test_cleanup: | |
| @@ -33,13 +33,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *list = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -32,8 +32,8 @@ static CURLcode send_ping(CURL *curl, const char *send_payload) | |
| size_t sent; | |
| CURLcode result = | |
| curl_ws_send(curl, send_payload, strlen(send_payload), &sent, CURLWS_PING); | |
| - | fprintf(stderr, |
| - | "ws: curl_ws_send returned %d, sent %d\n", result, (int)sent); |
| + | curl_mfprintf(stderr, |
| + | "ws: curl_ws_send returned %d, sent %d\n", result, (int)sent); |
| return result; | |
| } | |
| @@ -47,21 +47,22 @@ static CURLcode recv_pong(CURL *curl, const char *expected_payload) | |
| curl_ws_recv(curl, buffer, sizeof(buffer), &rlen, &rflags); | |
| if(rflags & CURLWS_PONG) { | |
| int same = 0; | |
| - | fprintf(stderr, "ws: got PONG back\n"); |
| + | curl_mfprintf(stderr, "ws: got PONG back\n"); |
| if(rlen == strlen(expected_payload)) { | |
| if(!memcmp(expected_payload, buffer, rlen)) { | |
| - | fprintf(stderr, "ws: got the same payload back\n"); |
| + | curl_mfprintf(stderr, "ws: got the same payload back\n"); |
| same = 1; | |
| } | |
| } | |
| if(!same) | |
| - | fprintf(stderr, "ws: did NOT get the same payload back\n"); |
| + | curl_mfprintf(stderr, "ws: did NOT get the same payload back\n"); |
| } | |
| else { | |
| - | fprintf(stderr, "recv_pong: got %d bytes rflags %x\n", (int)rlen, rflags); |
| + | curl_mfprintf(stderr, "recv_pong: got %d bytes rflags %x\n", |
| + | (int)rlen, rflags); |
| } | |
| - | fprintf(stderr, "ws: curl_ws_recv returned %d, received %d\n", result, |
| - | (int)rlen); |
| + | curl_mfprintf(stderr, "ws: curl_ws_recv returned %d, received %d\n", result, |
| + | (int)rlen); |
| return result; | |
| } | |
| @@ -71,14 +72,14 @@ static void websocket_close(CURL *curl) | |
| size_t sent; | |
| CURLcode result = | |
| curl_ws_send(curl, "", 0, &sent, CURLWS_CLOSE); | |
| - | fprintf(stderr, |
| - | "ws: curl_ws_send returned %d, sent %d\n", result, (int)sent); |
| + | curl_mfprintf(stderr, |
| + | "ws: curl_ws_send returned %d, sent %d\n", result, (int)sent); |
| } | |
| static void websocket(CURL *curl) | |
| { | |
| int i = 0; | |
| - | fprintf(stderr, "ws: websocket() starts\n"); |
| + | curl_mfprintf(stderr, "ws: websocket() starts\n"); |
| do { | |
| if(send_ping(curl, "foobar")) | |
| return; | |
| @@ -101,21 +102,21 @@ static size_t writecb(char *b, size_t size, size_t nitems, void *p) | |
| 0x8a, 0x0 | |
| }; | |
| size_t incoming = nitems; | |
| - | fprintf(stderr, "Called CURLOPT_WRITEFUNCTION with %d bytes: ", |
| - | (int)nitems); |
| + | curl_mfprintf(stderr, "Called CURLOPT_WRITEFUNCTION with %d bytes: ", |
| + | (int)nitems); |
| for(i = 0; i < nitems; i++) | |
| - | fprintf(stderr, "%02x ", (unsigned char)buffer[i]); |
| - | fprintf(stderr, "\n"); |
| + | curl_mfprintf(stderr, "%02x ", (unsigned char)buffer[i]); |
| + | curl_mfprintf(stderr, "\n"); |
| (void)size; | |
| if(buffer[0] == 0x89) { | |
| CURLcode result; | |
| - | fprintf(stderr, "send back a simple PONG\n"); |
| + | curl_mfprintf(stderr, "send back a simple PONG\n"); |
| result = curl_ws_send(easy, pong, 2, &sent, 0, 0); | |
| if(result) | |
| nitems = 0; | |
| } | |
| if(nitems != incoming) | |
| - | fprintf(stderr, "returns error from callback\n"); |
| + | curl_mfprintf(stderr, "returns error from callback\n"); |
| return nitems; | |
| } | |
| @@ -137,7 +138,7 @@ CURLcode test(char *URL) | |
| curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writecb); | |
| curl_easy_setopt(curl, CURLOPT_WRITEDATA, curl); | |
| res = curl_easy_perform(curl); | |
| - | fprintf(stderr, "curl_easy_perform() returned %d\n", res); |
| + | curl_mfprintf(stderr, "curl_easy_perform() returned %d\n", res); |
| #if 0 | |
| if(res == CURLE_OK) | |
| websocket(curl); | |
| @@ -45,13 +45,13 @@ static void flush_data(struct ws_data *wd) | |
| return; | |
| for(i = 0; i < wd->blen; ++i) | |
| - | printf("%02x ", (unsigned char)wd->buf[i]); |
| + | curl_mprintf("%02x ", (unsigned char)wd->buf[i]); |
| - | printf("\n"); |
| + | curl_mprintf("\n"); |
| if(wd->has_meta) | |
| - | printf("RECFLAGS: %x\n", wd->meta_flags); |
| + | curl_mprintf("RECFLAGS: %x\n", wd->meta_flags); |
| else | |
| - | fprintf(stderr, "RECFLAGS: NULL\n"); |
| + | curl_mfprintf(stderr, "RECFLAGS: NULL\n"); |
| wd->blen = 0; | |
| wd->nwrites = 0; | |
| } | |
| @@ -89,7 +89,7 @@ static size_t writecb(char *buffer, size_t size, size_t nitems, void *p) | |
| incoming = add_data(ws_data, buffer, incoming, meta); | |
| if(nitems != incoming) | |
| - | fprintf(stderr, "returns error from callback\n"); |
| + | curl_mfprintf(stderr, "returns error from callback\n"); |
| return nitems; | |
| } | |
| @@ -115,7 +115,7 @@ CURLcode test(char *URL) | |
| curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writecb); | |
| curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ws_data); | |
| res = curl_easy_perform(curl); | |
| - | fprintf(stderr, "curl_easy_perform() returned %d\n", res); |
| + | curl_mfprintf(stderr, "curl_easy_perform() returned %d\n", res); |
| /* always cleanup */ | |
| curl_easy_cleanup(curl); | |
| flush_data(&ws_data); | |
| @@ -32,8 +32,8 @@ static CURLcode send_ping(CURL *curl, const char *send_payload) | |
| CURLcode result = | |
| curl_ws_send(curl, send_payload, strlen(send_payload), &sent, 0, | |
| CURLWS_PING); | |
| - | fprintf(stderr, |
| - | "ws: curl_ws_send returned %d, sent %d\n", result, (int)sent); |
| + | curl_mfprintf(stderr, |
| + | "ws: curl_ws_send returned %d, sent %d\n", result, (int)sent); |
| return result; | |
| } | |
| @@ -47,23 +47,23 @@ static CURLcode recv_pong(CURL *curl, const char *expected_payload) | |
| if(!result) { | |
| if(meta->flags & CURLWS_PONG) { | |
| int same = 0; | |
| - | fprintf(stderr, "ws: got PONG back\n"); |
| + | curl_mfprintf(stderr, "ws: got PONG back\n"); |
| if(rlen == strlen(expected_payload)) { | |
| if(!memcmp(expected_payload, buffer, rlen)) { | |
| - | fprintf(stderr, "ws: got the same payload back\n"); |
| + | curl_mfprintf(stderr, "ws: got the same payload back\n"); |
| same = 1; | |
| } | |
| } | |
| if(!same) | |
| - | fprintf(stderr, "ws: did NOT get the same payload back\n"); |
| + | curl_mfprintf(stderr, "ws: did NOT get the same payload back\n"); |
| } | |
| else { | |
| - | fprintf(stderr, "recv_pong: got %d bytes rflags %x\n", (int)rlen, |
| - | meta->flags); |
| + | curl_mfprintf(stderr, "recv_pong: got %d bytes rflags %x\n", (int)rlen, |
| + | meta->flags); |
| } | |
| } | |
| - | fprintf(stderr, "ws: curl_ws_recv returned %d, received %d\n", result, |
| - | (int)rlen); |
| + | curl_mfprintf(stderr, "ws: curl_ws_recv returned %d, received %d\n", result, |
| + | (int)rlen); |
| return result; | |
| } | |
| @@ -76,8 +76,8 @@ static CURLcode recv_any(CURL *curl) | |
| if(result) | |
| return result; | |
| - | fprintf(stderr, "recv_any: got %u bytes rflags %x\n", (int)rlen, |
| - | meta->flags); |
| + | curl_mfprintf(stderr, "recv_any: got %u bytes rflags %x\n", (int)rlen, |
| + | meta->flags); |
| return CURLE_OK; | |
| } | |
| @@ -87,22 +87,22 @@ static void websocket_close(CURL *curl) | |
| size_t sent; | |
| CURLcode result = | |
| curl_ws_send(curl, "", 0, &sent, 0, CURLWS_CLOSE); | |
| - | fprintf(stderr, |
| - | "ws: curl_ws_send returned %d, sent %u\n", result, (int)sent); |
| + | curl_mfprintf(stderr, |
| + | "ws: curl_ws_send returned %d, sent %u\n", result, (int)sent); |
| } | |
| static void websocket(CURL *curl) | |
| { | |
| int i = 0; | |
| - | fprintf(stderr, "ws: websocket() starts\n"); |
| + | curl_mfprintf(stderr, "ws: websocket() starts\n"); |
| do { | |
| recv_any(curl); | |
| - | fprintf(stderr, "Send ping\n"); |
| + | curl_mfprintf(stderr, "Send ping\n"); |
| if(send_ping(curl, "foobar")) | |
| return; | |
| - | fprintf(stderr, "Receive pong\n"); |
| + | curl_mfprintf(stderr, "Receive pong\n"); |
| if(recv_pong(curl, "foobar")) { | |
| - | printf("Connection closed\n"); |
| + | curl_mprintf("Connection closed\n"); |
| return; | |
| } | |
| sleep(2); | |
| @@ -126,7 +126,7 @@ CURLcode test(char *URL) | |
| curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); | |
| curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 2L); /* websocket style */ | |
| res = curl_easy_perform(curl); | |
| - | fprintf(stderr, "curl_easy_perform() returned %d\n", res); |
| + | curl_mfprintf(stderr, "curl_easy_perform() returned %d\n", res); |
| if(res == CURLE_OK) | |
| websocket(curl); | |
| @@ -34,8 +34,8 @@ static void websocket_close(CURL *curl) | |
| size_t sent; | |
| CURLcode result = | |
| curl_ws_send(curl, "", 0, &sent, 0, CURLWS_CLOSE); | |
| - | fprintf(stderr, |
| - | "ws: curl_ws_send returned %d, sent %d\n", result, (int)sent); |
| + | curl_mfprintf(stderr, |
| + | "ws: curl_ws_send returned %d, sent %d\n", result, (int)sent); |
| } | |
| static void websocket(CURL *curl) | |
| @@ -57,14 +57,14 @@ static void websocket(CURL *curl) | |
| /* crude busy-loop */ | |
| continue; | |
| fclose(save); | |
| - | printf("curl_ws_recv returned %d\n", result); |
| + | curl_mprintf("curl_ws_recv returned %d\n", result); |
| return; | |
| } | |
| - | printf("%d: nread %zu Age %d Flags %x " |
| - | "Offset %" CURL_FORMAT_CURL_OFF_T " " |
| - | "Bytesleft %" CURL_FORMAT_CURL_OFF_T "\n", |
| - | (int)i, |
| - | nread, meta->age, meta->flags, meta->offset, meta->bytesleft); |
| + | curl_mprintf("%d: nread %zu Age %d Flags %x " |
| + | "Offset %" CURL_FORMAT_CURL_OFF_T " " |
| + | "Bytesleft %" CURL_FORMAT_CURL_OFF_T "\n", |
| + | (int)i, |
| + | nread, meta->age, meta->flags, meta->offset, meta->bytesleft); |
| i += meta->len; | |
| fwrite(buffer, 1, nread, save); | |
| } | |
| @@ -93,7 +93,7 @@ CURLcode test(char *URL) | |
| curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); | |
| curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 2L); /* websocket style */ | |
| res = curl_easy_perform(curl); | |
| - | fprintf(stderr, "curl_easy_perform() returned %d\n", res); |
| + | curl_mfprintf(stderr, "curl_easy_perform() returned %d\n", res); |
| if(res == CURLE_OK) | |
| websocket(curl); | |
| @@ -46,7 +46,7 @@ CURLcode test(char *URL) | |
| curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cb_curl); | |
| curl_easy_setopt(curl, CURLOPT_URL, URL); | |
| res = curl_easy_perform(curl); | |
| - | printf("Returned %d, should be %d.\n", res, CURLE_WRITE_ERROR); |
| + | curl_mprintf("Returned %d, should be %d.\n", res, CURLE_WRITE_ERROR); |
| fflush(stdout); | |
| curl_easy_cleanup(curl); | |
| curl_global_cleanup(); | |
| @@ -55,7 +55,7 @@ CURLcode test(char *URL) | |
| curldupe = curl_easy_duphandle(curl); | |
| if(curldupe) { | |
| res = curl_easy_perform(curldupe); | |
| - | printf("Returned %d, should be %d.\n", res, CURLE_WRITE_ERROR); |
| + | curl_mprintf("Returned %d, should be %d.\n", res, CURLE_WRITE_ERROR); |
| fflush(stdout); | |
| curl_easy_cleanup(curldupe); | |
| } | |
| @@ -54,7 +54,7 @@ CURLcode test(char *URL) | |
| curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writecb); | |
| curl_easy_setopt(curl, CURLOPT_WRITEDATA, curl); | |
| res = curl_easy_perform(curl); | |
| - | printf("Returned %d, should be %d.\n", res, CURLE_RECV_ERROR); |
| + | curl_mprintf("Returned %d, should be %d.\n", res, CURLE_RECV_ERROR); |
| /* always cleanup */ | |
| curl_easy_cleanup(curl); | |
| @@ -34,8 +34,8 @@ static void websocket_close(CURL *curl) | |
| size_t sent; | |
| CURLcode result = | |
| curl_ws_send(curl, "", 0, &sent, 0, CURLWS_CLOSE); | |
| - | fprintf(stderr, |
| - | "ws: curl_ws_send returned %d, sent %zu\n", result, sent); |
| + | curl_mfprintf(stderr, |
| + | "ws: curl_ws_send returned %d, sent %zu\n", result, sent); |
| } | |
| static void websocket_frame(CURL *curl, FILE *save, int expected_flags) | |
| @@ -56,14 +56,14 @@ static void websocket_frame(CURL *curl, FILE *save, int expected_flags) | |
| if(result == CURLE_AGAIN) | |
| /* crude busy-loop */ | |
| continue; | |
| - | printf("curl_ws_recv returned %d\n", result); |
| + | curl_mprintf("curl_ws_recv returned %d\n", result); |
| return; | |
| } | |
| - | printf("%d: nread %zu Age %d Flags %x " |
| - | "Offset %" CURL_FORMAT_CURL_OFF_T " " |
| - | "Bytesleft %" CURL_FORMAT_CURL_OFF_T "\n", |
| - | (int)total_read, |
| - | nread, meta->age, meta->flags, meta->offset, meta->bytesleft); |
| + | curl_mprintf("%d: nread %zu Age %d Flags %x " |
| + | "Offset %" CURL_FORMAT_CURL_OFF_T " " |
| + | "Bytesleft %" CURL_FORMAT_CURL_OFF_T "\n", |
| + | (int)total_read, |
| + | nread, meta->age, meta->flags, meta->offset, meta->bytesleft); |
| assert(meta->flags == expected_flags); | |
| total_read += nread; | |
| fwrite(buffer, 1, nread, save); | |
| @@ -111,7 +111,7 @@ CURLcode test(char *URL) | |
| curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); | |
| curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 2L); /* websocket style */ | |
| res = curl_easy_perform(curl); | |
| - | fprintf(stderr, "curl_easy_perform() returned %d\n", res); |
| + | curl_mfprintf(stderr, "curl_easy_perform() returned %d\n", res); |
| if(res == CURLE_OK) | |
| websocket(curl); | |
| @@ -41,23 +41,23 @@ static size_t write_cb(char *b, size_t size, size_t nitems, void *p) | |
| /* upon ping, respond with input data, disconnect, mark a success */ | |
| if(frame->flags & CURLWS_PING) { | |
| - | fprintf(stderr, "write_cb received ping with %zd bytes\n", |
| - | size * nitems); |
| - | fprintf(stderr, "\n"); |
| + | curl_mfprintf(stderr, "write_cb received ping with %zd bytes\n", |
| + | size * nitems); |
| + | curl_mfprintf(stderr, "\n"); |
| for(i = 0; i < size * nitems; i++) { | |
| - | fprintf(stderr, "%02X%s", (int)b[i], |
| - | (i % 10 == 0 && i != 0) ? "\n" : " "); |
| + | curl_mfprintf(stderr, "%02X%s", (int)b[i], |
| + | (i % 10 == 0 && i != 0) ? "\n" : " "); |
| } | |
| - | fprintf(stderr, "\n"); |
| - | fprintf(stderr, "write_cb sending pong response\n"); |
| + | curl_mfprintf(stderr, "\n"); |
| + | curl_mfprintf(stderr, "write_cb sending pong response\n"); |
| curl_ws_send(curl, b, size * nitems, &sent, 0, CURLWS_PONG); | |
| - | fprintf(stderr, "write_cb closing websocket\n"); |
| + | curl_mfprintf(stderr, "write_cb closing websocket\n"); |
| curl_ws_send(curl, NULL, 0, &sent, 0, CURLWS_CLOSE); | |
| ping_check->pinged = 1; | |
| } | |
| else { | |
| - | fprintf(stderr, "ping_check_cb: non-ping message, frame->flags %x\n", |
| - | frame->flags); |
| + | curl_mfprintf(stderr, "ping_check_cb: non-ping message, frame->flags %x\n", |
| + | frame->flags); |
| } | |
| return size * nitems; | |
| @@ -86,7 +86,7 @@ CURLcode test(char *URL) | |
| curl_easy_setopt(curl, CURLOPT_WRITEDATA, &state); | |
| res = curl_easy_perform(curl); | |
| - | fprintf(stderr, "curl_easy_perform() returned %u\n", (int)res); |
| + | curl_mfprintf(stderr, "curl_easy_perform() returned %u\n", (int)res); |
| res = state.pinged ? 0 : 1; | |
| @@ -46,12 +46,12 @@ CURLcode test(char *URL) | |
| (void)URL; | |
| - | msnprintf(dnsentry, sizeof(dnsentry), "localhost:%s:%s", |
| - | port, address); |
| - | printf("%s\n", dnsentry); |
| + | curl_msnprintf(dnsentry, sizeof(dnsentry), "localhost:%s:%s", |
| + | port, address); |
| + | curl_mprintf("%s\n", dnsentry); |
| slist = curl_slist_append(slist, dnsentry); | |
| if(!slist) { | |
| - | fprintf(stderr, "curl_slist_append() failed\n"); |
| + | curl_mfprintf(stderr, "curl_slist_append() failed\n"); |
| goto test_cleanup; | |
| } | |
| @@ -68,9 +68,9 @@ CURLcode test(char *URL) | |
| /* get an easy handle */ | |
| easy_init(curl[i]); | |
| /* specify target */ | |
| - | msnprintf(target_url, sizeof(target_url), |
| - | "https://localhost:%s/path/2402%04i", |
| - | port, i + 1); |
| + | curl_msnprintf(target_url, sizeof(target_url), |
| + | "https://localhost:%s/path/2402%04i", |
| + | port, i + 1); |
| target_url[sizeof(target_url) - 1] = '\0'; | |
| easy_setopt(curl[i], CURLOPT_URL, target_url); | |
| /* go http2 */ | |
| @@ -88,7 +88,7 @@ CURLcode test(char *URL) | |
| easy_setopt(curl[i], CURLOPT_RESOLVE, slist); | |
| } | |
| - | fprintf(stderr, "Start at URL 0\n"); |
| + | curl_mfprintf(stderr, "Start at URL 0\n"); |
| for(i = 0; i < NUM_HANDLES; i++) { | |
| /* add handle to multi */ | |
| @@ -46,12 +46,12 @@ CURLcode test(char *URL) | |
| (void)URL; | |
| - | msnprintf(dnsentry, sizeof(dnsentry), "localhost:%s:%s", |
| - | port, address); |
| - | printf("%s\n", dnsentry); |
| + | curl_msnprintf(dnsentry, sizeof(dnsentry), "localhost:%s:%s", |
| + | port, address); |
| + | curl_mprintf("%s\n", dnsentry); |
| slist = curl_slist_append(slist, dnsentry); | |
| if(!slist) { | |
| - | fprintf(stderr, "curl_slist_append() failed\n"); |
| + | curl_mfprintf(stderr, "curl_slist_append() failed\n"); |
| goto test_cleanup; | |
| } | |
| @@ -68,9 +68,9 @@ CURLcode test(char *URL) | |
| /* get an easy handle */ | |
| easy_init(curl[i]); | |
| /* specify target */ | |
| - | msnprintf(target_url, sizeof(target_url), |
| - | "https://localhost:%s/path/2404%04i", |
| - | port, i + 1); |
| + | curl_msnprintf(target_url, sizeof(target_url), |
| + | "https://localhost:%s/path/2404%04i", |
| + | port, i + 1); |
| target_url[sizeof(target_url) - 1] = '\0'; | |
| easy_setopt(curl[i], CURLOPT_URL, target_url); | |
| /* go http2 */ | |
| @@ -90,7 +90,7 @@ CURLcode test(char *URL) | |
| easy_setopt(curl[i], CURLOPT_STREAM_WEIGHT, (long)128 + i); | |
| } | |
| - | fprintf(stderr, "Start at URL 0\n"); |
| + | curl_mfprintf(stderr, "Start at URL 0\n"); |
| for(i = 0; i < NUM_HANDLES; i++) { | |
| /* add handle to multi */ | |
| @@ -48,11 +48,11 @@ | |
| #define test_check(expected_fds) \ | |
| if(res != CURLE_OK) { \ | |
| - | fprintf(stderr, "test failed with code: %d\n", res); \ |
| + | curl_mfprintf(stderr, "test failed with code: %d\n", res); \ |
| goto test_cleanup; \ | |
| } \ | |
| else if(fd_count != expected_fds) { \ | |
| - | fprintf(stderr, "Max number of waitfds: %d not as expected: %d\n", \ |
| + | curl_mfprintf(stderr, "Max number of waitfds: %d not as expected: %d\n", \ |
| fd_count, expected_fds); \ | |
| res = TEST_ERR_FAILURE; \ | |
| goto test_cleanup; \ | |
| @@ -172,8 +172,8 @@ static CURLcode test_run(char *URL, long option, unsigned int *max_fd_count) | |
| mc = curl_multi_waitfds(multi, NULL, 0, NULL); | |
| if(mc != CURLM_BAD_FUNCTION_ARGUMENT) { | |
| - | fprintf(stderr, "curl_multi_waitfds() return code %d instead of " |
| - | "CURLM_BAD_FUNCTION_ARGUMENT.\n", mc); |
| + | curl_mfprintf(stderr, "curl_multi_waitfds() return code %d instead of " |
| + | "CURLM_BAD_FUNCTION_ARGUMENT.\n", mc); |
| res = TEST_ERR_FAILURE; | |
| break; | |
| } | |
| @@ -181,8 +181,8 @@ static CURLcode test_run(char *URL, long option, unsigned int *max_fd_count) | |
| mc = curl_multi_waitfds(multi, NULL, 1, NULL); | |
| if(mc != CURLM_BAD_FUNCTION_ARGUMENT) { | |
| - | fprintf(stderr, "curl_multi_waitfds() return code %d instead of " |
| - | "CURLM_BAD_FUNCTION_ARGUMENT.\n", mc); |
| + | curl_mfprintf(stderr, "curl_multi_waitfds() return code %d instead of " |
| + | "CURLM_BAD_FUNCTION_ARGUMENT.\n", mc); |
| res = TEST_ERR_FAILURE; | |
| break; | |
| } | |
| @@ -190,8 +190,8 @@ static CURLcode test_run(char *URL, long option, unsigned int *max_fd_count) | |
| mc = curl_multi_waitfds(multi, NULL, 1, &fd_count); | |
| if(mc != CURLM_BAD_FUNCTION_ARGUMENT) { | |
| - | fprintf(stderr, "curl_multi_waitfds() return code %d instead of " |
| - | "CURLM_BAD_FUNCTION_ARGUMENT.\n", mc); |
| + | curl_mfprintf(stderr, "curl_multi_waitfds() return code %d instead of " |
| + | "CURLM_BAD_FUNCTION_ARGUMENT.\n", mc); |
| res = TEST_ERR_FAILURE; | |
| break; | |
| } | |
| @@ -199,7 +199,7 @@ static CURLcode test_run(char *URL, long option, unsigned int *max_fd_count) | |
| mc = curl_multi_waitfds(multi, ufds, 10, &fd_count); | |
| if(mc != CURLM_OK) { | |
| - | fprintf(stderr, "curl_multi_waitfds() failed, code %d.\n", mc); |
| + | curl_mfprintf(stderr, "curl_multi_waitfds() failed, code %d.\n", mc); |
| res = TEST_ERR_FAILURE; | |
| break; | |
| } | |
| @@ -212,14 +212,15 @@ static CURLcode test_run(char *URL, long option, unsigned int *max_fd_count) | |
| mc = curl_multi_waitfds(multi, NULL, 0, &fd_count_chk); | |
| if(mc != CURLM_OK) { | |
| - | fprintf(stderr, "curl_multi_waitfds() failed, code %d.\n", mc); |
| + | curl_mfprintf(stderr, "curl_multi_waitfds() failed, code %d.\n", mc); |
| res = TEST_ERR_FAILURE; | |
| break; | |
| } | |
| if(fd_count_chk < fd_count) { | |
| - | fprintf(stderr, "curl_multi_waitfds() should return at least the number " |
| - | "of fds needed\n"); |
| + | curl_mfprintf(stderr, |
| + | "curl_multi_waitfds() should return at least the number " |
| + | "of fds needed\n"); |
| res = TEST_ERR_FAILURE; | |
| break; | |
| } | |
| @@ -228,15 +229,16 @@ static CURLcode test_run(char *URL, long option, unsigned int *max_fd_count) | |
| mc = curl_multi_waitfds(multi, ufds1, fd_count - 1, &fd_count_chk); | |
| if(mc != CURLM_OUT_OF_MEMORY) { | |
| - | fprintf(stderr, "curl_multi_waitfds() return code %d instead of " |
| - | "CURLM_OUT_OF_MEMORY.\n", mc); |
| + | curl_mfprintf(stderr, "curl_multi_waitfds() return code %d instead of " |
| + | "CURLM_OUT_OF_MEMORY.\n", mc); |
| res = TEST_ERR_FAILURE; | |
| break; | |
| } | |
| if(fd_count_chk < fd_count) { | |
| - | fprintf(stderr, "curl_multi_waitfds() sould return the amount of fds " |
| - | "needed if enough isn't passed in.\n"); |
| + | curl_mfprintf(stderr, |
| + | "curl_multi_waitfds() sould return the amount of fds " |
| + | "needed if enough isn't passed in.\n"); |
| res = TEST_ERR_FAILURE; | |
| break; | |
| } | |
| @@ -245,8 +247,8 @@ static CURLcode test_run(char *URL, long option, unsigned int *max_fd_count) | |
| mc = curl_multi_waitfds(multi, ufds, 0, NULL); | |
| if(mc != CURLM_OUT_OF_MEMORY) { | |
| - | fprintf(stderr, "curl_multi_waitfds() return code %d instead of " |
| - | "CURLM_OUT_OF_MEMORY.\n", mc); |
| + | curl_mfprintf(stderr, "curl_multi_waitfds() return code %d instead of " |
| + | "CURLM_OUT_OF_MEMORY.\n", mc); |
| res = TEST_ERR_FAILURE; | |
| break; | |
| } | |
| @@ -254,15 +256,16 @@ static CURLcode test_run(char *URL, long option, unsigned int *max_fd_count) | |
| mc = curl_multi_waitfds(multi, ufds, 0, &fd_count_chk); | |
| if(mc != CURLM_OUT_OF_MEMORY) { | |
| - | fprintf(stderr, "curl_multi_waitfds() return code %d instead of " |
| - | "CURLM_OUT_OF_MEMORY.\n", mc); |
| + | curl_mfprintf(stderr, "curl_multi_waitfds() return code %d instead of " |
| + | "CURLM_OUT_OF_MEMORY.\n", mc); |
| res = TEST_ERR_FAILURE; | |
| break; | |
| } | |
| if(fd_count_chk < fd_count) { | |
| - | fprintf(stderr, "curl_multi_waitfds() sould return the amount of fds " |
| - | "needed if enough isn't passed in.\n"); |
| + | curl_mfprintf(stderr, |
| + | "curl_multi_waitfds() sould return the amount of fds " |
| + | "needed if enough isn't passed in.\n"); |
| res = TEST_ERR_FAILURE; | |
| break; | |
| } | |
| @@ -274,7 +277,7 @@ static CURLcode test_run(char *URL, long option, unsigned int *max_fd_count) | |
| mc = curl_multi_poll(multi1, ufds, fd_count, 500, &numfds); | |
| if(mc != CURLM_OK) { | |
| - | fprintf(stderr, "curl_multi_poll() failed, code %d.\\n", mc); |
| + | curl_mfprintf(stderr, "curl_multi_poll() failed, code %d.\\n", mc); |
| res = TEST_ERR_FAILURE; | |
| break; | |
| } | |
| @@ -325,13 +328,13 @@ static CURLcode empty_multi_test(void) | |
| mc = curl_multi_waitfds(multi, ufds, 10, &fd_count); | |
| if(mc != CURLM_OK) { | |
| - | fprintf(stderr, "curl_multi_waitfds() failed, code %d.\n", mc); |
| + | curl_mfprintf(stderr, "curl_multi_waitfds() failed, code %d.\n", mc); |
| res = TEST_ERR_FAILURE; | |
| goto test_cleanup; | |
| } | |
| else if(fd_count > 0) { | |
| - | fprintf(stderr, "curl_multi_waitfds() returned non-zero count of " |
| - | "waitfds: %d.\n", fd_count); |
| + | curl_mfprintf(stderr, "curl_multi_waitfds() returned non-zero count of " |
| + | "waitfds: %d.\n", fd_count); |
| res = TEST_ERR_FAILURE; | |
| goto test_cleanup; | |
| } | |
| @@ -348,13 +351,13 @@ static CURLcode empty_multi_test(void) | |
| mc = curl_multi_waitfds(multi, ufds, 10, &fd_count); | |
| if(mc != CURLM_OK) { | |
| - | fprintf(stderr, "curl_multi_waitfds() failed, code %d.\n", mc); |
| + | curl_mfprintf(stderr, "curl_multi_waitfds() failed, code %d.\n", mc); |
| res = TEST_ERR_FAILURE; | |
| goto test_cleanup; | |
| } | |
| else if(fd_count > 0) { | |
| - | fprintf(stderr, "curl_multi_waitfds() returned non-zero count of " |
| - | "waitfds: %d.\n", fd_count); |
| + | curl_mfprintf(stderr, "curl_multi_waitfds() returned non-zero count of " |
| + | "waitfds: %d.\n", fd_count); |
| res = TEST_ERR_FAILURE; | |
| goto test_cleanup; | |
| } | |
| @@ -47,12 +47,12 @@ CURLcode test(char *URL) | |
| (void)URL; | |
| - | msnprintf(dnsentry, sizeof(dnsentry), "localhost:%s:%s", |
| - | port, address); |
| - | printf("%s\n", dnsentry); |
| + | curl_msnprintf(dnsentry, sizeof(dnsentry), "localhost:%s:%s", |
| + | port, address); |
| + | curl_mprintf("%s\n", dnsentry); |
| slist = curl_slist_append(slist, dnsentry); | |
| if(!slist) { | |
| - | fprintf(stderr, "curl_slist_append() failed\n"); |
| + | curl_mfprintf(stderr, "curl_slist_append() failed\n"); |
| goto test_cleanup; | |
| } | |
| @@ -69,9 +69,9 @@ CURLcode test(char *URL) | |
| /* get an easy handle */ | |
| easy_init(curl[i]); | |
| /* specify target */ | |
| - | msnprintf(target_url, sizeof(target_url), |
| - | "https://localhost:%s/path/2502%04i", |
| - | port, i + 1); |
| + | curl_msnprintf(target_url, sizeof(target_url), |
| + | "https://localhost:%s/path/2502%04i", |
| + | port, i + 1); |
| target_url[sizeof(target_url) - 1] = '\0'; | |
| easy_setopt(curl[i], CURLOPT_URL, target_url); | |
| /* go http2 */ | |
| @@ -92,7 +92,7 @@ CURLcode test(char *URL) | |
| easy_setopt(curl[i], CURLOPT_RESOLVE, slist); | |
| } | |
| - | fprintf(stderr, "Start at URL 0\n"); |
| + | curl_mfprintf(stderr, "Start at URL 0\n"); |
| for(i = 0; i < NUM_HANDLES; i++) { | |
| /* add handle to multi */ | |
| @@ -39,24 +39,26 @@ CURLcode test(char *URL) | |
| curl_easy_setopt(curl, CURLOPT_URL, URL); | |
| ret = curl_easy_perform(curl); | |
| if(ret) { | |
| - | fprintf(stderr, "%s:%d curl_easy_perform() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, ret, curl_easy_strerror(ret)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_perform() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, ret, curl_easy_strerror(ret)); |
| goto test_cleanup; | |
| } | |
| curl_easy_getinfo(curl, CURLINFO_REDIRECT_URL, &follow_url); | |
| curl_easy_getinfo(curl, CURLINFO_RETRY_AFTER, &retry_after); | |
| - | printf("Retry-After %" CURL_FORMAT_CURL_OFF_T "\n", retry_after); |
| + | curl_mprintf("Retry-After %" CURL_FORMAT_CURL_OFF_T "\n", retry_after); |
| curl_easy_setopt(curl, CURLOPT_URL, follow_url); | |
| ret = curl_easy_perform(curl); | |
| if(ret) { | |
| - | fprintf(stderr, "%s:%d curl_easy_perform() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, ret, curl_easy_strerror(ret)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_perform() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, ret, curl_easy_strerror(ret)); |
| goto test_cleanup; | |
| } | |
| curl_easy_reset(curl); | |
| curl_easy_getinfo(curl, CURLINFO_RETRY_AFTER, &retry_after); | |
| - | printf("Retry-After %" CURL_FORMAT_CURL_OFF_T "\n", retry_after); |
| + | curl_mprintf("Retry-After %" CURL_FORMAT_CURL_OFF_T "\n", retry_after); |
| } | |
| test_cleanup: | |
| @@ -32,13 +32,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *icy = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -61,9 +61,9 @@ CURLcode test(char *URL) | |
| ver = curl_version_info(CURLVERSION_NOW); | |
| if((ver->features & CURL_VERSION_THREADSAFE) == 0) { | |
| - | fprintf(stderr, "%s:%d On Windows but the " |
| - | "CURL_VERSION_THREADSAFE feature flag is not set\n", |
| - | __FILE__, __LINE__); |
| + | curl_mfprintf(stderr, "%s:%d On Windows but the " |
| + | "CURL_VERSION_THREADSAFE feature flag is not set\n", |
| + | __FILE__, __LINE__); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -84,8 +84,8 @@ CURLcode test(char *URL) | |
| th = _beginthreadex(NULL, 0, run_thread, &results[i], 0, NULL); | |
| #endif | |
| if(!th) { | |
| - | fprintf(stderr, "%s:%d Couldn't create thread, errno %lu\n", |
| - | __FILE__, __LINE__, GetLastError()); |
| + | curl_mfprintf(stderr, "%s:%d Couldn't create thread, errno %lu\n", |
| + | __FILE__, __LINE__, GetLastError()); |
| tid_count = i; | |
| test_failure = TEST_ERR_MAJOR_BAD; | |
| goto cleanup; | |
| @@ -98,9 +98,9 @@ cleanup: | |
| WaitForSingleObject((HANDLE)ths[i], INFINITE); | |
| CloseHandle((HANDLE)ths[i]); | |
| if(results[i] != CURLE_OK) { | |
| - | fprintf(stderr, "%s:%d thread[%u]: curl_global_init() failed," |
| - | "with code %d (%s)\n", __FILE__, __LINE__, |
| - | i, (int) results[i], curl_easy_strerror(results[i])); |
| + | curl_mfprintf(stderr, "%s:%d thread[%u]: curl_global_init() failed," |
| + | "with code %d (%s)\n", __FILE__, __LINE__, |
| + | i, (int) results[i], curl_easy_strerror(results[i])); |
| test_failure = TEST_ERR_MAJOR_BAD; | |
| } | |
| } | |
| @@ -134,9 +134,9 @@ CURLcode test(char *URL) | |
| ver = curl_version_info(CURLVERSION_NOW); | |
| if((ver->features & CURL_VERSION_THREADSAFE) == 0) { | |
| - | fprintf(stderr, "%s:%d Have pthread but the " |
| - | "CURL_VERSION_THREADSAFE feature flag is not set\n", |
| - | __FILE__, __LINE__); |
| + | curl_mfprintf(stderr, "%s:%d Have pthread but the " |
| + | "CURL_VERSION_THREADSAFE feature flag is not set\n", |
| + | __FILE__, __LINE__); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -145,8 +145,8 @@ CURLcode test(char *URL) | |
| results[i] = CURL_LAST; /* initialize with invalid value */ | |
| res = pthread_create(&tids[i], NULL, run_thread, &results[i]); | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d Couldn't create thread, errno %d\n", |
| - | __FILE__, __LINE__, res); |
| + | curl_mfprintf(stderr, "%s:%d Couldn't create thread, errno %d\n", |
| + | __FILE__, __LINE__, res); |
| tid_count = i; | |
| test_failure = TEST_ERR_MAJOR_BAD; | |
| goto cleanup; | |
| @@ -157,9 +157,9 @@ cleanup: | |
| for(i = 0; i < tid_count; i++) { | |
| pthread_join(tids[i], NULL); | |
| if(results[i] != CURLE_OK) { | |
| - | fprintf(stderr, "%s:%d thread[%u]: curl_global_init() failed," |
| - | "with code %d (%s)\n", __FILE__, __LINE__, |
| - | i, (int) results[i], curl_easy_strerror(results[i])); |
| + | curl_mfprintf(stderr, "%s:%d thread[%u]: curl_global_init() failed," |
| + | "with code %d (%s)\n", __FILE__, __LINE__, |
| + | i, (int) results[i], curl_easy_strerror(results[i])); |
| test_failure = TEST_ERR_MAJOR_BAD; | |
| } | |
| } | |
| @@ -175,9 +175,9 @@ CURLcode test(char *URL) | |
| ver = curl_version_info(CURLVERSION_NOW); | |
| if((ver->features & CURL_VERSION_THREADSAFE) != 0) { | |
| - | fprintf(stderr, "%s:%d No pthread but the " |
| - | "CURL_VERSION_THREADSAFE feature flag is set\n", |
| - | __FILE__, __LINE__); |
| + | curl_mfprintf(stderr, "%s:%d No pthread but the " |
| + | "CURL_VERSION_THREADSAFE feature flag is set\n", |
| + | __FILE__, __LINE__); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| return CURLE_OK; | |
| @@ -30,13 +30,13 @@ CURLcode test(char *URL) | |
| CURL *curl; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -55,7 +55,7 @@ CURLcode test(char *URL) | |
| res = curl_easy_perform(curl); | |
| if(res != CURLE_OK) { | |
| - | fprintf(stderr, "Failed to send DESCRIBE: %d\n", res); |
| + | curl_mfprintf(stderr, "Failed to send DESCRIBE: %d\n", res); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -30,13 +30,13 @@ CURLcode test(char *URL) | |
| CURL *curl; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -58,17 +58,18 @@ static bool is_chain_in_order(struct curl_certinfo *cert_info) | |
| } | |
| if(subject && issuer) { | |
| - | printf("cert %d\n", cert); |
| - | printf(" subject: %s\n", subject); |
| - | printf(" issuer: %s\n", issuer); |
| + | curl_mprintf("cert %d\n", cert); |
| + | curl_mprintf(" subject: %s\n", subject); |
| + | curl_mprintf(" issuer: %s\n", issuer); |
| if(last_issuer) { | |
| /* If the last certificate's issuer matches the current certificate's | |
| * subject, then the chain is in order */ | |
| if(strcmp(last_issuer, subject) != 0) { | |
| - | fprintf(stderr, "cert %d issuer does not match cert %d subject\n", |
| - | cert - 1, cert); |
| - | fprintf(stderr, "certificate chain is not in order\n"); |
| + | curl_mfprintf(stderr, |
| + | "cert %d issuer does not match cert %d subject\n", |
| + | cert - 1, cert); |
| + | curl_mfprintf(stderr, "certificate chain is not in order\n"); |
| return false; | |
| } | |
| } | |
| @@ -77,7 +78,7 @@ static bool is_chain_in_order(struct curl_certinfo *cert_info) | |
| last_issuer = issuer; | |
| } | |
| - | printf("certificate chain is in order\n"); |
| + | curl_mprintf("certificate chain is in order\n"); |
| return true; | |
| } | |
| @@ -94,13 +95,13 @@ CURLcode test(char *URL) | |
| CURLcode res = CURLE_OK; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -51,8 +51,8 @@ CURLcode test(char *URL) | |
| res = curl_easy_perform(curl); | |
| if(res) { | |
| - | fprintf(stderr, "curl_easy_perform() failed: %s\n", |
| - | curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, "curl_easy_perform() failed: %s\n", |
| + | curl_easy_strerror(res)); |
| } | |
| test_cleanup: | |
| @@ -51,8 +51,8 @@ CURLcode test(char *URL) | |
| res = curl_easy_perform(curl); | |
| if(res) { | |
| - | fprintf(stderr, "curl_easy_perform() failed: %s\n", |
| - | curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, "curl_easy_perform() failed: %s\n", |
| + | curl_easy_strerror(res)); |
| } | |
| test_cleanup: | |
| @@ -51,7 +51,7 @@ CURLcode test(char *URL) | |
| mc += curl_multi_remove_handle(multi, curls); | |
| if(mc) { | |
| - | fprintf(stderr, "%d was unexpected\n", (int)mc); |
| + | curl_mfprintf(stderr, "%d was unexpected\n", (int)mc); |
| i = CURLE_FAILED_INIT; | |
| } | |
| @@ -55,7 +55,7 @@ static size_t write_memory_callback(char *contents, size_t size, | |
| char *data = (char *)malloc(realsize + 1); | |
| struct curl_slist *item_append = NULL; | |
| if(!data) { | |
| - | printf("not enough memory (malloc returned NULL)\n"); |
| + | curl_mprintf("not enough memory (malloc returned NULL)\n"); |
| return 0; | |
| } | |
| memcpy(data, contents, realsize); | |
| @@ -66,7 +66,7 @@ static size_t write_memory_callback(char *contents, size_t size, | |
| mem->contents = item_append; | |
| } | |
| else { | |
| - | printf("not enough memory (curl_slist_append returned NULL)\n"); |
| + | curl_mprintf("not enough memory (curl_slist_append returned NULL)\n"); |
| return 0; | |
| } | |
| return realsize; | |
| @@ -112,8 +112,8 @@ test_thread(void *ptr) | |
| curl_easy_cleanup(curl); | |
| /* Check for errors */ | |
| if(res != CURLE_OK) { | |
| - | fprintf(stderr, "curl_easy_perform() failed: %s\n", |
| - | curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, "curl_easy_perform() failed: %s\n", |
| + | curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| } | |
| @@ -195,7 +195,7 @@ CURLcode test(char *URL) | |
| share = curl_share_init(); | |
| if(!share) { | |
| - | fprintf(stderr, "curl_share_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_share_init() failed\n"); |
| goto test_cleanup; | |
| } | |
| @@ -216,7 +216,7 @@ CURLcode test(char *URL) | |
| else { | |
| struct curl_slist *item = ctx[i].contents; | |
| while(item) { | |
| - | printf("%s", item->data); |
| + | curl_mprintf("%s", item->data); |
| item = item->next; | |
| } | |
| } | |
| @@ -68,7 +68,7 @@ CURLcode test(char *URL) | |
| int num; | |
| mres = curl_multi_wait(multi, NULL, 0, TEST_HANG_TIMEOUT, &num); | |
| if(mres != CURLM_OK) { | |
| - | printf("curl_multi_wait() returned %d\n", mres); |
| + | curl_mprintf("curl_multi_wait() returned %d\n", mres); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -36,14 +36,14 @@ static curl_socket_t tst_opensocket(void *clientp, | |
| { | |
| (void)clientp; | |
| (void)purpose; | |
| - | printf("[OPEN] counter: %d\n", ++testcounter); |
| + | curl_mprintf("[OPEN] counter: %d\n", ++testcounter); |
| return socket(addr->family, addr->socktype, addr->protocol); | |
| } | |
| static int tst_closesocket(void *clientp, curl_socket_t sock) | |
| { | |
| (void)clientp; | |
| - | printf("[CLOSE] counter: %d\n", testcounter--); |
| + | curl_mprintf("[CLOSE] counter: %d\n", testcounter--); |
| return sclose(sock); | |
| } | |
| @@ -66,13 +66,13 @@ CURLcode test(char *URL) | |
| char *ipstr = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -104,7 +104,7 @@ CURLcode test(char *URL) | |
| curl_off_t time_posttransfer; | |
| curl_off_t time_starttransfer; | |
| curl_off_t time_total; | |
| - | fprintf(moo, "IP %s\n", ipstr); |
| + | curl_mfprintf(moo, "IP %s\n", ipstr); |
| curl_easy_getinfo(curl, CURLINFO_NAMELOOKUP_TIME_T, &time_namelookup); | |
| curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME_T, &time_connect); | |
| curl_easy_getinfo(curl, CURLINFO_PRETRANSFER_TIME_T, | |
| @@ -118,48 +118,55 @@ CURLcode test(char *URL) | |
| /* since the timing will always vary we only compare relative | |
| differences between these 5 times */ | |
| if(time_namelookup > time_connect) { | |
| - | fprintf(moo, "namelookup vs connect: %" CURL_FORMAT_CURL_OFF_T |
| - | ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n", |
| - | (time_namelookup / 1000000), |
| - | (long)(time_namelookup % 1000000), |
| - | (time_connect / 1000000), (long)(time_connect % 1000000)); |
| + | curl_mfprintf(moo, "namelookup vs connect: %" CURL_FORMAT_CURL_OFF_T |
| + | ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n", |
| + | (time_namelookup / 1000000), |
| + | (long)(time_namelookup % 1000000), |
| + | (time_connect / 1000000), |
| + | (long)(time_connect % 1000000)); |
| } | |
| if(time_connect > time_pretransfer) { | |
| - | fprintf(moo, "connect vs pretransfer: %" CURL_FORMAT_CURL_OFF_T |
| - | ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n", |
| - | (time_connect / 1000000), (long)(time_connect % 1000000), |
| - | (time_pretransfer / 1000000), |
| - | (long)(time_pretransfer % 1000000)); |
| + | curl_mfprintf(moo, "connect vs pretransfer: %" |
| + | CURL_FORMAT_CURL_OFF_T |
| + | ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n", |
| + | (time_connect / 1000000), |
| + | (long)(time_connect % 1000000), |
| + | (time_pretransfer / 1000000), |
| + | (long)(time_pretransfer % 1000000)); |
| } | |
| if(time_pretransfer > time_posttransfer) { | |
| - | fprintf(moo, "pretransfer vs posttransfer: %" CURL_FORMAT_CURL_OFF_T |
| - | ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n", |
| - | (time_pretransfer / 1000000), |
| - | (long)(time_pretransfer % 1000000), |
| - | (time_posttransfer / 1000000), |
| - | (long)(time_posttransfer % 1000000)); |
| + | curl_mfprintf(moo, "pretransfer vs posttransfer: %" |
| + | CURL_FORMAT_CURL_OFF_T |
| + | ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n", |
| + | (time_pretransfer / 1000000), |
| + | (long)(time_pretransfer % 1000000), |
| + | (time_posttransfer / 1000000), |
| + | (long)(time_posttransfer % 1000000)); |
| } | |
| if(time_pretransfer > time_starttransfer) { | |
| - | fprintf(moo, "pretransfer vs starttransfer: %" CURL_FORMAT_CURL_OFF_T |
| - | ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n", |
| - | (time_pretransfer / 1000000), |
| - | (long)(time_pretransfer % 1000000), |
| - | (time_starttransfer / 1000000), |
| - | (long)(time_starttransfer % 1000000)); |
| + | curl_mfprintf(moo, "pretransfer vs starttransfer: %" |
| + | CURL_FORMAT_CURL_OFF_T |
| + | ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n", |
| + | (time_pretransfer / 1000000), |
| + | (long)(time_pretransfer % 1000000), |
| + | (time_starttransfer / 1000000), |
| + | (long)(time_starttransfer % 1000000)); |
| } | |
| if(time_starttransfer > time_total) { | |
| - | fprintf(moo, "starttransfer vs total: %" CURL_FORMAT_CURL_OFF_T |
| - | ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n", |
| - | (time_starttransfer / 1000000), |
| - | (long)(time_starttransfer % 1000000), |
| - | (time_total / 1000000), (long)(time_total % 1000000)); |
| + | curl_mfprintf(moo, "starttransfer vs total: %" CURL_FORMAT_CURL_OFF_T |
| + | ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n", |
| + | (time_starttransfer / 1000000), |
| + | (long)(time_starttransfer % 1000000), |
| + | (time_total / 1000000), |
| + | (long)(time_total % 1000000)); |
| } | |
| if(time_posttransfer > time_total) { | |
| - | fprintf(moo, "posttransfer vs total: %" CURL_FORMAT_CURL_OFF_T |
| - | ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n", |
| - | (time_posttransfer / 1000000), |
| - | (long)(time_posttransfer % 1000000), |
| - | (time_total / 1000000), (long)(time_total % 1000000)); |
| + | curl_mfprintf(moo, "posttransfer vs total: %" CURL_FORMAT_CURL_OFF_T |
| + | ".%06ld %" CURL_FORMAT_CURL_OFF_T ".%06ld\n", |
| + | (time_posttransfer / 1000000), |
| + | (long)(time_posttransfer % 1000000), |
| + | (time_total / 1000000), |
| + | (long)(time_total % 1000000)); |
| } | |
| fclose(moo); | |
| @@ -33,13 +33,13 @@ CURLcode test(char *URL) | |
| (void)URL; /* we don't use this */ | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -68,7 +68,7 @@ CURLcode test(char *URL) | |
| interval.tv_sec = 1; | |
| interval.tv_usec = 0; | |
| - | fprintf(stderr, "curl_multi_perform()\n"); |
| + | curl_mfprintf(stderr, "curl_multi_perform()\n"); |
| multi_perform(m, &running); | |
| @@ -77,7 +77,7 @@ CURLcode test(char *URL) | |
| int num; | |
| mres = curl_multi_wait(m, NULL, 0, TEST_HANG_TIMEOUT, &num); | |
| if(mres != CURLM_OK) { | |
| - | printf("curl_multi_wait() returned %d\n", mres); |
| + | curl_mprintf("curl_multi_wait() returned %d\n", mres); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -93,20 +93,20 @@ CURLcode test(char *URL) | |
| /* This is where this code is expected to reach */ | |
| int numleft; | |
| CURLMsg *msg = curl_multi_info_read(m, &numleft); | |
| - | fprintf(stderr, "Expected: not running\n"); |
| + | curl_mfprintf(stderr, "Expected: not running\n"); |
| if(msg && !numleft) | |
| res = TEST_ERR_SUCCESS; /* this is where we should be */ | |
| else | |
| res = TEST_ERR_FAILURE; /* not correct */ | |
| break; /* done */ | |
| } | |
| - | fprintf(stderr, "running == %d\n", running); |
| + | curl_mfprintf(stderr, "running == %d\n", running); |
| FD_ZERO(&rd); | |
| FD_ZERO(&wr); | |
| FD_ZERO(&exc); | |
| - | fprintf(stderr, "curl_multi_fdset()\n"); |
| + | curl_mfprintf(stderr, "curl_multi_fdset()\n"); |
| multi_fdset(m, &rd, &wr, &exc, &maxfd); | |
| @@ -50,15 +50,15 @@ CURLcode test(char *URL) | |
| const char *buf_2 = "RNTO 505-forreal"; | |
| if(!libtest_arg2) { | |
| - | fprintf(stderr, "Usage: <url> <file-to-upload>\n"); |
| + | curl_mfprintf(stderr, "Usage: <url> <file-to-upload>\n"); |
| return TEST_ERR_USAGE; | |
| } | |
| hd_src = fopen(libtest_arg2, "rb"); | |
| if(!hd_src) { | |
| - | fprintf(stderr, "fopen failed with error (%d) %s\n", |
| - | errno, strerror(errno)); |
| - | fprintf(stderr, "Error opening file '%s'\n", libtest_arg2); |
| + | curl_mfprintf(stderr, "fopen failed with error (%d) %s\n", |
| + | errno, strerror(errno)); |
| + | curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2); |
| return TEST_ERR_MAJOR_BAD; /* if this happens things are major weird */ | |
| } | |
| @@ -70,21 +70,21 @@ CURLcode test(char *URL) | |
| #endif | |
| if(hd == -1) { | |
| /* can't open file, bail out */ | |
| - | fprintf(stderr, "fstat() failed with error (%d) %s\n", |
| - | errno, strerror(errno)); |
| - | fprintf(stderr, "Error opening file '%s'\n", libtest_arg2); |
| + | curl_mfprintf(stderr, "fstat() failed with error (%d) %s\n", |
| + | errno, strerror(errno)); |
| + | curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2); |
| fclose(hd_src); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| if(!file_info.st_size) { | |
| - | fprintf(stderr, "File %s has zero size!\n", libtest_arg2); |
| + | curl_mfprintf(stderr, "File %s has zero size!\n", libtest_arg2); |
| fclose(hd_src); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| fclose(hd_src); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -92,7 +92,7 @@ CURLcode test(char *URL) | |
| /* get a curl handle */ | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| fclose(hd_src); | |
| return TEST_ERR_MAJOR_BAD; | |
| @@ -102,7 +102,7 @@ CURLcode test(char *URL) | |
| hl = curl_slist_append(headerlist, buf_1); | |
| if(!hl) { | |
| - | fprintf(stderr, "curl_slist_append() failed\n"); |
| + | curl_mfprintf(stderr, "curl_slist_append() failed\n"); |
| curl_easy_cleanup(curl); | |
| curl_global_cleanup(); | |
| fclose(hd_src); | |
| @@ -110,7 +110,7 @@ CURLcode test(char *URL) | |
| } | |
| headerlist = curl_slist_append(hl, buf_2); | |
| if(!headerlist) { | |
| - | fprintf(stderr, "curl_slist_append() failed\n"); |
| + | curl_mfprintf(stderr, "curl_slist_append() failed\n"); |
| curl_slist_free_all(hl); | |
| curl_easy_cleanup(curl); | |
| curl_global_cleanup(); | |
| @@ -66,18 +66,18 @@ static void test_lock(CURL *handle, curl_lock_data data, | |
| locknum = 2; | |
| break; | |
| default: | |
| - | fprintf(stderr, "lock: no such data: %d\n", (int)data); |
| + | curl_mfprintf(stderr, "lock: no such data: %d\n", (int)data); |
| return; | |
| } | |
| /* detect locking of locked locks */ | |
| if(locks[locknum]) { | |
| - | printf("lock: double locked %s\n", what); |
| + | curl_mprintf("lock: double locked %s\n", what); |
| return; | |
| } | |
| locks[locknum]++; | |
| - | printf("lock: %-6s [%s]: %d\n", what, user->text, user->counter); |
| + | curl_mprintf("lock: %-6s [%s]: %d\n", what, user->text, user->counter); |
| user->counter++; | |
| } | |
| @@ -102,18 +102,18 @@ static void test_unlock(CURL *handle, curl_lock_data data, void *useptr) | |
| locknum = 2; | |
| break; | |
| default: | |
| - | fprintf(stderr, "unlock: no such data: %d\n", (int)data); |
| + | curl_mfprintf(stderr, "unlock: no such data: %d\n", (int)data); |
| return; | |
| } | |
| /* detect unlocking of unlocked locks */ | |
| if(!locks[locknum]) { | |
| - | printf("unlock: double unlocked %s\n", what); |
| + | curl_mprintf("unlock: double unlocked %s\n", what); |
| return; | |
| } | |
| locks[locknum]--; | |
| - | printf("unlock: %-6s [%s]: %d\n", what, user->text, user->counter); |
| + | curl_mprintf("unlock: %-6s [%s]: %d\n", what, user->text, user->counter); |
| user->counter++; | |
| } | |
| @@ -136,7 +136,7 @@ static void *test_fire(void *ptr) | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| return NULL; | |
| } | |
| @@ -145,18 +145,18 @@ static void *test_fire(void *ptr) | |
| curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); | |
| curl_easy_setopt(curl, CURLOPT_URL, tdata->url); | |
| curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); | |
| - | printf("CURLOPT_SHARE\n"); |
| + | curl_mprintf("CURLOPT_SHARE\n"); |
| curl_easy_setopt(curl, CURLOPT_SHARE, tdata->share); | |
| - | printf("PERFORM\n"); |
| + | curl_mprintf("PERFORM\n"); |
| code = curl_easy_perform(curl); | |
| if(code) { | |
| int i = 0; | |
| - | fprintf(stderr, "perform url '%s' repeat %d failed, curlcode %d\n", |
| + | curl_mfprintf(stderr, "perform url '%s' repeat %d failed, curlcode %d\n", |
| tdata->url, i, (int)code); | |
| } | |
| - | printf("CLEANUP\n"); |
| + | curl_mprintf("CLEANUP\n"); |
| curl_easy_cleanup(curl); | |
| curl_slist_free_all(headers); | |
| @@ -190,44 +190,44 @@ CURLcode test(char *URL) | |
| user.text = "Pigs in space"; | |
| user.counter = 0; | |
| - | printf("GLOBAL_INIT\n"); |
| + | curl_mprintf("GLOBAL_INIT\n"); |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| /* prepare share */ | |
| - | printf("SHARE_INIT\n"); |
| + | curl_mprintf("SHARE_INIT\n"); |
| share = curl_share_init(); | |
| if(!share) { | |
| - | fprintf(stderr, "curl_share_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_share_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| if(CURLSHE_OK == scode) { | |
| - | printf("CURLSHOPT_LOCKFUNC\n"); |
| + | curl_mprintf("CURLSHOPT_LOCKFUNC\n"); |
| scode = curl_share_setopt(share, CURLSHOPT_LOCKFUNC, test_lock); | |
| } | |
| if(CURLSHE_OK == scode) { | |
| - | printf("CURLSHOPT_UNLOCKFUNC\n"); |
| + | curl_mprintf("CURLSHOPT_UNLOCKFUNC\n"); |
| scode = curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, test_unlock); | |
| } | |
| if(CURLSHE_OK == scode) { | |
| - | printf("CURLSHOPT_USERDATA\n"); |
| + | curl_mprintf("CURLSHOPT_USERDATA\n"); |
| scode = curl_share_setopt(share, CURLSHOPT_USERDATA, &user); | |
| } | |
| if(CURLSHE_OK == scode) { | |
| - | printf("CURL_LOCK_DATA_COOKIE\n"); |
| + | curl_mprintf("CURL_LOCK_DATA_COOKIE\n"); |
| scode = curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE); | |
| } | |
| if(CURLSHE_OK == scode) { | |
| - | printf("CURL_LOCK_DATA_DNS\n"); |
| + | curl_mprintf("CURL_LOCK_DATA_DNS\n"); |
| scode = curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS); | |
| } | |
| if(CURLSHE_OK != scode) { | |
| - | fprintf(stderr, "curl_share_setopt() failed\n"); |
| + | curl_mfprintf(stderr, "curl_share_setopt() failed\n"); |
| curl_share_cleanup(share); | |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| @@ -236,28 +236,28 @@ CURLcode test(char *URL) | |
| /* initial cookie manipulation */ | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_share_cleanup(share); | |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| - | printf("CURLOPT_SHARE\n"); |
| + | curl_mprintf("CURLOPT_SHARE\n"); |
| test_setopt(curl, CURLOPT_SHARE, share); | |
| - | printf("CURLOPT_COOKIELIST injected_and_clobbered\n"); |
| + | curl_mprintf("CURLOPT_COOKIELIST injected_and_clobbered\n"); |
| test_setopt(curl, CURLOPT_COOKIELIST, | |
| "Set-Cookie: injected_and_clobbered=yes; " | |
| "domain=host.foo.com; expires=Sat Feb 2 11:56:27 GMT 2030"); | |
| - | printf("CURLOPT_COOKIELIST ALL\n"); |
| + | curl_mprintf("CURLOPT_COOKIELIST ALL\n"); |
| test_setopt(curl, CURLOPT_COOKIELIST, "ALL"); | |
| - | printf("CURLOPT_COOKIELIST session\n"); |
| + | curl_mprintf("CURLOPT_COOKIELIST session\n"); |
| test_setopt(curl, CURLOPT_COOKIELIST, "Set-Cookie: session=elephants"); | |
| - | printf("CURLOPT_COOKIELIST injected\n"); |
| + | curl_mprintf("CURLOPT_COOKIELIST injected\n"); |
| test_setopt(curl, CURLOPT_COOKIELIST, | |
| "Set-Cookie: injected=yes; domain=host.foo.com; " | |
| "expires=Sat Feb 2 11:56:27 GMT 2030"); | |
| - | printf("CURLOPT_COOKIELIST SESS\n"); |
| + | curl_mprintf("CURLOPT_COOKIELIST SESS\n"); |
| test_setopt(curl, CURLOPT_COOKIELIST, "SESS"); | |
| - | printf("CLEANUP\n"); |
| + | curl_mprintf("CLEANUP\n"); |
| curl_easy_cleanup(curl); | |
| @@ -269,7 +269,7 @@ CURLcode test(char *URL) | |
| tdata.share = share; | |
| /* simulate thread, direct call of "thread" function */ | |
| - | printf("*** run %d\n",i); |
| + | curl_mprintf("*** run %d\n",i); |
| test_fire(&tdata); | |
| curl_free(tdata.url); | |
| @@ -277,10 +277,10 @@ CURLcode test(char *URL) | |
| /* fetch another one and save cookies */ | |
| - | printf("*** run %d\n", i); |
| + | curl_mprintf("*** run %d\n", i); |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_share_cleanup(share); | |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| @@ -290,17 +290,17 @@ CURLcode test(char *URL) | |
| headers = sethost(NULL); | |
| test_setopt(curl, CURLOPT_HTTPHEADER, headers); | |
| test_setopt(curl, CURLOPT_URL, url); | |
| - | printf("CURLOPT_SHARE\n"); |
| + | curl_mprintf("CURLOPT_SHARE\n"); |
| test_setopt(curl, CURLOPT_SHARE, share); | |
| - | printf("CURLOPT_COOKIEJAR\n"); |
| + | curl_mprintf("CURLOPT_COOKIEJAR\n"); |
| test_setopt(curl, CURLOPT_COOKIEJAR, JAR); | |
| - | printf("CURLOPT_COOKIELIST FLUSH\n"); |
| + | curl_mprintf("CURLOPT_COOKIELIST FLUSH\n"); |
| test_setopt(curl, CURLOPT_COOKIELIST, "FLUSH"); | |
| - | printf("PERFORM\n"); |
| + | curl_mprintf("PERFORM\n"); |
| curl_easy_perform(curl); | |
| - | printf("CLEANUP\n"); |
| + | curl_mprintf("CLEANUP\n"); |
| curl_easy_cleanup(curl); | |
| curl_free(url); | |
| curl_slist_free_all(headers); | |
| @@ -308,7 +308,7 @@ CURLcode test(char *URL) | |
| /* load cookies */ | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_share_cleanup(share); | |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| @@ -317,65 +317,65 @@ CURLcode test(char *URL) | |
| headers = sethost(NULL); | |
| test_setopt(curl, CURLOPT_HTTPHEADER, headers); | |
| test_setopt(curl, CURLOPT_URL, url); | |
| - | printf("CURLOPT_SHARE\n"); |
| + | curl_mprintf("CURLOPT_SHARE\n"); |
| test_setopt(curl, CURLOPT_SHARE, share); | |
| - | printf("CURLOPT_COOKIELIST ALL\n"); |
| + | curl_mprintf("CURLOPT_COOKIELIST ALL\n"); |
| test_setopt(curl, CURLOPT_COOKIELIST, "ALL"); | |
| - | printf("CURLOPT_COOKIEJAR\n"); |
| + | curl_mprintf("CURLOPT_COOKIEJAR\n"); |
| test_setopt(curl, CURLOPT_COOKIEFILE, JAR); | |
| - | printf("CURLOPT_COOKIELIST RELOAD\n"); |
| + | curl_mprintf("CURLOPT_COOKIELIST RELOAD\n"); |
| test_setopt(curl, CURLOPT_COOKIELIST, "RELOAD"); | |
| res = CURLE_OK; | |
| code = curl_easy_getinfo(curl, CURLINFO_COOKIELIST, &cookies); | |
| if(code != CURLE_OK) { | |
| - | fprintf(stderr, "curl_easy_getinfo() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_getinfo() failed\n"); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| - | printf("loaded cookies:\n"); |
| + | curl_mprintf("loaded cookies:\n"); |
| if(!cookies) { | |
| - | fprintf(stderr, " reloading cookies from '%s' failed\n", JAR); |
| + | curl_mfprintf(stderr, " reloading cookies from '%s' failed\n", JAR); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| - | printf("-----------------\n"); |
| + | curl_mprintf("-----------------\n"); |
| next_cookie = cookies; | |
| while(next_cookie) { | |
| - | printf(" %s\n", next_cookie->data); |
| + | curl_mprintf(" %s\n", next_cookie->data); |
| next_cookie = next_cookie->next; | |
| } | |
| - | printf("-----------------\n"); |
| + | curl_mprintf("-----------------\n"); |
| curl_slist_free_all(cookies); | |
| /* try to free share, expect to fail because share is in use */ | |
| - | printf("try SHARE_CLEANUP...\n"); |
| + | curl_mprintf("try SHARE_CLEANUP...\n"); |
| scode = curl_share_cleanup(share); | |
| if(scode == CURLSHE_OK) { | |
| - | fprintf(stderr, "curl_share_cleanup succeed but error expected\n"); |
| + | curl_mfprintf(stderr, "curl_share_cleanup succeed but error expected\n"); |
| share = NULL; | |
| } | |
| else { | |
| - | printf("SHARE_CLEANUP failed, correct\n"); |
| + | curl_mprintf("SHARE_CLEANUP failed, correct\n"); |
| } | |
| test_cleanup: | |
| /* clean up last handle */ | |
| - | printf("CLEANUP\n"); |
| + | curl_mprintf("CLEANUP\n"); |
| curl_easy_cleanup(curl); | |
| curl_slist_free_all(headers); | |
| curl_free(url); | |
| /* free share */ | |
| - | printf("SHARE_CLEANUP\n"); |
| + | curl_mprintf("SHARE_CLEANUP\n"); |
| scode = curl_share_cleanup(share); | |
| if(scode != CURLSHE_OK) | |
| - | fprintf(stderr, "curl_share_cleanup failed, code errno %d\n", |
| + | curl_mfprintf(stderr, "curl_share_cleanup failed, code errno %d\n", |
| (int)scode); | |
| - | printf("GLOBAL_CLEANUP\n"); |
| + | curl_mprintf("GLOBAL_CLEANUP\n"); |
| curl_global_cleanup(); | |
| return res; | |
| @@ -60,13 +60,13 @@ CURLcode test(char *URL) | |
| pooh.sizeleft = strlen(testdata); | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -86,13 +86,13 @@ CURLcode test(char *URL) | |
| custom_strdup, | |
| custom_calloc); | |
| if(res != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init_mem() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init_mem() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -103,7 +103,7 @@ CURLcode test(char *URL) | |
| str = curl_easy_escape(curl, (char *)a, asize); /* uses realloc() */ | |
| if(seen) | |
| - | printf("Callbacks were invoked!\n"); |
| + | curl_mprintf("Callbacks were invoked!\n"); |
| test_cleanup: | |
| @@ -51,7 +51,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) | |
| if(data) { | |
| size_t len = strlen(data); | |
| if(size*nmemb < len) { | |
| - | fprintf(stderr, "read buffer is too small to run test\n"); |
| + | curl_mfprintf(stderr, "read buffer is too small to run test\n"); |
| return 0; | |
| } | |
| memcpy(ptr, data, len); | |
| @@ -70,20 +70,20 @@ CURLcode test(char *URL) | |
| pooh.counter = 0; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| slist = curl_slist_append(slist, "Transfer-Encoding: chunked"); | |
| if(!slist) { | |
| - | fprintf(stderr, "curl_slist_append() failed\n"); |
| + | curl_mfprintf(stderr, "curl_slist_append() failed\n"); |
| curl_easy_cleanup(curl); | |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| @@ -31,13 +31,13 @@ CURLcode test(char *URL) | |
| CURL *curl; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -40,13 +40,13 @@ CURLcode test(char *URL) | |
| CURLcode res = CURLE_OK; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -31,13 +31,13 @@ CURLcode test(char *URL) | |
| CURLcode res = CURLE_OK; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -31,13 +31,13 @@ CURLcode test(char *URL) | |
| CURLcode res = CURLE_OK; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -31,13 +31,13 @@ CURLcode test(char *URL) | |
| CURLcode res = CURLE_OK; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -172,7 +172,7 @@ CURLcode test(char *URL) | |
| for(i = 0; dates[i].input; i++) { | |
| time_t out = curl_getdate(dates[i].input, NULL); | |
| if(out != dates[i].output) { | |
| - | printf("WRONGLY %s => %ld (instead of %ld)\n", |
| + | curl_mprintf("WRONGLY %s => %ld (instead of %ld)\n", |
| dates[i].input, (long)out, (long)dates[i].output); | |
| error++; | |
| } | |
| @@ -57,9 +57,9 @@ static char msgbuff[256]; | |
| static void store_errmsg(const char *msg, int err) | |
| { | |
| if(!err) | |
| - | msnprintf(msgbuff, sizeof(msgbuff), "%s", msg); |
| + | curl_msnprintf(msgbuff, sizeof(msgbuff), "%s", msg); |
| else | |
| - | msnprintf(msgbuff, sizeof(msgbuff), "%s, errno %d, %s", msg, |
| + | curl_msnprintf(msgbuff, sizeof(msgbuff), "%s, errno %d, %s", msg, |
| err, strerror(err)); | |
| } | |
| @@ -87,7 +87,7 @@ static int fopen_works(void) | |
| fpa[i] = fopen(DEV_NULL, FOPEN_READTEXT); | |
| if(!fpa[i]) { | |
| store_errmsg("fopen failed", errno); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| ret = 0; | |
| break; | |
| } | |
| @@ -103,20 +103,20 @@ static void rlim2str(char *buf, size_t len, rlim_t val) | |
| { | |
| #ifdef RLIM_INFINITY | |
| if(val == RLIM_INFINITY) { | |
| - | msnprintf(buf, len, "INFINITY"); |
| + | curl_msnprintf(buf, len, "INFINITY"); |
| return; | |
| } | |
| #endif | |
| #ifdef HAVE_LONGLONG | |
| if(sizeof(rlim_t) > sizeof(long)) | |
| - | msnprintf(buf, len, "%llu", (unsigned long long)val); |
| + | curl_msnprintf(buf, len, "%llu", (unsigned long long)val); |
| else | |
| #endif | |
| { | |
| if(sizeof(rlim_t) < sizeof(long)) | |
| - | msnprintf(buf, len, "%u", (unsigned int)val); |
| + | curl_msnprintf(buf, len, "%u", (unsigned int)val); |
| else | |
| - | msnprintf(buf, len, "%lu", (unsigned long)val); |
| + | curl_msnprintf(buf, len, "%lu", (unsigned long)val); |
| } | |
| } | |
| @@ -133,23 +133,23 @@ static int test_rlimit(int keep_open) | |
| if(getrlimit(RLIMIT_NOFILE, &rl) != 0) { | |
| store_errmsg("getrlimit() failed", errno); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| return -1; | |
| } | |
| /* show initial open file limits */ | |
| rlim2str(strbuff, sizeof(strbuff), rl.rlim_cur); | |
| - | fprintf(stderr, "initial soft limit: %s\n", strbuff); |
| + | curl_mfprintf(stderr, "initial soft limit: %s\n", strbuff); |
| rlim2str(strbuff, sizeof(strbuff), rl.rlim_max); | |
| - | fprintf(stderr, "initial hard limit: %s\n", strbuff); |
| + | curl_mfprintf(stderr, "initial hard limit: %s\n", strbuff); |
| /* show our constants */ | |
| - | fprintf(stderr, "test518 FD_SETSIZE: %d\n", FD_SETSIZE); |
| - | fprintf(stderr, "test518 NUM_OPEN : %d\n", NUM_OPEN); |
| - | fprintf(stderr, "test518 NUM_NEEDED: %d\n", NUM_NEEDED); |
| + | curl_mfprintf(stderr, "test518 FD_SETSIZE: %d\n", FD_SETSIZE); |
| + | curl_mfprintf(stderr, "test518 NUM_OPEN : %d\n", NUM_OPEN); |
| + | curl_mfprintf(stderr, "test518 NUM_NEEDED: %d\n", NUM_NEEDED); |
| /* | |
| * if soft limit and hard limit are different we ask the | |
| @@ -165,23 +165,23 @@ static int test_rlimit(int keep_open) | |
| #ifdef OPEN_MAX | |
| if((rl.rlim_cur > 0) && | |
| (rl.rlim_cur < OPEN_MAX)) { | |
| - | fprintf(stderr, "raising soft limit up to OPEN_MAX\n"); |
| + | curl_mfprintf(stderr, "raising soft limit up to OPEN_MAX\n"); |
| rl.rlim_cur = OPEN_MAX; | |
| if(setrlimit(RLIMIT_NOFILE, &rl) != 0) { | |
| /* on failure don't abort just issue a warning */ | |
| store_errmsg("setrlimit() failed", errno); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| msgbuff[0] = '\0'; | |
| } | |
| } | |
| #endif | |
| - | fprintf(stderr, "raising soft limit up to hard limit\n"); |
| + | curl_mfprintf(stderr, "raising soft limit up to hard limit\n"); |
| rl.rlim_cur = rl.rlim_max; | |
| if(setrlimit(RLIMIT_NOFILE, &rl) != 0) { | |
| /* on failure don't abort just issue a warning */ | |
| store_errmsg("setrlimit() failed", errno); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| msgbuff[0] = '\0'; | |
| } | |
| @@ -189,17 +189,17 @@ static int test_rlimit(int keep_open) | |
| if(getrlimit(RLIMIT_NOFILE, &rl) != 0) { | |
| store_errmsg("getrlimit() failed", errno); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| return -3; | |
| } | |
| /* show current open file limits */ | |
| rlim2str(strbuff, sizeof(strbuff), rl.rlim_cur); | |
| - | fprintf(stderr, "current soft limit: %s\n", strbuff); |
| + | curl_mfprintf(stderr, "current soft limit: %s\n", strbuff); |
| rlim2str(strbuff, sizeof(strbuff), rl.rlim_max); | |
| - | fprintf(stderr, "current hard limit: %s\n", strbuff); |
| + | curl_mfprintf(stderr, "current hard limit: %s\n", strbuff); |
| } /* (rl.rlim_cur != rl.rlim_max) */ | |
| @@ -227,10 +227,10 @@ static int test_rlimit(int keep_open) | |
| (rl.rlim_cur <= num_open.rlim_cur)) { | |
| rlim2str(strbuff2, sizeof(strbuff2), rl.rlim_cur); | |
| rlim2str(strbuff1, sizeof(strbuff1), num_open.rlim_cur); | |
| - | msnprintf(strbuff, sizeof(strbuff), "fds needed %s > system limit %s", |
| + | curl_msnprintf(strbuff, sizeof(strbuff), "fds needed %s > system limit %s", |
| strbuff1, strbuff2); | |
| store_errmsg(strbuff, 0); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| return -4; | |
| } | |
| @@ -250,22 +250,22 @@ static int test_rlimit(int keep_open) | |
| do { | |
| num_open.rlim_max = sizeof(*memchunk) * nitems; | |
| rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); | |
| - | fprintf(stderr, "allocating memchunk %s byte array\n", strbuff); |
| + | curl_mfprintf(stderr, "allocating memchunk %s byte array\n", strbuff); |
| memchunk = malloc(sizeof(*memchunk) * (size_t)nitems); | |
| if(!memchunk) { | |
| - | fprintf(stderr, "memchunk, malloc() failed\n"); |
| + | curl_mfprintf(stderr, "memchunk, malloc() failed\n"); |
| nitems /= 2; | |
| } | |
| } while(nitems && !memchunk); | |
| if(!memchunk) { | |
| store_errmsg("memchunk, malloc() failed", errno); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| return -5; | |
| } | |
| /* initialize it to fight lazy allocation */ | |
| - | fprintf(stderr, "initializing memchunk array\n"); |
| + | curl_mfprintf(stderr, "initializing memchunk array\n"); |
| for(i = 0; i < nitems; i++) | |
| memchunk[i] = -1; | |
| @@ -278,10 +278,11 @@ static int test_rlimit(int keep_open) | |
| if((size_t)(num_open.rlim_max) > ((size_t)-1) / sizeof(*testfd)) { | |
| rlim2str(strbuff1, sizeof(strbuff1), num_open.rlim_max); | |
| - | msnprintf(strbuff, sizeof(strbuff), "unable to allocate an array for %s " |
| - | "file descriptors, would overflow size_t", strbuff1); |
| + | curl_msnprintf(strbuff, sizeof(strbuff), |
| + | "unable to allocate an array for %s " |
| + | "file descriptors, would overflow size_t", strbuff1); |
| store_errmsg(strbuff, 0); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| free(memchunk); | |
| return -6; | |
| } | |
| @@ -289,19 +290,19 @@ static int test_rlimit(int keep_open) | |
| /* allocate array for file descriptors */ | |
| rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); | |
| - | fprintf(stderr, "allocating array for %s file descriptors\n", strbuff); |
| + | curl_mfprintf(stderr, "allocating array for %s file descriptors\n", strbuff); |
| testfd = malloc(sizeof(*testfd) * (size_t)(num_open.rlim_max)); | |
| if(!testfd) { | |
| store_errmsg("testfd, malloc() failed", errno); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| free(memchunk); | |
| return -7; | |
| } | |
| /* initialize it to fight lazy allocation */ | |
| - | fprintf(stderr, "initializing testfd array\n"); |
| + | curl_mfprintf(stderr, "initializing testfd array\n"); |
| for(num_open.rlim_cur = 0; | |
| num_open.rlim_cur < num_open.rlim_max; | |
| @@ -309,15 +310,15 @@ static int test_rlimit(int keep_open) | |
| testfd[num_open.rlim_cur] = -1; | |
| rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); | |
| - | fprintf(stderr, "trying to open %s file descriptors\n", strbuff); |
| + | curl_mfprintf(stderr, "trying to open %s file descriptors\n", strbuff); |
| /* open a dummy descriptor */ | |
| testfd[0] = open(DEV_NULL, O_RDONLY); | |
| if(testfd[0] < 0) { | |
| - | msnprintf(strbuff, sizeof(strbuff), "opening of %s failed", DEV_NULL); |
| + | curl_msnprintf(strbuff, sizeof(strbuff), "opening of %s failed", DEV_NULL); |
| store_errmsg(strbuff, errno); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| free(testfd); | |
| testfd = NULL; | |
| free(memchunk); | |
| @@ -337,22 +338,23 @@ static int test_rlimit(int keep_open) | |
| testfd[num_open.rlim_cur] = -1; | |
| rlim2str(strbuff1, sizeof(strbuff1), num_open.rlim_cur); | |
| - | msnprintf(strbuff, sizeof(strbuff), "dup() attempt %s failed", strbuff1); |
| - | fprintf(stderr, "%s\n", strbuff); |
| + | curl_msnprintf(strbuff, sizeof(strbuff), "dup() attempt %s failed", |
| + | strbuff1); |
| + | curl_mfprintf(stderr, "%s\n", strbuff); |
| rlim2str(strbuff1, sizeof(strbuff1), num_open.rlim_cur); | |
| - | msnprintf(strbuff, sizeof(strbuff), "fds system limit seems close to %s", |
| - | strbuff1); |
| - | fprintf(stderr, "%s\n", strbuff); |
| + | curl_msnprintf(strbuff, sizeof(strbuff), |
| + | "fds system limit seems close to %s", strbuff1); |
| + | curl_mfprintf(stderr, "%s\n", strbuff); |
| num_open.rlim_max = NUM_NEEDED; | |
| rlim2str(strbuff2, sizeof(strbuff2), num_open.rlim_max); | |
| rlim2str(strbuff1, sizeof(strbuff1), num_open.rlim_cur); | |
| - | msnprintf(strbuff, sizeof(strbuff), "fds needed %s > system limit %s", |
| - | strbuff2, strbuff1); |
| + | curl_msnprintf(strbuff, sizeof(strbuff), |
| + | "fds needed %s > system limit %s", strbuff2, strbuff1); |
| store_errmsg(strbuff, 0); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| for(num_open.rlim_cur = 0; | |
| testfd[num_open.rlim_cur] >= 0; | |
| @@ -366,7 +368,7 @@ static int test_rlimit(int keep_open) | |
| } | |
| rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); | |
| - | fprintf(stderr, "%s file descriptors open\n", strbuff); |
| + | curl_mfprintf(stderr, "%s file descriptors open\n", strbuff); |
| #if !defined(HAVE_POLL) && !defined(USE_WINSOCK) | |
| @@ -383,10 +385,10 @@ static int test_rlimit(int keep_open) | |
| num_open.rlim_cur = FD_SETSIZE - SAFETY_MARGIN; | |
| if(num_open.rlim_max > num_open.rlim_cur) { | |
| - | msnprintf(strbuff, sizeof(strbuff), "select limit is FD_SETSIZE %d", |
| + | curl_msnprintf(strbuff, sizeof(strbuff), "select limit is FD_SETSIZE %d", |
| FD_SETSIZE); | |
| store_errmsg(strbuff, 0); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| close_file_descriptors(); | |
| free(memchunk); | |
| return -10; | |
| @@ -398,10 +400,10 @@ static int test_rlimit(int keep_open) | |
| rl.rlim_cur++) { | |
| if((testfd[rl.rlim_cur] > 0) && | |
| ((unsigned int)testfd[rl.rlim_cur] > num_open.rlim_cur)) { | |
| - | msnprintf(strbuff, sizeof(strbuff), "select limit is FD_SETSIZE %d", |
| + | curl_msnprintf(strbuff, sizeof(strbuff), "select limit is FD_SETSIZE %d", |
| FD_SETSIZE); | |
| store_errmsg(strbuff, 0); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| close_file_descriptors(); | |
| free(memchunk); | |
| return -11; | |
| @@ -421,10 +423,11 @@ static int test_rlimit(int keep_open) | |
| if(!fopen_works()) { | |
| rlim2str(strbuff1, sizeof(strbuff1), num_open.rlim_max); | |
| - | msnprintf(strbuff, sizeof(strbuff), "fopen fails with %s fds open", |
| + | curl_msnprintf(strbuff, sizeof(strbuff), "fopen fails with %s fds open", |
| strbuff1); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| - | msnprintf(strbuff, sizeof(strbuff), "fopen fails with lots of fds open"); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| + | curl_msnprintf(strbuff, sizeof(strbuff), |
| + | "fopen fails with lots of fds open"); |
| store_errmsg(strbuff, 0); | |
| close_file_descriptors(); | |
| free(memchunk); | |
| @@ -453,7 +456,7 @@ CURLcode test(char *URL) | |
| if(!strcmp(URL, "check")) { | |
| /* used by the test script to ask if we can run this test or not */ | |
| if(test_rlimit(FALSE)) { | |
| - | fprintf(stdout, "test_rlimit problem: %s\n", msgbuff); |
| + | curl_mfprintf(stdout, "test_rlimit problem: %s\n", msgbuff); |
| return TEST_ERR_FAILURE; | |
| } | |
| return CURLE_OK; /* sure, run this! */ | |
| @@ -468,14 +471,14 @@ CURLcode test(char *URL) | |
| and close them all once the test is over */ | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| close_file_descriptors(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| close_file_descriptors(); | |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| @@ -500,7 +503,7 @@ test_cleanup: | |
| CURLcode test(char *URL) | |
| { | |
| (void)URL; | |
| - | printf("system lacks necessary system function(s)"); |
| + | curl_mprintf("system lacks necessary system function(s)"); |
| return 1; /* skip test */ | |
| } | |
| @@ -31,13 +31,13 @@ CURLcode test(char *URL) | |
| CURL *curl; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -31,13 +31,13 @@ CURLcode test(char *URL) | |
| CURL *curl; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -31,13 +31,13 @@ CURLcode test(char *URL) | |
| CURL *curl; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -31,13 +31,13 @@ CURLcode test(char *URL) | |
| CURL *curl; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -31,13 +31,13 @@ CURLcode test(char *URL) | |
| CURL *curl; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -46,19 +46,19 @@ CURLcode test(char *URL) | |
| if(!libtest_arg2) { | |
| #ifdef LIB529 | |
| /* test 529 */ | |
| - | fprintf(stderr, "Usage: lib529 [url] [uploadfile]\n"); |
| + | curl_mfprintf(stderr, "Usage: lib529 [url] [uploadfile]\n"); |
| #else | |
| /* test 525 */ | |
| - | fprintf(stderr, "Usage: lib525 [url] [uploadfile]\n"); |
| + | curl_mfprintf(stderr, "Usage: lib525 [url] [uploadfile]\n"); |
| #endif | |
| return TEST_ERR_USAGE; | |
| } | |
| hd_src = fopen(libtest_arg2, "rb"); | |
| if(!hd_src) { | |
| - | fprintf(stderr, "fopen failed with error (%d) %s\n", |
| + | curl_mfprintf(stderr, "fopen failed with error (%d) %s\n", |
| errno, strerror(errno)); | |
| - | fprintf(stderr, "Error opening file '%s'\n", libtest_arg2); |
| + | curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2); |
| return TEST_ERR_FOPEN; | |
| } | |
| @@ -70,9 +70,9 @@ CURLcode test(char *URL) | |
| #endif | |
| if(hd == -1) { | |
| /* can't open file, bail out */ | |
| - | fprintf(stderr, "fstat() failed with error (%d) %s\n", |
| + | curl_mfprintf(stderr, "fstat() failed with error (%d) %s\n", |
| errno, strerror(errno)); | |
| - | fprintf(stderr, "Error opening file '%s'\n", libtest_arg2); |
| + | curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2); |
| fclose(hd_src); | |
| return TEST_ERR_FSTAT; | |
| } | |
| @@ -81,7 +81,7 @@ CURLcode test(char *URL) | |
| multi_add_handle(m, curl[current]); | |
| - | fprintf(stderr, "Start at URL 0\n"); |
| + | curl_mfprintf(stderr, "Start at URL 0\n"); |
| for(;;) { | |
| struct timeval interval; | |
| @@ -104,7 +104,7 @@ CURLcode test(char *URL) | |
| curl[current] = NULL; | |
| #endif | |
| if(++current < NUM_HANDLES) { | |
| - | fprintf(stderr, "Advancing to URL %d\n", current); |
| + | curl_mfprintf(stderr, "Advancing to URL %d\n", current); |
| #ifdef LIB532 | |
| /* first remove the only handle we use */ | |
| curl_multi_remove_handle(m, curl[0]); | |
| @@ -56,7 +56,7 @@ static void removeFd(struct Sockets *sockets, curl_socket_t fd, int mention) | |
| int i; | |
| if(mention) | |
| - | fprintf(stderr, "Remove socket fd %d\n", (int) fd); |
| + | curl_mfprintf(stderr, "Remove socket fd %d\n", (int) fd); |
| for(i = 0; i < sockets->count; ++i) { | |
| if(sockets->sockets[i] == fd) { | |
| @@ -78,7 +78,7 @@ static int addFd(struct Sockets *sockets, curl_socket_t fd, const char *what) | |
| * To ensure we only have each file descriptor once, we remove it then add | |
| * it again. | |
| */ | |
| - | fprintf(stderr, "Add socket fd %d for %s\n", (int) fd, what); |
| + | curl_mfprintf(stderr, "Add socket fd %d for %s\n", (int) fd, what); |
| removeFd(sockets, fd, 0); | |
| /* | |
| * Allocate array storage when required. | |
| @@ -120,9 +120,10 @@ static int curlSocketCallback(CURL *easy, curl_socket_t s, int action, | |
| (void)easy; /* unused */ | |
| (void)socketp; /* unused */ | |
| - | fprintf(stderr, "CURLMOPT_SOCKETFUNCTION called: %u\n", socket_calls++); |
| + | curl_mfprintf(stderr, "CURLMOPT_SOCKETFUNCTION called: %u\n", |
| + | socket_calls++); |
| if(socket_calls == max_socket_calls) { | |
| - | fprintf(stderr, "curlSocketCallback returns error\n"); |
| + | curl_mfprintf(stderr, "curlSocketCallback returns error\n"); |
| return -1; | |
| } | |
| @@ -153,9 +154,9 @@ static int curlTimerCallback(CURLM *multi, long timeout_ms, void *userp) | |
| struct timeval *timeout = userp; | |
| (void)multi; /* unused */ | |
| - | fprintf(stderr, "CURLMOPT_TIMERFUNCTION called: %u\n", timer_calls++); |
| + | curl_mfprintf(stderr, "CURLMOPT_TIMERFUNCTION called: %u\n", timer_calls++); |
| if(timer_calls == max_timer_calls) { | |
| - | fprintf(stderr, "curlTimerCallback returns error\n"); |
| + | curl_mfprintf(stderr, "curlTimerCallback returns error\n"); |
| return -1; | |
| } | |
| if(timeout_ms != -1) { | |
| @@ -188,7 +189,7 @@ static int checkForCompletion(CURLM *curl, int *success) | |
| *success = 0; | |
| } | |
| else { | |
| - | fprintf(stderr, "Got an unexpected message from curl: %i\n", |
| + | curl_mfprintf(stderr, "Got an unexpected message from curl: %i\n", |
| message->msg); | |
| result = 1; | |
| *success = 0; | |
| @@ -238,7 +239,7 @@ static int socket_action(CURLM *curl, curl_socket_t s, int evBitmask, | |
| int numhandles = 0; | |
| CURLMcode result = curl_multi_socket_action(curl, s, evBitmask, &numhandles); | |
| if(result != CURLM_OK) { | |
| - | fprintf(stderr, "Curl error on %s (%i) %s\n", |
| + | curl_mfprintf(stderr, "Curl error on %s (%i) %s\n", |
| info, result, curl_multi_strerror(result)); | |
| } | |
| return (int)result; | |
| @@ -278,7 +279,7 @@ static CURLcode testone(char *URL, int timercb, int socketcb) | |
| timer_calls = 0; /* reset the globals */ | |
| socket_calls = 0; | |
| - | fprintf(stderr, "start test: %d %d\n", timercb, socketcb); |
| + | curl_mfprintf(stderr, "start test: %d %d\n", timercb, socketcb); |
| start_test_timing(); | |
| res_global_init(CURL_GLOBAL_ALL); | |
| @@ -354,14 +355,14 @@ static CURLcode testone(char *URL, int timercb, int socketcb) | |
| } | |
| if(!success) { | |
| - | fprintf(stderr, "Error getting file.\n"); |
| + | curl_mfprintf(stderr, "Error getting file.\n"); |
| res = TEST_ERR_MAJOR_BAD; | |
| } | |
| test_cleanup: | |
| /* proper cleanup sequence */ | |
| - | fprintf(stderr, "cleanup: %d %d\n", timercb, socketcb); |
| + | curl_mfprintf(stderr, "cleanup: %d %d\n", timercb, socketcb); |
| curl_multi_remove_handle(m, curl); | |
| curl_easy_cleanup(curl); | |
| curl_multi_cleanup(m); | |
| @@ -380,23 +381,23 @@ CURLcode test(char *URL) | |
| callback calls */ | |
| rc = testone(URL, 0, 0); | |
| if(rc) | |
| - | fprintf(stderr, "test 0/0 failed: %d\n", rc); |
| + | curl_mfprintf(stderr, "test 0/0 failed: %d\n", rc); |
| rc = testone(URL, 1, 0); | |
| if(!rc) | |
| - | fprintf(stderr, "test 1/0 failed: %d\n", rc); |
| + | curl_mfprintf(stderr, "test 1/0 failed: %d\n", rc); |
| rc = testone(URL, 2, 0); | |
| if(!rc) | |
| - | fprintf(stderr, "test 2/0 failed: %d\n", rc); |
| + | curl_mfprintf(stderr, "test 2/0 failed: %d\n", rc); |
| rc = testone(URL, 0, 1); | |
| if(!rc) | |
| - | fprintf(stderr, "test 0/1 failed: %d\n", rc); |
| + | curl_mfprintf(stderr, "test 0/1 failed: %d\n", rc); |
| rc = testone(URL, 0, 2); | |
| if(!rc) | |
| - | fprintf(stderr, "test 0/2 failed: %d\n", rc); |
| + | curl_mfprintf(stderr, "test 0/2 failed: %d\n", rc); |
| return CURLE_OK; | |
| } | |
| @@ -55,7 +55,7 @@ CURLcode test(char *URL) | |
| multi_add_handle(m, curl); | |
| - | fprintf(stderr, "Start at URL 0\n"); |
| + | curl_mfprintf(stderr, "Start at URL 0\n"); |
| for(;;) { | |
| struct timeval interval; | |
| @@ -71,7 +71,7 @@ CURLcode test(char *URL) | |
| if(!running) { | |
| if(!current++) { | |
| - | fprintf(stderr, "Advancing to URL 1\n"); |
| + | curl_mfprintf(stderr, "Advancing to URL 1\n"); |
| /* remove the handle we use */ | |
| curl_multi_remove_handle(m, curl); | |
| @@ -32,7 +32,7 @@ static void proxystat(CURL *curl) | |
| { | |
| long wasproxy; | |
| if(!curl_easy_getinfo(curl, CURLINFO_USED_PROXY, &wasproxy)) { | |
| - | printf("This %sthe proxy\n", wasproxy ? "used ": |
| + | curl_mprintf("This %sthe proxy\n", wasproxy ? "used ": |
| "DID NOT use "); | |
| } | |
| } | |
| @@ -44,13 +44,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *host = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -55,9 +55,9 @@ static char msgbuff[256]; | |
| static void store_errmsg(const char *msg, int err) | |
| { | |
| if(!err) | |
| - | msnprintf(msgbuff, sizeof(msgbuff), "%s", msg); |
| + | curl_msnprintf(msgbuff, sizeof(msgbuff), "%s", msg); |
| else | |
| - | msnprintf(msgbuff, sizeof(msgbuff), "%s, errno %d, %s", msg, |
| + | curl_msnprintf(msgbuff, sizeof(msgbuff), "%s, errno %d, %s", msg, |
| err, strerror(err)); | |
| } | |
| @@ -85,7 +85,7 @@ static int fopen_works(void) | |
| fpa[i] = fopen(DEV_NULL, FOPEN_READTEXT); | |
| if(!fpa[i]) { | |
| store_errmsg("fopen failed", errno); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| ret = 0; | |
| break; | |
| } | |
| @@ -101,20 +101,20 @@ static void rlim2str(char *buf, size_t len, rlim_t val) | |
| { | |
| #ifdef RLIM_INFINITY | |
| if(val == RLIM_INFINITY) { | |
| - | msnprintf(buf, len, "INFINITY"); |
| + | curl_msnprintf(buf, len, "INFINITY"); |
| return; | |
| } | |
| #endif | |
| #ifdef HAVE_LONGLONG | |
| if(sizeof(rlim_t) > sizeof(long)) | |
| - | msnprintf(buf, len, "%llu", (unsigned long long)val); |
| + | curl_msnprintf(buf, len, "%llu", (unsigned long long)val); |
| else | |
| #endif | |
| { | |
| if(sizeof(rlim_t) < sizeof(long)) | |
| - | msnprintf(buf, len, "%u", (unsigned int)val); |
| + | curl_msnprintf(buf, len, "%u", (unsigned int)val); |
| else | |
| - | msnprintf(buf, len, "%lu", (unsigned long)val); |
| + | curl_msnprintf(buf, len, "%lu", (unsigned long)val); |
| } | |
| } | |
| @@ -131,24 +131,25 @@ static int test_rlimit(int keep_open) | |
| if(getrlimit(RLIMIT_NOFILE, &rl) != 0) { | |
| store_errmsg("getrlimit() failed", errno); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| return -1; | |
| } | |
| /* show initial open file limits */ | |
| rlim2str(strbuff, sizeof(strbuff), rl.rlim_cur); | |
| - | fprintf(stderr, "initial soft limit: %s\n", strbuff); |
| + | curl_mfprintf(stderr, "initial soft limit: %s\n", strbuff); |
| rlim2str(strbuff, sizeof(strbuff), rl.rlim_max); | |
| - | fprintf(stderr, "initial hard limit: %s\n", strbuff); |
| + | curl_mfprintf(stderr, "initial hard limit: %s\n", strbuff); |
| /* If the OS allows a HUGE number of open files, we do not run. | |
| * Modern debian sid reports a limit of 134217724 and this tests | |
| * takes minutes. */ | |
| #define LIMIT_CAP (256*1024) | |
| if(rl.rlim_cur > LIMIT_CAP) { | |
| - | fprintf(stderr, "soft limit above %ld, not running\n", (long)LIMIT_CAP); |
| + | curl_mfprintf(stderr, "soft limit above %ld, not running\n", |
| + | (long)LIMIT_CAP); |
| return -2; | |
| } | |
| @@ -166,23 +167,23 @@ static int test_rlimit(int keep_open) | |
| #ifdef OPEN_MAX | |
| if((rl.rlim_cur > 0) && | |
| (rl.rlim_cur < OPEN_MAX)) { | |
| - | fprintf(stderr, "raising soft limit up to OPEN_MAX\n"); |
| + | curl_mfprintf(stderr, "raising soft limit up to OPEN_MAX\n"); |
| rl.rlim_cur = OPEN_MAX; | |
| if(setrlimit(RLIMIT_NOFILE, &rl) != 0) { | |
| /* on failure don't abort just issue a warning */ | |
| store_errmsg("setrlimit() failed", errno); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| msgbuff[0] = '\0'; | |
| } | |
| } | |
| #endif | |
| - | fprintf(stderr, "raising soft limit up to hard limit\n"); |
| + | curl_mfprintf(stderr, "raising soft limit up to hard limit\n"); |
| rl.rlim_cur = rl.rlim_max; | |
| if(setrlimit(RLIMIT_NOFILE, &rl) != 0) { | |
| /* on failure don't abort just issue a warning */ | |
| store_errmsg("setrlimit() failed", errno); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| msgbuff[0] = '\0'; | |
| } | |
| @@ -190,17 +191,17 @@ static int test_rlimit(int keep_open) | |
| if(getrlimit(RLIMIT_NOFILE, &rl) != 0) { | |
| store_errmsg("getrlimit() failed", errno); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| return -3; | |
| } | |
| /* show current open file limits */ | |
| rlim2str(strbuff, sizeof(strbuff), rl.rlim_cur); | |
| - | fprintf(stderr, "current soft limit: %s\n", strbuff); |
| + | curl_mfprintf(stderr, "current soft limit: %s\n", strbuff); |
| rlim2str(strbuff, sizeof(strbuff), rl.rlim_max); | |
| - | fprintf(stderr, "current hard limit: %s\n", strbuff); |
| + | curl_mfprintf(stderr, "current hard limit: %s\n", strbuff); |
| } /* (rl.rlim_cur != rl.rlim_max) */ | |
| @@ -230,22 +231,22 @@ static int test_rlimit(int keep_open) | |
| do { | |
| num_open.rlim_max = sizeof(*memchunk) * nitems; | |
| rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); | |
| - | fprintf(stderr, "allocating memchunk %s byte array\n", strbuff); |
| + | curl_mfprintf(stderr, "allocating memchunk %s byte array\n", strbuff); |
| memchunk = malloc(sizeof(*memchunk) * (size_t)nitems); | |
| if(!memchunk) { | |
| - | fprintf(stderr, "memchunk, malloc() failed\n"); |
| + | curl_mfprintf(stderr, "memchunk, malloc() failed\n"); |
| nitems /= 2; | |
| } | |
| } while(nitems && !memchunk); | |
| if(!memchunk) { | |
| store_errmsg("memchunk, malloc() failed", errno); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| return -4; | |
| } | |
| /* initialize it to fight lazy allocation */ | |
| - | fprintf(stderr, "initializing memchunk array\n"); |
| + | curl_mfprintf(stderr, "initializing memchunk array\n"); |
| for(i = 0; i < nitems; i++) | |
| memchunk[i] = -1; | |
| @@ -273,10 +274,11 @@ static int test_rlimit(int keep_open) | |
| if((size_t)(num_open.rlim_max) > ((size_t)-1) / sizeof(*testfd)) { | |
| rlim2str(strbuff1, sizeof(strbuff1), num_open.rlim_max); | |
| - | msnprintf(strbuff, sizeof(strbuff), "unable to allocate an array for %s " |
| - | "file descriptors, would overflow size_t", strbuff1); |
| + | curl_msnprintf(strbuff, sizeof(strbuff), |
| + | "unable to allocate an array for %s " |
| + | "file descriptors, would overflow size_t", strbuff1); |
| store_errmsg(strbuff, 0); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| free(memchunk); | |
| return -5; | |
| } | |
| @@ -285,24 +287,25 @@ static int test_rlimit(int keep_open) | |
| do { | |
| rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); | |
| - | fprintf(stderr, "allocating array for %s file descriptors\n", strbuff); |
| + | curl_mfprintf(stderr, "allocating array for %s file descriptors\n", |
| + | strbuff); |
| testfd = malloc(sizeof(*testfd) * (size_t)(num_open.rlim_max)); | |
| if(!testfd) { | |
| - | fprintf(stderr, "testfd, malloc() failed\n"); |
| + | curl_mfprintf(stderr, "testfd, malloc() failed\n"); |
| num_open.rlim_max /= 2; | |
| } | |
| } while(num_open.rlim_max && !testfd); | |
| if(!testfd) { | |
| store_errmsg("testfd, malloc() failed", errno); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| free(memchunk); | |
| return -6; | |
| } | |
| /* initialize it to fight lazy allocation */ | |
| - | fprintf(stderr, "initializing testfd array\n"); |
| + | curl_mfprintf(stderr, "initializing testfd array\n"); |
| for(num_open.rlim_cur = 0; | |
| num_open.rlim_cur < num_open.rlim_max; | |
| @@ -310,15 +313,15 @@ static int test_rlimit(int keep_open) | |
| testfd[num_open.rlim_cur] = -1; | |
| rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); | |
| - | fprintf(stderr, "trying to open %s file descriptors\n", strbuff); |
| + | curl_mfprintf(stderr, "trying to open %s file descriptors\n", strbuff); |
| /* open a dummy descriptor */ | |
| testfd[0] = open(DEV_NULL, O_RDONLY); | |
| if(testfd[0] < 0) { | |
| - | msnprintf(strbuff, sizeof(strbuff), "opening of %s failed", DEV_NULL); |
| + | curl_msnprintf(strbuff, sizeof(strbuff), "opening of %s failed", DEV_NULL); |
| store_errmsg(strbuff, errno); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| free(testfd); | |
| testfd = NULL; | |
| free(memchunk); | |
| @@ -338,21 +341,22 @@ static int test_rlimit(int keep_open) | |
| testfd[num_open.rlim_cur] = -1; | |
| rlim2str(strbuff1, sizeof(strbuff1), num_open.rlim_cur); | |
| - | msnprintf(strbuff, sizeof(strbuff), "dup() attempt %s failed", strbuff1); |
| - | fprintf(stderr, "%s\n", strbuff); |
| + | curl_msnprintf(strbuff, sizeof(strbuff), "dup() attempt %s failed", |
| + | strbuff1); |
| + | curl_mfprintf(stderr, "%s\n", strbuff); |
| rlim2str(strbuff1, sizeof(strbuff1), num_open.rlim_cur); | |
| - | msnprintf(strbuff, sizeof(strbuff), "fds system limit seems close to %s", |
| - | strbuff1); |
| - | fprintf(stderr, "%s\n", strbuff); |
| + | curl_msnprintf(strbuff, sizeof(strbuff), |
| + | "fds system limit seems close to %s", strbuff1); |
| + | curl_mfprintf(stderr, "%s\n", strbuff); |
| num_open.rlim_max = num_open.rlim_cur - SAFETY_MARGIN; | |
| num_open.rlim_cur -= num_open.rlim_max; | |
| rlim2str(strbuff1, sizeof(strbuff1), num_open.rlim_cur); | |
| - | msnprintf(strbuff, sizeof(strbuff), "closing %s file descriptors", |
| - | strbuff1); |
| - | fprintf(stderr, "%s\n", strbuff); |
| + | curl_msnprintf(strbuff, sizeof(strbuff), "closing %s file descriptors", |
| + | strbuff1); |
| + | curl_mfprintf(stderr, "%s\n", strbuff); |
| for(num_open.rlim_cur = num_open.rlim_max; | |
| testfd[num_open.rlim_cur] >= 0; | |
| @@ -362,7 +366,8 @@ static int test_rlimit(int keep_open) | |
| } | |
| rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); | |
| - | fprintf(stderr, "shrinking array for %s file descriptors\n", strbuff); |
| + | curl_mfprintf(stderr, "shrinking array for %s file descriptors\n", |
| + | strbuff); |
| /* we don't care if we can't shrink it */ | |
| @@ -377,7 +382,7 @@ static int test_rlimit(int keep_open) | |
| } | |
| rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); | |
| - | fprintf(stderr, "%s file descriptors open\n", strbuff); |
| + | curl_mfprintf(stderr, "%s file descriptors open\n", strbuff); |
| #if !defined(HAVE_POLL) && !defined(USE_WINSOCK) | |
| @@ -394,10 +399,10 @@ static int test_rlimit(int keep_open) | |
| num_open.rlim_cur = FD_SETSIZE - SAFETY_MARGIN; | |
| if(num_open.rlim_max > num_open.rlim_cur) { | |
| - | msnprintf(strbuff, sizeof(strbuff), "select limit is FD_SETSIZE %d", |
| + | curl_msnprintf(strbuff, sizeof(strbuff), "select limit is FD_SETSIZE %d", |
| FD_SETSIZE); | |
| store_errmsg(strbuff, 0); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| close_file_descriptors(); | |
| free(memchunk); | |
| return -8; | |
| @@ -409,10 +414,10 @@ static int test_rlimit(int keep_open) | |
| rl.rlim_cur++) { | |
| if((testfd[rl.rlim_cur] > 0) && | |
| ((unsigned int)testfd[rl.rlim_cur] > num_open.rlim_cur)) { | |
| - | msnprintf(strbuff, sizeof(strbuff), "select limit is FD_SETSIZE %d", |
| + | curl_msnprintf(strbuff, sizeof(strbuff), "select limit is FD_SETSIZE %d", |
| FD_SETSIZE); | |
| store_errmsg(strbuff, 0); | |
| - | fprintf(stderr, "%s\n", msgbuff); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| close_file_descriptors(); | |
| free(memchunk); | |
| return -9; | |
| @@ -432,10 +437,11 @@ static int test_rlimit(int keep_open) | |
| if(!fopen_works()) { | |
| rlim2str(strbuff1, sizeof(strbuff1), num_open.rlim_max); | |
| - | msnprintf(strbuff, sizeof(strbuff), "fopen fails with %s fds open", |
| - | strbuff1); |
| - | fprintf(stderr, "%s\n", msgbuff); |
| - | msnprintf(strbuff, sizeof(strbuff), "fopen fails with lots of fds open"); |
| + | curl_msnprintf(strbuff, sizeof(strbuff), "fopen fails with %s fds open", |
| + | strbuff1); |
| + | curl_mfprintf(stderr, "%s\n", msgbuff); |
| + | curl_msnprintf(strbuff, sizeof(strbuff), |
| + | "fopen fails with lots of fds open"); |
| store_errmsg(strbuff, 0); | |
| close_file_descriptors(); | |
| free(memchunk); | |
| @@ -464,7 +470,7 @@ CURLcode test(char *URL) | |
| if(!strcmp(URL, "check")) { | |
| /* used by the test script to ask if we can run this test or not */ | |
| if(test_rlimit(FALSE)) { | |
| - | fprintf(stdout, "test_rlimit problem: %s\n", msgbuff); |
| + | curl_mfprintf(stdout, "test_rlimit problem: %s\n", msgbuff); |
| return TEST_ERR_FAILURE; | |
| } | |
| return CURLE_OK; /* sure, run this! */ | |
| @@ -479,14 +485,14 @@ CURLcode test(char *URL) | |
| and close them all once the test is over */ | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| close_file_descriptors(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| close_file_descriptors(); | |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| @@ -511,7 +517,7 @@ test_cleanup: | |
| CURLcode test(char *URL) | |
| { | |
| (void)URL; | |
| - | printf("system lacks necessary system function(s)"); |
| + | curl_mprintf("system lacks necessary system function(s)"); |
| return TEST_ERR_MAJOR_BAD; /* skip test */ | |
| } | |
| @@ -33,13 +33,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *slist = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -169,7 +169,7 @@ static CURLcode loop(int num, CURLM *cm, const char *url, const char *userpwd, | |
| if(msg->msg == CURLMSG_DONE) { | |
| int i; | |
| CURL *e = msg->easy_handle; | |
| - | fprintf(stderr, "R: %d - %s\n", (int)msg->data.result, |
| + | curl_mfprintf(stderr, "R: %d - %s\n", (int)msg->data.result, |
| curl_easy_strerror(msg->data.result)); | |
| curl_multi_remove_handle(cm, e); | |
| curl_easy_cleanup(e); | |
| @@ -181,7 +181,7 @@ static CURLcode loop(int num, CURLM *cm, const char *url, const char *userpwd, | |
| } | |
| } | |
| else | |
| - | fprintf(stderr, "E: CURLMsg (%d)\n", (int)msg->msg); |
| + | curl_mfprintf(stderr, "E: CURLMsg (%d)\n", (int)msg->msg); |
| } | |
| res_test_timedout(); | |
| @@ -208,12 +208,12 @@ CURLcode test(char *URL) | |
| if(test_argc < 4) | |
| return TEST_ERR_MAJOR_BAD; | |
| - | msnprintf(buffer, sizeof(buffer), "Host: %s", HOST); |
| + | curl_msnprintf(buffer, sizeof(buffer), "Host: %s", HOST); |
| /* now add a custom Host: header */ | |
| headers = curl_slist_append(headers, buffer); | |
| if(!headers) { | |
| - | fprintf(stderr, "curl_slist_append() failed\n"); |
| + | curl_mfprintf(stderr, "curl_slist_append() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -234,7 +234,7 @@ CURLcode test(char *URL) | |
| if(res) | |
| goto test_cleanup; | |
| - | fprintf(stderr, "lib540: now we do the request again\n"); |
| + | curl_mfprintf(stderr, "lib540: now we do the request again\n"); |
| res = loop(1, cm, URL, PROXYUSERPWD, headers); | |
| @@ -42,15 +42,15 @@ CURLcode test(char *URL) | |
| struct_stat file_info; | |
| if(!libtest_arg2) { | |
| - | fprintf(stderr, "Usage: <url> <file-to-upload>\n"); |
| + | curl_mfprintf(stderr, "Usage: <url> <file-to-upload>\n"); |
| return TEST_ERR_USAGE; | |
| } | |
| hd_src = fopen(libtest_arg2, "rb"); | |
| if(!hd_src) { | |
| - | fprintf(stderr, "fopen failed with error (%d) %s\n", |
| + | curl_mfprintf(stderr, "fopen failed with error (%d) %s\n", |
| errno, strerror(errno)); | |
| - | fprintf(stderr, "Error opening file '%s'\n", libtest_arg2); |
| + | curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2); |
| return TEST_ERR_MAJOR_BAD; /* if this happens things are major weird */ | |
| } | |
| @@ -62,21 +62,21 @@ CURLcode test(char *URL) | |
| #endif | |
| if(hd == -1) { | |
| /* can't open file, bail out */ | |
| - | fprintf(stderr, "fstat() failed with error (%d) %s\n", |
| + | curl_mfprintf(stderr, "fstat() failed with error (%d) %s\n", |
| errno, strerror(errno)); | |
| - | fprintf(stderr, "Error opening file '%s'\n", libtest_arg2); |
| + | curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2); |
| fclose(hd_src); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| if(!file_info.st_size) { | |
| - | fprintf(stderr, "File %s has zero size!\n", libtest_arg2); |
| + | curl_mfprintf(stderr, "File %s has zero size!\n", libtest_arg2); |
| fclose(hd_src); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| fclose(hd_src); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -84,7 +84,7 @@ CURLcode test(char *URL) | |
| /* get a curl handle */ | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| fclose(hd_src); | |
| return TEST_ERR_MAJOR_BAD; | |
| @@ -39,14 +39,14 @@ CURLcode test(char *URL) | |
| CURLcode res = CURLE_OK; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| /* get a curl handle */ | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -41,7 +41,7 @@ CURLcode test(char *URL) | |
| global_init(CURL_GLOBAL_ALL); | |
| easy = curl_easy_init(); | |
| if(!easy) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| res = TEST_ERR_MAJOR_BAD; | |
| } | |
| else { | |
| @@ -49,18 +49,18 @@ CURLcode test(char *URL) | |
| char *s = curl_easy_escape(easy, (const char *)a, asize); | |
| if(s) { | |
| - | printf("%s\n", s); |
| + | curl_mprintf("%s\n", s); |
| curl_free(s); | |
| } | |
| s = curl_easy_escape(easy, "", 0); | |
| if(s) { | |
| - | printf("IN: '' OUT: '%s'\n", s); |
| + | curl_mprintf("IN: '' OUT: '%s'\n", s); |
| curl_free(s); | |
| } | |
| s = curl_easy_escape(easy, " 123", 3); | |
| if(s) { | |
| - | printf("IN: ' 12' OUT: '%s'\n", s); |
| + | curl_mprintf("IN: ' 12' OUT: '%s'\n", s); |
| curl_free(s); | |
| } | |
| @@ -37,13 +37,13 @@ CURLcode test(char *URL) | |
| CURLcode res = CURLE_OK; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -42,17 +42,17 @@ static size_t readcallback(char *ptr, | |
| if(*counter) { | |
| /* only do this once and then require a clearing of this */ | |
| - | fprintf(stderr, "READ ALREADY DONE!\n"); |
| + | curl_mfprintf(stderr, "READ ALREADY DONE!\n"); |
| return 0; | |
| } | |
| (*counter)++; /* bump */ | |
| if(size * nmemb >= strlen(UPLOADTHIS)) { | |
| - | fprintf(stderr, "READ!\n"); |
| + | curl_mfprintf(stderr, "READ!\n"); |
| strcpy(ptr, UPLOADTHIS); | |
| return strlen(UPLOADTHIS); | |
| } | |
| - | fprintf(stderr, "READ NOT FINE!\n"); |
| + | curl_mfprintf(stderr, "READ NOT FINE!\n"); |
| return 0; | |
| } | |
| static curlioerr ioctlcallback(CURL *handle, | |
| @@ -62,7 +62,7 @@ static curlioerr ioctlcallback(CURL *handle, | |
| int *counter = (int *)clientp; | |
| (void)handle; /* unused */ | |
| if(cmd == CURLIOCMD_RESTARTREAD) { | |
| - | fprintf(stderr, "REWIND!\n"); |
| + | curl_mfprintf(stderr, "REWIND!\n"); |
| *counter = 0; /* clear counter to make the read callback restart */ | |
| } | |
| return CURLIOE_OK; | |
| @@ -81,13 +81,13 @@ CURLcode test(char *URL) | |
| #endif | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -36,13 +36,13 @@ CURLcode test(char *URL) | |
| CURL *curl; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -48,17 +48,17 @@ void dump(const char *text, | |
| /* without the hex output, we can fit more on screen */ | |
| width = 0x40; | |
| - | fprintf(stream, "%s, %zu bytes (0x%zx)\n", text, size, size); |
| + | curl_mfprintf(stream, "%s, %zu bytes (0x%zx)\n", text, size, size); |
| for(i = 0; i < size; i += width) { | |
| - | fprintf(stream, "%04zx: ", i); |
| + | curl_mfprintf(stream, "%04zx: ", i); |
| if(!nohex) { | |
| /* hex not disabled, show it */ | |
| for(c = 0; c < width; c++) | |
| if(i + c < size) | |
| - | fprintf(stream, "%02x ", ptr[i + c]); |
| + | curl_mfprintf(stream, "%02x ", ptr[i + c]); |
| else | |
| fputs(" ", stream); | |
| } | |
| @@ -70,7 +70,7 @@ void dump(const char *text, | |
| i += (c + 2 - width); | |
| break; | |
| } | |
| - | fprintf(stream, "%c", |
| + | curl_mfprintf(stream, "%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 && | |
| @@ -95,7 +95,7 @@ int my_trace(CURL *handle, curl_infotype type, | |
| switch(type) { | |
| case CURLINFO_TEXT: | |
| - | fprintf(stderr, "== Info: %s", (char *)data); |
| + | curl_mfprintf(stderr, "== Info: %s", (char *)data); |
| return 0; | |
| case CURLINFO_HEADER_OUT: | |
| text = "=> Send header"; | |
| @@ -145,7 +145,7 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb, | |
| void *stream) | |
| { | |
| int amount = curlx_uztosi(size * nmemb); | |
| - | printf("%.*s", amount, (char *)ptr); |
| + | curl_mprintf("%.*s", amount, (char *)ptr); |
| (void)stream; | |
| return size * nmemb; | |
| } | |
| @@ -155,8 +155,8 @@ static curlioerr ioctl_callback(CURL *handle, int cmd, void *clientp) | |
| { | |
| (void)clientp; | |
| if(cmd == CURLIOCMD_RESTARTREAD) { | |
| - | printf("APPLICATION received a CURLIOCMD_RESTARTREAD request\n"); |
| - | printf("APPLICATION ** REWINDING! **\n"); |
| + | curl_mprintf("APPLICATION received a CURLIOCMD_RESTARTREAD request\n"); |
| + | curl_mprintf("APPLICATION ** REWINDING! **\n"); |
| current_offset = 0; | |
| return CURLIOE_OK; | |
| } | |
| @@ -65,19 +65,19 @@ CURLcode test(char *URL) | |
| struct curl_slist *headerlist = NULL, *hl; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| for(i = 0; i < NUM_HEADERS; i++) { | |
| - | int len = msnprintf(testbuf, sizeof(testbuf), "Header%d: ", i); |
| + | int len = curl_msnprintf(testbuf, sizeof(testbuf), "Header%d: ", i); |
| memset(&testbuf[len], 'A', SIZE_HEADERS); | |
| testbuf[len + SIZE_HEADERS] = 0; /* null-terminate */ | |
| hl = curl_slist_append(headerlist, testbuf); | |
| @@ -99,7 +99,7 @@ static CURLcode test_once(char *URL, bool oldstyle) | |
| } | |
| if(formrc) | |
| - | printf("curl_formadd(1) = %d\n", (int)formrc); |
| + | curl_mprintf("curl_formadd(1) = %d\n", (int)formrc); |
| /* Now add the same data with another name and make it not look like | |
| a file upload but still using the callback */ | |
| @@ -117,7 +117,7 @@ static CURLcode test_once(char *URL, bool oldstyle) | |
| CURLFORM_END); | |
| ) | |
| if(formrc) | |
| - | printf("curl_formadd(2) = %d\n", (int)formrc); |
| + | curl_mprintf("curl_formadd(2) = %d\n", (int)formrc); |
| CURL_IGNORE_DEPRECATION( | |
| /* Fill in the filename field */ | |
| @@ -128,7 +128,7 @@ static CURLcode test_once(char *URL, bool oldstyle) | |
| CURLFORM_END); | |
| ) | |
| if(formrc) | |
| - | printf("curl_formadd(3) = %d\n", (int)formrc); |
| + | curl_mprintf("curl_formadd(3) = %d\n", (int)formrc); |
| CURL_IGNORE_DEPRECATION( | |
| /* Fill in a submit field too */ | |
| @@ -140,7 +140,7 @@ static CURLcode test_once(char *URL, bool oldstyle) | |
| CURLFORM_END); | |
| ) | |
| if(formrc) | |
| - | printf("curl_formadd(4) = %d\n", (int)formrc); |
| + | curl_mprintf("curl_formadd(4) = %d\n", (int)formrc); |
| CURL_IGNORE_DEPRECATION( | |
| formrc = curl_formadd(&formpost, &lastptr, | |
| @@ -151,11 +151,11 @@ static CURLcode test_once(char *URL, bool oldstyle) | |
| CURLFORM_END); | |
| ) | |
| if(formrc) | |
| - | printf("curl_formadd(5) = %d\n", (int)formrc); |
| + | curl_mprintf("curl_formadd(5) = %d\n", (int)formrc); |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| CURL_IGNORE_DEPRECATION( | |
| curl_formfree(formpost); | |
| ) | |
| @@ -209,7 +209,7 @@ CURLcode test(char *URL) | |
| CURLcode res; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -49,17 +49,17 @@ static size_t readcallback(char *ptr, | |
| if(*counter) { | |
| /* only do this once and then require a clearing of this */ | |
| - | fprintf(stderr, "READ ALREADY DONE!\n"); |
| + | curl_mfprintf(stderr, "READ ALREADY DONE!\n"); |
| return 0; | |
| } | |
| (*counter)++; /* bump */ | |
| if(size * nmemb >= strlen(uploadthis)) { | |
| - | fprintf(stderr, "READ!\n"); |
| + | curl_mfprintf(stderr, "READ!\n"); |
| strcpy(ptr, uploadthis); | |
| return strlen(uploadthis); | |
| } | |
| - | fprintf(stderr, "READ NOT FINE!\n"); |
| + | curl_mfprintf(stderr, "READ NOT FINE!\n"); |
| return 0; | |
| } | |
| static curlioerr ioctlcallback(CURL *handle, | |
| @@ -69,7 +69,7 @@ static curlioerr ioctlcallback(CURL *handle, | |
| int *counter = (int *)clientp; | |
| (void)handle; /* unused */ | |
| if(cmd == CURLIOCMD_RESTARTREAD) { | |
| - | fprintf(stderr, "REWIND!\n"); |
| + | curl_mfprintf(stderr, "REWIND!\n"); |
| *counter = 0; /* clear counter to make the read callback restart */ | |
| } | |
| return CURLIOE_OK; | |
| @@ -35,13 +35,13 @@ CURLcode test(char *URL) | |
| #endif | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -88,7 +88,7 @@ again: | |
| #else | |
| if((size_t)write(STDOUT_FILENO, buf, nread) != nread) { | |
| #endif | |
| - | fprintf(stderr, "write() failed: errno %d (%s)\n", |
| + | curl_mfprintf(stderr, "write() failed: errno %d (%s)\n", |
| errno, strerror(errno)); | |
| res = TEST_ERR_FAILURE; | |
| break; | |
| @@ -166,17 +166,18 @@ static int test_unsigned_short_formatting(void) | |
| if(memcmp(us_test[i].result, | |
| us_test[i].expected, | |
| strlen(us_test[i].expected))) { | |
| - | printf("unsigned short test #%.2d: Failed (Expected: %s Got: %s)\n", |
| - | i, us_test[i].expected, us_test[i].result); |
| + | curl_mprintf("unsigned short test #%.2d: Failed " |
| + | "(Expected: %s Got: %s)\n", |
| + | i, us_test[i].expected, us_test[i].result); |
| failed++; | |
| } | |
| } | |
| if(!failed) | |
| - | printf("All curl_mprintf() unsigned short tests OK!\n"); |
| + | curl_mprintf("All curl_mprintf() unsigned short tests OK!\n"); |
| else | |
| - | printf("Some curl_mprintf() unsigned short tests Failed!\n"); |
| + | curl_mprintf("Some curl_mprintf() unsigned short tests Failed!\n"); |
| return failed; | |
| } | |
| @@ -240,7 +241,7 @@ static int test_signed_short_formatting(void) | |
| if(memcmp(ss_test[i].result, | |
| ss_test[i].expected, | |
| strlen(ss_test[i].expected))) { | |
| - | printf("signed short test #%.2d: Failed (Expected: %s Got: %s)\n", |
| + | curl_mprintf("signed short test #%.2d: Failed (Expected: %s Got: %s)\n", |
| i, ss_test[i].expected, ss_test[i].result); | |
| failed++; | |
| } | |
| @@ -248,9 +249,9 @@ static int test_signed_short_formatting(void) | |
| } | |
| if(!failed) | |
| - | printf("All curl_mprintf() signed short tests OK!\n"); |
| + | curl_mprintf("All curl_mprintf() signed short tests OK!\n"); |
| else | |
| - | printf("Some curl_mprintf() signed short tests Failed!\n"); |
| + | curl_mprintf("Some curl_mprintf() signed short tests Failed!\n"); |
| return failed; | |
| } | |
| @@ -390,7 +391,7 @@ static int test_unsigned_int_formatting(void) | |
| if(memcmp(ui_test[i].result, | |
| ui_test[i].expected, | |
| strlen(ui_test[i].expected))) { | |
| - | printf("unsigned int test #%.2d: Failed (Expected: %s Got: %s)\n", |
| + | curl_mprintf("unsigned int test #%.2d: Failed (Expected: %s Got: %s)\n", |
| i, ui_test[i].expected, ui_test[i].result); | |
| failed++; | |
| } | |
| @@ -398,9 +399,9 @@ static int test_unsigned_int_formatting(void) | |
| } | |
| if(!failed) | |
| - | printf("All curl_mprintf() unsigned int tests OK!\n"); |
| + | curl_mprintf("All curl_mprintf() unsigned int tests OK!\n"); |
| else | |
| - | printf("Some curl_mprintf() unsigned int tests Failed!\n"); |
| + | curl_mprintf("Some curl_mprintf() unsigned int tests Failed!\n"); |
| return failed; | |
| } | |
| @@ -618,7 +619,7 @@ static int test_signed_int_formatting(void) | |
| if(memcmp(si_test[i].result, | |
| si_test[i].expected, | |
| strlen(si_test[i].expected))) { | |
| - | printf("signed int test #%.2d: Failed (Expected: %s Got: %s)\n", |
| + | curl_mprintf("signed int test #%.2d: Failed (Expected: %s Got: %s)\n", |
| i, si_test[i].expected, si_test[i].result); | |
| failed++; | |
| } | |
| @@ -626,9 +627,9 @@ static int test_signed_int_formatting(void) | |
| } | |
| if(!failed) | |
| - | printf("All curl_mprintf() signed int tests OK!\n"); |
| + | curl_mprintf("All curl_mprintf() signed int tests OK!\n"); |
| else | |
| - | printf("Some curl_mprintf() signed int tests Failed!\n"); |
| + | curl_mprintf("Some curl_mprintf() signed int tests Failed!\n"); |
| return failed; | |
| } | |
| @@ -767,7 +768,7 @@ static int test_unsigned_long_formatting(void) | |
| if(memcmp(ul_test[i].result, | |
| ul_test[i].expected, | |
| strlen(ul_test[i].expected))) { | |
| - | printf("unsigned long test #%.2d: Failed (Expected: %s Got: %s)\n", |
| + | curl_mprintf("unsigned long test #%.2d: Failed (Expected: %s Got: %s)\n", |
| i, ul_test[i].expected, ul_test[i].result); | |
| failed++; | |
| } | |
| @@ -775,9 +776,9 @@ static int test_unsigned_long_formatting(void) | |
| } | |
| if(!failed) | |
| - | printf("All curl_mprintf() unsigned long tests OK!\n"); |
| + | curl_mprintf("All curl_mprintf() unsigned long tests OK!\n"); |
| else | |
| - | printf("Some curl_mprintf() unsigned long tests Failed!\n"); |
| + | curl_mprintf("Some curl_mprintf() unsigned long tests Failed!\n"); |
| return failed; | |
| } | |
| @@ -995,7 +996,7 @@ static int test_signed_long_formatting(void) | |
| if(memcmp(sl_test[i].result, | |
| sl_test[i].expected, | |
| strlen(sl_test[i].expected))) { | |
| - | printf("signed long test #%.2d: Failed (Expected: %s Got: %s)\n", |
| + | curl_mprintf("signed long test #%.2d: Failed (Expected: %s Got: %s)\n", |
| i, sl_test[i].expected, sl_test[i].result); | |
| failed++; | |
| } | |
| @@ -1003,9 +1004,9 @@ static int test_signed_long_formatting(void) | |
| } | |
| if(!failed) | |
| - | printf("All curl_mprintf() signed long tests OK!\n"); |
| + | curl_mprintf("All curl_mprintf() signed long tests OK!\n"); |
| else | |
| - | printf("Some curl_mprintf() signed long tests Failed!\n"); |
| + | curl_mprintf("Some curl_mprintf() signed long tests Failed!\n"); |
| return failed; | |
| } | |
| @@ -1110,7 +1111,7 @@ static int test_curl_off_t_formatting(void) | |
| if(memcmp(co_test[i].result, | |
| co_test[i].expected, | |
| strlen(co_test[i].expected))) { | |
| - | printf("curl_off_t test #%.2d: Failed (Expected: %s Got: %s)\n", |
| + | curl_mprintf("curl_off_t test #%.2d: Failed (Expected: %s Got: %s)\n", |
| i, co_test[i].expected, co_test[i].result); | |
| failed++; | |
| } | |
| @@ -1118,9 +1119,9 @@ static int test_curl_off_t_formatting(void) | |
| } | |
| if(!failed) | |
| - | printf("All curl_mprintf() curl_off_t tests OK!\n"); |
| + | curl_mprintf("All curl_mprintf() curl_off_t tests OK!\n"); |
| else | |
| - | printf("Some curl_mprintf() curl_off_t tests Failed!\n"); |
| + | curl_mprintf("Some curl_mprintf() curl_off_t tests Failed!\n"); |
| return failed; | |
| } | |
| @@ -1129,7 +1130,7 @@ static int _string_check(int linenumber, char *buf, const char *buf2) | |
| { | |
| if(strcmp(buf, buf2)) { | |
| /* they shouldn't differ */ | |
| - | printf("sprintf line %d failed:\nwe '%s'\nsystem: '%s'\n", |
| + | curl_mprintf("sprintf line %d failed:\nwe '%s'\nsystem: '%s'\n", |
| linenumber, buf, buf2); | |
| return 1; | |
| } | |
| @@ -1142,7 +1143,7 @@ static int _strlen_check(int linenumber, char *buf, size_t len) | |
| size_t buflen = strlen(buf); | |
| if(len != buflen) { | |
| /* they shouldn't differ */ | |
| - | printf("sprintf strlen:%d failed:\nwe '%zu'\nsystem: '%zu'\n", |
| + | curl_mprintf("sprintf strlen:%d failed:\nwe '%zu'\nsystem: '%zu'\n", |
| linenumber, buflen, len); | |
| return 1; | |
| } | |
| @@ -1181,9 +1182,9 @@ static int test_string_formatting(void) | |
| errors += string_check(buf, "foo "); | |
| if(!errors) | |
| - | printf("All curl_mprintf() strings tests OK!\n"); |
| + | curl_mprintf("All curl_mprintf() strings tests OK!\n"); |
| else | |
| - | printf("Some curl_mprintf() string tests Failed!\n"); |
| + | curl_mprintf("Some curl_mprintf() string tests Failed!\n"); |
| return errors; | |
| } | |
| @@ -1302,7 +1303,7 @@ static int test_weird_arguments(void) | |
| 0, 1, 2, 3, 4, 5, 6, 7); /* 8 */ | |
| if(rc != 128) { | |
| - | printf("curl_mprintf() returned %d and not 128!\n", rc); |
| + | curl_mprintf("curl_mprintf() returned %d and not 128!\n", rc); |
| errors++; | |
| } | |
| @@ -1354,7 +1355,7 @@ static int test_weird_arguments(void) | |
| 0, 1, 2, 3, 4, 5, 6, 7, 8); /* 9 */ | |
| if(rc) { | |
| - | printf("curl_mprintf() returned %d and not 0\n", rc); |
| + | curl_mprintf("curl_mprintf() returned %d and not 0\n", rc); |
| errors++; | |
| } | |
| @@ -1363,7 +1364,7 @@ static int test_weird_arguments(void) | |
| errors += test_width_precision(); | |
| if(errors) | |
| - | printf("Some curl_mprintf() weird arguments tests failed!\n"); |
| + | curl_mprintf("Some curl_mprintf() weird arguments tests failed!\n"); |
| return errors; | |
| } | |
| @@ -1475,9 +1476,9 @@ static int test_float_formatting(void) | |
| errors += strlen_check(buf, 5); | |
| if(!errors) | |
| - | printf("All float strings tests OK!\n"); |
| + | curl_mprintf("All float strings tests OK!\n"); |
| else | |
| - | printf("test_float_formatting Failed!\n"); |
| + | curl_mprintf("test_float_formatting Failed!\n"); |
| return errors; | |
| } | |
| @@ -1517,9 +1518,9 @@ static int test_oct_hex_formatting(void) | |
| #endif | |
| if(!errors) | |
| - | printf("All curl_mprintf() octal & hexadecimal tests OK!\n"); |
| + | curl_mprintf("All curl_mprintf() octal & hexadecimal tests OK!\n"); |
| else | |
| - | printf("Some curl_mprintf() octal & hexadecimal tests Failed!\n"); |
| + | curl_mprintf("Some curl_mprintf() octal & hexadecimal tests Failed!\n"); |
| return errors; | |
| } | |
| @@ -36,7 +36,7 @@ CURLcode test(char *URL) | |
| (void)URL; /* we don't use this */ | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -32,13 +32,13 @@ CURLcode test(char *URL) | |
| CURL *curl; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -43,14 +43,14 @@ CURLcode test(char *URL) | |
| CURLcode res = CURLE_OK; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| /* get a curl handle */ | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -53,7 +53,7 @@ CURLcode test(char *URL) | |
| multi_add_handle(m, curl); | |
| - | fprintf(stderr, "Start at URL 0\n"); |
| + | curl_mfprintf(stderr, "Start at URL 0\n"); |
| for(;;) { | |
| struct timeval interval; | |
| @@ -33,13 +33,13 @@ CURLcode test(char *URL) | |
| double content_length = 3; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -57,7 +57,7 @@ CURLcode test(char *URL) | |
| ) | |
| moo = fopen(libtest_arg2, "wb"); | |
| if(moo) { | |
| - | fprintf(moo, "CL %.0f\n", content_length); |
| + | curl_mfprintf(moo, "CL %.0f\n", content_length); |
| fclose(moo); | |
| } | |
| } | |
| @@ -35,13 +35,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *custom_headers = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -53,13 +53,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *custom_headers = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -80,7 +80,7 @@ CURLcode test(char *URL) | |
| sdp = open(libtest_arg2, O_RDONLY); | |
| if(sdp == -1) { | |
| - | fprintf(stderr, "can't open %s\n", libtest_arg2); |
| + | curl_mfprintf(stderr, "can't open %s\n", libtest_arg2); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -89,7 +89,7 @@ CURLcode test(char *URL) | |
| sdpf = fopen(libtest_arg2, "rb"); | |
| if(!sdpf) { | |
| - | fprintf(stderr, "can't fopen %s\n", libtest_arg2); |
| + | curl_mfprintf(stderr, "can't fopen %s\n", libtest_arg2); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -44,19 +44,19 @@ CURLcode test(char *URL) | |
| FILE *idfile = fopen(libtest_arg2, "wb"); | |
| if(!idfile) { | |
| - | fprintf(stderr, "couldn't open the Session ID File\n"); |
| + | curl_mfprintf(stderr, "couldn't open the Session ID File\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| fclose(idfile); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| fclose(idfile); | |
| return TEST_ERR_MAJOR_BAD; | |
| @@ -71,7 +71,7 @@ CURLcode test(char *URL) | |
| test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_SETUP); | |
| res = curl_easy_perform(curl); | |
| if(res != (int)CURLE_BAD_FUNCTION_ARGUMENT) { | |
| - | fprintf(stderr, "This should have failed. " |
| + | curl_mfprintf(stderr, "This should have failed. " |
| "Cannot setup without a Transport: header"); | |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| @@ -96,7 +96,7 @@ CURLcode test(char *URL) | |
| goto test_cleanup; | |
| curl_easy_getinfo(curl, CURLINFO_RTSP_SESSION_ID, &rtsp_session_id); | |
| - | fprintf(idfile, "Got Session ID: [%s]\n", rtsp_session_id); |
| + | curl_mfprintf(idfile, "Got Session ID: [%s]\n", rtsp_session_id); |
| rtsp_session_id = NULL; | |
| stream_uri = suburl(URL, request++); | |
| @@ -38,13 +38,13 @@ CURLcode test(char *URL) | |
| char *stream_uri = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -68,7 +68,7 @@ CURLcode test(char *URL) | |
| res = curl_easy_perform(curl); | |
| if(res != (int)CURLE_RTSP_CSEQ_ERROR) { | |
| - | fprintf(stderr, "Failed to detect CSeq mismatch"); |
| + | curl_mfprintf(stderr, "Failed to detect CSeq mismatch"); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -107,7 +107,7 @@ CURLcode test(char *URL) | |
| res = CURLE_OK; | |
| } | |
| else { | |
| - | fprintf(stderr, "Failed to detect a Session ID mismatch"); |
| + | curl_mfprintf(stderr, "Failed to detect a Session ID mismatch"); |
| res = TEST_ERR_FAILURE; | |
| } | |
| @@ -64,10 +64,11 @@ static size_t rtp_write(char *ptr, size_t size, size_t nmemb, void *stream) | |
| message_size = curlx_uztosi(size * nmemb) - 4; | |
| - | printf("RTP: message size %d, channel %d\n", message_size, channel); |
| + | curl_mprintf("RTP: message size %d, channel %d\n", message_size, channel); |
| if(message_size != coded_size) { | |
| - | printf("RTP embedded size (%d) does not match the write size (%d).\n", |
| - | coded_size, message_size); |
| + | curl_mprintf("RTP embedded size (%d) does not match " |
| + | "the write size (%d).\n", |
| + | coded_size, message_size); |
| return failure; | |
| } | |
| @@ -75,13 +76,13 @@ static size_t rtp_write(char *ptr, size_t size, size_t nmemb, void *stream) | |
| for(i = 0; i < message_size; i += RTP_DATA_SIZE) { | |
| if(message_size - i > RTP_DATA_SIZE) { | |
| if(memcmp(RTP_DATA, data + i, RTP_DATA_SIZE) != 0) { | |
| - | printf("RTP PAYLOAD CORRUPTED [%s]\n", data + i); |
| + | curl_mprintf("RTP PAYLOAD CORRUPTED [%s]\n", data + i); |
| /* return failure; */ | |
| } | |
| } | |
| else { | |
| if(memcmp(RTP_DATA, data + i, message_size - i) != 0) { | |
| - | printf("RTP PAYLOAD END CORRUPTED (%d), [%s]\n", |
| + | curl_mprintf("RTP PAYLOAD END CORRUPTED (%d), [%s]\n", |
| message_size - i, data + i); | |
| /* return failure; */ | |
| } | |
| @@ -89,7 +90,7 @@ static size_t rtp_write(char *ptr, size_t size, size_t nmemb, void *stream) | |
| } | |
| rtp_packet_count++; | |
| - | fprintf(stderr, "packet count is %d\n", rtp_packet_count); |
| + | curl_mfprintf(stderr, "packet count is %d\n", rtp_packet_count); |
| return size * nmemb; | |
| } | |
| @@ -109,19 +110,19 @@ CURLcode test(char *URL) | |
| FILE *protofile = fopen(libtest_arg2, "wb"); | |
| if(!protofile) { | |
| - | fprintf(stderr, "Couldn't open the protocol dump file\n"); |
| + | curl_mfprintf(stderr, "Couldn't open the protocol dump file\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| fclose(protofile); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| fclose(protofile); | |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| @@ -193,11 +194,11 @@ CURLcode test(char *URL) | |
| if(res) | |
| goto test_cleanup; | |
| - | fprintf(stderr, "PLAY COMPLETE\n"); |
| + | curl_mfprintf(stderr, "PLAY COMPLETE\n"); |
| /* Use Receive to get the rest of the data */ | |
| while(!res && rtp_packet_count < 19) { | |
| - | fprintf(stderr, "LOOPY LOOP!\n"); |
| + | curl_mfprintf(stderr, "LOOPY LOOP!\n"); |
| test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_RECEIVE); | |
| res = curl_easy_perform(curl); | |
| } | |
| @@ -53,13 +53,13 @@ CURLcode test(char *URL) | |
| struct curl_slist *custom_headers = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -99,7 +99,7 @@ CURLcode test(char *URL) | |
| /* PUT style GET_PARAMETERS */ | |
| params = open(libtest_arg2, O_RDONLY); | |
| if(params == -1) { | |
| - | fprintf(stderr, "can't open %s\n", libtest_arg2); |
| + | curl_mfprintf(stderr, "can't open %s\n", libtest_arg2); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -108,7 +108,7 @@ CURLcode test(char *URL) | |
| paramsf = fopen(libtest_arg2, "rb"); | |
| if(!paramsf) { | |
| - | fprintf(stderr, "can't fopen %s\n", libtest_arg2); |
| + | curl_mfprintf(stderr, "can't fopen %s\n", libtest_arg2); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -97,7 +97,7 @@ CURLcode test(char *URL) | |
| curl_easy_getinfo(c, CURLINFO_CONNECT_TIME, &connect_time); | |
| if(connect_time < dbl_epsilon) { | |
| - | fprintf(stderr, "connect time %e is < epsilon %e\n", |
| + | curl_mfprintf(stderr, "connect time %e is < epsilon %e\n", |
| connect_time, dbl_epsilon); | |
| res = TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -31,7 +31,7 @@ static int new_fnmatch(void *ptr, | |
| const char *pattern, const char *string) | |
| { | |
| (void)ptr; | |
| - | fprintf(stderr, "lib574: match string '%s' against pattern '%s'\n", |
| + | curl_mfprintf(stderr, "lib574: match string '%s' against pattern '%s'\n", |
| string, pattern); | |
| return CURL_FNMATCHFUNC_MATCH; | |
| } | |
| @@ -42,13 +42,13 @@ CURLcode test(char *URL) | |
| CURL *curl; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -60,12 +60,12 @@ CURLcode test(char *URL) | |
| res = curl_easy_perform(curl); | |
| if(res) { | |
| - | fprintf(stderr, "curl_easy_perform() failed %d\n", res); |
| + | curl_mfprintf(stderr, "curl_easy_perform() failed %d\n", res); |
| goto test_cleanup; | |
| } | |
| res = curl_easy_perform(curl); | |
| if(res) { | |
| - | fprintf(stderr, "curl_easy_perform() failed %d\n", res); |
| + | curl_mfprintf(stderr, "curl_easy_perform() failed %d\n", res); |
| goto test_cleanup; | |
| } | |
| @@ -38,45 +38,46 @@ long chunk_bgn(const void *f, void *ptr, int remains) | |
| struct chunk_data *ch_d = ptr; | |
| ch_d->remains = remains; | |
| - | printf("=============================================================\n"); |
| - | printf("Remains: %d\n", remains); |
| - | printf("Filename: %s\n", finfo->filename); |
| + | curl_mprintf("==================================" |
| + | "===========================\n"); |
| + | curl_mprintf("Remains: %d\n", remains); |
| + | curl_mprintf("Filename: %s\n", finfo->filename); |
| if(finfo->strings.perm) { | |
| - | printf("Permissions: %s", finfo->strings.perm); |
| + | curl_mprintf("Permissions: %s", finfo->strings.perm); |
| if(finfo->flags & CURLFINFOFLAG_KNOWN_PERM) | |
| - | printf(" (parsed => %o)", finfo->perm); |
| - | printf("\n"); |
| + | curl_mprintf(" (parsed => %o)", finfo->perm); |
| + | curl_mprintf("\n"); |
| } | |
| - | printf("Size: %ldB\n", (long)finfo->size); |
| + | curl_mprintf("Size: %ldB\n", (long)finfo->size); |
| if(finfo->strings.user) | |
| - | printf("User: %s\n", finfo->strings.user); |
| + | curl_mprintf("User: %s\n", finfo->strings.user); |
| if(finfo->strings.group) | |
| - | printf("Group: %s\n", finfo->strings.group); |
| + | curl_mprintf("Group: %s\n", finfo->strings.group); |
| if(finfo->strings.time) | |
| - | printf("Time: %s\n", finfo->strings.time); |
| - | printf("Filetype: "); |
| + | curl_mprintf("Time: %s\n", finfo->strings.time); |
| + | curl_mprintf("Filetype: "); |
| switch(finfo->filetype) { | |
| case CURLFILETYPE_FILE: | |
| - | printf("regular file\n"); |
| + | curl_mprintf("regular file\n"); |
| break; | |
| case CURLFILETYPE_DIRECTORY: | |
| - | printf("directory\n"); |
| + | curl_mprintf("directory\n"); |
| break; | |
| case CURLFILETYPE_SYMLINK: | |
| - | printf("symlink\n"); |
| - | printf("Target: %s\n", finfo->strings.target); |
| + | curl_mprintf("symlink\n"); |
| + | curl_mprintf("Target: %s\n", finfo->strings.target); |
| break; | |
| default: | |
| - | printf("other type\n"); |
| + | curl_mprintf("other type\n"); |
| break; | |
| } | |
| if(finfo->filetype == CURLFILETYPE_FILE) { | |
| ch_d->print_content = 1; | |
| - | printf("Content:\n" |
| + | curl_mprintf("Content:\n" |
| "-------------------------------------------------------------\n"); | |
| } | |
| if(strcmp(finfo->filename, "someothertext.txt") == 0) { | |
| - | printf("# THIS CONTENT WAS SKIPPED IN CHUNK_BGN CALLBACK #\n"); |
| + | curl_mprintf("# THIS CONTENT WAS SKIPPED IN CHUNK_BGN CALLBACK #\n"); |
| return CURL_CHUNK_BGN_FUNC_SKIP; | |
| } | |
| return CURL_CHUNK_BGN_FUNC_OK; | |
| @@ -88,10 +89,12 @@ long chunk_end(void *ptr) | |
| struct chunk_data *ch_d = ptr; | |
| if(ch_d->print_content) { | |
| ch_d->print_content = 0; | |
| - | printf("-------------------------------------------------------------\n"); |
| + | curl_mprintf("-------------------------------------------" |
| + | "------------------\n"); |
| } | |
| if(ch_d->remains == 1) | |
| - | printf("=============================================================\n"); |
| + | curl_mprintf("===========================================" |
| + | "==================\n"); |
| return CURL_CHUNK_END_FUNC_OK; | |
| } | |
| @@ -41,9 +41,9 @@ static int progress_callback(void *clientp, double dltotal, double dlnow, | |
| if(moo) { | |
| if((size_t)ultotal == data_size && (size_t)ulnow == data_size) | |
| - | fprintf(moo, "PASSED, UL data matched data size\n"); |
| + | curl_mfprintf(moo, "PASSED, UL data matched data size\n"); |
| else | |
| - | fprintf(moo, "Progress callback called with UL %f out of %f\n", |
| + | curl_mfprintf(moo, "Progress callback called with UL %f out of %f\n", |
| ulnow, ultotal); | |
| fclose(moo); | |
| } | |
| @@ -56,13 +56,13 @@ CURLcode test(char *URL) | |
| CURLcode res = CURLE_OK; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -45,12 +45,12 @@ static size_t last_ul_total = 0; | |
| static void progress_final_report(void) | |
| { | |
| FILE *moo = fopen(libtest_arg2, "ab"); | |
| - | fprintf(moo ? moo : stderr, "Progress: end UL %zu/%zu\n", |
| + | curl_mfprintf(moo ? moo : stderr, "Progress: end UL %zu/%zu\n", |
| last_ul, last_ul_total); | |
| if(moo) | |
| fclose(moo); | |
| else | |
| - | fprintf(stderr, "Progress: end UL, can't open %s\n", libtest_arg2); |
| + | curl_mfprintf(stderr, "Progress: end UL, can't open %s\n", libtest_arg2); |
| started = FALSE; | |
| } | |
| @@ -69,12 +69,13 @@ static int progress_callback(void *clientp, double dltotal, double dlnow, | |
| last_ul_total = (size_t)ultotal; | |
| if(!started) { | |
| FILE *moo = fopen(libtest_arg2, "ab"); | |
| - | fprintf(moo ? moo : stderr, "Progress: start UL %zu/%zu\n", |
| + | curl_mfprintf(moo ? moo : stderr, "Progress: start UL %zu/%zu\n", |
| last_ul, last_ul_total); | |
| if(moo) | |
| fclose(moo); | |
| else | |
| - | fprintf(stderr, "Progress: start UL, can't open %s\n", libtest_arg2); |
| + | curl_mfprintf(stderr, "Progress: start UL, can't open %s\n", |
| + | libtest_arg2); |
| started = TRUE; | |
| } | |
| @@ -109,20 +110,20 @@ CURLcode test(char *URL) | |
| pooh.counter = 0; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| slist = curl_slist_append(slist, "Transfer-Encoding: chunked"); | |
| if(!slist) { | |
| - | fprintf(stderr, "curl_slist_append() failed\n"); |
| + | curl_mfprintf(stderr, "curl_slist_append() failed\n"); |
| curl_easy_cleanup(curl); | |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| @@ -49,7 +49,7 @@ static void removeFd(struct Sockets *sockets, curl_socket_t fd, int mention) | |
| int i; | |
| if(mention) | |
| - | fprintf(stderr, "Remove socket fd %d\n", (int) fd); |
| + | curl_mfprintf(stderr, "Remove socket fd %d\n", (int) fd); |
| for(i = 0; i < sockets->count; ++i) { | |
| if(sockets->sockets[i] == fd) { | |
| @@ -70,7 +70,7 @@ static void addFd(struct Sockets *sockets, curl_socket_t fd, const char *what) | |
| * To ensure we only have each file descriptor once, we remove it then add | |
| * it again. | |
| */ | |
| - | fprintf(stderr, "Add socket fd %d for %s\n", (int) fd, what); |
| + | curl_mfprintf(stderr, "Add socket fd %d for %s\n", (int) fd, what); |
| removeFd(sockets, fd, 0); | |
| /* | |
| * Allocate array storage when required. | |
| @@ -83,7 +83,7 @@ static void addFd(struct Sockets *sockets, curl_socket_t fd, const char *what) | |
| } | |
| else if(sockets->count >= sockets->max_count) { | |
| /* this can't happen in normal cases */ | |
| - | fprintf(stderr, "too many file handles error\n"); |
| + | curl_mfprintf(stderr, "too many file handles error\n"); |
| exit(2); | |
| } | |
| /* | |
| @@ -156,7 +156,7 @@ static int checkForCompletion(CURLM *curl, int *success) | |
| *success = 0; | |
| } | |
| else { | |
| - | fprintf(stderr, "Got an unexpected message from curl: %i\n", |
| + | curl_mfprintf(stderr, "Got an unexpected message from curl: %i\n", |
| (int)message->msg); | |
| result = 1; | |
| *success = 0; | |
| @@ -206,7 +206,7 @@ static void notifyCurl(CURLM *curl, curl_socket_t s, int evBitmask, | |
| int numhandles = 0; | |
| CURLMcode result = curl_multi_socket_action(curl, s, evBitmask, &numhandles); | |
| if(result != CURLM_OK) { | |
| - | fprintf(stderr, "Curl error on %s (%i) %s\n", |
| + | curl_mfprintf(stderr, "Curl error on %s (%i) %s\n", |
| info, result, curl_multi_strerror(result)); | |
| } | |
| } | |
| @@ -243,15 +243,15 @@ CURLcode test(char *URL) | |
| start_test_timing(); | |
| if(!libtest_arg3) { | |
| - | fprintf(stderr, "Usage: lib582 [url] [filename] [username]\n"); |
| + | curl_mfprintf(stderr, "Usage: lib582 [url] [filename] [username]\n"); |
| return TEST_ERR_USAGE; | |
| } | |
| hd_src = fopen(libtest_arg2, "rb"); | |
| if(!hd_src) { | |
| - | fprintf(stderr, "fopen() failed with error (%d) %s\n", |
| + | curl_mfprintf(stderr, "fopen() failed with error (%d) %s\n", |
| errno, strerror(errno)); | |
| - | fprintf(stderr, "Error opening file '%s'\n", libtest_arg2); |
| + | curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2); |
| return TEST_ERR_FOPEN; | |
| } | |
| @@ -263,13 +263,13 @@ CURLcode test(char *URL) | |
| #endif | |
| if(hd == -1) { | |
| /* can't open file, bail out */ | |
| - | fprintf(stderr, "fstat() failed with error (%d) %s\n", |
| + | curl_mfprintf(stderr, "fstat() failed with error (%d) %s\n", |
| errno, strerror(errno)); | |
| - | fprintf(stderr, "Error opening file '%s'\n", libtest_arg2); |
| + | curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg2); |
| fclose(hd_src); | |
| return TEST_ERR_FSTAT; | |
| } | |
| - | fprintf(stderr, "Set to upload %d bytes\n", (int)file_info.st_size); |
| + | curl_mfprintf(stderr, "Set to upload %d bytes\n", (int)file_info.st_size); |
| res_global_init(CURL_GLOBAL_ALL); | |
| if(res) { | |
| @@ -344,7 +344,7 @@ CURLcode test(char *URL) | |
| } | |
| if(!success) { | |
| - | fprintf(stderr, "Error uploading file.\n"); |
| + | curl_mfprintf(stderr, "Error uploading file.\n"); |
| res = TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -63,21 +63,21 @@ CURLcode test(char *URL) | |
| /* this tests if removing an easy handle immediately after multi | |
| perform has been called succeeds or not. */ | |
| - | fprintf(stderr, "curl_multi_perform()...\n"); |
| + | curl_mfprintf(stderr, "curl_multi_perform()...\n"); |
| multi_perform(multiHandle, &stillRunning); | |
| - | fprintf(stderr, "curl_multi_perform() succeeded\n"); |
| + | curl_mfprintf(stderr, "curl_multi_perform() succeeded\n"); |
| - | fprintf(stderr, "curl_multi_remove_handle()...\n"); |
| + | curl_mfprintf(stderr, "curl_multi_remove_handle()...\n"); |
| mres = curl_multi_remove_handle(multiHandle, curl); | |
| if(mres) { | |
| - | fprintf(stderr, "curl_multi_remove_handle() failed, " |
| + | curl_mfprintf(stderr, "curl_multi_remove_handle() failed, " |
| "with code %d\n", (int)mres); | |
| res = TEST_ERR_MULTI; | |
| } | |
| else | |
| - | fprintf(stderr, "curl_multi_remove_handle() succeeded\n"); |
| + | curl_mfprintf(stderr, "curl_multi_remove_handle() succeeded\n"); |
| test_cleanup: | |
| @@ -61,10 +61,10 @@ static void test_lock(CURL *handle, curl_lock_data data, | |
| what = "ssl_session"; | |
| break; | |
| default: | |
| - | fprintf(stderr, "lock: no such data: %d\n", (int)data); |
| + | curl_mfprintf(stderr, "lock: no such data: %d\n", (int)data); |
| return; | |
| } | |
| - | printf("lock: %-6s [%s]: %d\n", what, user->text, user->counter); |
| + | curl_mprintf("lock: %-6s [%s]: %d\n", what, user->text, user->counter); |
| user->counter++; | |
| } | |
| @@ -88,10 +88,10 @@ static void test_unlock(CURL *handle, curl_lock_data data, void *useptr) | |
| what = "ssl_session"; | |
| break; | |
| default: | |
| - | fprintf(stderr, "unlock: no such data: %d\n", (int)data); |
| + | curl_mfprintf(stderr, "unlock: no such data: %d\n", (int)data); |
| return; | |
| } | |
| - | printf("unlock: %-6s [%s]: %d\n", what, user->text, user->counter); |
| + | curl_mprintf("unlock: %-6s [%s]: %d\n", what, user->text, user->counter); |
| user->counter++; | |
| } | |
| @@ -104,25 +104,25 @@ static void *test_fire(void *ptr) | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| return NULL; | |
| } | |
| curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); | |
| curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); | |
| curl_easy_setopt(curl, CURLOPT_URL, tdata->url); | |
| - | printf("CURLOPT_SHARE\n"); |
| + | curl_mprintf("CURLOPT_SHARE\n"); |
| curl_easy_setopt(curl, CURLOPT_SHARE, tdata->share); | |
| - | printf("PERFORM\n"); |
| + | curl_mprintf("PERFORM\n"); |
| code = curl_easy_perform(curl); | |
| if(code != CURLE_OK) { | |
| int i = 0; | |
| - | fprintf(stderr, "perform url '%s' repeat %d failed, curlcode %d\n", |
| + | curl_mfprintf(stderr, "perform url '%s' repeat %d failed, curlcode %d\n", |
| tdata->url, i, (int)code); | |
| } | |
| - | printf("CLEANUP\n"); |
| + | curl_mprintf("CLEANUP\n"); |
| curl_easy_cleanup(curl); | |
| return NULL; | |
| @@ -143,41 +143,41 @@ CURLcode test(char *URL) | |
| user.text = "Pigs in space"; | |
| user.counter = 0; | |
| - | printf("GLOBAL_INIT\n"); |
| + | curl_mprintf("GLOBAL_INIT\n"); |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| /* prepare share */ | |
| - | printf("SHARE_INIT\n"); |
| + | curl_mprintf("SHARE_INIT\n"); |
| share = curl_share_init(); | |
| if(!share) { | |
| - | fprintf(stderr, "curl_share_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_share_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| if(CURLSHE_OK == scode) { | |
| - | printf("CURLSHOPT_LOCKFUNC\n"); |
| + | curl_mprintf("CURLSHOPT_LOCKFUNC\n"); |
| scode = curl_share_setopt(share, CURLSHOPT_LOCKFUNC, test_lock); | |
| } | |
| if(CURLSHE_OK == scode) { | |
| - | printf("CURLSHOPT_UNLOCKFUNC\n"); |
| + | curl_mprintf("CURLSHOPT_UNLOCKFUNC\n"); |
| scode = curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, test_unlock); | |
| } | |
| if(CURLSHE_OK == scode) { | |
| - | printf("CURLSHOPT_USERDATA\n"); |
| + | curl_mprintf("CURLSHOPT_USERDATA\n"); |
| scode = curl_share_setopt(share, CURLSHOPT_USERDATA, &user); | |
| } | |
| if(CURLSHE_OK == scode) { | |
| - | printf("CURL_LOCK_DATA_SSL_SESSION\n"); |
| + | curl_mprintf("CURL_LOCK_DATA_SSL_SESSION\n"); |
| scode = curl_share_setopt(share, CURLSHOPT_SHARE, | |
| CURL_LOCK_DATA_SSL_SESSION); | |
| } | |
| if(CURLSHE_OK != scode) { | |
| - | fprintf(stderr, "curl_share_setopt() failed\n"); |
| + | curl_mfprintf(stderr, "curl_share_setopt() failed\n"); |
| curl_share_cleanup(share); | |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| @@ -192,16 +192,16 @@ CURLcode test(char *URL) | |
| tdata.share = share; | |
| /* simulate thread, direct call of "thread" function */ | |
| - | printf("*** run %d\n",i); |
| + | curl_mprintf("*** run %d\n",i); |
| test_fire(&tdata); | |
| } | |
| /* fetch another one */ | |
| - | printf("*** run %d\n", i); |
| + | curl_mprintf("*** run %d\n", i); |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_share_cleanup(share); | |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| @@ -209,37 +209,37 @@ CURLcode test(char *URL) | |
| url = URL; | |
| test_setopt(curl, CURLOPT_URL, url); | |
| - | printf("CURLOPT_SHARE\n"); |
| + | curl_mprintf("CURLOPT_SHARE\n"); |
| test_setopt(curl, CURLOPT_SHARE, share); | |
| - | printf("PERFORM\n"); |
| + | curl_mprintf("PERFORM\n"); |
| res = curl_easy_perform(curl); | |
| /* try to free share, expect to fail because share is in use */ | |
| - | printf("try SHARE_CLEANUP...\n"); |
| + | curl_mprintf("try SHARE_CLEANUP...\n"); |
| scode = curl_share_cleanup(share); | |
| if(scode == CURLSHE_OK) { | |
| - | fprintf(stderr, "curl_share_cleanup succeed but error expected\n"); |
| + | curl_mfprintf(stderr, "curl_share_cleanup succeed but error expected\n"); |
| share = NULL; | |
| } | |
| else { | |
| - | printf("SHARE_CLEANUP failed, correct\n"); |
| + | curl_mprintf("SHARE_CLEANUP failed, correct\n"); |
| } | |
| test_cleanup: | |
| /* clean up last handle */ | |
| - | printf("CLEANUP\n"); |
| + | curl_mprintf("CLEANUP\n"); |
| curl_easy_cleanup(curl); | |
| /* free share */ | |
| - | printf("SHARE_CLEANUP\n"); |
| + | curl_mprintf("SHARE_CLEANUP\n"); |
| scode = curl_share_cleanup(share); | |
| if(scode != CURLSHE_OK) | |
| - | fprintf(stderr, "curl_share_cleanup failed, code errno %d\n", |
| + | curl_mfprintf(stderr, "curl_share_cleanup failed, code errno %d\n", |
| (int)scode); | |
| - | printf("GLOBAL_CLEANUP\n"); |
| + | curl_mprintf("GLOBAL_CLEANUP\n"); |
| curl_global_cleanup(); | |
| return res; | |
| @@ -31,13 +31,13 @@ CURLcode test(char *URL) | |
| CURLcode res = CURLE_OK; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -45,13 +45,13 @@ CURLcode test(char *URL) | |
| long usedauth = 0; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -73,7 +73,7 @@ CURLcode test(char *URL) | |
| res = curl_easy_getinfo(curl, CURLINFO_PROXYAUTH_USED, &usedauth); | |
| if(CURLAUTH_NTLM != usedauth) { | |
| - | printf("CURLINFO_PROXYAUTH_USED did not say NTLM\n"); |
| + | curl_mprintf("CURLINFO_PROXYAUTH_USED did not say NTLM\n"); |
| } | |
| test_cleanup: | |
| @@ -49,9 +49,9 @@ CURLcode test(char *URL) | |
| upload = fopen(libtest_arg3, "rb"); | |
| if(!upload) { | |
| - | fprintf(stderr, "fopen() failed with error (%d) %s\n", |
| + | curl_mfprintf(stderr, "fopen() failed with error (%d) %s\n", |
| errno, strerror(errno)); | |
| - | fprintf(stderr, "Error opening file '%s'\n", libtest_arg3); |
| + | curl_mfprintf(stderr, "Error opening file '%s'\n", libtest_arg3); |
| return TEST_ERR_FOPEN; | |
| } | |
| @@ -31,13 +31,13 @@ CURLcode test(char *URL) | |
| CURL *curl; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -51,7 +51,7 @@ CURLcode test(char *URL) | |
| res = curl_easy_perform(curl); | |
| if(res) { | |
| - | fprintf(stderr, "retrieve 1 failed\n"); |
| + | curl_mfprintf(stderr, "retrieve 1 failed\n"); |
| goto test_cleanup; | |
| } | |
| @@ -63,7 +63,7 @@ CURLcode test(char *URL) | |
| res = curl_easy_perform(curl); | |
| if(res) | |
| - | fprintf(stderr, "retrieve 2 failed\n"); |
| + | curl_mfprintf(stderr, "retrieve 2 failed\n"); |
| test_cleanup: | |
| @@ -34,7 +34,7 @@ static int progress_callback(void *clientp, double dltotal, | |
| if((dltotal > 0.0) && (dlnow > dltotal)) { | |
| /* this should not happen with test case 599 */ | |
| - | printf("%.0f > %.0f !!\n", dltotal, dlnow); |
| + | curl_mprintf("%.0f > %.0f !!\n", dltotal, dlnow); |
| return -1; | |
| } | |
| @@ -48,13 +48,13 @@ CURLcode test(char *URL) | |
| double content_length = 0.0; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -88,7 +88,7 @@ CURLcode test(char *URL) | |
| ) | |
| moo = fopen(libtest_arg2, "wb"); | |
| if(moo) { | |
| - | fprintf(moo, "CL %.0f\n", content_length); |
| + | curl_mfprintf(moo, "CL %.0f\n", content_length); |
| fclose(moo); | |
| } | |
| } | |
| @@ -77,14 +77,14 @@ static CURLcode test_once(char *URL, bool oldstyle) | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| mime = curl_mime_init(curl); | |
| if(!mime) { | |
| - | fprintf(stderr, "curl_mime_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_mime_init() failed\n"); |
| curl_easy_cleanup(curl); | |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| @@ -92,7 +92,7 @@ static CURLcode test_once(char *URL, bool oldstyle) | |
| part = curl_mime_addpart(mime); | |
| if(!part) { | |
| - | fprintf(stderr, "curl_mime_addpart(1) failed\n"); |
| + | curl_mfprintf(stderr, "curl_mime_addpart(1) failed\n"); |
| curl_mime_free(mime); | |
| curl_easy_cleanup(curl); | |
| curl_global_cleanup(); | |
| @@ -119,7 +119,7 @@ static CURLcode test_once(char *URL, bool oldstyle) | |
| } | |
| if(res) | |
| - | printf("curl_mime_xxx(1) = %s\n", curl_easy_strerror(res)); |
| + | curl_mprintf("curl_mime_xxx(1) = %s\n", curl_easy_strerror(res)); |
| /* Now add the same data with another name and make it not look like | |
| a file upload but still using the callback */ | |
| @@ -132,7 +132,7 @@ static CURLcode test_once(char *URL, bool oldstyle) | |
| part = curl_mime_addpart(mime); | |
| if(!part) { | |
| - | fprintf(stderr, "curl_mime_addpart(2) failed\n"); |
| + | curl_mfprintf(stderr, "curl_mime_addpart(2) failed\n"); |
| curl_mime_free(mime); | |
| curl_easy_cleanup(curl); | |
| curl_global_cleanup(); | |
| @@ -145,11 +145,11 @@ static CURLcode test_once(char *URL, bool oldstyle) | |
| NULL, NULL, &pooh2); | |
| if(res) | |
| - | printf("curl_mime_xxx(2) = %s\n", curl_easy_strerror(res)); |
| + | curl_mprintf("curl_mime_xxx(2) = %s\n", curl_easy_strerror(res)); |
| part = curl_mime_addpart(mime); | |
| if(!part) { | |
| - | fprintf(stderr, "curl_mime_addpart(3) failed\n"); |
| + | curl_mfprintf(stderr, "curl_mime_addpart(3) failed\n"); |
| curl_mime_free(mime); | |
| curl_easy_cleanup(curl); | |
| curl_global_cleanup(); | |
| @@ -163,12 +163,12 @@ static CURLcode test_once(char *URL, bool oldstyle) | |
| CURL_ZERO_TERMINATED); | |
| if(res) | |
| - | printf("curl_mime_xxx(3) = %s\n", curl_easy_strerror(res)); |
| + | curl_mprintf("curl_mime_xxx(3) = %s\n", curl_easy_strerror(res)); |
| /* Fill in a submit field too */ | |
| part = curl_mime_addpart(mime); | |
| if(!part) { | |
| - | fprintf(stderr, "curl_mime_addpart(4) failed\n"); |
| + | curl_mfprintf(stderr, "curl_mime_addpart(4) failed\n"); |
| curl_mime_free(mime); | |
| curl_easy_cleanup(curl); | |
| curl_global_cleanup(); | |
| @@ -180,11 +180,11 @@ static CURLcode test_once(char *URL, bool oldstyle) | |
| CURL_ZERO_TERMINATED); | |
| if(res) | |
| - | printf("curl_mime_xxx(4) = %s\n", curl_easy_strerror(res)); |
| + | curl_mprintf("curl_mime_xxx(4) = %s\n", curl_easy_strerror(res)); |
| part = curl_mime_addpart(mime); | |
| if(!part) { | |
| - | fprintf(stderr, "curl_mime_addpart(5) failed\n"); |
| + | curl_mfprintf(stderr, "curl_mime_addpart(5) failed\n"); |
| curl_mime_free(mime); | |
| curl_easy_cleanup(curl); | |
| curl_global_cleanup(); | |
| @@ -197,7 +197,7 @@ static CURLcode test_once(char *URL, bool oldstyle) | |
| res = curl_mime_data(part, "blah blah", 9); | |
| if(res) | |
| - | printf("curl_mime_xxx(5) = %s\n", curl_easy_strerror(res)); |
| + | curl_mprintf("curl_mime_xxx(5) = %s\n", curl_easy_strerror(res)); |
| /* First set the URL that is about to receive our POST. */ | |
| test_setopt(curl, CURLOPT_URL, URL); | |
| @@ -254,7 +254,7 @@ CURLcode test(char *URL) | |
| CURLcode res; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -60,7 +60,7 @@ CURLcode test(char *URL) | |
| long contentlength = 0; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -87,7 +87,7 @@ CURLcode test(char *URL) | |
| CURLFORM_END); | |
| ) | |
| if(formrc) { | |
| - | printf("curl_formadd(1) = %d\n", (int) formrc); |
| + | curl_mprintf("curl_formadd(1) = %d\n", (int) formrc); |
| goto test_cleanup; | |
| } | |
| @@ -110,7 +110,7 @@ CURLcode test(char *URL) | |
| CURLFORM_END); | |
| ) | |
| if(formrc) { | |
| - | printf("curl_formadd(2) = %d\n", (int) formrc); |
| + | curl_mprintf("curl_formadd(2) = %d\n", (int) formrc); |
| goto test_cleanup; | |
| } | |
| @@ -131,7 +131,7 @@ CURLcode test(char *URL) | |
| CURLFORM_END); | |
| ) | |
| if(formrc) { | |
| - | printf("curl_formadd(3) = %d\n", (int) formrc); |
| + | curl_mprintf("curl_formadd(3) = %d\n", (int) formrc); |
| goto test_cleanup; | |
| } | |
| @@ -144,7 +144,7 @@ CURLcode test(char *URL) | |
| CURLFORM_END); | |
| ) | |
| if(formrc) { | |
| - | printf("curl_formadd(4) = %d\n", (int) formrc); |
| + | curl_mprintf("curl_formadd(4) = %d\n", (int) formrc); |
| goto test_cleanup; | |
| } | |
| @@ -166,7 +166,7 @@ CURLcode test(char *URL) | |
| CURLFORM_END); | |
| ) | |
| if(formrc) { | |
| - | printf("curl_formadd(5) = %d\n", (int) formrc); |
| + | curl_mprintf("curl_formadd(5) = %d\n", (int) formrc); |
| goto test_cleanup; | |
| } | |
| @@ -179,13 +179,13 @@ CURLcode test(char *URL) | |
| CURLFORM_END); | |
| ) | |
| if(formrc) { | |
| - | printf("curl_formadd(6) = %d\n", (int) formrc); |
| + | curl_mprintf("curl_formadd(6) = %d\n", (int) formrc); |
| goto test_cleanup; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| goto test_cleanup; | |
| } | |
| @@ -45,7 +45,7 @@ CURLcode test(char *URL) | |
| testbuf[sizeof(testbuf)-1] = 0; /* null-terminate */ | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -57,12 +57,12 @@ CURLcode test(char *URL) | |
| CURLFORM_END); | |
| ) | |
| if(formrc) | |
| - | printf("curl_formadd(1) = %d\n", (int) formrc); |
| + | curl_mprintf("curl_formadd(1) = %d\n", (int) formrc); |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| CURL_IGNORE_DEPRECATION( | |
| curl_formfree(formpost); | |
| ) | |
| @@ -43,13 +43,13 @@ CURLcode test(char *URL) | |
| memset(&testbuf[i * 10], 65 + (i % 26), 10); | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -57,41 +57,41 @@ CURLcode test(char *URL) | |
| /* Build mime structure. */ | |
| mime = curl_mime_init(curl); | |
| if(!mime) { | |
| - | fprintf(stderr, "curl_mime_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_mime_init() failed\n"); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| part = curl_mime_addpart(mime); | |
| if(!part) { | |
| - | fprintf(stderr, "curl_mime_addpart() failed\n"); |
| + | curl_mfprintf(stderr, "curl_mime_addpart() failed\n"); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| res = curl_mime_filename(part, "myfile.jpg"); | |
| if(res) { | |
| - | fprintf(stderr, "curl_mime_filename() failed\n"); |
| + | curl_mfprintf(stderr, "curl_mime_filename() failed\n"); |
| goto test_cleanup; | |
| } | |
| res = curl_mime_type(part, "image/jpeg"); | |
| if(res) { | |
| - | fprintf(stderr, "curl_mime_type() failed\n"); |
| + | curl_mfprintf(stderr, "curl_mime_type() failed\n"); |
| goto test_cleanup; | |
| } | |
| res = curl_mime_data(part, testbuf, sizeof(testbuf)); | |
| if(res) { | |
| - | fprintf(stderr, "curl_mime_data() failed\n"); |
| + | curl_mfprintf(stderr, "curl_mime_data() failed\n"); |
| goto test_cleanup; | |
| } | |
| res = curl_mime_encoder(part, "base64"); | |
| if(res) { | |
| - | fprintf(stderr, "curl_mime_encoder() failed\n"); |
| + | curl_mfprintf(stderr, "curl_mime_encoder() failed\n"); |
| goto test_cleanup; | |
| } | |
| /* Prepare recipients. */ | |
| recipients = curl_slist_append(NULL, "[email protected]"); | |
| if(!recipients) { | |
| - | fprintf(stderr, "curl_slist_append() failed\n"); |
| + | curl_mfprintf(stderr, "curl_slist_append() failed\n"); |
| goto test_cleanup; | |
| } | |
| @@ -78,7 +78,7 @@ CURLcode test(char *URL) | |
| */ | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -119,7 +119,7 @@ CURLcode test(char *URL) | |
| /* Duplicate the handle. */ | |
| easy2 = curl_easy_duphandle(easy); | |
| if(!easy2) { | |
| - | fprintf(stderr, "curl_easy_duphandle() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_duphandle() failed\n"); |
| res = TEST_ERR_FAILURE; | |
| goto test_cleanup; | |
| } | |
| @@ -132,7 +132,7 @@ CURLcode test(char *URL) | |
| /* Perform on the first handle: should not send any data. */ | |
| res = curl_easy_perform(easy); | |
| if(res != CURLE_OK) { | |
| - | fprintf(stderr, "curl_easy_perform(original) failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_perform(original) failed\n"); |
| goto test_cleanup; | |
| } | |
| @@ -140,7 +140,7 @@ CURLcode test(char *URL) | |
| duplicated properly, it should cause a valgrind error. */ | |
| res = curl_easy_perform(easy2); | |
| if(res != CURLE_OK) { | |
| - | fprintf(stderr, "curl_easy_perform(duplicated) failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_perform(duplicated) failed\n"); |
| goto test_cleanup; | |
| } | |
| @@ -151,7 +151,7 @@ CURLcode test(char *URL) | |
| easy2 = NULL; /* Already cleaned up. */ | |
| if(pooh.freecount != 2) { | |
| - | fprintf(stderr, "free_callback() called %d times instead of 2\n", |
| + | curl_mfprintf(stderr, "free_callback() called %d times instead of 2\n", |
| pooh.freecount); | |
| res = TEST_ERR_FAILURE; | |
| goto test_cleanup; | |
| @@ -36,7 +36,7 @@ resolver_alloc_cb_fail(void *resolver_state, void *reserved, void *userdata) | |
| cb_count++; | |
| if(strcmp(userdata, TEST_DATA_STRING)) { | |
| - | fprintf(stderr, "Invalid test data received"); |
| + | curl_mfprintf(stderr, "Invalid test data received"); |
| exit(1); | |
| } | |
| @@ -51,7 +51,7 @@ resolver_alloc_cb_pass(void *resolver_state, void *reserved, void *userdata) | |
| cb_count++; | |
| if(strcmp(userdata, TEST_DATA_STRING)) { | |
| - | fprintf(stderr, "Invalid test data received"); |
| + | curl_mfprintf(stderr, "Invalid test data received"); |
| exit(1); | |
| } | |
| @@ -64,12 +64,12 @@ CURLcode test(char *URL) | |
| CURLcode res = CURLE_OK; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -83,7 +83,7 @@ CURLcode test(char *URL) | |
| /* this should fail */ | |
| res = curl_easy_perform(curl); | |
| if(res != CURLE_COULDNT_RESOLVE_HOST) { | |
| - | fprintf(stderr, "curl_easy_perform should have returned " |
| + | curl_mfprintf(stderr, "curl_easy_perform should have returned " |
| "CURLE_COULDNT_RESOLVE_HOST but instead returned error %d\n", res); | |
| if(res == CURLE_OK) | |
| res = TEST_ERR_FAILURE; | |
| @@ -95,12 +95,12 @@ CURLcode test(char *URL) | |
| /* this should succeed */ | |
| res = curl_easy_perform(curl); | |
| if(res) { | |
| - | fprintf(stderr, "curl_easy_perform failed.\n"); |
| + | curl_mfprintf(stderr, "curl_easy_perform failed.\n"); |
| goto test_cleanup; | |
| } | |
| if(cb_count != 2) { | |
| - | fprintf(stderr, "Unexpected number of callbacks: %d\n", cb_count); |
| + | curl_mfprintf(stderr, "Unexpected number of callbacks: %d\n", cb_count); |
| res = TEST_ERR_FAILURE; | |
| goto test_cleanup; | |
| } | |
| @@ -44,13 +44,13 @@ CURLcode test(char *URL) | |
| urlp = curl_url(); | |
| if(!urlp) { | |
| - | fprintf(stderr, "problem init URL api."); |
| + | curl_mfprintf(stderr, "problem init URL api."); |
| goto test_cleanup; | |
| } | |
| uc = curl_url_set(urlp, CURLUPART_URL, URL, 0); | |
| if(uc) { | |
| - | fprintf(stderr, "problem setting CURLUPART_URL: %s.", |
| + | curl_mfprintf(stderr, "problem setting CURLUPART_URL: %s.", |
| curl_url_strerror(uc)); | |
| goto test_cleanup; | |
| } | |
| @@ -64,8 +64,9 @@ CURLcode test(char *URL) | |
| res = curl_easy_perform(handle); | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_perform() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, "%s:%d curl_easy_perform() failed " |
| + | "with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| @@ -43,7 +43,7 @@ CURLcode test(char *URL) | |
| urlp = curl_url(); | |
| if(!urlp) { | |
| - | fprintf(stderr, "problem init URL api."); |
| + | curl_mfprintf(stderr, "problem init URL api."); |
| goto test_cleanup; | |
| } | |
| @@ -51,7 +51,7 @@ CURLcode test(char *URL) | |
| if(curl_url_set(urlp, CURLUPART_HOST, "www.example.com", 0) || | |
| curl_url_set(urlp, CURLUPART_SCHEME, "http", 0) || | |
| curl_url_set(urlp, CURLUPART_PORT, "80", 0)) { | |
| - | fprintf(stderr, "problem setting CURLUPART"); |
| + | curl_mfprintf(stderr, "problem setting CURLUPART"); |
| goto test_cleanup; | |
| } | |
| @@ -62,8 +62,9 @@ CURLcode test(char *URL) | |
| res = curl_easy_perform(handle); | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_perform() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, "%s:%d curl_easy_perform() failed " |
| + | "with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| @@ -32,20 +32,20 @@ CURLcode test(char *URL) | |
| struct curl_slist *slist = NULL; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| /* test: CURLFTPMETHOD_SINGLECWD with absolute path should | |
| skip CWD to entry path */ | |
| - | newURL = aprintf("%s/folderA/661", URL); |
| + | newURL = curl_maprintf("%s/folderA/661", URL); |
| test_setopt(curl, CURLOPT_URL, newURL); | |
| test_setopt(curl, CURLOPT_VERBOSE, 1L); | |
| test_setopt(curl, CURLOPT_IGNORE_CONTENT_LENGTH, 1L); | |
| @@ -55,7 +55,7 @@ CURLcode test(char *URL) | |
| goto test_cleanup; | |
| curl_free(newURL); | |
| - | newURL = aprintf("%s/folderB/661", URL); |
| + | newURL = curl_maprintf("%s/folderB/661", URL); |
| test_setopt(curl, CURLOPT_URL, newURL); | |
| res = curl_easy_perform(curl); | |
| if(res != CURLE_REMOTE_FILE_NOT_FOUND) | |
| @@ -66,13 +66,13 @@ CURLcode test(char *URL) | |
| curl_easy_cleanup(curl); | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| curl_free(newURL); | |
| - | newURL = aprintf("%s/folderA/661", URL); |
| + | newURL = curl_maprintf("%s/folderA/661", URL); |
| test_setopt(curl, CURLOPT_URL, newURL); | |
| test_setopt(curl, CURLOPT_VERBOSE, 1L); | |
| test_setopt(curl, CURLOPT_IGNORE_CONTENT_LENGTH, 1L); | |
| @@ -83,7 +83,7 @@ CURLcode test(char *URL) | |
| /* curve ball: CWD /folderB before reusing connection with _NOCWD */ | |
| curl_free(newURL); | |
| - | newURL = aprintf("%s/folderB/661", URL); |
| + | newURL = curl_maprintf("%s/folderB/661", URL); |
| test_setopt(curl, CURLOPT_URL, newURL); | |
| test_setopt(curl, CURLOPT_FTP_FILEMETHOD, (long) CURLFTPMETHOD_SINGLECWD); | |
| res = curl_easy_perform(curl); | |
| @@ -91,7 +91,7 @@ CURLcode test(char *URL) | |
| goto test_cleanup; | |
| curl_free(newURL); | |
| - | newURL = aprintf("%s/folderA/661", URL); |
| + | newURL = curl_maprintf("%s/folderA/661", URL); |
| test_setopt(curl, CURLOPT_URL, newURL); | |
| test_setopt(curl, CURLOPT_FTP_FILEMETHOD, (long) CURLFTPMETHOD_NOCWD); | |
| res = curl_easy_perform(curl); | |
| @@ -103,14 +103,14 @@ CURLcode test(char *URL) | |
| curl_easy_cleanup(curl); | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| slist = curl_slist_append(NULL, "SYST"); | |
| if(!slist) { | |
| - | fprintf(stderr, "curl_slist_append() failed\n"); |
| + | curl_mfprintf(stderr, "curl_slist_append() failed\n"); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -129,7 +129,7 @@ CURLcode test(char *URL) | |
| curl_easy_cleanup(curl); | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -158,7 +158,7 @@ CURLcode test(char *URL) | |
| test_cleanup: | |
| if(res) | |
| - | fprintf(stderr, "test encountered error %d\n", res); |
| + | curl_mfprintf(stderr, "test encountered error %d\n", res); |
| curl_slist_free_all(slist); | |
| curl_free(newURL); | |
| curl_easy_cleanup(curl); | |
| @@ -45,13 +45,13 @@ CURLcode test(char *URL) | |
| testbuf[i] = (char) (0x41 + i % 26); /* A...Z */ | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| @@ -59,34 +59,34 @@ CURLcode test(char *URL) | |
| /* Build mime structure. */ | |
| mime = curl_mime_init(curl); | |
| if(!mime) { | |
| - | fprintf(stderr, "curl_mime_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_mime_init() failed\n"); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| part = curl_mime_addpart(mime); | |
| if(!part) { | |
| - | fprintf(stderr, "curl_mime_addpart() failed\n"); |
| + | curl_mfprintf(stderr, "curl_mime_addpart() failed\n"); |
| res = TEST_ERR_MAJOR_BAD; | |
| goto test_cleanup; | |
| } | |
| res = curl_mime_name(part, "upfile"); | |
| if(res) { | |
| - | fprintf(stderr, "curl_mime_name() failed\n"); |
| + | curl_mfprintf(stderr, "curl_mime_name() failed\n"); |
| goto test_cleanup; | |
| } | |
| res = curl_mime_filename(part, "myfile.txt"); | |
| if(res) { | |
| - | fprintf(stderr, "curl_mime_filename() failed\n"); |
| + | curl_mfprintf(stderr, "curl_mime_filename() failed\n"); |
| goto test_cleanup; | |
| } | |
| res = curl_mime_data(part, testbuf, sizeof(testbuf)); | |
| if(res) { | |
| - | fprintf(stderr, "curl_mime_data() failed\n"); |
| + | curl_mfprintf(stderr, "curl_mime_data() failed\n"); |
| goto test_cleanup; | |
| } | |
| res = curl_mime_encoder(part, "binary"); | |
| if(res) { | |
| - | fprintf(stderr, "curl_mime_encoder() failed\n"); |
| + | curl_mfprintf(stderr, "curl_mime_encoder() failed\n"); |
| goto test_cleanup; | |
| } | |
| @@ -68,7 +68,7 @@ CURLcode test(char *URL) | |
| */ | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -101,7 +101,7 @@ CURLcode test(char *URL) | |
| /* Send data. */ | |
| res = curl_easy_perform(easy); | |
| if(res != CURLE_OK) { | |
| - | fprintf(stderr, "curl_easy_perform() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_perform() failed\n"); |
| } | |
| test_cleanup: | |
| @@ -61,7 +61,7 @@ CURLcode test(char *URL) | |
| */ | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -105,7 +105,7 @@ CURLcode test(char *URL) | |
| /* Send data. */ | |
| res = curl_easy_perform(easy); | |
| if(res != CURLE_OK) { | |
| - | fprintf(stderr, "curl_easy_perform() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_perform() failed\n"); |
| } | |
| test_cleanup: | |
| @@ -61,7 +61,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) | |
| case 3: | |
| return 0; | |
| } | |
| - | fprintf(stderr, "Read callback called after EOF\n"); |
| + | curl_mfprintf(stderr, "Read callback called after EOF\n"); |
| exit(1); | |
| } | |
| @@ -80,7 +80,7 @@ static int xferinfo(void *clientp, curl_off_t dltotal, curl_off_t dlnow, | |
| time_t delta = time(NULL) - pooh->origin; | |
| if(delta >= 4 * PAUSE_TIME) { | |
| - | fprintf(stderr, "unpausing failed: drain problem?\n"); |
| + | curl_mfprintf(stderr, "unpausing failed: drain problem?\n"); |
| return CURLE_ABORTED_BY_CALLBACK; | |
| } | |
| @@ -118,7 +118,7 @@ CURLcode test(char *URL) | |
| */ | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -141,7 +141,7 @@ CURLcode test(char *URL) | |
| part = curl_mime_addpart(mime); | |
| res = curl_mime_name(part, testname); | |
| if(res != CURLE_OK) { | |
| - | fprintf(stderr, |
| + | curl_mfprintf(stderr, |
| "Something went wrong when building the mime structure: %d\n", | |
| res); | |
| goto test_cleanup; | |
| @@ -163,7 +163,7 @@ CURLcode test(char *URL) | |
| CURLFORM_END); | |
| ) | |
| if(formrc) { | |
| - | fprintf(stderr, "curl_formadd() = %d\n", (int) formrc); |
| + | curl_mfprintf(stderr, "curl_formadd() = %d\n", (int) formrc); |
| goto test_cleanup; | |
| } | |
| @@ -196,7 +196,7 @@ CURLcode test(char *URL) | |
| time_t delta = time(NULL) - pooh.origin; | |
| if(delta >= 4 * PAUSE_TIME) { | |
| - | fprintf(stderr, "unpausing failed: drain problem?\n"); |
| + | curl_mfprintf(stderr, "unpausing failed: drain problem?\n"); |
| res = CURLE_OPERATION_TIMEDOUT; | |
| break; | |
| } | |
| @@ -220,7 +220,7 @@ CURLcode test(char *URL) | |
| #endif | |
| rc = select(maxfd + 1, &fdread, &fdwrite, &fdexcept, &timeout); | |
| if(rc == -1) { | |
| - | fprintf(stderr, "Select error\n"); |
| + | curl_mfprintf(stderr, "Select error\n"); |
| break; | |
| } | |
| } | |
| @@ -45,13 +45,13 @@ CURLcode test(char *URL) | |
| urlp = curl_url(); | |
| if(!urlp) { | |
| - | fprintf(stderr, "problem init URL api."); |
| + | curl_mfprintf(stderr, "problem init URL api."); |
| goto test_cleanup; | |
| } | |
| uc = curl_url_set(urlp, CURLUPART_URL, URL, 0); | |
| if(uc) { | |
| - | fprintf(stderr, "problem setting CURLUPART_URL: %s.", |
| + | curl_mfprintf(stderr, "problem setting CURLUPART_URL: %s.", |
| curl_url_strerror(uc)); | |
| goto test_cleanup; | |
| } | |
| @@ -65,8 +65,9 @@ CURLcode test(char *URL) | |
| res = curl_easy_perform(handle); | |
| if(res) { | |
| - | fprintf(stderr, "%s:%d curl_easy_perform() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| + | curl_mfprintf(stderr, "%s:%d curl_easy_perform() failed " |
| + | "with code %d (%s)\n", |
| + | __FILE__, __LINE__, res, curl_easy_strerror(res)); |
| goto test_cleanup; | |
| } | |
| @@ -31,13 +31,13 @@ CURLcode test(char *URL) | |
| CURL *curl; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -50,7 +50,7 @@ CURLcode test(char *URL) | |
| res = curl_easy_perform(curl); | |
| if(res) { | |
| - | fprintf(stderr, "retrieve 1 failed\n"); |
| + | curl_mfprintf(stderr, "retrieve 1 failed\n"); |
| goto test_cleanup; | |
| } | |
| @@ -59,7 +59,7 @@ CURLcode test(char *URL) | |
| res = curl_easy_perform(curl); | |
| if(res) | |
| - | fprintf(stderr, "retrieve 2 failed\n"); |
| + | curl_mfprintf(stderr, "retrieve 2 failed\n"); |
| test_cleanup: | |
| @@ -65,7 +65,7 @@ CURLcode test(char *URL) | |
| curl_easy_getinfo(curl, CURLINFO_ACTIVESOCKET, &sock); | |
| if(sock == CURL_SOCKET_BAD) | |
| goto test_cleanup; | |
| - | printf("Connected fine, extracted socket. Moving on\n"); |
| + | curl_mprintf("Connected fine, extracted socket. Moving on\n"); |
| } | |
| } | |
| @@ -88,7 +88,7 @@ CURLcode test(char *URL) | |
| continue; | |
| } | |
| else if(ec) { | |
| - | fprintf(stderr, "curl_easy_send() failed, with code %d (%s)\n", |
| + | curl_mfprintf(stderr, "curl_easy_send() failed, with code %d (%s)\n", |
| (int)ec, curl_easy_strerror(ec)); | |
| res = ec; | |
| goto test_cleanup; | |
| @@ -109,7 +109,7 @@ CURLcode test(char *URL) | |
| continue; | |
| } | |
| else if(ec) { | |
| - | fprintf(stderr, "curl_easy_recv() failed, with code %d (%s)\n", |
| + | curl_mfprintf(stderr, "curl_easy_recv() failed, with code %d (%s)\n", |
| (int)ec, curl_easy_strerror(ec)); | |
| res = ec; | |
| goto test_cleanup; | |
| @@ -73,7 +73,7 @@ static CURLcode test_cert_blob(const char *url, const char *cafile) | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| return CURLE_FAILED_INIT; | |
| } | |
| @@ -109,7 +109,7 @@ CURLcode test(char *URL) | |
| if(e) { | |
| w = curl_easy_setopt(e, CURLOPT_CAINFO_BLOB, &blob); | |
| if(w) | |
| - | printf("CURLOPT_CAINFO_BLOB is not supported\n"); |
| + | curl_mprintf("CURLOPT_CAINFO_BLOB is not supported\n"); |
| curl_easy_cleanup(e); | |
| } | |
| res = w; | |
| @@ -33,13 +33,13 @@ CURLcode test(char *URL) | |
| int count = 0; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -61,7 +61,7 @@ CURLcode test(char *URL) | |
| if(res) | |
| goto test_cleanup; | |
| if(CURLAUTH_NTLM != usedauth) { | |
| - | printf("CURLINFO_HTTPAUTH_USED did not say NTLM\n"); |
| + | curl_mprintf("CURLINFO_HTTPAUTH_USED did not say NTLM\n"); |
| } | |
| /* set a new URL for the second, so that we don't restart NTLM */ | |
| @@ -47,7 +47,7 @@ CURLcode test(char *URL) | |
| */ | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -77,7 +77,7 @@ CURLcode test(char *URL) | |
| /* Check for errors */ | |
| if(res != CURLE_OK) | |
| - | fprintf(stderr, "curl_easy_perform() 1 failed: %s\n", |
| + | curl_mfprintf(stderr, "curl_easy_perform() 1 failed: %s\n", |
| curl_easy_strerror(res)); | |
| else { | |
| /* phase two, create a mime struct using the mime1 handle */ | |
| @@ -91,7 +91,7 @@ CURLcode test(char *URL) | |
| res = curl_mime_subparts(part, mime1); | |
| if(res != CURLE_OK) | |
| - | fprintf(stderr, "curl_mime_subparts() failed: %sn", |
| + | curl_mfprintf(stderr, "curl_mime_subparts() failed: %sn", |
| curl_easy_strerror(res)); | |
| else { | |
| mime1 = NULL; | |
| @@ -101,7 +101,7 @@ CURLcode test(char *URL) | |
| /* Check for errors */ | |
| if(res != CURLE_OK) | |
| - | fprintf(stderr, "curl_easy_perform() 2 failed: %s\n", |
| + | curl_mfprintf(stderr, "curl_easy_perform() 2 failed: %s\n", |
| curl_easy_strerror(res)); | |
| } | |
| } | |
| @@ -36,12 +36,12 @@ static CURLcode send_request(CURL *curl, const char *url, int seq, | |
| size_t len = strlen(url) + 4 + 1; | |
| char *full_url = malloc(len); | |
| if(!full_url) { | |
| - | fprintf(stderr, "Not enough memory for full url\n"); |
| + | curl_mfprintf(stderr, "Not enough memory for full url\n"); |
| return CURLE_OUT_OF_MEMORY; | |
| } | |
| - | msnprintf(full_url, len, "%s%04d", url, seq); |
| - | fprintf(stderr, "Sending new request %d to %s with credential %s " |
| + | curl_msnprintf(full_url, len, "%s%04d", url, seq); |
| + | curl_mfprintf(stderr, "Sending new request %d to %s with credential %s " |
| "(auth %ld)\n", seq, full_url, userpwd, auth_scheme); | |
| test_setopt(curl, CURLOPT_URL, full_url); | |
| test_setopt(curl, CURLOPT_VERBOSE, 1L); | |
| @@ -92,12 +92,12 @@ CURLcode test(char *url) | |
| if(main_auth_scheme == CURLAUTH_NONE || | |
| fallback_auth_scheme == CURLAUTH_NONE) { | |
| - | fprintf(stderr, "auth schemes not found on commandline\n"); |
| + | curl_mfprintf(stderr, "auth schemes not found on commandline\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -105,7 +105,7 @@ CURLcode test(char *url) | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -123,7 +123,7 @@ CURLcode test(char *url) | |
| /* Send wrong password twice, then right password */ | |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| - | fprintf(stderr, "curl_easy_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_easy_init() failed\n"); |
| curl_global_cleanup(); | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -54,7 +54,7 @@ static size_t callback(char *ptr, size_t size, size_t nmemb, void *data) | |
| code = curl_easy_getinfo(ntlm_easy[idx], CURLINFO_LASTSOCKET, &longdata); | |
| ) | |
| if(CURLE_OK != code) { | |
| - | fprintf(stderr, "%s:%d curl_easy_getinfo() failed, " |
| + | curl_mfprintf(stderr, "%s:%d curl_easy_getinfo() failed, " |
| "with code %d (%s)\n", | |
| __FILE__, __LINE__, (int)code, curl_easy_strerror(code)); | |
| ntlmcb_res = TEST_ERR_MAJOR_BAD; | |
| @@ -74,7 +74,7 @@ static size_t callback(char *ptr, size_t size, size_t nmemb, void *data) | |
| else if(sock != ntlm_sockets[idx]) { | |
| /* An easy handle with a socket different to previously | |
| tracked one, log and fail right away. Known bug #37. */ | |
| - | fprintf(stderr, "Handle %d started on socket %d and moved to %d\n", |
| + | curl_mfprintf(stderr, "Handle %d started on socket %d and moved to %d\n", |
| curlx_sztosi(idx), (int)ntlm_sockets[idx], (int)sock); | |
| ntlmcb_res = TEST_ERR_MAJOR_BAD; | |
| return failure; | |
| @@ -103,7 +103,7 @@ CURLcode test(char *url) | |
| start_test_timing(); | |
| if(!full_url) { | |
| - | fprintf(stderr, "Not enough memory for full url\n"); |
| + | curl_mfprintf(stderr, "Not enough memory for full url\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -134,11 +134,11 @@ CURLcode test(char *url) | |
| easy_init(ntlm_easy[num_handles]); | |
| if(num_handles % 3 == 2) { | |
| - | msnprintf(full_url, urllen, "%s0200", url); |
| + | curl_msnprintf(full_url, urllen, "%s0200", url); |
| easy_setopt(ntlm_easy[num_handles], CURLOPT_HTTPAUTH, CURLAUTH_NTLM); | |
| } | |
| else { | |
| - | msnprintf(full_url, urllen, "%s0100", url); |
| + | curl_msnprintf(full_url, urllen, "%s0100", url); |
| easy_setopt(ntlm_easy[num_handles], CURLOPT_HTTPAUTH, CURLAUTH_BASIC); | |
| } | |
| easy_setopt(ntlm_easy[num_handles], CURLOPT_FRESH_CONNECT, 1L); | |
| @@ -160,7 +160,7 @@ CURLcode test(char *url) | |
| multi_perform(multi, &running); | |
| - | fprintf(stderr, "%s:%d running %d state %d\n", |
| + | curl_mfprintf(stderr, "%s:%d running %d state %d\n", |
| __FILE__, __LINE__, running, state); | |
| abort_on_test_timeout(); | |
| @@ -178,22 +178,23 @@ CURLcode test(char *url) | |
| if(state == NeedSocketForNewHandle) { | |
| if(maxfd != -1 && !found_new_socket) { | |
| - | fprintf(stderr, "Warning: socket did not open immediately for new " |
| - | "handle (trying again)\n"); |
| + | curl_mfprintf(stderr, |
| + | "Warning: socket did not open immediately for new " |
| + | "handle (trying again)\n"); |
| continue; | |
| } | |
| state = num_handles < MAX_EASY_HANDLES ? ReadyForNewHandle | |
| : NoMoreHandles; | |
| - | fprintf(stderr, "%s:%d new state %d\n", |
| - | __FILE__, __LINE__, state); |
| + | curl_mfprintf(stderr, "%s:%d new state %d\n", |
| + | __FILE__, __LINE__, state); |
| } | |
| multi_timeout(multi, &timeout); | |
| /* At this point, timeout is guaranteed to be greater or equal than -1. */ | |
| - | fprintf(stderr, "%s:%d num_handles %d timeout %ld running %d\n", |
| - | __FILE__, __LINE__, num_handles, timeout, running); |
| + | curl_mfprintf(stderr, "%s:%d num_handles %d timeout %ld running %d\n", |
| + | __FILE__, __LINE__, num_handles, timeout, running); |
| if(timeout != -1L) { | |
| int itimeout; | |
| @@ -227,7 +228,7 @@ test_cleanup: | |
| /* proper cleanup sequence - type PB */ | |
| for(i = 0; i < MAX_EASY_HANDLES; i++) { | |
| - | printf("Data connection %d: %d\n", i, ntlm_counter[i]); |
| + | curl_mprintf("Data connection %d: %d\n", i, ntlm_counter[i]); |
| curl_multi_remove_handle(multi, ntlm_easy[i]); | |
| curl_easy_cleanup(ntlm_easy[i]); | |
| } | |
| @@ -37,17 +37,17 @@ static int prereq_callback(void *clientp, | |
| PRCS *prereq_cb = (PRCS *)clientp; | |
| if(prereq_cb->ipv6) { | |
| - | printf("Connected to [%s]\n", conn_primary_ip); |
| - | printf("Connected from [%s]\n", conn_local_ip); |
| + | curl_mprintf("Connected to [%s]\n", conn_primary_ip); |
| + | curl_mprintf("Connected from [%s]\n", conn_local_ip); |
| } | |
| else { | |
| - | printf("Connected to %s\n", conn_primary_ip); |
| - | printf("Connected from %s\n", conn_local_ip); |
| + | curl_mprintf("Connected to %s\n", conn_primary_ip); |
| + | curl_mprintf("Connected from %s\n", conn_local_ip); |
| } | |
| - | printf("Remote port = %d\n", conn_primary_port); |
| - | printf("Local port = %d\n", conn_local_port); |
| - | printf("Returning = %d\n", prereq_cb->prereq_retcode); |
| + | curl_mprintf("Remote port = %d\n", conn_primary_port); |
| + | curl_mprintf("Local port = %d\n", conn_local_port); |
| + | curl_mprintf("Returning = %d\n", prereq_cb->prereq_retcode); |
| return prereq_cb->prereq_retcode; | |
| } | |
| @@ -85,8 +85,9 @@ CURLcode test(char *URL) | |
| ret = curl_easy_perform(curl); | |
| if(ret) { | |
| - | fprintf(stderr, "%s:%d curl_easy_perform() failed with code %d (%s)\n", |
| - | __FILE__, __LINE__, ret, curl_easy_strerror(ret)); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d curl_easy_perform() failed with code %d (%s)\n", |
| + | __FILE__, __LINE__, ret, curl_easy_strerror(ret)); |
| goto test_cleanup; | |
| } | |
| } | |
| @@ -0,0 +1,50 @@ | |
| + | /*************************************************************************** |
| + | * _ _ ____ _ |
| + | * Project ___| | | | _ \| | |
| + | * / __| | | | |_) | | |
| + | * | (__| |_| | _ <| |___ |
| + | * \___|\___/|_| \_\_____| |
| + | * |
| + | * Copyright (C) Daniel Stenberg, <[email protected]>, et al. |
| + | * |
| + | * This software is licensed as described in the file COPYING, which |
| + | * you should have received as part of this distribution. The terms |
| + | * are also available at https://curl.se/docs/copyright.html. |
| + | * |
| + | * You may opt to use, copy, modify, merge, publish, distribute and/or sell |
| + | * copies of the Software, and permit persons to whom the Software is |
| + | * furnished to do so, under the terms of the COPYING file. |
| + | * |
| + | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| + | * KIND, either express or implied. |
| + | * |
| + | * SPDX-License-Identifier: curl |
| + | * |
| + | ***************************************************************************/ |
| + | #include "test.h" |
| + | #include "curl_memory.h" |
| + | |
| + | #ifndef CURL_STATICLIB |
| + | |
| + | #if defined(_MSC_VER) && defined(_DLL) |
| + | # pragma warning(push) |
| + | # pragma warning(disable:4232) /* MSVC extension, dllimport identity */ |
| + | #endif |
| + | |
| + | /* when libcurl is *not* static and we build libtests, the global pointers in |
| + | curl_memory.c is not available unless we provide them like this */ |
| + | |
| + | curl_malloc_callback Curl_cmalloc = (curl_malloc_callback)malloc; |
| + | curl_free_callback Curl_cfree = (curl_free_callback)free; |
| + | curl_realloc_callback Curl_crealloc = (curl_realloc_callback)realloc; |
| + | curl_strdup_callback Curl_cstrdup = (curl_strdup_callback)strdup; |
| + | curl_calloc_callback Curl_ccalloc = (curl_calloc_callback)calloc; |
| + | #if defined(_WIN32) && defined(UNICODE) |
| + | curl_wcsdup_callback Curl_cwcsdup = wcsdup; |
| + | #endif |
| + | |
| + | #if defined(_MSC_VER) && defined(_DLL) |
| + | # pragma warning(pop) |
| + | #endif |
| + | |
| + | #endif /* !CURL_STATICLIB */ |
| @@ -142,7 +142,7 @@ extern int unitfail; | |
| #define exe_easy_init(A,Y,Z) do { \ | |
| if(((A) = curl_easy_init()) == NULL) { \ | |
| - | fprintf(stderr, "%s:%d curl_easy_init() failed\n", (Y), (Z)); \ |
| + | curl_mfprintf(stderr, "%s:%d curl_easy_init() failed\n", (Y), (Z)); \ |
| res = TEST_ERR_EASY_INIT; \ | |
| } \ | |
| } while(0) | |
| @@ -163,7 +163,7 @@ extern int unitfail; | |
| #define exe_multi_init(A,Y,Z) do { \ | |
| if(((A) = curl_multi_init()) == NULL) { \ | |
| - | fprintf(stderr, "%s:%d curl_multi_init() failed\n", (Y), (Z)); \ |
| + | curl_mfprintf(stderr, "%s:%d curl_multi_init() failed\n", (Y), (Z)); \ |
| res = TEST_ERR_MULTI; \ | |
| } \ | |
| } while(0) | |
| @@ -185,7 +185,7 @@ extern int unitfail; | |
| #define exe_easy_setopt(A,B,C,Y,Z) do { \ | |
| CURLcode ec; \ | |
| if((ec = curl_easy_setopt((A), (B), (C))) != CURLE_OK) { \ | |
| - | fprintf(stderr, "%s:%d curl_easy_setopt() failed, " \ |
| + | curl_mfprintf(stderr, "%s:%d curl_easy_setopt() failed, " \ |
| "with code %d (%s)\n", \ | |
| (Y), (Z), (int)ec, curl_easy_strerror(ec)); \ | |
| res = ec; \ | |
| @@ -209,7 +209,7 @@ extern int unitfail; | |
| #define exe_multi_setopt(A, B, C, Y, Z) do { \ | |
| CURLMcode ec; \ | |
| if((ec = curl_multi_setopt((A), (B), (C))) != CURLM_OK) { \ | |
| - | fprintf(stderr, "%s:%d curl_multi_setopt() failed, " \ |
| + | curl_mfprintf(stderr, "%s:%d curl_multi_setopt() failed, " \ |
| "with code %d (%s)\n", \ | |
| (Y), (Z), (int)ec, curl_multi_strerror(ec)); \ | |
| res = TEST_ERR_MULTI; \ | |
| @@ -233,7 +233,7 @@ extern int unitfail; | |
| #define exe_multi_add_handle(A,B,Y,Z) do { \ | |
| CURLMcode ec; \ | |
| if((ec = curl_multi_add_handle((A), (B))) != CURLM_OK) { \ | |
| - | fprintf(stderr, "%s:%d curl_multi_add_handle() failed, " \ |
| + | curl_mfprintf(stderr, "%s:%d curl_multi_add_handle() failed, " \ |
| "with code %d (%s)\n", \ | |
| (Y), (Z), (int)ec, curl_multi_strerror(ec)); \ | |
| res = TEST_ERR_MULTI; \ | |
| @@ -257,7 +257,7 @@ extern int unitfail; | |
| #define exe_multi_remove_handle(A,B,Y,Z) do { \ | |
| CURLMcode ec; \ | |
| if((ec = curl_multi_remove_handle((A), (B))) != CURLM_OK) { \ | |
| - | fprintf(stderr, "%s:%d curl_multi_remove_handle() failed, " \ |
| + | curl_mfprintf(stderr, "%s:%d curl_multi_remove_handle() failed, " \ |
| "with code %d (%s)\n", \ | |
| (Y), (Z), (int)ec, curl_multi_strerror(ec)); \ | |
| res = TEST_ERR_MULTI; \ | |
| @@ -282,13 +282,13 @@ extern int unitfail; | |
| #define exe_multi_perform(A,B,Y,Z) do { \ | |
| CURLMcode ec; \ | |
| if((ec = curl_multi_perform((A), (B))) != CURLM_OK) { \ | |
| - | fprintf(stderr, "%s:%d curl_multi_perform() failed, " \ |
| + | curl_mfprintf(stderr, "%s:%d curl_multi_perform() failed, " \ |
| "with code %d (%s)\n", \ | |
| (Y), (Z), (int)ec, curl_multi_strerror(ec)); \ | |
| res = TEST_ERR_MULTI; \ | |
| } \ | |
| else if(*((B)) < 0) { \ | |
| - | fprintf(stderr, "%s:%d curl_multi_perform() succeeded, " \ |
| + | curl_mfprintf(stderr, "%s:%d curl_multi_perform() succeeded, " \ |
| "but returned invalid running_handles value (%d)\n", \ | |
| (Y), (Z), (int)*((B))); \ | |
| res = TEST_ERR_NUM_HANDLES; \ | |
| @@ -312,13 +312,13 @@ extern int unitfail; | |
| #define exe_multi_fdset(A, B, C, D, E, Y, Z) do { \ | |
| CURLMcode ec; \ | |
| if((ec = curl_multi_fdset((A), (B), (C), (D), (E))) != CURLM_OK) { \ | |
| - | fprintf(stderr, "%s:%d curl_multi_fdset() failed, " \ |
| + | curl_mfprintf(stderr, "%s:%d curl_multi_fdset() failed, " \ |
| "with code %d (%s)\n", \ | |
| (Y), (Z), (int)ec, curl_multi_strerror(ec)); \ | |
| res = TEST_ERR_MULTI; \ | |
| } \ | |
| else if(*((E)) < -1) { \ | |
| - | fprintf(stderr, "%s:%d curl_multi_fdset() succeeded, " \ |
| + | curl_mfprintf(stderr, "%s:%d curl_multi_fdset() succeeded, " \ |
| "but returned invalid max_fd value (%d)\n", \ | |
| (Y), (Z), (int)*((E))); \ | |
| res = TEST_ERR_NUM_HANDLES; \ | |
| @@ -342,13 +342,13 @@ extern int unitfail; | |
| #define exe_multi_timeout(A,B,Y,Z) do { \ | |
| CURLMcode ec; \ | |
| if((ec = curl_multi_timeout((A), (B))) != CURLM_OK) { \ | |
| - | fprintf(stderr, "%s:%d curl_multi_timeout() failed, " \ |
| + | curl_mfprintf(stderr, "%s:%d curl_multi_timeout() failed, " \ |
| "with code %d (%s)\n", \ | |
| (Y), (Z), (int)ec, curl_multi_strerror(ec)); \ | |
| res = TEST_ERR_BAD_TIMEOUT; \ | |
| } \ | |
| else if(*((B)) < -1L) { \ | |
| - | fprintf(stderr, "%s:%d curl_multi_timeout() succeeded, " \ |
| + | curl_mfprintf(stderr, "%s:%d curl_multi_timeout() succeeded, " \ |
| "but returned invalid timeout value (%ld)\n", \ | |
| (Y), (Z), (long)*((B))); \ | |
| res = TEST_ERR_BAD_TIMEOUT; \ | |
| @@ -372,13 +372,13 @@ extern int unitfail; | |
| #define exe_multi_poll(A,B,C,D,E,Y,Z) do { \ | |
| CURLMcode ec; \ | |
| if((ec = curl_multi_poll((A), (B), (C), (D), (E))) != CURLM_OK) { \ | |
| - | fprintf(stderr, "%s:%d curl_multi_poll() failed, " \ |
| + | curl_mfprintf(stderr, "%s:%d curl_multi_poll() failed, " \ |
| "with code %d (%s)\n", \ | |
| (Y), (Z), (int)ec, curl_multi_strerror(ec)); \ | |
| res = TEST_ERR_MULTI; \ | |
| } \ | |
| else if(*((E)) < 0) { \ | |
| - | fprintf(stderr, "%s:%d curl_multi_poll() succeeded, " \ |
| + | curl_mfprintf(stderr, "%s:%d curl_multi_poll() succeeded, " \ |
| "but returned invalid numfds value (%d)\n", \ | |
| (Y), (Z), (int)*((E))); \ | |
| res = TEST_ERR_NUM_HANDLES; \ | |
| @@ -402,7 +402,7 @@ extern int unitfail; | |
| #define exe_multi_wakeup(A,Y,Z) do { \ | |
| CURLMcode ec; \ | |
| if((ec = curl_multi_wakeup((A))) != CURLM_OK) { \ | |
| - | fprintf(stderr, "%s:%d curl_multi_wakeup() failed, " \ |
| + | curl_mfprintf(stderr, "%s:%d curl_multi_wakeup() failed, " \ |
| "with code %d (%s)\n", \ | |
| (Y), (Z), (int)ec, curl_multi_strerror(ec)); \ | |
| res = TEST_ERR_MULTI; \ | |
| @@ -427,7 +427,7 @@ extern int unitfail; | |
| int ec; \ | |
| if(select_wrapper((A), (B), (C), (D), (E)) == -1) { \ | |
| ec = SOCKERRNO; \ | |
| - | fprintf(stderr, "%s:%d select() failed, with " \ |
| + | curl_mfprintf(stderr, "%s:%d select() failed, with " \ |
| "errno %d (%s)\n", \ | |
| (Y), (Z), ec, strerror(ec)); \ | |
| res = TEST_ERR_SELECT; \ | |
| @@ -455,7 +455,7 @@ extern int unitfail; | |
| #define exe_test_timedout(Y,Z) do { \ | |
| long timediff = tutil_tvdiff(tutil_tvnow(), tv_test_start); \ | |
| if(timediff > (TEST_HANG_TIMEOUT)) { \ | |
| - | fprintf(stderr, "%s:%d ABORTING TEST, since it seems " \ |
| + | curl_mfprintf(stderr, "%s:%d ABORTING TEST, since it seems " \ |
| "that it would have run forever (%ld ms > %ld ms)\n", \ | |
| (Y), (Z), timediff, (long) (TEST_HANG_TIMEOUT)); \ | |
| res = TEST_ERR_RUNS_FOREVER; \ | |
| @@ -479,7 +479,7 @@ extern int unitfail; | |
| #define exe_global_init(A,Y,Z) do { \ | |
| CURLcode ec; \ | |
| if((ec = curl_global_init((A))) != CURLE_OK) { \ | |
| - | fprintf(stderr, "%s:%d curl_global_init() failed, " \ |
| + | curl_mfprintf(stderr, "%s:%d curl_global_init() failed, " \ |
| "with code %d (%s)\n", \ | |
| (Y), (Z), (int)ec, curl_easy_strerror(ec)); \ | |
| res = ec; \ | |
| @@ -506,7 +506,7 @@ extern int unitfail; | |
| CURLcode test(char *URL) \ | |
| { \ | |
| (void)URL; \ | |
| - | fprintf(stderr, "Missing support\n"); \ |
| + | curl_mfprintf(stderr, "Missing support\n"); \ |
| return CURLE_UNSUPPORTED_PROTOCOL; \ | |
| } | |
| #endif | |
| @@ -524,7 +524,7 @@ extern CURLcode test(char *URL); /* the actual test function provided by each | |
| CURLcode test(char *URL) \ | |
| { \ | |
| (void)URL; \ | |
| - | fprintf(stderr, "Missing support\n"); \ |
| + | curl_mfprintf(stderr, "Missing support\n"); \ |
| return CURLE_UNSUPPORTED_PROTOCOL; \ | |
| } | |
| #endif | |
| @@ -45,18 +45,18 @@ void libtest_debug_dump(const char *timebuf, const char *text, FILE *stream, | |
| /* without the hex output, we can fit more on screen */ | |
| width = 0x40; | |
| - | fprintf(stream, "%s%s, %zu bytes (0x%zx)\n", timebuf, text, |
| - | size, size); |
| + | curl_mfprintf(stream, "%s%s, %zu bytes (0x%zx)\n", timebuf, text, |
| + | size, size); |
| for(i = 0; i < size; i += width) { | |
| - | fprintf(stream, "%04zx: ", i); |
| + | curl_mfprintf(stream, "%04zx: ", i); |
| if(!nohex) { | |
| /* hex not disabled, show it */ | |
| for(c = 0; c < width; c++) | |
| if(i + c < size) | |
| - | fprintf(stream, "%02x ", ptr[i + c]); |
| + | curl_mfprintf(stream, "%02x ", ptr[i + c]); |
| else | |
| fputs(" ", stream); | |
| } | |
| @@ -69,8 +69,9 @@ void libtest_debug_dump(const char *timebuf, const char *text, FILE *stream, | |
| i += (c + 2 - width); | |
| break; | |
| } | |
| - | fprintf(stream, "%c", ((ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80)) ? |
| - | ptr[i + c] : '.'); |
| + | curl_mfprintf(stream, "%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) && | |
| @@ -108,13 +109,13 @@ int libtest_debug_cb(CURL *handle, curl_infotype type, | |
| } | |
| secs = epoch_offset + tv.tv_sec; | |
| now = localtime(&secs); /* not thread safe but we don't care */ | |
| - | msnprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%06ld ", |
| - | now->tm_hour, now->tm_min, now->tm_sec, (long)tv.tv_usec); |
| + | curl_msnprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%06ld ", |
| + | now->tm_hour, now->tm_min, now->tm_sec, (long)tv.tv_usec); |
| } | |
| switch(type) { | |
| case CURLINFO_TEXT: | |
| - | fprintf(stderr, "%s== Info: %s", timestr, (char *)data); |
| + | curl_mfprintf(stderr, "%s== Info: %s", timestr, (char *)data); |
| return 0; | |
| case CURLINFO_HEADER_OUT: | |
| text = "=> Send header"; | |
| @@ -50,6 +50,7 @@ foreach(_target IN LISTS SERVERPROGS) | |
| target_include_directories(${_target_name} PRIVATE | |
| "${PROJECT_BINARY_DIR}/lib" # for "curl_config.h" | |
| "${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h" | |
| + | "${PROJECT_SOURCE_DIR}/lib/curlx" # for curlx |
| "${PROJECT_SOURCE_DIR}/src" # for "tool_binmode.h", "tool_xattr.h" | |
| "${PROJECT_SOURCE_DIR}/tests/server" # for "first.h" | |
| ) | |
| @@ -36,6 +36,7 @@ AUTOMAKE_OPTIONS = foreign nostdinc | |
| AM_CPPFLAGS = -I$(top_srcdir)/include \ | |
| -I$(top_builddir)/lib \ | |
| -I$(top_srcdir)/lib \ | |
| + | -I$(top_srcdir)/lib/curlx \ |
| -I$(top_srcdir)/src \ | |
| -I$(top_srcdir)/tests/server | |
| @@ -31,12 +31,12 @@ MEMDEBUG = \ | |
| CURLX_SRCS = \ | |
| ../../lib/mprintf.c \ | |
| ../../lib/nonblock.c \ | |
| - | ../../lib/strparse.c \ |
| + | ../../lib/curlx/strparse.c \ |
| ../../lib/strequal.c \ | |
| - | ../../lib/warnless.c \ |
| - | ../../lib/timediff.c \ |
| - | ../../lib/timeval.c \ |
| - | ../../lib/dynbuf.c \ |
| + | ../../lib/curlx/warnless.c \ |
| + | ../../lib/curlx/timediff.c \ |
| + | ../../lib/curlx/timeval.c \ |
| + | ../../lib/curlx/dynbuf.c \ |
| ../../lib/strcase.c \ | |
| ../../lib/strdup.c \ | |
| ../../lib/curl_get_line.c \ | |
| @@ -44,14 +44,14 @@ CURLX_SRCS = \ | |
| ../../lib/version_win32.c | |
| CURLX_HDRS = \ | |
| - | ../../lib/curlx.h \ |
| + | ../../lib/curlx/curlx.h \ |
| ../../lib/curl_ctype.h \ | |
| ../../lib/nonblock.h \ | |
| ../../lib/strcase.h \ | |
| - | ../../lib/warnless.h \ |
| - | ../../lib/timediff.h \ |
| - | ../../lib/timeval.h \ |
| - | ../../lib/dynbuf.h \ |
| + | ../../lib/curlx/warnless.h \ |
| + | ../../lib/curlx/timediff.h \ |
| + | ../../lib/curlx/timeval.h \ |
| + | ../../lib/curlx/dynbuf.h \ |
| ../../lib/strcase.h \ | |
| ../../lib/strdup.h \ | |
| ../../lib/curl_get_line.h \ | |
| @@ -64,8 +64,8 @@ UTIL = \ | |
| util.c \ | |
| util.h \ | |
| server_setup.h \ | |
| - | ../../lib/base64.c \ |
| - | ../../lib/curl_base64.h \ |
| + | ../../lib/curlx/base64.c \ |
| + | ../../lib/curlx/base64.h \ |
| ../../lib/strerror.c \ | |
| ../../lib/strerror.h | |
| @@ -51,7 +51,7 @@ | |
| #include <ctype.h> | |
| - | #include "curlx.h" /* from the private lib dir */ |
| + | #include <curlx.h> /* from the private lib dir */ |
| #include "getpart.h" | |
| #include "util.h" | |
| #include "server_sockaddr.h" | |
| @@ -29,10 +29,9 @@ | |
| #include "curl/curl.h" | |
| #include "warnless.h" | |
| #else | |
| - | #include "curlx.h" /* from the private lib dir */ |
| + | #include <curlx.h> /* from the private lib dir */ |
| #endif | |
| - | #include "curl_base64.h" |
| #include "curl_memory.h" | |
| #ifndef TEST | |
| @@ -53,10 +53,9 @@ | |
| #include <netdb.h> | |
| #endif | |
| - | #include "curlx.h" /* from the private lib dir */ |
| + | #include <curlx.h> /* from the private lib dir */ |
| #include "getpart.h" | |
| #include "server_sockaddr.h" | |
| - | #include "warnless.h" |
| #include "tool_binmode.h" | |
| @@ -48,7 +48,7 @@ | |
| #include <netinet/tcp.h> /* for TCP_NODELAY */ | |
| #endif | |
| - | #include "curlx.h" /* from the private lib dir */ |
| + | #include <curlx.h> /* from the private lib dir */ |
| #include "getpart.h" | |
| #include "util.h" | |
| #include "server_sockaddr.h" | |
| @@ -431,7 +431,7 @@ static int rtspd_ProcessRequest(struct rtspd_httprequest *req) | |
| if(got_exit_signal) | |
| return 1; /* done */ | |
| - | if((req->cl == 0) && strncasecompare("Content-Length:", line, 15)) { |
| + | if((req->cl == 0) && curl_strnequal("Content-Length:", line, 15)) { |
| /* If we don't ignore content-length, we read it and we read the whole | |
| request including the body before we return. If we've been told to | |
| ignore the content-length, we will return as soon as all headers | |
| @@ -451,7 +451,7 @@ static int rtspd_ProcessRequest(struct rtspd_httprequest *req) | |
| logmsg("... but will abort after %zu bytes", req->cl); | |
| break; | |
| } | |
| - | else if(strncasecompare("Transfer-Encoding: chunked", line, |
| + | else if(curl_strnequal("Transfer-Encoding: chunked", line, |
| strlen("Transfer-Encoding: chunked"))) { | |
| /* chunked data coming in */ | |
| chunked = TRUE; | |
| @@ -101,12 +101,11 @@ | |
| #include <netdb.h> | |
| #endif | |
| - | #include "curlx.h" /* from the private lib dir */ |
| + | #include <curlx.h> /* from the private lib dir */ |
| #include "inet_pton.h" | |
| #include "util.h" | |
| #include "server_sockaddr.h" | |
| #include "timediff.h" | |
| - | #include "warnless.h" |
| #include "tool_binmode.h" | |
| @@ -73,12 +73,10 @@ | |
| #include <netdb.h> | |
| #endif | |
| - | #include "curlx.h" /* from the private lib dir */ |
| + | #include <curlx.h> /* from the private lib dir */ |
| #include "inet_pton.h" | |
| #include "util.h" | |
| #include "server_sockaddr.h" | |
| - | #include "warnless.h" |
| - | |
| #include "tool_binmode.h" | |
| /* include memdebug.h last */ | |
| @@ -49,7 +49,7 @@ | |
| #include <netinet/tcp.h> /* for TCP_NODELAY */ | |
| #endif | |
| - | #include "curlx.h" /* from the private lib dir */ |
| + | #include <curlx.h> /* from the private lib dir */ |
| #include "getpart.h" | |
| #include "inet_pton.h" | |
| #include "util.h" | |
| @@ -583,7 +583,7 @@ static int sws_ProcessRequest(struct sws_httprequest *req) | |
| if(got_exit_signal) | |
| return 1; /* done */ | |
| - | if((req->cl == 0) && strncasecompare("Content-Length:", line, 15)) { |
| + | if((req->cl == 0) && curl_strnequal("Content-Length:", line, 15)) { |
| /* If we don't ignore content-length, we read it and we read the whole | |
| request including the body before we return. If we've been told to | |
| ignore the content-length, we will return as soon as all headers | |
| @@ -605,13 +605,13 @@ static int sws_ProcessRequest(struct sws_httprequest *req) | |
| if(req->skip) | |
| logmsg("... but will abort after %zu bytes", req->cl); | |
| } | |
| - | else if(strncasecompare("Transfer-Encoding: chunked", line, |
| + | else if(curl_strnequal("Transfer-Encoding: chunked", line, |
| strlen("Transfer-Encoding: chunked"))) { | |
| /* chunked data coming in */ | |
| chunked = TRUE; | |
| } | |
| else if(req->noexpect && | |
| - | strncasecompare("Expect: 100-continue", line, |
| + | curl_strnequal("Expect: 100-continue", line, |
| strlen("Expect: 100-continue"))) { | |
| if(req->cl) | |
| req->cl = 0; | |
| @@ -83,7 +83,7 @@ | |
| #include <ctype.h> | |
| - | #include "curlx.h" /* from the private lib dir */ |
| + | #include <curlx.h> /* from the private lib dir */ |
| #include "getpart.h" | |
| #include "util.h" | |
| #include "server_sockaddr.h" | |
| @@ -45,7 +45,7 @@ | |
| #include "strerror.h" | |
| #endif | |
| - | #include "curlx.h" /* from the private lib dir */ |
| + | #include <curlx.h> /* from the private lib dir */ |
| #include "util.h" | |
| /* need init from main() */ | |
| @@ -25,6 +25,26 @@ | |
| ***************************************************************************/ | |
| #include "server_setup.h" | |
| + | #include <curl/mprintf.h> |
| + | |
| + | /* make the test servers use the libcurl *printf family */ |
| + | # undef printf |
| + | # undef fprintf |
| + | # undef msnprintf |
| + | # undef vprintf |
| + | # undef vfprintf |
| + | # undef mvsnprintf |
| + | # undef aprintf |
| + | # undef vaprintf |
| + | # define printf curl_mprintf |
| + | # define fprintf curl_mfprintf |
| + | # define msnprintf curl_msnprintf |
| + | # define vprintf curl_mvprintf |
| + | # define vfprintf curl_mvfprintf |
| + | # define mvsnprintf curl_mvsnprintf |
| + | # define aprintf curl_maprintf |
| + | # define vaprintf curl_mvaprintf |
| + | |
| enum { | |
| DOCNUMBER_NOTHING = -7, | |
| DOCNUMBER_QUIT = -6, | |
| @@ -47,6 +47,7 @@ foreach(_target IN LISTS TOOLPROGS) | |
| target_include_directories(${_target_name} PRIVATE | |
| "${PROJECT_BINARY_DIR}/lib" # for "curl_config.h" | |
| "${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h" | |
| + | "${PROJECT_SOURCE_DIR}/lib/curlx" # for curlx |
| "${PROJECT_SOURCE_DIR}/src" | |
| "${PROJECT_SOURCE_DIR}/tests/libtest" | |
| "${PROJECT_SOURCE_DIR}/tests/unit" # for curlcheck.h | |
| @@ -35,6 +35,7 @@ AUTOMAKE_OPTIONS = foreign nostdinc | |
| AM_CPPFLAGS = -I$(top_srcdir)/include \ | |
| -I$(top_builddir)/lib \ | |
| -I$(top_srcdir)/lib \ | |
| + | -I$(top_srcdir)/lib/curlx \ |
| -I$(top_srcdir)/src \ | |
| -I$(top_srcdir)/tests/libtest \ | |
| -I$(top_srcdir)/tests/unit \ | |
| @@ -48,7 +49,7 @@ CFLAGS += @CURL_CFLAG_EXTRAS@ | |
| LIBS = $(BLANK_AT_MAKETIME) | |
| LDADD = $(top_builddir)/src/libcurltool.la \ | |
| - | $(top_builddir)/lib/libcurlu.la \ |
| + | $(top_builddir)/lib/libcurl.la \ |
| @LIBCURL_PC_LDFLAGS_PRIVATE@ @LIBCURL_PC_LIBS_PRIVATE@ | |
| AM_CPPFLAGS += -DCURL_STATICLIB -DUNITTESTS | |
| @@ -47,6 +47,7 @@ foreach(_target IN LISTS UNITPROGS) | |
| target_include_directories(${_target_name} PRIVATE | |
| "${PROJECT_BINARY_DIR}/lib" # for "curl_config.h" | |
| "${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h" | |
| + | "${PROJECT_SOURCE_DIR}/lib/curlx" # for curlx |
| "${PROJECT_SOURCE_DIR}/src" | |
| "${PROJECT_SOURCE_DIR}/tests/libtest" | |
| ) | |
| @@ -35,6 +35,7 @@ AUTOMAKE_OPTIONS = foreign nostdinc | |
| AM_CPPFLAGS = -I$(top_srcdir)/include \ | |
| -I$(top_builddir)/lib \ | |
| -I$(top_srcdir)/lib \ | |
| + | -I$(top_srcdir)/lib/curlx \ |
| -I$(top_srcdir)/src \ | |
| -I$(top_srcdir)/tests/libtest \ | |
| -I$(top_srcdir)/tests/unit | |
| @@ -24,72 +24,71 @@ | |
| #include "test.h" | |
| /* The fail macros mark the current test step as failed, and continue */ | |
| - | #define fail_if(expr, msg) \ |
| + | #define fail_if(expr, msg) \ |
| + | do { \ |
| + | if(expr) { \ |
| + | curl_mfprintf(stderr, "%s:%d FAILED Assertion '%s' met: %s\n", \ |
| + | __FILE__, __LINE__, #expr, msg); \ |
| + | unitfail++; \ |
| + | } \ |
| + | } while(0) |
| + | |
| + | #define fail_unless(expr, msg) \ |
| do { \ | |
| - | if(expr) { \ |
| - | fprintf(stderr, "%s:%d FAILED Assertion '%s' met: %s\n", \ |
| - | __FILE__, __LINE__, #expr, msg); \ |
| + | if(!(expr)) { \ |
| + | curl_mfprintf(stderr, "%s:%d Assertion '%s' FAILED: %s\n", \ |
| + | __FILE__, __LINE__, #expr, msg); \ |
| unitfail++; \ | |
| } \ | |
| } while(0) | |
| - | #define fail_unless(expr, msg) \ |
| - | do { \ |
| - | if(!(expr)) { \ |
| - | fprintf(stderr, "%s:%d Assertion '%s' FAILED: %s\n", \ |
| - | __FILE__, __LINE__, #expr, msg); \ |
| - | unitfail++; \ |
| - | } \ |
| - | } while(0) |
| - | |
| #define verify_memory(dynamic, check, len) \ | |
| do { \ | |
| if(dynamic && memcmp(dynamic, check, len)) { \ | |
| - | fprintf(stderr, "%s:%d Memory buffer FAILED match size %d. " \ |
| - | "'%s' is not\n", __FILE__, __LINE__, len, \ |
| - | hexdump((const unsigned char *)check, len)); \ |
| - | fprintf(stderr, "%s:%d the same as '%s'\n", __FILE__, __LINE__, \ |
| - | hexdump((const unsigned char *)dynamic, len)); \ |
| + | curl_mfprintf(stderr, "%s:%d Memory buffer FAILED match size %d. " \ |
| + | "'%s' is not\n", __FILE__, __LINE__, len, \ |
| + | hexdump((const unsigned char *)check, len)); \ |
| + | curl_mfprintf(stderr, "%s:%d the same as '%s'\n", __FILE__, __LINE__, \ |
| + | hexdump((const unsigned char *)dynamic, len)); \ |
| unitfail++; \ | |
| } \ | |
| } while(0) | |
| /* fail() is for when the test case figured out by itself that a check | |
| proved a failure */ | |
| - | #define fail(msg) do { \ |
| - | fprintf(stderr, "%s:%d test FAILED: '%s'\n", \ |
| - | __FILE__, __LINE__, msg); \ |
| - | unitfail++; \ |
| + | #define fail(msg) do { \ |
| + | curl_mfprintf(stderr, "%s:%d test FAILED: '%s'\n", \ |
| + | __FILE__, __LINE__, msg); \ |
| + | unitfail++; \ |
| } while(0) | |
| - | |
| /* The abort macros mark the current test step as failed, and exit the test */ | |
| - | #define abort_if(expr, msg) \ |
| - | do { \ |
| - | if(expr) { \ |
| - | fprintf(stderr, "%s:%d ABORT assertion '%s' met: %s\n", \ |
| - | __FILE__, __LINE__, #expr, msg); \ |
| - | unitfail++; \ |
| - | goto unit_test_abort; \ |
| - | } \ |
| + | #define abort_if(expr, msg) \ |
| + | do { \ |
| + | if(expr) { \ |
| + | curl_mfprintf(stderr, "%s:%d ABORT assertion '%s' met: %s\n", \ |
| + | __FILE__, __LINE__, #expr, msg); \ |
| + | unitfail++; \ |
| + | goto unit_test_abort; \ |
| + | } \ |
| } while(0) | |
| #define abort_unless(expr, msg) \ | |
| do { \ | |
| if(!(expr)) { \ | |
| - | fprintf(stderr, "%s:%d ABORT assertion '%s' failed: %s\n", \ |
| - | __FILE__, __LINE__, #expr, msg); \ |
| + | curl_mfprintf(stderr, "%s:%d ABORT assertion '%s' failed: %s\n", \ |
| + | __FILE__, __LINE__, #expr, msg); \ |
| unitfail++; \ | |
| goto unit_test_abort; \ | |
| } \ | |
| } while(0) | |
| - | #define unittest_abort(msg) \ |
| - | do { \ |
| - | fprintf(stderr, "%s:%d test ABORTED: '%s'\n", \ |
| - | __FILE__, __LINE__, msg); \ |
| - | unitfail++; \ |
| - | goto unit_test_abort; \ |
| + | #define unittest_abort(msg) \ |
| + | do { \ |
| + | curl_mfprintf(stderr, "%s:%d test ABORTED: '%s'\n", \ |
| + | __FILE__, __LINE__, msg); \ |
| + | unitfail++; \ |
| + | goto unit_test_abort; \ |
| } while(0) | |
| @@ -25,7 +25,7 @@ | |
| #include "urldata.h" | |
| #include "url.h" /* for Curl_safefree */ | |
| - | #include "curl_base64.h" |
| + | #include "curlx/base64.h" |
| #include "memdebug.h" /* LAST include file */ | |
| static struct Curl_easy *testdata; | |
| @@ -57,86 +57,86 @@ size_t size = 0; | |
| unsigned char anychar = 'x'; | |
| CURLcode rc; | |
| - | rc = Curl_base64_encode("i", 1, &output, &size); |
| + | rc = curlx_base64_encode("i", 1, &output, &size); |
| fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); | |
| fail_unless(size == 4, "size should be 4"); | |
| verify_memory(output, "aQ==", 4); | |
| Curl_safefree(output); | |
| - | rc = Curl_base64_encode("ii", 2, &output, &size); |
| + | rc = curlx_base64_encode("ii", 2, &output, &size); |
| fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); | |
| fail_unless(size == 4, "size should be 4"); | |
| verify_memory(output, "aWk=", 4); | |
| Curl_safefree(output); | |
| - | rc = Curl_base64_encode("iii", 3, &output, &size); |
| + | rc = curlx_base64_encode("iii", 3, &output, &size); |
| fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); | |
| fail_unless(size == 4, "size should be 4"); | |
| verify_memory(output, "aWlp", 4); | |
| Curl_safefree(output); | |
| - | rc = Curl_base64_encode("iiii", 4, &output, &size); |
| + | rc = curlx_base64_encode("iiii", 4, &output, &size); |
| fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); | |
| fail_unless(size == 8, "size should be 8"); | |
| verify_memory(output, "aWlpaQ==", 8); | |
| Curl_safefree(output); | |
| - | rc = Curl_base64_encode("\xff\x01\xfe\x02", 4, &output, &size); |
| + | rc = curlx_base64_encode("\xff\x01\xfe\x02", 4, &output, &size); |
| fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); | |
| fail_unless(size == 8, "size should be 8"); | |
| verify_memory(output, "/wH+Ag==", 8); | |
| Curl_safefree(output); | |
| - | rc = Curl_base64url_encode("\xff\x01\xfe\x02", 4, &output, &size); |
| + | rc = curlx_base64url_encode("\xff\x01\xfe\x02", 4, &output, &size); |
| fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); | |
| fail_unless(size == 6, "size should be 6"); | |
| verify_memory(output, "_wH-Ag", 6); | |
| Curl_safefree(output); | |
| - | rc = Curl_base64url_encode("iiii", 4, &output, &size); |
| + | rc = curlx_base64url_encode("iiii", 4, &output, &size); |
| fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); | |
| fail_unless(size == 6, "size should be 6"); | |
| verify_memory(output, "aWlpaQ", 6); | |
| Curl_safefree(output); | |
| /* 0 length makes it do strlen() */ | |
| - | rc = Curl_base64_encode("iiii", 0, &output, &size); |
| + | rc = curlx_base64_encode("iiii", 0, &output, &size); |
| fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); | |
| fail_unless(size == 8, "size should be 8"); | |
| verify_memory(output, "aWlpaQ==", 8); | |
| Curl_safefree(output); | |
| - | rc = Curl_base64_encode("", 0, &output, &size); |
| + | rc = curlx_base64_encode("", 0, &output, &size); |
| fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); | |
| fail_unless(size == 0, "size should be 0"); | |
| fail_unless(output && !output[0], "output should be a zero-length string"); | |
| Curl_safefree(output); | |
| - | rc = Curl_base64url_encode("", 0, &output, &size); |
| + | rc = curlx_base64url_encode("", 0, &output, &size); |
| fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); | |
| fail_unless(size == 0, "size should be 0"); | |
| fail_unless(output && !output[0], "output should be a zero-length string"); | |
| Curl_safefree(output); | |
| - | rc = Curl_base64_decode("aWlpaQ==", &decoded, &size); |
| + | rc = curlx_base64_decode("aWlpaQ==", &decoded, &size); |
| fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); | |
| fail_unless(size == 4, "size should be 4"); | |
| verify_memory(decoded, "iiii", 4); | |
| Curl_safefree(decoded); | |
| - | rc = Curl_base64_decode("aWlp", &decoded, &size); |
| + | rc = curlx_base64_decode("aWlp", &decoded, &size); |
| fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); | |
| fail_unless(size == 3, "size should be 3"); | |
| verify_memory(decoded, "iii", 3); | |
| Curl_safefree(decoded); | |
| - | rc = Curl_base64_decode("aWk=", &decoded, &size); |
| + | rc = curlx_base64_decode("aWk=", &decoded, &size); |
| fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); | |
| fail_unless(size == 2, "size should be 2"); | |
| verify_memory(decoded, "ii", 2); | |
| Curl_safefree(decoded); | |
| - | rc = Curl_base64_decode("aQ==", &decoded, &size); |
| + | rc = curlx_base64_decode("aQ==", &decoded, &size); |
| fail_unless(rc == CURLE_OK, "return code should be CURLE_OK"); | |
| fail_unless(size == 1, "size should be 1"); | |
| verify_memory(decoded, "i", 2); | |
| @@ -145,7 +145,7 @@ Curl_safefree(decoded); | |
| /* This is illegal input as the data is too short */ | |
| size = 1; /* not zero */ | |
| decoded = &anychar; /* not NULL */ | |
| - | rc = Curl_base64_decode("aQ", &decoded, &size); |
| + | rc = curlx_base64_decode("aQ", &decoded, &size); |
| fail_unless(rc == CURLE_BAD_CONTENT_ENCODING, | |
| "return code should be CURLE_BAD_CONTENT_ENCODING"); | |
| fail_unless(size == 0, "size should be 0"); | |
| @@ -154,7 +154,7 @@ fail_if(decoded, "returned pointer should be NULL"); | |
| /* This is illegal input as it contains three padding characters */ | |
| size = 1; /* not zero */ | |
| decoded = &anychar; /* not NULL */ | |
| - | rc = Curl_base64_decode("a===", &decoded, &size); |
| + | rc = curlx_base64_decode("a===", &decoded, &size); |
| fail_unless(rc == CURLE_BAD_CONTENT_ENCODING, | |
| "return code should be CURLE_BAD_CONTENT_ENCODING"); | |
| fail_unless(size == 0, "size should be 0"); | |
| @@ -163,7 +163,7 @@ fail_if(decoded, "returned pointer should be NULL"); | |
| /* This is illegal input as it contains a padding character mid input */ | |
| size = 1; /* not zero */ | |
| decoded = &anychar; /* not NULL */ | |
| - | rc = Curl_base64_decode("a=Q=", &decoded, &size); |
| + | rc = curlx_base64_decode("a=Q=", &decoded, &size); |
| fail_unless(rc == CURLE_BAD_CONTENT_ENCODING, | |
| "return code should be CURLE_BAD_CONTENT_ENCODING"); | |
| fail_unless(size == 0, "size should be 0"); | |
| @@ -172,7 +172,7 @@ fail_if(decoded, "returned pointer should be NULL"); | |
| /* This is also illegal input as it contains a padding character mid input */ | |
| size = 1; /* not zero */ | |
| decoded = &anychar; /* not NULL */ | |
| - | rc = Curl_base64_decode("aWlpa=Q=", &decoded, &size); |
| + | rc = curlx_base64_decode("aWlpa=Q=", &decoded, &size); |
| fail_unless(rc == CURLE_BAD_CONTENT_ENCODING, | |
| "return code should be CURLE_BAD_CONTENT_ENCODING"); | |
| fail_unless(size == 0, "size should be 0"); | |
| @@ -181,7 +181,7 @@ fail_if(decoded, "returned pointer should be NULL"); | |
| /* This is garbage input as it contains an illegal base64 character */ | |
| size = 1; /* not zero */ | |
| decoded = &anychar; /* not NULL */ | |
| - | rc = Curl_base64_decode("a\x1f==", &decoded, &size); |
| + | rc = curlx_base64_decode("a\x1f==", &decoded, &size); |
| fail_unless(rc == CURLE_BAD_CONTENT_ENCODING, | |
| "return code should be CURLE_BAD_CONTENT_ENCODING"); | |
| fail_unless(size == 0, "size should be 0"); | |
| @@ -33,7 +33,7 @@ | |
| # include <arpa/inet.h> | |
| #endif | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "hash.h" | |
| #include "hostip.h" | |
| @@ -94,7 +94,7 @@ static struct Curl_addrinfo *fake_ai(void) | |
| static CURLcode create_node(void) | |
| { | |
| - | data_key = aprintf("%s:%d", "dummy", 0); |
| + | data_key = curl_maprintf("%s:%d", "dummy", 0); |
| if(!data_key) | |
| return CURLE_OUT_OF_MEMORY; | |
| @@ -99,8 +99,8 @@ UNITTEST_START | |
| int rem = (i + 7)%NUM_NODES; | |
| printf("Tree look:\n"); | |
| splayprint(root, 0, 1); | |
| - | printf("remove pointer %d, payload %zu\n", rem, |
| - | *(size_t *)Curl_splayget(&nodes[rem])); |
| + | curl_mprintf("remove pointer %d, payload %zu\n", rem, |
| + | *(size_t *)Curl_splayget(&nodes[rem])); |
| rc = Curl_splayremove(root, &nodes[rem], &root); | |
| if(rc) { | |
| /* failed! */ | |
| @@ -132,9 +132,9 @@ UNITTEST_START | |
| tv_now.tv_usec = i; | |
| root = Curl_splaygetbest(tv_now, root, &removed); | |
| while(removed) { | |
| - | printf("removed payload %zu[%zu]\n", |
| - | *(size_t *)Curl_splayget(removed) / 10, |
| - | *(size_t *)Curl_splayget(removed) % 10); |
| + | curl_mprintf("removed payload %zu[%zu]\n", |
| + | *(size_t *)Curl_splayget(removed) / 10, |
| + | *(size_t *)Curl_splayget(removed) % 10); |
| root = Curl_splaygetbest(tv_now, root, &removed); | |
| } | |
| } | |
| @@ -52,7 +52,7 @@ UNITTEST_START | |
| size_t i; | |
| for(i = 0; i < CURL_ARRAYSIZE(tests); i++) { | |
| - | timediff_t result = Curl_timediff(tests[i].first, tests[i].second); |
| + | timediff_t result = curlx_timediff(tests[i].first, tests[i].second); |
| if(result != tests[i].result) { | |
| printf("%ld.%06u to %ld.%06u got %d, but expected %ld\n", | |
| (long)tests[i].first.tv_sec, | |
| @@ -128,21 +128,21 @@ UNITTEST_START | |
| abort_if(err && out, "returned error with output"); | |
| if(out && pairs[i].output && strcmp(out, pairs[i].output)) { | |
| - | fprintf(stderr, "Test %u: '%s' gave '%s' instead of '%s'\n", |
| - | i, pairs[i].input, out, pairs[i].output); |
| + | curl_mfprintf(stderr, "Test %u: '%s' gave '%s' instead of '%s'\n", |
| + | i, pairs[i].input, out, pairs[i].output); |
| fail("Test case output mismatched"); | |
| fails++; | |
| } | |
| else if((!out && pairs[i].output) || | |
| (out && !pairs[i].output)) { | |
| - | fprintf(stderr, "Test %u: '%s' gave '%s' instead of '%s'\n", |
| - | i, pairs[i].input, out ? out : "(null)", |
| - | pairs[i].output ? pairs[i].output : "(null)"); |
| + | curl_mfprintf(stderr, "Test %u: '%s' gave '%s' instead of '%s'\n", |
| + | i, pairs[i].input, out ? out : "(null)", |
| + | pairs[i].output ? pairs[i].output : "(null)"); |
| fail("Test case output mismatched"); | |
| fails++; | |
| } | |
| else | |
| - | fprintf(stderr, "Test %u: OK\n", i); |
| + | curl_mfprintf(stderr, "Test %u: OK\n", i); |
| free(out); | |
| } | |
| @@ -103,13 +103,13 @@ UNITTEST_START | |
| strlen(tests[i].pattern), | |
| tests[i].host, | |
| strlen(tests[i].host))) { | |
| - | fprintf(stderr, |
| - | "HOST: %s\n" |
| - | "PTRN: %s\n" |
| - | "did %sMATCH\n", |
| - | tests[i].host, |
| - | tests[i].pattern, |
| - | tests[i].match ? "NOT ": ""); |
| + | curl_mfprintf(stderr, |
| + | "HOST: %s\n" |
| + | "PTRN: %s\n" |
| + | "did %sMATCH\n", |
| + | tests[i].host, |
| + | tests[i].pattern, |
| + | tests[i].match ? "NOT ": ""); |
| unitfail++; | |
| } | |
| } | |
| @@ -56,16 +56,17 @@ static bool usec_matches_seconds(timediff_t time_usec, int expected_seconds) | |
| { | |
| int time_sec = (int)(time_usec / usec_magnitude); | |
| 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"); |
| + | curl_mfprintf(stderr, "is %d us same as %d seconds? %s\n", |
| + | (int)time_usec, expected_seconds, |
| + | same ? "Yes" : "No"); |
| return same; | |
| } | |
| static void expect_timer_seconds(struct Curl_easy *data, int seconds) | |
| { | |
| char msg[64]; | |
| - | msnprintf(msg, sizeof(msg), "about %d seconds should have passed", seconds); |
| + | curl_msnprintf(msg, sizeof(msg), "about %d seconds should have passed", |
| + | seconds); |
| fail_unless(usec_matches_seconds(data->progress.t_nslookup, seconds), msg); | |
| fail_unless(usec_matches_seconds(data->progress.t_connect, seconds), msg); | |
| fail_unless(usec_matches_seconds(data->progress.t_appconnect, seconds), msg); | |
| @@ -82,7 +83,7 @@ static void expect_timer_seconds(struct Curl_easy *data, int seconds) | |
| * be 3 seconds. */ | |
| UNITTEST_START | |
| struct Curl_easy data; | |
| - | struct curltime now = Curl_now(); |
| + | struct curltime now = curlx_now(); |
| data.progress.t_nslookup = 0; | |
| data.progress.t_connect = 0; | |
| @@ -23,11 +23,11 @@ | |
| ***************************************************************************/ | |
| #include "curlcheck.h" | |
| - | #include "curlx.h" |
| + | #include <curlx.h> |
| #include "hash.h" | |
| - | #include "memdebug.h" /* LAST include file */ |
| + | #include <memdebug.h> /* LAST include file */ |
| static struct Curl_hash hash_static; | |
| @@ -40,7 +40,7 @@ static void mydtor(void *p) | |
| static CURLcode unit_setup(void) | |
| { | |
| Curl_hash_init(&hash_static, 7, Curl_hash_str, | |
| - | Curl_str_key_compare, mydtor); |
| + | curlx_str_key_compare, mydtor); |
| return CURLE_OK; | |
| } | |
| @@ -23,11 +23,9 @@ | |
| ***************************************************************************/ | |
| #include "curlcheck.h" | |
| - | #include "curlx.h" |
| - | |
| + | #include <curlx.h> |
| #include "hash.h" | |
| - | |
| - | #include "memdebug.h" /* LAST include file */ |
| + | #include <memdebug.h> /* LAST include file */ |
| static struct Curl_hash hash_static; | |
| static const size_t slots = 3; | |
| @@ -51,7 +49,7 @@ static void my_elem_dtor(void *key, size_t key_len, void *p) | |
| static CURLcode unit_setup(void) | |
| { | |
| Curl_hash_init(&hash_static, slots, Curl_hash_str, | |
| - | Curl_str_key_compare, mydtor); |
| + | curlx_str_key_compare, mydtor); |
| return CURLE_OK; | |
| } | |
| @@ -76,8 +74,9 @@ UNITTEST_START | |
| Curl_hash_str(key2, strlen(key2), slots) != 0 || | |
| Curl_hash_str(key3, strlen(key3), slots) != 2 || | |
| Curl_hash_str(key4, strlen(key4), slots) != 1) | |
| - | fprintf(stderr, "Warning: hashes are not computed as expected on this " |
| - | "architecture; test coverage will be less comprehensive\n"); |
| + | curl_mfprintf(stderr, |
| + | "Warning: hashes are not computed as expected on this " |
| + | "architecture; test coverage will be less comprehensive\n"); |
| nodep = Curl_hash_add(&hash_static, &key1, strlen(key1), &key1); | |
| fail_unless(nodep, "insertion into hash failed"); | |
| @@ -136,7 +136,7 @@ UNITTEST_START | |
| Curl_loadhostpairs(easy); | |
| - | entry_id = (void *)aprintf("%s:%d", tests[i].host, tests[i].port); |
| + | entry_id = (void *)curl_maprintf("%s:%d", tests[i].host, tests[i].port); |
| if(!entry_id) | |
| goto error; | |
| dns = Curl_hash_pick(&multi->dnscache.entries, | |
| @@ -158,56 +158,60 @@ UNITTEST_START | |
| if(addr && !Curl_addr2string(addr->ai_addr, addr->ai_addrlen, | |
| ipaddress, &port)) { | |
| - | fprintf(stderr, "%s:%d tests[%d] failed. getaddressinfo failed.\n", |
| - | __FILE__, __LINE__, i); |
| + | curl_mfprintf(stderr, "%s:%d tests[%d] failed. " |
| + | "getaddressinfo failed.\n", |
| + | __FILE__, __LINE__, i); |
| problem = true; | |
| break; | |
| } | |
| if(addr && !tests[i].address[j]) { | |
| - | fprintf(stderr, "%s:%d tests[%d] failed. the retrieved addr " |
| - | "is %s but tests[%d].address[%d] is NULL.\n", |
| - | __FILE__, __LINE__, i, ipaddress, i, j); |
| + | curl_mfprintf(stderr, "%s:%d tests[%d] failed. the retrieved addr " |
| + | "is %s but tests[%d].address[%d] is NULL.\n", |
| + | __FILE__, __LINE__, i, ipaddress, i, j); |
| problem = true; | |
| break; | |
| } | |
| if(!addr && tests[i].address[j]) { | |
| - | fprintf(stderr, "%s:%d tests[%d] failed. the retrieved addr " |
| - | "is NULL but tests[%d].address[%d] is %s.\n", |
| - | __FILE__, __LINE__, i, i, j, tests[i].address[j]); |
| + | curl_mfprintf(stderr, "%s:%d tests[%d] failed. the retrieved addr " |
| + | "is NULL but tests[%d].address[%d] is %s.\n", |
| + | __FILE__, __LINE__, i, i, j, tests[i].address[j]); |
| problem = true; | |
| break; | |
| } | |
| if(!curl_strequal(ipaddress, tests[i].address[j])) { | |
| - | fprintf(stderr, "%s:%d tests[%d] failed. the retrieved addr " |
| - | "%s is not equal to tests[%d].address[%d] %s.\n", |
| - | __FILE__, __LINE__, i, ipaddress, i, j, tests[i].address[j]); |
| + | curl_mfprintf(stderr, "%s:%d tests[%d] failed. the retrieved addr " |
| + | "%s is not equal to tests[%d].address[%d] %s.\n", |
| + | __FILE__, __LINE__, i, ipaddress, i, j, |
| + | tests[i].address[j]); |
| problem = true; | |
| break; | |
| } | |
| if(port != tests[i].port) { | |
| - | fprintf(stderr, "%s:%d tests[%d] failed. the retrieved port " |
| - | "for tests[%d].address[%d] is %d but tests[%d].port is %d.\n", |
| - | __FILE__, __LINE__, i, i, j, port, i, tests[i].port); |
| + | curl_mfprintf(stderr, "%s:%d tests[%d] failed. the retrieved port " |
| + | "for tests[%d].address[%d] is %d " |
| + | "but tests[%d].port is %d.\n", |
| + | __FILE__, __LINE__, i, i, j, port, i, tests[i].port); |
| problem = true; | |
| break; | |
| } | |
| if(dns->timestamp && tests[i].permanent) { | |
| - | fprintf(stderr, "%s:%d tests[%d] failed. the timestamp is not zero " |
| - | "but tests[%d].permanent is TRUE\n", |
| - | __FILE__, __LINE__, i, i); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d tests[%d] failed. the timestamp is not zero " |
| + | "but tests[%d].permanent is TRUE\n", |
| + | __FILE__, __LINE__, i, i); |
| problem = true; | |
| break; | |
| } | |
| if(dns->timestamp == 0 && !tests[i].permanent) { | |
| - | fprintf(stderr, "%s:%d tests[%d] failed. the timestamp is zero " |
| - | "but tests[%d].permanent is FALSE\n", |
| - | __FILE__, __LINE__, i, i); |
| + | curl_mfprintf(stderr, "%s:%d tests[%d] failed. the timestamp is zero " |
| + | "but tests[%d].permanent is FALSE\n", |
| + | __FILE__, __LINE__, i, i); |
| problem = true; | |
| break; | |
| } | |
| @@ -137,7 +137,7 @@ UNITTEST_START | |
| if(Curl_loadhostpairs(easy)) | |
| goto error; | |
| - | entry_id = (void *)aprintf("%s:%d", tests[i].host, tests[i].port); |
| + | entry_id = (void *)curl_maprintf("%s:%d", tests[i].host, tests[i].port); |
| if(!entry_id) | |
| goto error; | |
| @@ -157,40 +157,43 @@ UNITTEST_START | |
| if(addr && !Curl_addr2string(addr->ai_addr, addr->ai_addrlen, | |
| ipaddress, &port)) { | |
| - | fprintf(stderr, "%s:%d tests[%d] failed. Curl_addr2string failed.\n", |
| - | __FILE__, __LINE__, i); |
| + | curl_mfprintf(stderr, |
| + | "%s:%d tests[%d] failed. Curl_addr2string failed.\n", |
| + | __FILE__, __LINE__, i); |
| problem = true; | |
| break; | |
| } | |
| if(addr && !tests[i].address[j]) { | |
| - | fprintf(stderr, "%s:%d tests[%d] failed. the retrieved addr " |
| - | "is %s but tests[%d].address[%d] is NULL.\n", |
| - | __FILE__, __LINE__, i, ipaddress, i, j); |
| + | curl_mfprintf(stderr, "%s:%d tests[%d] failed. the retrieved addr " |
| + | "is %s but tests[%d].address[%d] is NULL.\n", |
| + | __FILE__, __LINE__, i, ipaddress, i, j); |
| problem = true; | |
| break; | |
| } | |
| if(!addr && tests[i].address[j]) { | |
| - | fprintf(stderr, "%s:%d tests[%d] failed. the retrieved addr " |
| - | "is NULL but tests[%d].address[%d] is %s.\n", |
| - | __FILE__, __LINE__, i, i, j, tests[i].address[j]); |
| + | curl_mfprintf(stderr, "%s:%d tests[%d] failed. the retrieved addr " |
| + | "is NULL but tests[%d].address[%d] is %s.\n", |
| + | __FILE__, __LINE__, i, i, j, tests[i].address[j]); |
| problem = true; | |
| break; | |
| } | |
| if(!curl_strequal(ipaddress, tests[i].address[j])) { | |
| - | fprintf(stderr, "%s:%d tests[%d] failed. the retrieved addr " |
| - | "%s is not equal to tests[%d].address[%d] %s.\n", |
| - | __FILE__, __LINE__, i, ipaddress, i, j, tests[i].address[j]); |
| + | curl_mfprintf(stderr, "%s:%d tests[%d] failed. the retrieved addr " |
| + | "%s is not equal to tests[%d].address[%d] %s.\n", |
| + | __FILE__, __LINE__, i, ipaddress, i, j, |
| + | tests[i].address[j]); |
| problem = true; | |
| break; | |
| } | |
| if(port != tests[i].port) { | |
| - | fprintf(stderr, "%s:%d tests[%d] failed. the retrieved port " |
| - | "for tests[%d].address[%d] is %d but tests[%d].port is %d.\n", |
| - | __FILE__, __LINE__, i, i, j, port, i, tests[i].port); |
| + | curl_mfprintf(stderr, "%s:%d tests[%d] failed. the retrieved port " |
| + | "for tests[%d].address[%d] is %d " |
| + | "but tests[%d].port is %d.\n", |
| + | __FILE__, __LINE__, i, i, j, port, i, tests[i].port); |
| problem = true; | |
| break; | |
| } | |
| @@ -134,9 +134,9 @@ UNITTEST_START | |
| for(i = 0; list4[i].a; i++) { | |
| bool match = Curl_cidr4_match(list4[i].a, list4[i].n, list4[i].bits); | |
| if(match != list4[i].match) { | |
| - | fprintf(stderr, "%s in %s/%u should %smatch\n", |
| - | list4[i].a, list4[i].n, list4[i].bits, |
| - | list4[i].match ? "": "not "); |
| + | curl_mfprintf(stderr, "%s in %s/%u should %smatch\n", |
| + | list4[i].a, list4[i].n, list4[i].bits, |
| + | list4[i].match ? "": "not "); |
| err++; | |
| } | |
| } | |
| @@ -144,9 +144,9 @@ UNITTEST_START | |
| for(i = 0; list6[i].a; i++) { | |
| bool match = Curl_cidr6_match(list6[i].a, list6[i].n, list6[i].bits); | |
| if(match != list6[i].match) { | |
| - | fprintf(stderr, "%s in %s/%u should %smatch\n", |
| - | list6[i].a, list6[i].n, list6[i].bits, |
| - | list6[i].match ? "": "not "); |
| + | curl_mfprintf(stderr, "%s in %s/%u should %smatch\n", |
| + | list6[i].a, list6[i].n, list6[i].bits, |
| + | list6[i].match ? "": "not "); |
| err++; | |
| } | |
| } | |
| @@ -154,9 +154,9 @@ UNITTEST_START | |
| for(i = 0; list[i].a; i++) { | |
| bool match = Curl_check_noproxy(list[i].a, list[i].n); | |
| if(match != list[i].match) { | |
| - | fprintf(stderr, "%s in %s should %smatch\n", |
| - | list[i].a, list[i].n, |
| - | list[i].match ? "": "not "); |
| + | curl_mfprintf(stderr, "%s in %s should %smatch\n", |
| + | list[i].a, list[i].n, |
| + | list[i].match ? "": "not "); |
| err++; | |
| } | |
| } | |
| @@ -23,11 +23,9 @@ | |
| ***************************************************************************/ | |
| #include "curlcheck.h" | |
| - | #include "curlx.h" |
| - | |
| - | #include "uint-hash.h" |
| - | |
| - | #include "memdebug.h" /* LAST include file */ |
| + | #include <curlx.h> |
| + | #include <uint-hash.h> |
| + | #include <memdebug.h> /* LAST include file */ |
| static struct uint_hash hash_static; | |
| @@ -164,20 +164,20 @@ UNITTEST_START | |
| DOHcode rc = doh_req_encode(req[i].name, req[i].type, | |
| buffer, sizeof(buffer), &size); | |
| if(rc != req[i].rc) { | |
| - | fprintf(stderr, "req %zu: Expected return code %d got %d\n", i, |
| - | req[i].rc, rc); |
| + | curl_mfprintf(stderr, "req %zu: Expected return code %d got %d\n", i, |
| + | req[i].rc, rc); |
| abort_if(rc != req[i].rc, "return code"); | |
| } | |
| if(size != req[i].size) { | |
| - | fprintf(stderr, "req %zu: Expected size %zu got %zu\n", i, |
| - | req[i].size, size); |
| - | fprintf(stderr, "DNS encode made: %s\n", hexdump(buffer, size)); |
| + | curl_mfprintf(stderr, "req %zu: Expected size %zu got %zu\n", i, |
| + | req[i].size, size); |
| + | curl_mfprintf(stderr, "DNS encode made: %s\n", hexdump(buffer, size)); |
| abort_if(size != req[i].size, "size"); | |
| } | |
| if(req[i].packet && memcmp(req[i].packet, buffer, size)) { | |
| - | fprintf(stderr, "DNS encode made: %s\n", hexdump(buffer, size)); |
| - | fprintf(stderr, "... instead of: %s\n", |
| - | hexdump((const unsigned char *)req[i].packet, size)); |
| + | curl_mfprintf(stderr, "DNS encode made: %s\n", hexdump(buffer, size)); |
| + | curl_mfprintf(stderr, "... instead of: %s\n", |
| + | hexdump((const unsigned char *)req[i].packet, size)); |
| abort_if(req[i].packet && memcmp(req[i].packet, buffer, size), | |
| "contents"); | |
| } | |
| @@ -193,8 +193,8 @@ UNITTEST_START | |
| rc = doh_resp_decode((const unsigned char *)resp[i].packet, resp[i].size, | |
| resp[i].type, &d); | |
| if(rc != resp[i].rc) { | |
| - | fprintf(stderr, "resp %zu: Expected return code %d got %d\n", i, |
| - | resp[i].rc, rc); |
| + | curl_mfprintf(stderr, "resp %zu: Expected return code %d got %d\n", i, |
| + | resp[i].rc, rc); |
| abort_if(rc != resp[i].rc, "return code"); | |
| } | |
| len = sizeof(buffer); | |
| @@ -205,7 +205,7 @@ UNITTEST_START | |
| a = &d.addr[u]; | |
| if(resp[i].type == DNS_TYPE_A) { | |
| p = &a->ip.v4[0]; | |
| - | msnprintf(ptr, len, "%u.%u.%u.%u ", p[0], p[1], p[2], p[3]); |
| + | curl_msnprintf(ptr, len, "%u.%u.%u.%u ", p[0], p[1], p[2], p[3]); |
| o = strlen(ptr); | |
| len -= o; | |
| ptr += o; | |
| @@ -214,28 +214,28 @@ UNITTEST_START | |
| int j; | |
| for(j = 0; j < 16; j += 2) { | |
| size_t l; | |
| - | msnprintf(ptr, len, "%s%02x%02x", j?":":"", a->ip.v6[j], |
| - | a->ip.v6[j + 1]); |
| + | curl_msnprintf(ptr, len, "%s%02x%02x", j?":":"", a->ip.v6[j], |
| + | a->ip.v6[j + 1]); |
| l = strlen(ptr); | |
| len -= l; | |
| ptr += l; | |
| } | |
| - | msnprintf(ptr, len, " "); |
| + | curl_msnprintf(ptr, len, " "); |
| len--; | |
| ptr++; | |
| } | |
| } | |
| for(u = 0; u < d.numcname; u++) { | |
| size_t o; | |
| - | msnprintf(ptr, len, "%s ", Curl_dyn_ptr(&d.cname[u])); |
| + | curl_msnprintf(ptr, len, "%s ", curlx_dyn_ptr(&d.cname[u])); |
| o = strlen(ptr); | |
| len -= o; | |
| ptr += o; | |
| } | |
| de_cleanup(&d); | |
| if(resp[i].out && strcmp((char *)buffer, resp[i].out)) { | |
| - | fprintf(stderr, "resp %zu: Expected %s got %s\n", i, |
| - | resp[i].out, buffer); |
| + | curl_mfprintf(stderr, "resp %zu: Expected %s got %s\n", i, |
| + | resp[i].out, buffer); |
| abort_if(resp[i].out && strcmp((char *)buffer, resp[i].out), "content"); | |
| } | |
| } | |
| @@ -248,7 +248,7 @@ UNITTEST_START | |
| rc = doh_resp_decode((const unsigned char *)full49, i, DNS_TYPE_A, &d); | |
| if(!rc) { | |
| /* none of them should work */ | |
| - | fprintf(stderr, "%zu: %d\n", i, rc); |
| + | curl_mfprintf(stderr, "%zu: %d\n", i, rc); |
| abort_if(!rc, "error rc"); | |
| } | |
| } | |
| @@ -262,7 +262,7 @@ UNITTEST_START | |
| DNS_TYPE_A, &d); | |
| if(!rc) { | |
| /* none of them should work */ | |
| - | fprintf(stderr, "2 %zu: %d\n", i, rc); |
| + | curl_mfprintf(stderr, "2 %zu: %d\n", i, rc); |
| abort_if(!rc, "error rc"); | |
| } | |
| } | |
| @@ -277,10 +277,10 @@ UNITTEST_START | |
| fail_if(d.numaddr != 1, "missing address"); | |
| a = &d.addr[0]; | |
| p = &a->ip.v4[0]; | |
| - | msnprintf((char *)buffer, sizeof(buffer), |
| - | "%u.%u.%u.%u", p[0], p[1], p[2], p[3]); |
| + | curl_msnprintf((char *)buffer, sizeof(buffer), |
| + | "%u.%u.%u.%u", p[0], p[1], p[2], p[3]); |
| if(rc || strcmp((char *)buffer, "127.0.0.1")) { | |
| - | fprintf(stderr, "bad address decoded: %s, rc == %d\n", buffer, rc); |
| + | curl_mfprintf(stderr, "bad address decoded: %s, rc == %d\n", buffer, rc); |
| abort_if(rc || strcmp((char *)buffer, "127.0.0.1"), "bad address"); | |
| } | |
| fail_if(d.numcname, "bad cname counter"); | |
| @@ -354,7 +354,7 @@ UNITTEST_START | |
| int byte; | |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -102,7 +102,7 @@ UNITTEST_START | |
| #endif | |
| /* Injecting a simple short string via a format */ | |
| - | msnprintf(input, sizeof(input), "Simple Test"); |
| + | curl_msnprintf(input, sizeof(input), "Simple Test"); |
| Curl_infof(testdata, "%s", input); | |
| fail_unless(verify(output, input) == 0, "Simple string test"); | |
| @@ -49,11 +49,11 @@ static CURLUcode parse_port(CURLU *url, | |
| { | |
| struct dynbuf host; | |
| CURLUcode ret; | |
| - | Curl_dyn_init(&host, 10000); |
| - | if(Curl_dyn_add(&host, h)) |
| + | curlx_dyn_init(&host, 10000); |
| + | if(curlx_dyn_add(&host, h)) |
| return CURLUE_OUT_OF_MEMORY; | |
| ret = Curl_parse_port(url, &host, has_scheme); | |
| - | Curl_dyn_free(&host); |
| + | curlx_dyn_free(&host); |
| return ret; | |
| } | |
| @@ -58,7 +58,7 @@ UNITTEST_START | |
| goto fail; | |
| } | |
| fail_unless(Curl_llist_count(&asi->list) == 4, "wrong number of entries"); | |
| - | msnprintf(outname, sizeof(outname), "%s-out", arg); |
| + | curl_msnprintf(outname, sizeof(outname), "%s-out", arg); |
| result = Curl_altsvc_parse(curl, asi, "h2=\"example.com:8080\"\r\n", | |
| ALPN_h1, "example.org", 8080); | |
| @@ -78,16 +78,17 @@ static bool do_test(struct test_spec *spec, size_t i, struct dynbuf *dbuf) | |
| CURLcode result; | |
| const char *in = spec->input; | |
| - | Curl_dyn_reset(dbuf); |
| + | curlx_dyn_reset(dbuf); |
| result = Curl_x509_GTime2str(dbuf, in, in + strlen(in)); | |
| if(result != spec->exp_result) { | |
| - | fprintf(stderr, "test %zu: expect result %d, got %d\n", |
| - | i, spec->exp_result, result); |
| + | curl_mfprintf(stderr, "test %zu: expect result %d, got %d\n", |
| + | i, spec->exp_result, result); |
| return FALSE; | |
| } | |
| - | else if(!result && strcmp(spec->exp_output, Curl_dyn_ptr(dbuf))) { |
| - | fprintf(stderr, "test %zu: input '%s', expected output '%s', got '%s'\n", |
| - | i, in, spec->exp_output, Curl_dyn_ptr(dbuf)); |
| + | else if(!result && strcmp(spec->exp_output, curlx_dyn_ptr(dbuf))) { |
| + | curl_mfprintf(stderr, |
| + | "test %zu: input '%s', expected output '%s', got '%s'\n", |
| + | i, in, spec->exp_output, curlx_dyn_ptr(dbuf)); |
| return FALSE; | |
| } | |
| @@ -100,10 +101,10 @@ UNITTEST_START | |
| struct dynbuf dbuf; | |
| bool all_ok = TRUE; | |
| - | Curl_dyn_init(&dbuf, 32*1024); |
| + | curlx_dyn_init(&dbuf, 32*1024); |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -113,7 +114,7 @@ UNITTEST_START | |
| } | |
| fail_unless(all_ok, "some tests of Curl_x509_GTime2str() fails"); | |
| - | Curl_dyn_free(&dbuf); |
| + | curlx_dyn_free(&dbuf); |
| curl_global_cleanup(); | |
| } | |
| UNITTEST_STOP | |
| @@ -52,12 +52,12 @@ static CURLcode make1657_nested(struct test1657_spec *spec, struct dynbuf *buf) | |
| unsigned char close_undef[] = { 0x00, 0x00 }; | |
| for(i = 0; i < spec->n; ++i) { | |
| - | r = Curl_dyn_addn(buf, open_undef, sizeof(open_undef)); |
| + | r = curlx_dyn_addn(buf, open_undef, sizeof(open_undef)); |
| if(r) | |
| return r; | |
| } | |
| for(i = 0; i < spec->n; ++i) { | |
| - | r = Curl_dyn_addn(buf, close_undef, sizeof(close_undef)); |
| + | r = curlx_dyn_addn(buf, close_undef, sizeof(close_undef)); |
| if(r) | |
| return r; | |
| } | |
| @@ -79,17 +79,17 @@ static bool do_test1657(struct test1657_spec *spec, size_t i, | |
| const char *in; | |
| memset(&elem, 0, sizeof(elem)); | |
| - | Curl_dyn_reset(buf); |
| + | curlx_dyn_reset(buf); |
| result = spec->setbuf(spec, buf); | |
| if(result) { | |
| - | fprintf(stderr, "test %zu: error setting buf %d\n", i, result); |
| + | curl_mfprintf(stderr, "test %zu: error setting buf %d\n", i, result); |
| return FALSE; | |
| } | |
| - | in = Curl_dyn_ptr(buf); |
| - | result = Curl_x509_getASN1Element(&elem, in, in + Curl_dyn_len(buf)); |
| + | in = curlx_dyn_ptr(buf); |
| + | result = Curl_x509_getASN1Element(&elem, in, in + curlx_dyn_len(buf)); |
| if(result != spec->exp_result) { | |
| - | fprintf(stderr, "test %zu: expect result %d, got %d\n", |
| - | i, spec->exp_result, result); |
| + | curl_mfprintf(stderr, "test %zu: expect result %d, got %d\n", |
| + | i, spec->exp_result, result); |
| return FALSE; | |
| } | |
| return TRUE; | |
| @@ -101,10 +101,10 @@ UNITTEST_START | |
| bool all_ok = TRUE; | |
| struct dynbuf dbuf; | |
| - | Curl_dyn_init(&dbuf, 32*1024); |
| + | curlx_dyn_init(&dbuf, 32*1024); |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| - | fprintf(stderr, "curl_global_init() failed\n"); |
| + | curl_mfprintf(stderr, "curl_global_init() failed\n"); |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -114,7 +114,7 @@ UNITTEST_START | |
| } | |
| fail_unless(all_ok, "some tests of Curl_x509_getASN1Element() fails"); | |
| - | Curl_dyn_free(&dbuf); |
| + | curlx_dyn_free(&dbuf); |
| curl_global_cleanup(); | |
| } | |
| UNITTEST_STOP | |
| @@ -65,62 +65,62 @@ static void rrresults(struct Curl_https_rrinfo *rr, CURLcode result) | |
| { | |
| char *p = rrbuffer; | |
| char *pend = rrbuffer + sizeof(rrbuffer); | |
| - | msnprintf(rrbuffer, sizeof(rrbuffer), "r:%d|", (int)result); |
| + | curl_msnprintf(rrbuffer, sizeof(rrbuffer), "r:%d|", (int)result); |
| p += strlen(rrbuffer); | |
| if(rr) { | |
| unsigned int i; | |
| - | msnprintf(p, pend - p, "p:%d|", rr->priority); |
| + | curl_msnprintf(p, pend - p, "p:%d|", rr->priority); |
| p += strlen(p); | |
| - | msnprintf(p, pend - p, "%s|", rr->target ? rr->target : "-"); |
| + | curl_msnprintf(p, pend - p, "%s|", rr->target ? rr->target : "-"); |
| p += strlen(p); | |
| for(i = 0; i < MAX_HTTPSRR_ALPNS && rr->alpns[i] != ALPN_none; i++) { | |
| - | msnprintf(p, pend - p, "alpn:%x|", rr->alpns[i]); |
| + | curl_msnprintf(p, pend - p, "alpn:%x|", rr->alpns[i]); |
| p += strlen(p); | |
| } | |
| if(rr->no_def_alpn) { | |
| - | msnprintf(p, pend - p, "no-def-alpn|"); |
| + | curl_msnprintf(p, pend - p, "no-def-alpn|"); |
| p += strlen(p); | |
| } | |
| if(rr->port >= 0) { | |
| - | msnprintf(p, pend - p, "port:%d|", rr->port); |
| + | curl_msnprintf(p, pend - p, "port:%d|", rr->port); |
| p += strlen(p); | |
| } | |
| if(rr->ipv4hints) { | |
| for(i = 0; i < rr->ipv4hints_len; i += 4) { | |
| - | msnprintf(p, pend - p, "ipv4:%d.%d.%d.%d|", |
| - | rr->ipv4hints[i], |
| - | rr->ipv4hints[i + 1], |
| - | rr->ipv4hints[i + 2], |
| - | rr->ipv4hints[i + 3]); |
| + | curl_msnprintf(p, pend - p, "ipv4:%d.%d.%d.%d|", |
| + | rr->ipv4hints[i], |
| + | rr->ipv4hints[i + 1], |
| + | rr->ipv4hints[i + 2], |
| + | rr->ipv4hints[i + 3]); |
| p += strlen(p); | |
| } | |
| } | |
| if(rr->echconfiglist) { | |
| - | msnprintf(p, pend - p, "ech:"); |
| + | curl_msnprintf(p, pend - p, "ech:"); |
| p += strlen(p); | |
| for(i = 0; i < rr->echconfiglist_len; i++) { | |
| - | msnprintf(p, pend - p, "%02x", rr->echconfiglist[i]); |
| + | curl_msnprintf(p, pend - p, "%02x", rr->echconfiglist[i]); |
| p += strlen(p); | |
| } | |
| - | msnprintf(p, pend - p, "|"); |
| + | curl_msnprintf(p, pend - p, "|"); |
| p += strlen(p); | |
| } | |
| if(rr->ipv6hints) { | |
| for(i = 0; i < rr->ipv6hints_len; i += 16) { | |
| int x; | |
| - | msnprintf(p, pend - p, "ipv6:"); |
| + | curl_msnprintf(p, pend - p, "ipv6:"); |
| p += strlen(p); | |
| for(x = 0; x < 16; x += 2) { | |
| - | msnprintf(p, pend - p, "%s%02x%02x", |
| - | x ? ":" : "", |
| - | rr->ipv6hints[i + x], |
| - | rr->ipv6hints[i + x + 1]); |
| + | curl_msnprintf(p, pend - p, "%s%02x%02x", |
| + | x ? ":" : "", |
| + | rr->ipv6hints[i + x], |
| + | rr->ipv6hints[i + x + 1]); |
| p += strlen(p); | |
| } | |
| - | msnprintf(p, pend - p, "|"); |
| + | curl_msnprintf(p, pend - p, "|"); |
| p += strlen(p); | |
| } | |
| } | |
| @@ -527,9 +527,9 @@ UNITTEST_START | |
| /* is the output the expected? */ | |
| if(strcmp(rrbuffer, t[i].expect)) { | |
| - | fprintf(stderr, "Test %s (%i) failed\n" |
| - | "Expected: %s\n" |
| - | "Received: %s\n", t[i].name, i, t[i].expect, rrbuffer); |
| + | curl_mfprintf(stderr, "Test %s (%i) failed\n" |
| + | "Expected: %s\n" |
| + | "Received: %s\n", t[i].name, i, t[i].expect, rrbuffer); |
| unitfail++; | |
| } | |
| @@ -111,9 +111,9 @@ static void showsts(struct stsentry *e, const char *chost) | |
| if(!e) | |
| printf("'%s' is not HSTS\n", chost); | |
| else { | |
| - | printf("%s [%s]: %" CURL_FORMAT_CURL_OFF_T "%s\n", |
| - | chost, e->host, e->expires, |
| - | e->includeSubDomains ? " includeSubDomains" : ""); |
| + | curl_mprintf("%s [%s]: %" CURL_FORMAT_CURL_OFF_T "%s\n", |
| + | chost, e->host, e->expires, |
| + | e->includeSubDomains ? " includeSubDomains" : ""); |
| } | |
| } | |
| @@ -144,8 +144,8 @@ UNITTEST_START | |
| result = Curl_hsts_parse(h, headers[i].host, headers[i].hdr); | |
| if(result != headers[i].result) { | |
| - | fprintf(stderr, "Curl_hsts_parse(%s) failed: %d\n", |
| - | headers[i].hdr, result); |
| + | curl_mfprintf(stderr, "Curl_hsts_parse(%s) failed: %d\n", |
| + | headers[i].hdr, result); |
| unitfail++; | |
| continue; | |
| } | |
| @@ -160,7 +160,7 @@ UNITTEST_START | |
| showsts(e, chost); | |
| } | |
| - | printf("Number of entries: %zu\n", Curl_llist_count(&h->list)); |
| + | curl_mprintf("Number of entries: %zu\n", Curl_llist_count(&h->list)); |
| /* verify that it is exists for 7 seconds */ | |
| chost = "expire.example"; | |
| @@ -170,7 +170,7 @@ UNITTEST_START | |
| deltatime++; /* another second passed */ | |
| } | |
| - | msnprintf(savename, sizeof(savename), "%s.save", arg); |
| + | curl_msnprintf(savename, sizeof(savename), "%s.save", arg); |
| (void)Curl_hsts_save(easy, h, savename); | |
| Curl_hsts_cleanup(&h); | |
| curl_easy_cleanup(easy); | |
| @@ -32,7 +32,7 @@ | |
| #include <curl/curl.h> | |
| - | #include "strparse.h" |
| + | #include "curlx/strparse.h" |
| #include "memdebug.h" /* LAST include file */ | |
| @@ -64,23 +64,23 @@ UNITTEST_START | |
| }; | |
| int i; | |
| - | printf("Curl_str_word\n"); |
| + | printf("curlx_str_word\n"); |
| for(i = 0; wordparse[i]; i++) { | |
| struct Curl_str out; | |
| const char *line = wordparse[i]; | |
| const char *orgline = line; | |
| - | int rc = Curl_str_word(&line, &out, 7); |
| + | int rc = curlx_str_word(&line, &out, 7); |
| printf("%u: (\"%s\") %d, \"%.*s\" [%d], line %d\n", | |
| i, orgline, rc, (int)out.len, out.str, (int)out.len, | |
| (int)(line - orgline)); | |
| } | |
| - | printf("Curl_str_until\n"); |
| + | printf("curlx_str_until\n"); |
| for(i = 0; wordparse[i]; i++) { | |
| struct Curl_str out; | |
| const char *line = wordparse[i]; | |
| const char *orgline = line; | |
| - | int rc = Curl_str_until(&line, &out, 7, 'd'); |
| + | int rc = curlx_str_until(&line, &out, 7, 'd'); |
| printf("%u: (\"%s\") %d, \"%.*s\" [%d], line %d\n", | |
| i, orgline, rc, (int)out.len, out.str, (int)out.len, | |
| (int)(line - orgline)); | |
| @@ -103,12 +103,12 @@ UNITTEST_START | |
| NULL | |
| }; | |
| - | printf("Curl_str_quotedword\n"); |
| + | printf("curlx_str_quotedword\n"); |
| for(i = 0; qwords[i]; i++) { | |
| struct Curl_str out; | |
| const char *line = qwords[i]; | |
| const char *orgline = line; | |
| - | int rc = Curl_str_quotedword(&line, &out, 7); |
| + | int rc = curlx_str_quotedword(&line, &out, 7); |
| printf("%u: (\"%s\") %d, \"%.*s\" [%d], line %d\n", | |
| i, orgline, rc, (int)out.len, out.str, (int)out.len, | |
| (int)(line - orgline)); | |
| @@ -126,11 +126,11 @@ UNITTEST_START | |
| "", | |
| NULL | |
| }; | |
| - | printf("Curl_str_single\n"); |
| + | printf("curlx_str_single\n"); |
| for(i = 0; single[i]; i++) { | |
| const char *line = single[i]; | |
| const char *orgline = line; | |
| - | int rc = Curl_str_single(&line, 'a'); |
| + | int rc = curlx_str_single(&line, 'a'); |
| printf("%u: (\"%s\") %d, line %d\n", | |
| i, orgline, rc, (int)(line - orgline)); | |
| } | |
| @@ -148,11 +148,11 @@ UNITTEST_START | |
| "", | |
| NULL | |
| }; | |
| - | printf("Curl_str_singlespace\n"); |
| + | printf("curlx_str_singlespace\n"); |
| for(i = 0; single[i]; i++) { | |
| const char *line = single[i]; | |
| const char *orgline = line; | |
| - | int rc = Curl_str_singlespace(&line); |
| + | int rc = curlx_str_singlespace(&line); |
| printf("%u: (\"%s\") %d, line %d\n", | |
| i, orgline, rc, (int)(line - orgline)); | |
| } | |
| @@ -169,11 +169,11 @@ UNITTEST_START | |
| "", | |
| NULL | |
| }; | |
| - | printf("Curl_str_single\n"); |
| + | printf("curlx_str_single\n"); |
| for(i = 0; single[i]; i++) { | |
| const char *line = single[i]; | |
| const char *orgline = line; | |
| - | int rc = Curl_str_single(&line, 'a'); |
| + | int rc = curlx_str_single(&line, 'a'); |
| printf("%u: (\"%s\") %d, line %d\n", | |
| i, orgline, rc, (int)(line - orgline)); | |
| } | |
| @@ -194,12 +194,12 @@ UNITTEST_START | |
| "", | |
| NULL | |
| }; | |
| - | printf("Curl_str_number\n"); |
| + | printf("curlx_str_number\n"); |
| for(i = 0; nums[i]; i++) { | |
| curl_off_t num; | |
| const char *line = nums[i]; | |
| const char *orgline = line; | |
| - | int rc = Curl_str_number(&line, &num, 1235); |
| + | int rc = curlx_str_number(&line, &num, 1235); |
| printf("%u: (\"%s\") %d, [%u] line %d\n", | |
| i, orgline, rc, (int)num, (int)(line - orgline)); | |
| } | |
| @@ -226,15 +226,15 @@ UNITTEST_START | |
| { "12", 10}, | |
| {NULL, 0} | |
| }; | |
| - | printf("Curl_str_number varying max\n"); |
| + | printf("curlx_str_number varying max\n"); |
| for(i = 0; nums[i].str; i++) { | |
| curl_off_t num; | |
| const char *line = nums[i].str; | |
| const char *orgline = line; | |
| - | int rc = Curl_str_number(&line, &num, nums[i].max); |
| - | printf("%u: (\"%s\") max %" CURL_FORMAT_CURL_OFF_T |
| - | " == %d, [%" CURL_FORMAT_CURL_OFF_T "]\n", |
| - | i, orgline, nums[i].max, rc, num); |
| + | int rc = curlx_str_number(&line, &num, nums[i].max); |
| + | curl_mprintf("%u: (\"%s\") max %" CURL_FORMAT_CURL_OFF_T |
| + | " == %d, [%" CURL_FORMAT_CURL_OFF_T "]\n", |
| + | i, orgline, nums[i].max, rc, num); |
| } | |
| } | |
| @@ -266,15 +266,15 @@ UNITTEST_START | |
| { "12", 16}, | |
| {NULL, 0} | |
| }; | |
| - | printf("Curl_str_hex varying max\n"); |
| + | printf("curlx_str_hex varying max\n"); |
| for(i = 0; nums[i].str; i++) { | |
| curl_off_t num; | |
| const char *line = nums[i].str; | |
| const char *orgline = line; | |
| - | int rc = Curl_str_hex(&line, &num, nums[i].max); |
| - | printf("%u: (\"%s\") max %" CURL_FORMAT_CURL_OFF_T |
| - | " == %d, [%" CURL_FORMAT_CURL_OFF_T "]\n", |
| - | i, orgline, nums[i].max, rc, num); |
| + | int rc = curlx_str_hex(&line, &num, nums[i].max); |
| + | curl_mprintf("%u: (\"%s\") max %" CURL_FORMAT_CURL_OFF_T |
| + | " == %d, [%" CURL_FORMAT_CURL_OFF_T "]\n", |
| + | i, orgline, nums[i].max, rc, num); |
| } | |
| } | |
| @@ -301,15 +301,15 @@ UNITTEST_START | |
| { "8", 10}, | |
| {NULL, 0} | |
| }; | |
| - | printf("Curl_str_octal varying max\n"); |
| + | printf("curlx_str_octal varying max\n"); |
| for(i = 0; nums[i].str; i++) { | |
| curl_off_t num; | |
| const char *line = nums[i].str; | |
| const char *orgline = line; | |
| - | int rc = Curl_str_octal(&line, &num, nums[i].max); |
| - | printf("%u: (\"%s\") max %" CURL_FORMAT_CURL_OFF_T |
| - | " == %d, [%" CURL_FORMAT_CURL_OFF_T "]\n", |
| - | i, orgline, nums[i].max, rc, num); |
| + | int rc = curlx_str_octal(&line, &num, nums[i].max); |
| + | curl_mprintf("%u: (\"%s\") max %" CURL_FORMAT_CURL_OFF_T |
| + | " == %d, [%" CURL_FORMAT_CURL_OFF_T "]\n", |
| + | i, orgline, nums[i].max, rc, num); |
| } | |
| } | |
| @@ -337,14 +337,14 @@ UNITTEST_START | |
| "999999999999999999", | |
| NULL | |
| }; | |
| - | printf("Curl_str_number / max\n"); |
| + | printf("curlx_str_number / max\n"); |
| for(i = 0; nums[i]; i++) { | |
| curl_off_t num; | |
| const char *line = nums[i]; | |
| const char *orgline = line; | |
| - | int rc = Curl_str_number(&line, &num, CURL_OFF_T_MAX); |
| - | printf("%u: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n", |
| - | i, orgline, rc, num, (int)(line - orgline)); |
| + | int rc = curlx_str_number(&line, &num, CURL_OFF_T_MAX); |
| + | curl_mprintf("%u: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n", |
| + | i, orgline, rc, num, (int)(line - orgline)); |
| } | |
| } | |
| @@ -363,13 +363,13 @@ UNITTEST_START | |
| "", | |
| NULL | |
| }; | |
| - | printf("Curl_str_newline\n"); |
| + | printf("curlx_str_newline\n"); |
| for(i = 0; newl[i]; i++) { | |
| const char *line = newl[i]; | |
| const char *orgline = line; | |
| - | int rc = Curl_str_newline(&line); |
| - | printf("%u: (%%%02x) %d, line %d\n", |
| - | i, *orgline, rc, (int)(line - orgline)); |
| + | int rc = curlx_str_newline(&line); |
| + | curl_mprintf("%u: (%%%02x) %d, line %d\n", |
| + | i, *orgline, rc, (int)(line - orgline)); |
| } | |
| } | |
| @@ -389,14 +389,14 @@ UNITTEST_START | |
| "", | |
| NULL | |
| }; | |
| - | printf("Curl_str_hex\n"); |
| + | printf("curlx_str_hex\n"); |
| for(i = 0; nums[i]; i++) { | |
| curl_off_t num; | |
| const char *line = nums[i]; | |
| const char *orgline = line; | |
| - | int rc = Curl_str_hex(&line, &num, 0x1235); |
| - | printf("%u: (\"%s\") %d, [%u] line %d\n", |
| - | i, orgline, rc, (int)num, (int)(line - orgline)); |
| + | int rc = curlx_str_hex(&line, &num, 0x1235); |
| + | curl_mprintf("%u: (\"%s\") %d, [%u] line %d\n", |
| + | i, orgline, rc, (int)num, (int)(line - orgline)); |
| } | |
| } | |
| @@ -416,14 +416,14 @@ UNITTEST_START | |
| "", | |
| NULL | |
| }; | |
| - | printf("Curl_str_octal\n"); |
| + | printf("curlx_str_octal\n"); |
| for(i = 0; nums[i]; i++) { | |
| curl_off_t num; | |
| const char *line = nums[i]; | |
| const char *orgline = line; | |
| - | int rc = Curl_str_octal(&line, &num, 01235); |
| - | printf("%u: (\"%s\") %d, [%u] line %d\n", |
| - | i, orgline, rc, (int)num, (int)(line - orgline)); |
| + | int rc = curlx_str_octal(&line, &num, 01235); |
| + | curl_mprintf("%u: (\"%s\") %d, [%u] line %d\n", |
| + | i, orgline, rc, (int)num, (int)(line - orgline)); |
| } | |
| } | |
| @@ -440,14 +440,14 @@ UNITTEST_START | |
| "666666666666666666666", | |
| NULL | |
| }; | |
| - | printf("Curl_str_octal / max\n"); |
| + | printf("curlx_str_octal / max\n"); |
| for(i = 0; nums[i]; i++) { | |
| curl_off_t num; | |
| const char *line = nums[i]; | |
| const char *orgline = line; | |
| - | int rc = Curl_str_octal(&line, &num, CURL_OFF_T_MAX); |
| - | printf("%u: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n", |
| - | i, orgline, rc, num, (int)(line - orgline)); |
| + | int rc = curlx_str_octal(&line, &num, CURL_OFF_T_MAX); |
| + | curl_mprintf("%u: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n", |
| + | i, orgline, rc, num, (int)(line - orgline)); |
| } | |
| } | |
| @@ -476,14 +476,14 @@ UNITTEST_START | |
| "ABCDEF", | |
| NULL | |
| }; | |
| - | printf("Curl_str_hex / max\n"); |
| + | printf("curlx_str_hex / max\n"); |
| for(i = 0; nums[i]; i++) { | |
| curl_off_t num; | |
| const char *line = nums[i]; | |
| const char *orgline = line; | |
| - | int rc = Curl_str_hex(&line, &num, CURL_OFF_T_MAX); |
| - | printf("%u: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n", |
| - | i, orgline, rc, num, (int)(line - orgline)); |
| + | int rc = curlx_str_hex(&line, &num, CURL_OFF_T_MAX); |
| + | curl_mprintf("%u: (\"%s\") %d, [%" CURL_FORMAT_CURL_OFF_T "] line %d\n", |
| + | i, orgline, rc, num, (int)(line - orgline)); |
| } | |
| } | |
| @@ -121,7 +121,7 @@ static void cf_test_destroy(struct Curl_cfilter *cf, struct Curl_easy *data) | |
| struct cf_test_ctx *ctx = cf->ctx; | |
| #ifndef CURL_DISABLE_VERBOSE_STRINGS | |
| infof(data, "%04dms: cf[%s] destroyed", | |
| - | (int)Curl_timediff(Curl_now(), current_tr->started), ctx->id); |
| + | (int)curlx_timediff(curlx_now(), current_tr->started), ctx->id); |
| #else | |
| (void)data; | |
| #endif | |
| @@ -138,7 +138,7 @@ static CURLcode cf_test_connect(struct Curl_cfilter *cf, | |
| (void)data; | |
| *done = FALSE; | |
| - | duration_ms = Curl_timediff(Curl_now(), ctx->started); |
| + | duration_ms = curlx_timediff(curlx_now(), ctx->started); |
| if(duration_ms >= ctx->fail_delay_ms) { | |
| infof(data, "%04dms: cf[%s] fail delay reached", | |
| (int)duration_ms, ctx->id); | |
| @@ -200,7 +200,7 @@ static CURLcode cf_test_create(struct Curl_cfilter **pcf, | |
| } | |
| ctx->ai_family = ai->ai_family; | |
| ctx->transport = transport; | |
| - | ctx->started = Curl_now(); |
| + | ctx->started = curlx_now(); |
| #ifdef USE_IPV6 | |
| if(ctx->ai_family == AF_INET6) { | |
| ctx->stats = ¤t_tr->cf6; | |
| @@ -217,7 +217,7 @@ static CURLcode cf_test_create(struct Curl_cfilter **pcf, | |
| ctx->stats->creations++; | |
| } | |
| - | created_at = Curl_timediff(ctx->started, current_tr->started); |
| + | created_at = curlx_timediff(ctx->started, current_tr->started); |
| if(ctx->stats->creations == 1) | |
| ctx->stats->first_created = created_at; | |
| ctx->stats->last_created = created_at; | |
| @@ -244,8 +244,8 @@ static void check_result(struct test_case *tc, | |
| char msg[256]; | |
| timediff_t duration_ms; | |
| - | duration_ms = Curl_timediff(tr->ended, tr->started); |
| - | fprintf(stderr, "%d: test case took %dms\n", tc->id, (int)duration_ms); |
| + | duration_ms = curlx_timediff(tr->ended, tr->started); |
| + | curl_mfprintf(stderr, "%d: test case took %dms\n", tc->id, (int)duration_ms); |
| if(tr->result != tc->exp_result | |
| && CURLE_OPERATION_TIMEDOUT != tr->result) { | |
| @@ -266,7 +266,7 @@ static void check_result(struct test_case *tc, | |
| fail(msg); | |
| } | |
| - | duration_ms = Curl_timediff(tr->ended, tr->started); |
| + | duration_ms = curlx_timediff(tr->ended, tr->started); |
| if(duration_ms < tc->min_duration_ms) { | |
| curl_msprintf(msg, "%d: expected min duration of %dms, but took %dms", | |
| tc->id, (int)tc->min_duration_ms, (int)duration_ms); | |
| @@ -324,9 +324,9 @@ static void test_connect(struct test_case *tc) | |
| tr.cf6.family = "v6"; | |
| tr.cf4.family = "v4"; | |
| - | tr.started = Curl_now(); |
| + | tr.started = curlx_now(); |
| tr.result = curl_easy_perform(easy); | |
| - | tr.ended = Curl_now(); |
| + | tr.ended = curlx_now(); |
| curl_easy_setopt(easy, CURLOPT_RESOLVE, NULL); | |
| curl_slist_free_all(list); | |
| @@ -64,26 +64,26 @@ static void dump_bufq(struct bufq *q, const char *msg) | |
| const char *terr; | |
| size_t n; | |
| - | fprintf(stderr, "bufq[chunk_size=%zu, max_chunks=%zu] %s\n", |
| - | q->chunk_size, q->max_chunks, msg); |
| - | fprintf(stderr, "- queue[\n"); |
| + | curl_mfprintf(stderr, "bufq[chunk_size=%zu, max_chunks=%zu] %s\n", |
| + | q->chunk_size, q->max_chunks, msg); |
| + | curl_mfprintf(stderr, "- queue[\n"); |
| chunk = q->head; | |
| while(chunk) { | |
| - | fprintf(stderr, " chunk[len=%zu, roff=%zu, woff=%zu]\n", |
| - | chunk->dlen, chunk->r_offset, chunk->w_offset); |
| + | curl_mfprintf(stderr, " chunk[len=%zu, roff=%zu, woff=%zu]\n", |
| + | chunk->dlen, chunk->r_offset, chunk->w_offset); |
| chunk = chunk->next; | |
| } | |
| - | fprintf(stderr, " ]\n"); |
| + | curl_mfprintf(stderr, " ]\n"); |
| terr = tail_err(q); | |
| - | fprintf(stderr, "- tail: %s\n", terr ? terr : "ok"); |
| + | curl_mfprintf(stderr, "- tail: %s\n", terr ? terr : "ok"); |
| n = 0; | |
| chunk = q->spare; | |
| while(chunk) { | |
| ++n; | |
| chunk = chunk->next; | |
| } | |
| - | fprintf(stderr, "- chunks: %zu\n", q->chunk_count); |
| - | fprintf(stderr, "- spares: %zu\n", n); |
| + | curl_mfprintf(stderr, "- chunks: %zu\n", q->chunk_count); |
| + | curl_mfprintf(stderr, "- spares: %zu\n", n); |
| } | |
| static unsigned char test_data[32*1024]; | |
| @@ -133,8 +133,8 @@ static void check_bufq(size_t pool_spares, | |
| } | |
| } | |
| if(nwritten != max_len) { | |
| - | fprintf(stderr, "%zu bytes written, but max_len=%zu\n", |
| - | nwritten, max_len); |
| + | curl_mfprintf(stderr, "%zu bytes written, but max_len=%zu\n", |
| + | nwritten, max_len); |
| dump_bufq(&q, "after writing full"); | |
| fail_if(TRUE, "write: bufq full but nwritten wrong"); | |
| } | |
| @@ -152,8 +152,8 @@ static void check_bufq(size_t pool_spares, | |
| } | |
| } | |
| if(nread != max_len) { | |
| - | fprintf(stderr, "%zu bytes read, but max_len=%zu\n", |
| - | nwritten, max_len); |
| + | curl_mfprintf(stderr, "%zu bytes read, but max_len=%zu\n", |
| + | nwritten, max_len); |
| dump_bufq(&q, "after reading empty"); | |
| fail_if(TRUE, "read: bufq empty but nread wrong"); | |
| } | |
| @@ -188,8 +188,8 @@ static void check_bufq(size_t pool_spares, | |
| nwritten += (size_t)n; | |
| } | |
| if(nwritten < max_len) { | |
| - | fprintf(stderr, "%zu bytes written, but max_len=%zu\n", |
| - | nwritten, max_len); |
| + | curl_mfprintf(stderr, "%zu bytes written, but max_len=%zu\n", |
| + | nwritten, max_len); |
| dump_bufq(&q, "after writing full"); | |
| fail_if(TRUE, "write: bufq full but nwritten wrong"); | |
| } | |
| @@ -235,8 +235,8 @@ static void check_bufq(size_t pool_spares, | |
| fail_unless(Curl_bufq_is_empty(&q), "should be last read"); | |
| } | |
| if(memcmp(buf, rbuf, n)) { | |
| - | fprintf(stderr, "at offset %zu expected '%.*s', got '%.*s'\n", |
| - | roffset, (int)n, buf, (int)n, rbuf); |
| + | curl_mfprintf(stderr, "at offset %zu expected '%.*s', got '%.*s'\n", |
| + | roffset, (int)n, buf, (int)n, rbuf); |
| fail("read buf content wrong"); | |
| } | |
| roffset += n; | |
| @@ -109,14 +109,14 @@ UNITTEST_START | |
| fail_unless(Curl_dynhds_ccount_name(&hds, "bLABlaBlA") == 0, "should"); | |
| fail_if(Curl_dynhds_cadd(&hds, "Bla-Bla", "thingies"), "add failed"); | |
| - | Curl_dyn_init(&dbuf, 32*1024); |
| + | curlx_dyn_init(&dbuf, 32*1024); |
| fail_if(Curl_dynhds_h1_dprint(&hds, &dbuf), "h1 print failed"); | |
| - | if(Curl_dyn_ptr(&dbuf)) { |
| - | fail_if(strcmp(Curl_dyn_ptr(&dbuf), |
| + | if(curlx_dyn_ptr(&dbuf)) { |
| + | fail_if(strcmp(curlx_dyn_ptr(&dbuf), |
| "test1: 123\r\ntest1: 123\r\nBla-Bla: thingies\r\n"), | |
| "h1 format differs"); | |
| } | |
| - | Curl_dyn_free(&dbuf); |
| + | curlx_dyn_free(&dbuf); |
| } | |
| Curl_dynhds_free(&hds); | |
| @@ -133,15 +133,15 @@ UNITTEST_START | |
| fail_if(Curl_dynhds_h1_cadd_line(&hds, "ti3: val1"), "add"); | |
| fail_if(Curl_dynhds_h1_cadd_line(&hds, " val2"), "add indent"); | |
| - | Curl_dyn_init(&dbuf, 32*1024); |
| + | curlx_dyn_init(&dbuf, 32*1024); |
| fail_if(Curl_dynhds_h1_dprint(&hds, &dbuf), "h1 print failed"); | |
| - | if(Curl_dyn_ptr(&dbuf)) { |
| - | fprintf(stderr, "indent concat: %s\n", Curl_dyn_ptr(&dbuf)); |
| - | fail_if(strcmp(Curl_dyn_ptr(&dbuf), |
| + | if(curlx_dyn_ptr(&dbuf)) { |
| + | curl_mfprintf(stderr, "indent concat: %s\n", curlx_dyn_ptr(&dbuf)); |
| + | fail_if(strcmp(curlx_dyn_ptr(&dbuf), |
| "ti1: val1 val2\r\nti2: val1 val2\r\nti3: val1 val2\r\n"), | |
| "wrong format"); | |
| } | |
| - | Curl_dyn_free(&dbuf); |
| + | curlx_dyn_free(&dbuf); |
| Curl_dynhds_free(&hds); | |
| @@ -53,16 +53,17 @@ static void check_eq(const char *s, const char *exp_s, const char *name) | |
| { | |
| if(s && exp_s) { | |
| if(strcmp(s, exp_s)) { | |
| - | fprintf(stderr, "expected %s: '%s' but got '%s'\n", name, exp_s, s); |
| + | curl_mfprintf(stderr, "expected %s: '%s' but got '%s'\n", |
| + | name, exp_s, s); |
| fail("unexpected req component"); | |
| } | |
| } | |
| else if(!s && exp_s) { | |
| - | fprintf(stderr, "expected %s: '%s' but got NULL\n", name, exp_s); |
| + | curl_mfprintf(stderr, "expected %s: '%s' but got NULL\n", name, exp_s); |
| fail("unexpected req component"); | |
| } | |
| else if(s && !exp_s) { | |
| - | fprintf(stderr, "expected %s: NULL but got '%s'\n", name, s); |
| + | curl_mfprintf(stderr, "expected %s: NULL but got '%s'\n", name, s); |
| fail("unexpected req component"); | |
| } | |
| } | |
| @@ -84,14 +85,14 @@ static void parse_success(struct tcase *t) | |
| nread = Curl_h1_req_parse_read(&p, buf, buflen, t->default_scheme, | |
| 0, &err); | |
| if(nread < 0) { | |
| - | fprintf(stderr, "got err %d parsing: '%s'\n", err, buf); |
| + | curl_mfprintf(stderr, "got err %d parsing: '%s'\n", err, buf); |
| fail("error consuming"); | |
| } | |
| in_consumed += (size_t)nread; | |
| if((size_t)nread != buflen) { | |
| if(!p.done) { | |
| - | fprintf(stderr, "only %zd/%zu consumed for: '%s'\n", |
| - | nread, buflen, buf); |
| + | curl_mfprintf(stderr, "only %zd/%zu consumed for: '%s'\n", |
| + | nread, buflen, buf); |
| fail("not all consumed"); | |
| } | |
| } | |
| @@ -100,8 +101,8 @@ static void parse_success(struct tcase *t) | |
| fail_if(!p.done, "end not detected"); | |
| fail_if(!p.req, "not request created"); | |
| if(t->input_remain != (in_len - in_consumed)) { | |
| - | fprintf(stderr, "expected %zu input bytes to remain, but got %zu\n", |
| - | t->input_remain, in_len - in_consumed); |
| + | curl_mfprintf(stderr, "expected %zu input bytes to remain, but got %zu\n", |
| + | t->input_remain, in_len - in_consumed); |
| fail("unexpected input consumption"); | |
| } | |
| if(p.req) { | |
| @@ -110,8 +111,8 @@ static void parse_success(struct tcase *t) | |
| check_eq(p.req->authority, t->authority, "authority"); | |
| check_eq(p.req->path, t->path, "path"); | |
| if(Curl_dynhds_count(&p.req->headers) != t->header_count) { | |
| - | fprintf(stderr, "expected %zu headers but got %zu\n", t->header_count, |
| - | Curl_dynhds_count(&p.req->headers)); |
| + | curl_mfprintf(stderr, "expected %zu headers but got %zu\n", |
| + | t->header_count, Curl_dynhds_count(&p.req->headers)); |
| fail("unexpected req header count"); | |
| } | |
| } | |
| @@ -91,7 +91,7 @@ UNITTEST_START | |
| struct dynbuf buf; | |
| size_t len = 4096; | |
| char *line; | |
| - | Curl_dyn_init(&buf, len); |
| + | curlx_dyn_init(&buf, len); |
| fp = fopen(arg, "wb"); | |
| abort_unless(fp != NULL, "Cannot open testfile"); | |
| @@ -101,74 +101,74 @@ UNITTEST_START | |
| fp = fopen(arg, "rb"); | |
| abort_unless(fp != NULL, "Cannot open testfile"); | |
| - | fprintf(stderr, "Test %zd...", i); |
| + | curl_mfprintf(stderr, "Test %zd...", i); |
| switch(i) { | |
| case 0: | |
| rc = Curl_get_line(&buf, fp); | |
| - | line = Curl_dyn_ptr(&buf); |
| + | line = curlx_dyn_ptr(&buf); |
| fail_unless(rc && line && !strcmp("LINE1\n", line), | |
| "First line failed (1)"); | |
| rc = Curl_get_line(&buf, fp); | |
| - | line = Curl_dyn_ptr(&buf); |
| + | line = curlx_dyn_ptr(&buf); |
| fail_unless(rc && line && !strcmp("LINE2 NEWLINE\n", line), | |
| "Second line failed (1)"); | |
| rc = Curl_get_line(&buf, fp); | |
| - | abort_unless(!Curl_dyn_len(&buf), "Missed EOF (1)"); |
| + | abort_unless(!curlx_dyn_len(&buf), "Missed EOF (1)"); |
| break; | |
| case 1: | |
| rc = Curl_get_line(&buf, fp); | |
| - | line = Curl_dyn_ptr(&buf); |
| + | line = curlx_dyn_ptr(&buf); |
| fail_unless(rc && line && !strcmp("LINE1\n", line), | |
| "First line failed (2)"); | |
| rc = Curl_get_line(&buf, fp); | |
| - | line = Curl_dyn_ptr(&buf); |
| + | line = curlx_dyn_ptr(&buf); |
| fail_unless(rc && line && !strcmp("LINE2 NONEWLINE\n", line), | |
| "Second line failed (2)"); | |
| rc = Curl_get_line(&buf, fp); | |
| - | abort_unless(!Curl_dyn_len(&buf), "Missed EOF (2)"); |
| + | abort_unless(!curlx_dyn_len(&buf), "Missed EOF (2)"); |
| break; | |
| case 2: | |
| rc = Curl_get_line(&buf, fp); | |
| - | line = Curl_dyn_ptr(&buf); |
| + | line = curlx_dyn_ptr(&buf); |
| fail_unless(rc && line && !strcmp("LINE1\n", line), | |
| "First line failed (3)"); | |
| rc = Curl_get_line(&buf, fp); | |
| - | fail_unless(!Curl_dyn_len(&buf), |
| + | fail_unless(!curlx_dyn_len(&buf), |
| "Did not detect max read on EOF (3)"); | |
| break; | |
| case 3: | |
| rc = Curl_get_line(&buf, fp); | |
| - | line = Curl_dyn_ptr(&buf); |
| + | line = curlx_dyn_ptr(&buf); |
| fail_unless(rc && line && !strcmp("LINE1\n", line), | |
| "First line failed (4)"); | |
| rc = Curl_get_line(&buf, fp); | |
| - | fail_unless(!Curl_dyn_len(&buf), |
| + | fail_unless(!curlx_dyn_len(&buf), |
| "Did not ignore partial on EOF (4)"); | |
| break; | |
| case 4: | |
| rc = Curl_get_line(&buf, fp); | |
| - | line = Curl_dyn_ptr(&buf); |
| + | line = curlx_dyn_ptr(&buf); |
| fail_unless(rc && line && !strcmp("LINE1\n", line), | |
| "First line failed (5)"); | |
| rc = Curl_get_line(&buf, fp); | |
| - | fail_unless(!Curl_dyn_len(&buf), |
| + | fail_unless(!curlx_dyn_len(&buf), |
| "Did not bail out on too long line"); | |
| break; | |
| case 5: | |
| rc = Curl_get_line(&buf, fp); | |
| - | line = Curl_dyn_ptr(&buf); |
| + | line = curlx_dyn_ptr(&buf); |
| fail_unless(rc && line && !strcmp("LINE1\x1aTEST\n", line), | |
| "Missed/Misinterpreted ^Z (6)"); | |
| rc = Curl_get_line(&buf, fp); | |
| - | abort_unless(!Curl_dyn_len(&buf), "Missed EOF (6)"); |
| + | abort_unless(!curlx_dyn_len(&buf), "Missed EOF (6)"); |
| break; | |
| default: | |
| abort_unless(1, "Unknown case"); | |
| break; | |
| } | |
| - | Curl_dyn_free(&buf); |
| + | curlx_dyn_free(&buf); |
| fclose(fp); | |
| - | fprintf(stderr, "OK\n"); |
| + | curl_mfprintf(stderr, "OK\n"); |
| } | |
| return (CURLcode)rc; | |
| UNITTEST_STOP | |
| @@ -698,9 +698,9 @@ UNITTEST_START | |
| if(test->rfc) { | |
| id = Curl_cipher_suite_lookup_id(test->rfc, strlen(test->rfc)); | |
| if(id != test->id) { | |
| - | fprintf(stderr, "Curl_cipher_suite_lookup_id FAILED for \"%s\", " |
| - | "result = 0x%04x, expected = 0x%04x\n", |
| - | test->rfc, id, test->id); |
| + | curl_mfprintf(stderr, "Curl_cipher_suite_lookup_id FAILED for \"%s\", " |
| + | "result = 0x%04x, expected = 0x%04x\n", |
| + | test->rfc, id, test->id); |
| unitfail++; | |
| } | |
| } | |
| @@ -709,9 +709,9 @@ UNITTEST_START | |
| if(test->openssl) { | |
| id = Curl_cipher_suite_lookup_id(test->openssl, strlen(test->openssl)); | |
| if(id != test->id) { | |
| - | fprintf(stderr, "Curl_cipher_suite_lookup_id FAILED for \"%s\", " |
| - | "result = 0x%04x, expected = 0x%04x\n", |
| - | test->openssl, id, test->id); |
| + | curl_mfprintf(stderr, "Curl_cipher_suite_lookup_id FAILED for \"%s\", " |
| + | "result = 0x%04x, expected = 0x%04x\n", |
| + | test->openssl, id, test->id); |
| unitfail++; | |
| } | |
| } | |
| @@ -723,9 +723,9 @@ UNITTEST_START | |
| Curl_cipher_suite_get_str(test->id, buf, sizeof(buf), true); | |
| if(expect && strcmp(buf, expect) != 0) { | |
| - | fprintf(stderr, "Curl_cipher_suite_get_str FAILED for 0x%04x, " |
| - | "result = \"%s\", expected = \"%s\"\n", |
| - | test->id, buf, expect); |
| + | curl_mfprintf(stderr, "Curl_cipher_suite_get_str FAILED for 0x%04x, " |
| + | "result = \"%s\", expected = \"%s\"\n", |
| + | test->id, buf, expect); |
| unitfail++; | |
| } | |
| @@ -744,9 +744,9 @@ UNITTEST_START | |
| } | |
| if(expect && strcmp(buf, expect) != 0) { | |
| - | fprintf(stderr, "Curl_cipher_suite_get_str FAILED for 0x%04x, " |
| - | "result = \"%s\", expected = \"%s\"\n", |
| - | test->id, buf, expect); |
| + | curl_mfprintf(stderr, "Curl_cipher_suite_get_str FAILED for 0x%04x, " |
| + | "result = \"%s\", expected = \"%s\"\n", |
| + | test->id, buf, expect); |
| unitfail++; | |
| } | |
| } | |
| @@ -766,16 +766,16 @@ UNITTEST_START | |
| len = end - ptr; | |
| if(id != test->id) { | |
| - | fprintf(stderr, "Curl_cipher_suite_walk_str FAILED for \"%s\" " |
| - | "unexpected cipher, " |
| - | "result = 0x%04x, expected = 0x%04x\n", |
| - | test->str, id, test->id); |
| + | curl_mfprintf(stderr, "Curl_cipher_suite_walk_str FAILED for \"%s\" " |
| + | "unexpected cipher, " |
| + | "result = 0x%04x, expected = 0x%04x\n", |
| + | test->str, id, test->id); |
| unitfail++; | |
| } | |
| if(len > 64 || strncmp(ptr, test->str, len) != 0) { | |
| - | fprintf(stderr, "Curl_cipher_suite_walk_str ABORT for \"%s\" " |
| - | "unexpected pointers\n", |
| - | test->str); |
| + | curl_mfprintf(stderr, "Curl_cipher_suite_walk_str ABORT for \"%s\" " |
| + | "unexpected pointers\n", |
| + | test->str); |
| unitfail++; | |
| goto unit_test_abort; | |
| } | |
| @@ -54,8 +54,8 @@ static void check_set(const char *name, unsigned int capacity, | |
| size_t i, j; | |
| unsigned int n, c; | |
| - | fprintf(stderr, "test %s, capacity=%u, %zu numbers\n", |
| - | name, capacity, slen); |
| + | curl_mfprintf(stderr, "test %s, capacity=%u, %zu numbers\n", |
| + | name, capacity, slen); |
| Curl_uint_bset_init(&bset); | |
| fail_unless(!Curl_uint_bset_resize(&bset, capacity), "bset resize failed"); | |
| c = Curl_uint_bset_capacity(&bset); | |
| @@ -81,7 +81,7 @@ static void check_set(const char *name, unsigned int capacity, | |
| for(i = 1; i < slen; ++i) { | |
| fail_unless(Curl_uint_bset_next(&bset, n, &n), "next failed"); | |
| if(n != s[i]) { | |
| - | fprintf(stderr, "expected next to be %u, not %u\n", s[i], n); |
| + | curl_mfprintf(stderr, "expected next to be %u, not %u\n", s[i], n); |
| fail_unless(n == s[i], "next not correct number"); | |
| } | |
| } | |
| @@ -57,7 +57,7 @@ static void check_spbset(const char *name, unsigned int *s, size_t slen) | |
| size_t i, j; | |
| unsigned int n, c; | |
| - | fprintf(stderr, "test %s, %zu numbers\n", name, slen); |
| + | curl_mfprintf(stderr, "test %s, %zu numbers\n", name, slen); |
| Curl_uint_spbset_init(&bset); | |
| @@ -83,7 +83,7 @@ static void check_spbset(const char *name, unsigned int *s, size_t slen) | |
| for(i = 1; i < slen; ++i) { | |
| fail_unless(Curl_uint_spbset_next(&bset, n, &n), "next failed"); | |
| if(n != s[i]) { | |
| - | fprintf(stderr, "expected next to be %u, not %u\n", s[i], n); |
| + | curl_mfprintf(stderr, "expected next to be %u, not %u\n", s[i], n); |
| fail_unless(n == s[i], "next not correct number"); | |
| } | |
| } | |
| @@ -90,7 +90,7 @@ PDB_NAME_DLL_DEBUG = $(BASE_NAME_DEBUG).pdb | |
| # CURL Command section | |
| PROGRAM_NAME = curl.exe | |
| - | CURL_CFLAGS = /I../lib /I../include /nologo /W4 /EHsc /FD /c |
| + | CURL_CFLAGS = /I../lib /I../lib/curlx /I../include /nologo /W4 /EHsc /FD /c |
| CURL_LFLAGS = /out:$(DIRDIST)\bin\$(PROGRAM_NAME) /subsystem:console $(LFLAGS) | |
| CURL_RESFLAGS = /i../include | |
| @@ -641,6 +641,7 @@ $(LIB_DIROBJ): | |
| @if not exist "$(LIB_DIROBJ)\vtls" mkdir $(LIB_DIROBJ)\vtls | |
| @if not exist "$(LIB_DIROBJ)\vssh" mkdir $(LIB_DIROBJ)\vssh | |
| @if not exist "$(LIB_DIROBJ)\vquic" mkdir $(LIB_DIROBJ)\vquic | |
| + | @if not exist "$(LIB_DIROBJ)\curlx" mkdir $(LIB_DIROBJ)\curlx |
| $(CURL_DIROBJ): | |
| @if not exist "$(CURL_DIROBJ)" mkdir $(CURL_DIROBJ) | |
| @@ -665,6 +666,9 @@ $(CURL_DIROBJ): | |
| {$(LIBCURL_SRC_DIR)\vquic\}.c{$(LIB_DIROBJ)\vquic\}.obj:: | |
| $(CURL_CC) $(CFLAGS) /Fo"$(LIB_DIROBJ)\vquic\\" $< | |
| + | {$(LIBCURL_SRC_DIR)\curlx\}.c{$(LIB_DIROBJ)\curlx\}.obj:: |
| + | $(CURL_CC) $(CFLAGS) /Fo"$(LIB_DIROBJ)\curlx\\" $< |
| + | |
| $(LIB_DIROBJ)\libcurl.res: $(LIBCURL_SRC_DIR)\libcurl.rc | |
| $(RC) $(RC_FLAGS) | |
| @@ -716,24 +720,24 @@ $(CURL_DIROBJ)\tool_hugehelp.obj: $(CURL_SRC_DIR)\tool_hugehelp.c | |
| !ENDIF | |
| $(CURL_DIROBJ)\nonblock.obj: ../lib/nonblock.c | |
| $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/nonblock.c | |
| - | $(CURL_DIROBJ)\strparse.obj: ../lib/strparse.c |
| - | $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/strparse.c |
| + | $(CURL_DIROBJ)\strparse.obj: ../lib/curlx/strparse.c |
| + | $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/curlx/strparse.c |
| $(CURL_DIROBJ)\strcase.obj: ../lib/strcase.c | |
| $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/strcase.c | |
| - | $(CURL_DIROBJ)\timeval.obj: ../lib/timeval.c |
| - | $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/timeval.c |
| - | $(CURL_DIROBJ)\warnless.obj: ../lib/warnless.c |
| - | $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/warnless.c |
| + | $(CURL_DIROBJ)\timeval.obj: ../lib/curlx/timeval.c |
| + | $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/curlx/timeval.c |
| $(CURL_DIROBJ)\curl_get_line.obj: ../lib/curl_get_line.c | |
| $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/curl_get_line.c | |
| $(CURL_DIROBJ)\curl_multibyte.obj: ../lib/curl_multibyte.c | |
| $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/curl_multibyte.c | |
| $(CURL_DIROBJ)\version_win32.obj: ../lib/version_win32.c | |
| $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/version_win32.c | |
| - | $(CURL_DIROBJ)\dynbuf.obj: ../lib/dynbuf.c |
| - | $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/dynbuf.c |
| - | $(CURL_DIROBJ)\base64.obj: ../lib/base64.c |
| - | $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/base64.c |
| + | $(CURL_DIROBJ)\warnless.obj: ../lib/curlx/warnless.c |
| + | $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/curlx/warnless.c |
| + | $(CURL_DIROBJ)\dynbuf.obj: ../lib/curlx/dynbuf.c |
| + | $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/curlx/dynbuf.c |
| + | $(CURL_DIROBJ)\base64.obj: ../lib/curlx/base64.c |
| + | $(CURL_CC) $(CURL_CFLAGS) /Fo"$@" ../lib/curlx/base64.c |
| $(CURL_DIROBJ)\curl.res: $(CURL_SRC_DIR)\curl.rc | |
| $(RC) $(CURL_RC_FLAGS) | |