← Commit list

bc55b435af

Viktor Szakats
Viktor Szakats
2025-03-07
SUCCESS Duration: 158s

Subject

tests/server: round of tidy-ups (part 2)

Binary

Download Binary (888 KB)

Architecture & Compiler Flags

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

—

Build Log

$ git checkout -f bc55b435afbb94c9c0e4b138d5375702c451a2ea
Previous HEAD position was 7cc4a23ee4 GHA/windows: ignore flaky 2310 with MSVC again
HEAD is now at bc55b435af tests/server: round of tidy-ups (part 2)

$ 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-base64.o
Removing lib/curl-curl_multibyte.o
Removing lib/curl-dynbuf.o
Removing lib/curl-nonblock.o
Removing lib/curl-strcase.o
Removing lib/curl-strparse.o
Removing lib/curl-strtoofft.o
Removing lib/curl-timediff.o
Removing lib/curl-version_win32.o
Removing lib/curl-warnless.o
Removing lib/curl_config.h
Removing lib/curl_config.h.in
Removing lib/libcurl.la
Removing lib/libcurl.vers
Removing lib/libcurl_la-altsvc.lo
Removing lib/libcurl_la-altsvc.o
Removing lib/libcurl_la-amigaos.lo
Removing lib/libcurl_la-amigaos.o
Removing lib/libcurl_la-asyn-ares.lo
Removing lib/libcurl_la-asyn-ares.o
Removing lib/libcurl_la-asyn-thread.lo
Removing lib/libcurl_la-asyn-thread.o
Removing lib/libcurl_la-base64.lo
Removing lib/libcurl_la-base64.o
Removing lib/libcurl_la-bufq.lo
Removing lib/libcurl_la-bufq.o
Removing lib/libcurl_la-bufref.lo
Removing lib/libcurl_la-bufref.o
Removing lib/libcurl_la-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-dllmain.lo
Removing lib/libcurl_la-dllmain.o
Removing lib/libcurl_la-doh.lo
Removing lib/libcurl_la-doh.o
Removing lib/libcurl_la-dynbuf.lo
Removing lib/libcurl_la-dynbuf.o
Removing lib/libcurl_la-dynhds.lo
Removing lib/libcurl_la-dynhds.o
Removing lib/libcurl_la-easy.lo
Removing lib/libcurl_la-easy.o
Removing lib/libcurl_la-easygetopt.lo
Removing lib/libcurl_la-easygetopt.o
Removing lib/libcurl_la-easyoptions.lo
Removing lib/libcurl_la-easyoptions.o
Removing lib/libcurl_la-escape.lo
Removing lib/libcurl_la-escape.o
Removing lib/libcurl_la-file.lo
Removing lib/libcurl_la-file.o
Removing lib/libcurl_la-fileinfo.lo
Removing lib/libcurl_la-fileinfo.o
Removing lib/libcurl_la-fopen.lo
Removing lib/libcurl_la-fopen.o
Removing lib/libcurl_la-formdata.lo
Removing lib/libcurl_la-formdata.o
Removing lib/libcurl_la-ftp.lo
Removing lib/libcurl_la-ftp.o
Removing lib/libcurl_la-ftplistparser.lo
Removing lib/libcurl_la-ftplistparser.o
Removing lib/libcurl_la-getenv.lo
Removing lib/libcurl_la-getenv.o
Removing lib/libcurl_la-getinfo.lo
Removing lib/libcurl_la-getinfo.o
Removing lib/libcurl_la-gopher.lo
Removing lib/libcurl_la-gopher.o
Removing lib/libcurl_la-hash.lo
Removing lib/libcurl_la-hash.o
Removing lib/libcurl_la-hash_offt.lo
Removing lib/libcurl_la-hash_offt.o
Removing lib/libcurl_la-headers.lo
Removing lib/libcurl_la-headers.o
Removing lib/libcurl_la-hmac.lo
Removing lib/libcurl_la-hmac.o
Removing lib/libcurl_la-hostasyn.lo
Removing lib/libcurl_la-hostasyn.o
Removing lib/libcurl_la-hostip.lo
Removing lib/libcurl_la-hostip.o
Removing lib/libcurl_la-hostip4.lo
Removing lib/libcurl_la-hostip4.o
Removing lib/libcurl_la-hostip6.lo
Removing lib/libcurl_la-hostip6.o
Removing lib/libcurl_la-hostsyn.lo
Removing lib/libcurl_la-hostsyn.o
Removing lib/libcurl_la-hsts.lo
Removing lib/libcurl_la-hsts.o
Removing lib/libcurl_la-http.lo
Removing lib/libcurl_la-http.o
Removing lib/libcurl_la-http1.lo
Removing lib/libcurl_la-http1.o
Removing lib/libcurl_la-http2.lo
Removing lib/libcurl_la-http2.o
Removing lib/libcurl_la-http_aws_sigv4.lo
Removing lib/libcurl_la-http_aws_sigv4.o
Removing lib/libcurl_la-http_chunks.lo
Removing lib/libcurl_la-http_chunks.o
Removing lib/libcurl_la-http_digest.lo
Removing lib/libcurl_la-http_digest.o
Removing lib/libcurl_la-http_negotiate.lo
Removing lib/libcurl_la-http_negotiate.o
Removing lib/libcurl_la-http_ntlm.lo
Removing lib/libcurl_la-http_ntlm.o
Removing lib/libcurl_la-http_proxy.lo
Removing lib/libcurl_la-http_proxy.o
Removing lib/libcurl_la-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-strparse.lo
Removing lib/libcurl_la-strparse.o
Removing lib/libcurl_la-strtoofft.lo
Removing lib/libcurl_la-strtoofft.o
Removing lib/libcurl_la-system_win32.lo
Removing lib/libcurl_la-system_win32.o
Removing lib/libcurl_la-telnet.lo
Removing lib/libcurl_la-telnet.o
Removing lib/libcurl_la-tftp.lo
Removing lib/libcurl_la-tftp.o
Removing lib/libcurl_la-timediff.lo
Removing lib/libcurl_la-timediff.o
Removing lib/libcurl_la-timeval.lo
Removing lib/libcurl_la-timeval.o
Removing lib/libcurl_la-transfer.lo
Removing lib/libcurl_la-transfer.o
Removing lib/libcurl_la-url.lo
Removing lib/libcurl_la-url.o
Removing lib/libcurl_la-urlapi.lo
Removing lib/libcurl_la-urlapi.o
Removing lib/libcurl_la-version.lo
Removing lib/libcurl_la-version.o
Removing lib/libcurl_la-version_win32.lo
Removing lib/libcurl_la-version_win32.o
Removing lib/libcurl_la-warnless.lo
Removing lib/libcurl_la-warnless.o
Removing lib/libcurl_la-ws.lo
Removing lib/libcurl_la-ws.o
Removing lib/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/vquic/.deps/
Removing lib/vquic/.dirstamp
Removing lib/vquic/libcurl_la-curl_msh3.lo
Removing lib/vquic/libcurl_la-curl_msh3.o
Removing lib/vquic/libcurl_la-curl_ngtcp2.lo
Removing lib/vquic/libcurl_la-curl_ngtcp2.o
Removing lib/vquic/libcurl_la-curl_osslq.lo
Removing lib/vquic/libcurl_la-curl_osslq.o
Removing lib/vquic/libcurl_la-curl_quiche.lo
Removing lib/vquic/libcurl_la-curl_quiche.o
Removing lib/vquic/libcurl_la-vquic-tls.lo
Removing lib/vquic/libcurl_la-vquic-tls.o
Removing lib/vquic/libcurl_la-vquic.lo
Removing lib/vquic/libcurl_la-vquic.o
Removing lib/vssh/.deps/
Removing lib/vssh/.dirstamp
Removing lib/vssh/libcurl_la-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/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 libcurl.pc
Removing libtool
Removing ltmain.sh
Removing m4/libtool.m4
Removing m4/ltoptions.m4
Removing m4/ltsugar.m4
Removing m4/ltversion.m4
Removing m4/lt~obsolete.m4
Removing missing
Removing packages/Makefile
Removing packages/Makefile.in
Removing packages/vms/Makefile
Removing packages/vms/Makefile.in
Removing scripts/Makefile
Removing scripts/Makefile.in
Removing src/.deps/
Removing src/.libs/
Removing src/Makefile
Removing src/Makefile.in
Removing src/curl
Removing src/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/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/certs/scripts/Makefile
Removing tests/certs/scripts/Makefile.in
Removing tests/config
Removing tests/configurehelp.pm
Removing tests/data/Makefile
Removing tests/data/Makefile.in
Removing tests/http/Makefile
Removing tests/http/Makefile.in
Removing tests/http/clients/.deps/
Removing tests/http/clients/Makefile
Removing tests/http/clients/Makefile.in
Removing tests/http/config.ini
Removing tests/libtest/.deps/
Removing tests/libtest/Makefile
Removing tests/libtest/Makefile.in
Removing tests/server/.deps/
Removing tests/server/Makefile
Removing tests/server/Makefile.in
Removing tests/unit/.deps/
Removing tests/unit/Makefile
Removing tests/unit/Makefile.in

$ autoreconf -fi
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
libtoolize: Remember to add 'LT_INIT' to configure.ac.
configure.ac:126: installing './compile'
configure.ac:422: installing './config.guess'
configure.ac:422: installing './config.sub'
configure.ac:126: installing './install-sh'
configure.ac:132: 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.13.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
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 is prototyped... 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 is compilable... 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 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 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 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 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 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 is prototyped... no
checking if ioctlsocket might be used... no
checking if IoctlSocket is compilable... 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 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 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 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 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/certs/scripts/Makefile
config.status: creating tests/data/Makefile
config.status: creating tests/server/Makefile
config.status: creating tests/libtest/Makefile
config.status: creating tests/unit/Makefile
config.status: creating tests/http/config.ini
config.status: creating tests/http/Makefile
config.status: creating tests/http/clients/Makefile
config.status: creating packages/Makefile
config.status: creating packages/vms/Makefile
config.status: creating curl-config
config.status: creating libcurl.pc
config.status: creating lib/curl_config.h
config.status: executing depfiles commands
config.status: executing libtool commands
configure: Configured to build curl/libcurl:

  Host setup:       x86_64-pc-linux-gnu
  Install prefix:   /usr/local
  Compiler:         ccache gcc
   CFLAGS:          -Werror-implicit-function-declaration -O2 -Wno-system-headers
   CFLAGS extras:   
   CPPFLAGS:        -D_GNU_SOURCE
   LDFLAGS:         
     curl-config:   
   LIBS:            -lpsl -lz

  curl version:     8.13.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-thread.lo
  CC       libcurl_la-base64.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-cshutdn.lo
  CC       libcurl_la-connect.lo
  CC       libcurl_la-content_encoding.lo
  CC       libcurl_la-cookie.lo
  CC       libcurl_la-curl_addrinfo.lo
  CC       libcurl_la-curl_des.lo
  CC       libcurl_la-curl_endian.lo
  CC       libcurl_la-curl_fnmatch.lo
  CC       libcurl_la-curl_get_line.lo
  CC       libcurl_la-curl_gethostname.lo
  CC       libcurl_la-curl_gssapi.lo
  CC       libcurl_la-curl_multibyte.lo
  CC       libcurl_la-curl_memrchr.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-dllmain.lo
  CC       libcurl_la-doh.lo
  CC       libcurl_la-dynbuf.lo
  CC       libcurl_la-dynhds.lo
  CC       libcurl_la-easy.lo
  CC       libcurl_la-easygetopt.lo
  CC       libcurl_la-easyoptions.lo
  CC       libcurl_la-escape.lo
  CC       libcurl_la-file.lo
  CC       libcurl_la-fileinfo.lo
  CC       libcurl_la-fopen.lo
  CC       libcurl_la-formdata.lo
  CC       libcurl_la-ftp.lo
  CC       libcurl_la-ftplistparser.lo
  CC       libcurl_la-getenv.lo
  CC       libcurl_la-getinfo.lo
  CC       libcurl_la-gopher.lo
  CC       libcurl_la-hash.lo
  CC       libcurl_la-hash_offt.lo
  CC       libcurl_la-headers.lo
  CC       libcurl_la-hmac.lo
  CC       libcurl_la-hostasyn.lo
  CC       libcurl_la-hostip.lo
  CC       libcurl_la-hostip4.lo
  CC       libcurl_la-hostip6.lo
  CC       libcurl_la-hostsyn.lo
  CC       libcurl_la-hsts.lo
  CC       libcurl_la-http.lo
  CC       libcurl_la-http1.lo
  CC       libcurl_la-http2.lo
  CC       libcurl_la-http_aws_sigv4.lo
  CC       libcurl_la-http_chunks.lo
  CC       libcurl_la-http_digest.lo
  CC       libcurl_la-http_negotiate.lo
  CC       libcurl_la-http_ntlm.lo
  CC       libcurl_la-http_proxy.lo
  CC       libcurl_la-httpsrr.lo
  CC       libcurl_la-idn.lo
  CC       libcurl_la-if2ip.lo
  CC       libcurl_la-imap.lo
  CC       libcurl_la-inet_ntop.lo
  CC       libcurl_la-inet_pton.lo
  CC       libcurl_la-krb5.lo
  CC       libcurl_la-ldap.lo
  CC       libcurl_la-llist.lo
  CC       libcurl_la-macos.lo
  CC       libcurl_la-md4.lo
  CC       libcurl_la-md5.lo
  CC       libcurl_la-memdebug.lo
  CC       libcurl_la-mime.lo
  CC       libcurl_la-mprintf.lo
  CC       libcurl_la-mqtt.lo
  CC       libcurl_la-multi.lo
  CC       libcurl_la-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-pop3.lo
  CC       libcurl_la-pingpong.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-strparse.lo
  CC       libcurl_la-strtoofft.lo
  CC       libcurl_la-system_win32.lo
  CC       libcurl_la-telnet.lo
  CC       libcurl_la-tftp.lo
  CC       libcurl_la-timediff.lo
  CC       libcurl_la-timeval.lo
  CC       libcurl_la-transfer.lo
  CC       libcurl_la-url.lo
  CC       libcurl_la-urlapi.lo
  CC       libcurl_la-version.lo
  CC       libcurl_la-version_win32.lo
  CC       libcurl_la-warnless.lo
  CC       libcurl_la-ws.lo
  CC       vauth/libcurl_la-cleartext.lo
  CC       vauth/libcurl_la-cram.lo
  CC       vauth/libcurl_la-digest.lo
  CC       vauth/libcurl_la-digest_sspi.lo
  CC       vauth/libcurl_la-gsasl.lo
  CC       vauth/libcurl_la-krb5_gssapi.lo
  CC       vauth/libcurl_la-krb5_sspi.lo
  CC       vauth/libcurl_la-ntlm.lo
  CC       vauth/libcurl_la-ntlm_sspi.lo
  CC       vauth/libcurl_la-oauth2.lo
  CC       vauth/libcurl_la-spnego_gssapi.lo
  CC       vauth/libcurl_la-spnego_sspi.lo
  CC       vauth/libcurl_la-vauth.lo
  CC       vtls/libcurl_la-bearssl.lo
  CC       vtls/libcurl_la-cipher_suite.lo
  CC       vtls/libcurl_la-gtls.lo
  CC       vtls/libcurl_la-hostcheck.lo
  CC       vtls/libcurl_la-keylog.lo
  CC       vtls/libcurl_la-mbedtls.lo
  CC       vtls/libcurl_la-mbedtls_threadlock.lo
  CC       vtls/libcurl_la-openssl.lo
  CC       vtls/libcurl_la-rustls.lo
  CC       vtls/libcurl_la-schannel.lo
  CC       vtls/libcurl_la-schannel_verify.lo
  CC       vtls/libcurl_la-sectransp.lo
  CC       vtls/libcurl_la-vtls.lo
  CC       vtls/libcurl_la-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_msh3.lo
  CC       vquic/libcurl_la-curl_ngtcp2.lo
  CC       vquic/libcurl_la-curl_osslq.lo
  CC       vquic/libcurl_la-curl_quiche.lo
  CC       vquic/libcurl_la-vquic.lo
  CC       vquic/libcurl_la-vquic-tls.lo
  CC       vssh/libcurl_la-libssh.lo
  CC       vssh/libcurl_la-libssh2.lo
  CC       vssh/libcurl_la-curl_path.lo
  CC       vssh/libcurl_la-wolfssh.lo
  CCLD     libcurl.la
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/lib'
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/lib'
Making all in docs
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
Making all in .
make[2]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
make[2]: Nothing to be done for 'all-am'.
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
Making all in cmdline-opts
make[2]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/cmdline-opts'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/cmdline-opts'
Making all in libcurl
make[2]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl'
Making all in opts
make[3]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl/opts'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl/opts'
make[3]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl'
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl'
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
Making all in src
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/src'
  CC       curl-tool_bname.o
  CC       curl-terminal.o
  CC       curl-slist_wc.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_soc.o
  CC       curl-tool_cb_see.o
  CC       curl-tool_cb_wrt.o
  CC       curl-tool_cfgable.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_stderr.o
  CC       curl-tool_strdup.o
  CC       curl-tool_ssls.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
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       ../lib/curl-base64.o
  CC       ../lib/curl-curl_multibyte.o
  CC       ../lib/curl-dynbuf.o
  CC       ../lib/curl-nonblock.o
  CC       ../lib/curl-strtoofft.o
  CC       ../lib/curl-strparse.o
  CC       ../lib/curl-strcase.o
  CC       ../lib/curl-timediff.o
  CC       ../lib/curl-version_win32.o
  CC       ../lib/curl-warnless.o
  CC       curl-tool_hugehelp.o
  CC       curl-tool_ca_embed.o
  CCLD     curl
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/src'
Making all in scripts
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/scripts'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/scripts'
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0'
make[1]: Nothing to be done for 'all-am'.
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0'

Commit Diff GitHub →

tests/server/mqttd.c+51 -81
@@ -63,12 +63,6 @@
/* include memdebug.h last */
#include "memdebug.h"
-#define DEFAULT_PORT 1883 /* MQTT default port */
-
-#ifndef DEFAULT_CONFIG
-#define DEFAULT_CONFIG "mqttd.config"
-#endif
-
#define MQTT_MSG_CONNECT 0x10
#define MQTT_MSG_CONNACK 0x20
#define MQTT_MSG_PUBLISH 0x30
@@ -77,7 +71,7 @@
#define MQTT_MSG_SUBACK 0x90
#define MQTT_MSG_DISCONNECT 0xe0
-struct configurable {
+struct mqttd_configurable {
unsigned char version; /* initial version byte in the request must match
this */
bool publish_before_suback;
@@ -90,39 +84,23 @@ struct configurable {
#define REQUEST_DUMP "server.input"
#define CONFIG_VERSION 5
-static struct configurable config;
-
-static const char *configfile = DEFAULT_CONFIG;
-static const char *logdir = "log";
-static char loglockfile[256];
-
-#ifdef USE_IPV6
-static bool use_ipv6 = FALSE;
-#endif
-static const char *ipv_inuse = "IPv4";
-static unsigned short port = DEFAULT_PORT;
+static struct mqttd_configurable m_config;
-static void resetdefaults(void)
+static void mqttd_resetdefaults(void)
{
logmsg("Reset to defaults");
- config.version = CONFIG_VERSION;
- config.publish_before_suback = FALSE;
- config.short_publish = FALSE;
- config.excessive_remaining = FALSE;
- config.error_connack = 0;
- config.testnum = 0;
+ m_config.version = CONFIG_VERSION;
+ m_config.publish_before_suback = FALSE;
+ m_config.short_publish = FALSE;
+ m_config.excessive_remaining = FALSE;
+ m_config.error_connack = 0;
+ m_config.testnum = 0;
}
-static unsigned char byteval(char *value)
-{
- unsigned long num = strtoul(value, NULL, 10);
- return num & 0xff;
-}
-
-static void getconfig(void)
+static void mqttd_getconfig(void)
{
FILE *fp = fopen(configfile, FOPEN_READTEXT);
- resetdefaults();
+ mqttd_resetdefaults();
if(fp) {
char buffer[512];
logmsg("parse config file");
@@ -131,28 +109,28 @@ static void getconfig(void)
char value[32];
if(2 == sscanf(buffer, "%31s %31s", key, value)) {
if(!strcmp(key, "version")) {
- config.version = byteval(value);
- logmsg("version [%d] set", config.version);
+ m_config.version = byteval(value);
+ logmsg("version [%d] set", m_config.version);
}
else if(!strcmp(key, "PUBLISH-before-SUBACK")) {
logmsg("PUBLISH-before-SUBACK set");
- config.publish_before_suback = TRUE;
+ m_config.publish_before_suback = TRUE;
}
else if(!strcmp(key, "short-PUBLISH")) {
logmsg("short-PUBLISH set");
- config.short_publish = TRUE;
+ m_config.short_publish = TRUE;
}
else if(!strcmp(key, "error-CONNACK")) {
- config.error_connack = byteval(value);
- logmsg("error-CONNACK = %d", config.error_connack);
+ m_config.error_connack = byteval(value);
+ logmsg("error-CONNACK = %d", m_config.error_connack);
}
else if(!strcmp(key, "Testnum")) {
- config.testnum = atoi(value);
- logmsg("testnum = %d", config.testnum);
+ m_config.testnum = atoi(value);
+ logmsg("testnum = %d", m_config.testnum);
}
else if(!strcmp(key, "excessive-remaining")) {
logmsg("excessive-remaining set");
- config.excessive_remaining = TRUE;
+ m_config.excessive_remaining = TRUE;
}
}
}
@@ -163,25 +141,6 @@ static void getconfig(void)
}
}
-static void loghex(unsigned char *buffer, ssize_t len)
-{
- char data[12000];
- ssize_t i;
- unsigned char *ptr = buffer;
- char *optr = data;
- ssize_t width = 0;
- int left = sizeof(data);
-
- for(i = 0; i < len && (left >= 0); i++) {
- msnprintf(optr, left, "%02x", ptr[i]);
- width += 2;
- optr += 2;
- left -= 2;
- }
- if(width)
- logmsg("'%s'", data);
-}
-
typedef enum {
FROM_CLIENT,
FROM_SERVER
@@ -218,7 +177,7 @@ static int connack(FILE *dump, curl_socket_t fd)
};
ssize_t rc;
- packet[3] = config.error_connack;
+ packet[3] = m_config.error_connack;
rc = swrite(fd, (char *)packet, sizeof(packet));
if(rc > 0) {
@@ -343,7 +302,7 @@ static size_t encode_length(size_t packetlen,
}
-static size_t decode_length(unsigned char *buf,
+static size_t decode_length(unsigned char *buffer,
size_t buflen, size_t *lenbytes)
{
size_t len = 0;
@@ -352,7 +311,7 @@ static size_t decode_length(unsigned char *buf,
unsigned char encoded = 0x80;
for(i = 0; (i < buflen) && (encoded & 0x80); i++) {
- encoded = buf[i];
+ encoded = buffer[i];
len += (encoded & 0x7f) * mult;
mult *= 0x80;
}
@@ -379,7 +338,7 @@ static int publish(FILE *dump,
unsigned char rembuffer[4];
size_t encodedlen;
- if(config.excessive_remaining) {
+ if(m_config.excessive_remaining) {
/* manually set illegal remaining length */
rembuffer[0] = 0xff;
rembuffer[1] = 0xff;
@@ -410,7 +369,7 @@ static int publish(FILE *dump,
memcpy(&packet[payloadindex], payload, payloadlen);
sendamount = packetlen;
- if(config.short_publish)
+ if(m_config.short_publish)
sendamount -= 2;
rc = swrite(fd, (char *)packet, sendamount);
@@ -493,9 +452,9 @@ static curl_socket_t mqttit(curl_socket_t fd)
if(!dump)
goto end;
- getconfig();
+ mqttd_getconfig();
- testno = config.testnum;
+ testno = m_config.testnum;
if(testno)
logmsg("Found test number %ld", testno);
@@ -627,7 +586,7 @@ static curl_socket_t mqttit(curl_socket_t fd)
stream = test2fopen(testno, logdir);
error = getpart(&data, &datalen, "reply", "data", stream);
if(!error) {
- if(!config.publish_before_suback) {
+ if(!m_config.publish_before_suback) {
if(suback(dump, fd, packet_id)) {
logmsg("failed sending SUBACK");
free(data);
@@ -640,7 +599,7 @@ static curl_socket_t mqttit(curl_socket_t fd)
goto end;
}
free(data);
- if(config.publish_before_suback) {
+ if(m_config.publish_before_suback) {
if(suback(dump, fd, packet_id)) {
logmsg("failed sending SUBACK");
goto end;
@@ -698,7 +657,7 @@ end:
if sockfd is CURL_SOCKET_BAD, listendfd is a listening socket we must
accept()
*/
-static bool incoming(curl_socket_t listenfd)
+static bool mqttd_incoming(curl_socket_t listenfd)
{
fd_set fds_read;
fd_set fds_write;
@@ -776,8 +735,9 @@ static bool incoming(curl_socket_t listenfd)
return TRUE;
}
-static curl_socket_t sockdaemon(curl_socket_t sock,
- unsigned short *listenport)
+static curl_socket_t mqttd_sockdaemon(curl_socket_t sock,
+ unsigned short *listenport,
+ bool bind_only)
{
/* passive daemon style */
srvr_sockaddr_union_t listener;
@@ -802,7 +762,9 @@ static curl_socket_t sockdaemon(curl_socket_t sock,
rc = wait_ms(delay);
if(rc) {
/* should not happen */
- logmsg("wait_ms() failed with error (%d)", rc);
+ error = errno;
+ logmsg("wait_ms() failed with error (%d) %s",
+ error, strerror(error));
sclose(sock);
return CURL_SOCKET_BAD;
}
@@ -896,6 +858,12 @@ static curl_socket_t sockdaemon(curl_socket_t sock,
}
}
+ /* bindonly option forces no listening */
+ if(bind_only) {
+ logmsg("instructed to bind port without listening");
+ return sock;
+ }
+
/* start accepting connections */
rc = listen(sock, 5);
if(0 != rc) {
@@ -916,13 +884,15 @@ int main(int argc, char *argv[])
curl_socket_t msgsock = CURL_SOCKET_BAD;
int wrotepidfile = 0;
int wroteportfile = 0;
- const char *pidname = ".mqttd.pid";
- const char *portname = ".mqttd.port";
bool juggle_again;
int error;
int arg = 1;
+ pidname = ".mqttd.pid";
+ portname = ".mqttd.port";
serverlogfile = "log/mqttd.log";
+ configfile = "mqttd.config";
+ server_port = 1883; /* MQTT default port */
while(argc > arg) {
if(!strcmp("--version", argv[arg])) {
@@ -986,7 +956,7 @@ int main(int argc, char *argv[])
argv[arg]);
return 0;
}
- port = util_ultous(ulnum);
+ server_port = util_ultous(ulnum);
arg++;
}
}
@@ -1036,7 +1006,7 @@ int main(int argc, char *argv[])
{
/* passive daemon style */
- sock = sockdaemon(sock, &port);
+ sock = mqttd_sockdaemon(sock, &server_port, FALSE);
if(CURL_SOCKET_BAD == sock) {
goto mqttd_cleanup;
}
@@ -1044,20 +1014,20 @@ int main(int argc, char *argv[])
}
logmsg("Running %s version", ipv_inuse);
- logmsg("Listening on port %hu", port);
+ logmsg("Listening on port %hu", server_port);
wrotepidfile = write_pidfile(pidname);
if(!wrotepidfile) {
goto mqttd_cleanup;
}
- wroteportfile = write_portfile(portname, port);
+ wroteportfile = write_portfile(portname, server_port);
if(!wroteportfile) {
goto mqttd_cleanup;
}
do {
- juggle_again = incoming(sock);
+ juggle_again = mqttd_incoming(sock);
} while(juggle_again);
mqttd_cleanup:
tests/server/resolve.c+9 -10
@@ -50,9 +50,6 @@
/* include memdebug.h last */
#include "memdebug.h"
-static bool use_ipv6 = FALSE;
-static const char *ipv_inuse = "IPv4";
-
int main(int argc, char *argv[])
{
int arg = 1;
@@ -71,14 +68,21 @@ int main(int argc, char *argv[])
return 0;
}
else if(!strcmp("--ipv6", argv[arg])) {
+#if defined(CURLRES_IPV6)
ipv_inuse = "IPv6";
use_ipv6 = TRUE;
arg++;
+#else
+ puts("IPv6 support has been disabled in this program");
+ return 1;
+#endif
}
else if(!strcmp("--ipv4", argv[arg])) {
/* for completeness, we support this option as well */
ipv_inuse = "IPv4";
+#if defined(CURLRES_IPV6)
use_ipv6 = FALSE;
+#endif
arg++;
}
else {
@@ -127,13 +131,8 @@ int main(int argc, char *argv[])
freeaddrinfo(ai);
}
#else
- if(use_ipv6) {
- puts("IPv6 support has been disabled in this program");
- return 1;
- }
- else {
- /* gethostbyname() resolve */
- struct hostent *he;
+ {
+ struct hostent *he; /* gethostbyname() resolve */
#ifdef __AMIGA__
he = gethostbyname((unsigned char *)host);
tests/server/rtspd.c+39 -51
@@ -56,19 +56,15 @@
/* include memdebug.h last */
#include "memdebug.h"
-#ifdef USE_IPV6
-static bool use_ipv6 = FALSE;
-#endif
-static const char *ipv_inuse = "IPv4";
-static int serverlogslocked = 0;
-
+#undef REQBUFSIZ
#define REQBUFSIZ 150000
-static long prevtestno = -1; /* previous test number we served */
-static long prevpartno = -1; /* previous part number we served */
-static bool prevbounce = FALSE; /* instructs the server to override the
- requested part number to prevpartno + 1 when
- prevtestno and current test are the same */
+static long rtspd_prevtestno = -1; /* previous test number we served */
+static long rtspd_prevpartno = -1; /* previous part number we served */
+static bool rtspd_prevbounce = FALSE; /* instructs the server to override the
+ requested part number to
+ prevpartno + 1 when prevtestno and
+ current test are the same */
#define RCMD_NORMALREQ 0 /* default request, use the tests file normally */
#define RCMD_IDLE 1 /* told to sit idle */
@@ -85,7 +81,7 @@ typedef enum {
#define SET_RTP_PKT_LEN(p,l) (((p)[2] = (char)(((l) >> 8) & 0xFF)), \
((p)[3] = (char)((l) & 0xFF)))
-struct httprequest {
+struct rtspd_httprequest {
char reqbuf[REQBUFSIZ]; /* buffer area for the incoming request */
size_t checkindex; /* where to start checking of the request */
size_t offset; /* size of the incoming request */
@@ -112,14 +108,6 @@ struct httprequest {
size_t rtp_buffersize;
};
-static int ProcessRequest(struct httprequest *req);
-static void storerequest(char *reqbuf, size_t totalsize);
-
-#define DEFAULT_PORT 8999
-
-static const char *logdir = "log";
-static char loglockfile[256];
-
#define RTSPDVERSION "curl test suite RTSP server/0.1"
#define REQUEST_DUMP "server.input"
@@ -145,7 +133,7 @@ static char loglockfile[256];
/* sent as reply to a QUIT */
-static const char *docquit =
+static const char *docquit_rtsp =
"HTTP/1.1 200 Goodbye" END_OF_HEADERS;
/* sent as reply to a CONNECT */
@@ -179,7 +167,7 @@ static const char *doc404_RTSP = "RTSP/1.0 404 Not Found\r\n"
#define RTP_DATA_SIZE 12
static const char *RTP_DATA = "$_1234\n\0Rsdf";
-static int ProcessRequest(struct httprequest *req)
+static int rtspd_ProcessRequest(struct rtspd_httprequest *req)
{
char *line = &req->reqbuf[req->checkindex];
bool chunked = FALSE;
@@ -189,7 +177,7 @@ static int ProcessRequest(struct httprequest *req)
int prot_major, prot_minor;
char *end = strstr(line, END_OF_HEADERS);
- logmsg("ProcessRequest() called with testno %ld and line [%s]",
+ logmsg("rtspd_ProcessRequest() called with testno %ld and line [%s]",
req->testno, line);
/* try to figure out the request characteristics as soon as possible, but
@@ -418,10 +406,10 @@ static int ProcessRequest(struct httprequest *req)
if(!end) {
/* we don't have a complete request yet! */
- logmsg("ProcessRequest returned without a complete request");
+ logmsg("rtspd_ProcessRequest returned without a complete request");
return 0; /* not complete yet */
}
- logmsg("ProcessRequest found a complete request");
+ logmsg("rtspd_ProcessRequest found a complete request");
if(req->pipe)
/* we do have a full set, advance the checkindex to after the end of the
@@ -573,7 +561,7 @@ static int ProcessRequest(struct httprequest *req)
}
/* store the entire request in a file */
-static void storerequest(char *reqbuf, size_t totalsize)
+static void rtspd_storerequest(char *reqbuf, size_t totalsize)
{
int res;
int error = 0;
@@ -627,7 +615,7 @@ storerequest_cleanup:
}
/* return 0 on success, non-zero on failure */
-static int get_request(curl_socket_t sock, struct httprequest *req)
+static int rtspd_get_request(curl_socket_t sock, struct rtspd_httprequest *req)
{
int error;
int fail = 0;
@@ -695,7 +683,7 @@ static int get_request(curl_socket_t sock, struct httprequest *req)
if(fail) {
/* dump the request received so far to the external file */
reqbuf[req->offset] = '\0';
- storerequest(reqbuf, req->offset);
+ rtspd_storerequest(reqbuf, req->offset);
return 1;
}
@@ -704,7 +692,7 @@ static int get_request(curl_socket_t sock, struct httprequest *req)
req->offset += (size_t)got;
reqbuf[req->offset] = '\0';
- done_processing = ProcessRequest(req);
+ done_processing = rtspd_ProcessRequest(req);
if(got_exit_signal)
return 1;
if(done_processing && req->pipe) {
@@ -730,7 +718,7 @@ static int get_request(curl_socket_t sock, struct httprequest *req)
reqbuf[req->offset] = '\0';
/* dump the request to an external file */
- storerequest(reqbuf, req->pipelining ? req->checkindex : req->offset);
+ rtspd_storerequest(reqbuf, req->pipelining ? req->checkindex : req->offset);
if(got_exit_signal)
return 1;
@@ -738,7 +726,7 @@ static int get_request(curl_socket_t sock, struct httprequest *req)
}
/* returns -1 on failure */
-static int send_doc(curl_socket_t sock, struct httprequest *req)
+static int rtspd_send_doc(curl_socket_t sock, struct rtspd_httprequest *req)
{
ssize_t written;
size_t count;
@@ -791,7 +779,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
switch(req->testno) {
case DOCNUMBER_QUIT:
logmsg("Replying to QUIT");
- buffer = docquit;
+ buffer = docquit_rtsp;
break;
case DOCNUMBER_WERULEZ:
/* we got a "friends?" question, reply back that we sure are */
@@ -890,11 +878,11 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
logmsg("connection close instruction \"swsclose\" found in response");
}
if(strstr(buffer, "swsbounce")) {
- prevbounce = TRUE;
+ rtspd_prevbounce = TRUE;
logmsg("enable \"swsbounce\" in the next request");
}
else
- prevbounce = FALSE;
+ rtspd_prevbounce = FALSE;
dump = fopen(responsedump, "ab");
if(!dump) {
@@ -1016,8 +1004,8 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
free(cmd);
req->open = persistent;
- prevtestno = req->testno;
- prevpartno = req->partno;
+ rtspd_prevtestno = req->testno;
+ rtspd_prevpartno = req->partno;
return 0;
}
@@ -1031,17 +1019,17 @@ int main(int argc, char *argv[])
int wrotepidfile = 0;
int wroteportfile = 0;
int flag;
- unsigned short port = DEFAULT_PORT;
- const char *pidname = ".rtsp.pid";
- const char *portname = NULL; /* none by default */
- struct httprequest req;
+ unsigned short port = 8999;
+ struct rtspd_httprequest req;
int rc;
int error;
int arg = 1;
memset(&req, 0, sizeof(req));
+ pidname = ".rtsp.pid";
serverlogfile = "log/rtspd.log";
+ serverlogslocked = 0;
while(argc > arg) {
if(!strcmp("--version", argv[arg])) {
@@ -1284,9 +1272,9 @@ int main(int argc, char *argv[])
}
#endif
- /* initialization of httprequest struct is done in get_request(), but due
- to pipelining treatment the pipelining struct field must be initialized
- previously to FALSE every time a new connection arrives. */
+ /* initialization of httprequest struct is done in rtspd_get_request(),
+ but due to pipelining treatment the pipelining struct field must be
+ initialized previously to FALSE every time a new connection arrives. */
req.pipelining = FALSE;
@@ -1294,24 +1282,24 @@ int main(int argc, char *argv[])
if(got_exit_signal)
break;
- if(get_request(msgsock, &req))
+ if(rtspd_get_request(msgsock, &req))
/* non-zero means error, break out of loop */
break;
- if(prevbounce) {
+ if(rtspd_prevbounce) {
/* bounce treatment requested */
- if(req.testno == prevtestno) {
- req.partno = prevpartno + 1;
+ if(req.testno == rtspd_prevtestno) {
+ req.partno = rtspd_prevpartno + 1;
logmsg("BOUNCE part number to %ld", req.partno);
}
else {
- prevbounce = FALSE;
- prevtestno = -1;
- prevpartno = -1;
+ rtspd_prevbounce = FALSE;
+ rtspd_prevtestno = -1;
+ rtspd_prevpartno = -1;
}
}
- send_doc(msgsock, &req);
+ rtspd_send_doc(msgsock, &req);
if(got_exit_signal)
break;
tests/server/sockfilt.c+24 -28
@@ -114,20 +114,14 @@
/* include memdebug.h last */
#include "memdebug.h"
-#define DEFAULT_PORT 8999
-
/* buffer is this excessively large only to be able to support things like
test 1003 which tests exceedingly large server response lines */
#define BUFFER_SIZE 17010
static bool verbose = FALSE;
-static bool bind_only = FALSE;
-#ifdef USE_IPV6
-static bool use_ipv6 = FALSE;
-#endif
-static const char *ipv_inuse = "IPv4";
-static unsigned short port = DEFAULT_PORT;
-static unsigned short connectport = 0; /* if non-zero, we activate this mode */
+static bool s_bind_only = FALSE;
+static unsigned short server_connectport = 0; /* if non-zero,
+ we activate this mode */
enum sockmode {
PASSIVE_LISTEN, /* as a server waiting for connections */
@@ -1126,7 +1120,8 @@ static bool juggle(curl_socket_t *sockfdp,
else if(!memcmp("PORT", buffer, 4)) {
/* Question asking us what PORT number we are listening to.
Replies to PORT with "IPv[num]/[port]" */
- msnprintf((char *)buffer, sizeof(buffer), "%s/%hu\n", ipv_inuse, port);
+ msnprintf((char *)buffer, sizeof(buffer), "%s/%hu\n",
+ ipv_inuse, server_port);
buffer_len = (ssize_t)strlen((char *)buffer);
msnprintf(data, sizeof(data), "PORT\n%04zx\n", buffer_len);
if(!write_stdout(data, 10))
@@ -1231,8 +1226,9 @@ static bool juggle(curl_socket_t *sockfdp,
#endif
}
-static curl_socket_t sockdaemon(curl_socket_t sock,
- unsigned short *listenport)
+static curl_socket_t sockfilt_sockdaemon(curl_socket_t sock,
+ unsigned short *listenport,
+ bool bind_only)
{
/* passive daemon style */
srvr_sockaddr_union_t listener;
@@ -1380,8 +1376,6 @@ int main(int argc, char *argv[])
curl_socket_t msgsock = CURL_SOCKET_BAD;
int wrotepidfile = 0;
int wroteportfile = 0;
- const char *pidname = ".sockfilt.pid";
- const char *portname = NULL; /* none by default */
bool juggle_again;
int rc;
int error;
@@ -1389,7 +1383,9 @@ int main(int argc, char *argv[])
enum sockmode mode = PASSIVE_LISTEN; /* default */
const char *addr = NULL;
+ pidname = ".sockfilt.pid";
serverlogfile = "log/sockfilt.log";
+ server_port = 8999;
while(argc > arg) {
if(!strcmp("--version", argv[arg])) {
@@ -1437,7 +1433,7 @@ int main(int argc, char *argv[])
arg++;
}
else if(!strcmp("--bindonly", argv[arg])) {
- bind_only = TRUE;
+ s_bind_only = TRUE;
arg++;
}
else if(!strcmp("--port", argv[arg])) {
@@ -1445,7 +1441,7 @@ int main(int argc, char *argv[])
if(argc > arg) {
char *endptr;
unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
- port = util_ultous(ulnum);
+ server_port = util_ultous(ulnum);
arg++;
}
}
@@ -1462,7 +1458,7 @@ int main(int argc, char *argv[])
argv[arg]);
return 0;
}
- connectport = util_ultous(ulnum);
+ server_connectport = util_ultous(ulnum);
arg++;
}
}
@@ -1518,7 +1514,7 @@ int main(int argc, char *argv[])
goto sockfilt_cleanup;
}
- if(connectport) {
+ if(server_connectport) {
/* Active mode, we should connect to the given port number */
mode = ACTIVE;
#ifdef USE_IPV6
@@ -1526,7 +1522,7 @@ int main(int argc, char *argv[])
#endif
memset(&me.sa4, 0, sizeof(me.sa4));
me.sa4.sin_family = AF_INET;
- me.sa4.sin_port = htons(connectport);
+ me.sa4.sin_port = htons(server_connectport);
me.sa4.sin_addr.s_addr = INADDR_ANY;
if(!addr)
addr = "127.0.0.1";
@@ -1538,7 +1534,7 @@ int main(int argc, char *argv[])
else {
memset(&me.sa6, 0, sizeof(me.sa6));
me.sa6.sin6_family = AF_INET6;
- me.sa6.sin6_port = htons(connectport);
+ me.sa6.sin6_port = htons(server_connectport);
if(!addr)
addr = "::1";
Curl_inet_pton(AF_INET6, addr, &me.sa6.sin6_addr);
@@ -1549,7 +1545,7 @@ int main(int argc, char *argv[])
if(rc) {
error = SOCKERRNO;
logmsg("Error connecting to port %hu (%d) %s",
- connectport, error, sstrerror(error));
+ server_connectport, error, sstrerror(error));
write_stdout("FAIL\n", 5);
goto sockfilt_cleanup;
}
@@ -1558,7 +1554,7 @@ int main(int argc, char *argv[])
}
else {
/* passive daemon style */
- sock = sockdaemon(sock, &port);
+ sock = sockfilt_sockdaemon(sock, &server_port, s_bind_only);
if(CURL_SOCKET_BAD == sock) {
write_stdout("FAIL\n", 5);
goto sockfilt_cleanup;
@@ -1568,12 +1564,12 @@ int main(int argc, char *argv[])
logmsg("Running %s version", ipv_inuse);
- if(connectport)
- logmsg("Connected to port %hu", connectport);
- else if(bind_only)
- logmsg("Bound without listening on port %hu", port);
+ if(server_connectport)
+ logmsg("Connected to port %hu", server_connectport);
+ else if(s_bind_only)
+ logmsg("Bound without listening on port %hu", server_port);
else
- logmsg("Listening on port %hu", port);
+ logmsg("Listening on port %hu", server_port);
wrotepidfile = write_pidfile(pidname);
if(!wrotepidfile) {
@@ -1581,7 +1577,7 @@ int main(int argc, char *argv[])
goto sockfilt_cleanup;
}
if(portname) {
- wroteportfile = write_portfile(portname, port);
+ wroteportfile = write_portfile(portname, server_port);
if(!wroteportfile) {
write_stdout("FAIL\n", 5);
goto sockfilt_cleanup;
tests/server/socksd.c+86 -122
@@ -85,20 +85,10 @@
/* include memdebug.h last */
#include "memdebug.h"
-#define DEFAULT_PORT 8905
-
-#ifndef DEFAULT_REQFILE
-#define DEFAULT_REQFILE "log/socksd-request.log"
-#endif
-
-#ifndef DEFAULT_CONFIG
-#define DEFAULT_CONFIG "socksd.config"
-#endif
-
static const char *backendaddr = "127.0.0.1";
static unsigned short backendport = 0; /* default is use client's */
-struct configurable {
+struct socksd_configurable {
unsigned char version; /* initial version byte in the request must match
this */
unsigned char nmethods_min; /* minimum number of nmethods to expect */
@@ -123,34 +113,24 @@ struct configurable {
#define CONFIG_ADDR backendaddr
#define CONFIG_CONNECTREP 0
-static struct configurable config;
-
-static const char *reqlogfile = DEFAULT_REQFILE;
-static const char *configfile = DEFAULT_CONFIG;
+static struct socksd_configurable s_config;
-static const char *socket_type = "IPv4";
-static unsigned short port = DEFAULT_PORT;
+static const char *reqlogfile = "log/socksd-request.log";
-static void resetdefaults(void)
+static void socksd_resetdefaults(void)
{
logmsg("Reset to defaults");
- config.version = CONFIG_VERSION;
- config.nmethods_min = CONFIG_NMETHODS_MIN;
- config.nmethods_max = CONFIG_NMETHODS_MAX;
- config.responseversion = CONFIG_RESPONSEVERSION;
- config.responsemethod = CONFIG_RESPONSEMETHOD;
- config.reqcmd = CONFIG_REQCMD;
- config.connectrep = CONFIG_CONNECTREP;
- config.port = CONFIG_PORT;
- strcpy(config.addr, CONFIG_ADDR);
- strcpy(config.user, "user");
- strcpy(config.password, "password");
-}
-
-static unsigned char byteval(char *value)
-{
- unsigned long num = strtoul(value, NULL, 10);
- return num & 0xff;
+ s_config.version = CONFIG_VERSION;
+ s_config.nmethods_min = CONFIG_NMETHODS_MIN;
+ s_config.nmethods_max = CONFIG_NMETHODS_MAX;
+ s_config.responseversion = CONFIG_RESPONSEVERSION;
+ s_config.responsemethod = CONFIG_RESPONSEMETHOD;
+ s_config.reqcmd = CONFIG_REQCMD;
+ s_config.connectrep = CONFIG_CONNECTREP;
+ s_config.port = CONFIG_PORT;
+ strcpy(s_config.addr, CONFIG_ADDR);
+ strcpy(s_config.user, "user");
+ strcpy(s_config.password, "password");
}
static unsigned short shortval(char *value)
@@ -159,12 +139,10 @@ static unsigned short shortval(char *value)
return num & 0xffff;
}
-static int socket_domain = AF_INET;
-
-static void getconfig(void)
+static void socksd_getconfig(void)
{
FILE *fp = fopen(configfile, FOPEN_READTEXT);
- resetdefaults();
+ socksd_resetdefaults();
if(fp) {
char buffer[512];
logmsg("parse config file");
@@ -173,32 +151,32 @@ static void getconfig(void)
char value[260];
if(2 == sscanf(buffer, "%31s %259s", key, value)) {
if(!strcmp(key, "version")) {
- config.version = byteval(value);
- logmsg("version [%d] set", config.version);
+ s_config.version = byteval(value);
+ logmsg("version [%d] set", s_config.version);
}
else if(!strcmp(key, "nmethods_min")) {
- config.nmethods_min = byteval(value);
- logmsg("nmethods_min [%d] set", config.nmethods_min);
+ s_config.nmethods_min = byteval(value);
+ logmsg("nmethods_min [%d] set", s_config.nmethods_min);
}
else if(!strcmp(key, "nmethods_max")) {
- config.nmethods_max = byteval(value);
- logmsg("nmethods_max [%d] set", config.nmethods_max);
+ s_config.nmethods_max = byteval(value);
+ logmsg("nmethods_max [%d] set", s_config.nmethods_max);
}
else if(!strcmp(key, "backend")) {
- strcpy(config.addr, value);
- logmsg("backend [%s] set", config.addr);
+ strcpy(s_config.addr, value);
+ logmsg("backend [%s] set", s_config.addr);
}
else if(!strcmp(key, "backendport")) {
- config.port = shortval(value);
- logmsg("backendport [%d] set", config.port);
+ s_config.port = shortval(value);
+ logmsg("backendport [%d] set", s_config.port);
}
else if(!strcmp(key, "user")) {
- strcpy(config.user, value);
- logmsg("user [%s] set", config.user);
+ strcpy(s_config.user, value);
+ logmsg("user [%s] set", s_config.user);
}
else if(!strcmp(key, "password")) {
- strcpy(config.password, value);
- logmsg("password [%s] set", config.password);
+ strcpy(s_config.password, value);
+ logmsg("password [%s] set", s_config.password);
}
/* Methods:
o X'00' NO AUTHENTICATION REQUIRED
@@ -206,12 +184,12 @@ static void getconfig(void)
o X'02' USERNAME/PASSWORD
*/
else if(!strcmp(key, "method")) {
- config.responsemethod = byteval(value);
- logmsg("method [%d] set", config.responsemethod);
+ s_config.responsemethod = byteval(value);
+ logmsg("method [%d] set", s_config.responsemethod);
}
else if(!strcmp(key, "response")) {
- config.connectrep = byteval(value);
- logmsg("response [%d] set", config.connectrep);
+ s_config.connectrep = byteval(value);
+ logmsg("response [%d] set", s_config.connectrep);
}
}
}
@@ -219,25 +197,6 @@ static void getconfig(void)
}
}
-static void loghex(unsigned char *buffer, ssize_t len)
-{
- char data[1200];
- ssize_t i;
- unsigned char *ptr = buffer;
- char *optr = data;
- ssize_t width = 0;
- int left = sizeof(data);
-
- for(i = 0; i < len && (left >= 0); i++) {
- msnprintf(optr, left, "%02x", ptr[i]);
- width += 2;
- optr += 2;
- left -= 2;
- }
- if(width)
- logmsg("'%s'", data);
-}
-
/* RFC 1928, SOCKS5 byte index */
#define SOCKS5_VERSION 0
#define SOCKS5_NMETHODS 1 /* number of methods that is listed */
@@ -303,13 +262,13 @@ static curl_socket_t socks4(curl_socket_t fd,
logmsg("SOCKS4 connect message too short: %zd", rc);
return CURL_SOCKET_BAD;
}
- if(!config.port)
+ if(!s_config.port)
s4port = (unsigned short)((buffer[SOCKS4_DSTPORT] << 8) |
(buffer[SOCKS4_DSTPORT + 1]));
else
- s4port = config.port;
+ s4port = s_config.port;
- connfd = socksconnect(s4port, config.addr);
+ connfd = socksconnect(s4port, s_config.addr);
if(connfd == CURL_SOCKET_BAD) {
/* failed */
cd = 91;
@@ -353,7 +312,7 @@ static curl_socket_t sockit(curl_socket_t fd)
curl_socket_t connfd = CURL_SOCKET_BAD;
unsigned short s5port;
- getconfig();
+ socksd_getconfig();
rc = recv(fd, (char *)buffer, sizeof(buffer), 0);
if(rc <= 0) {
@@ -372,14 +331,14 @@ static curl_socket_t sockit(curl_socket_t fd)
return CURL_SOCKET_BAD;
}
- if(buffer[SOCKS5_VERSION] != config.version) {
- logmsg("VERSION byte not %d", config.version);
+ if(buffer[SOCKS5_VERSION] != s_config.version) {
+ logmsg("VERSION byte not %d", s_config.version);
return CURL_SOCKET_BAD;
}
- if((buffer[SOCKS5_NMETHODS] < config.nmethods_min) ||
- (buffer[SOCKS5_NMETHODS] > config.nmethods_max)) {
+ if((buffer[SOCKS5_NMETHODS] < s_config.nmethods_min) ||
+ (buffer[SOCKS5_NMETHODS] > s_config.nmethods_max)) {
logmsg("NMETHODS byte not within %d - %d ",
- config.nmethods_min, config.nmethods_max);
+ s_config.nmethods_min, s_config.nmethods_max);
return CURL_SOCKET_BAD;
}
/* after NMETHODS follows that many bytes listing the methods the client
@@ -391,8 +350,8 @@ static curl_socket_t sockit(curl_socket_t fd)
logmsg("Incoming request deemed fine!");
/* respond with two bytes: VERSION + METHOD */
- response[0] = config.responseversion;
- response[1] = config.responsemethod;
+ response[0] = s_config.responseversion;
+ response[1] = s_config.responsemethod;
rc = (send)(fd, (char *)response, 2, 0);
if(rc != 2) {
logmsg("Sending response failed!");
@@ -411,7 +370,7 @@ static curl_socket_t sockit(curl_socket_t fd)
logmsg("READ %zd bytes", rc);
loghex(buffer, rc);
- if(config.responsemethod == 2) {
+ if(s_config.responsemethod == 2) {
/* RFC 1929 authentication
+----+------+----------+------+----------+
|VER | ULEN | UNAME | PLEN | PASSWD |
@@ -440,10 +399,10 @@ static curl_socket_t sockit(curl_socket_t fd)
logmsg("Too short packet for ulen %d plen %d: %zd", ulen, plen, rc);
return CURL_SOCKET_BAD;
}
- if((ulen != strlen(config.user)) ||
- (plen != strlen(config.password)) ||
- memcmp(&buffer[SOCKS5_UNAME], config.user, ulen) ||
- memcmp(&buffer[SOCKS5_UNAME + ulen + 1], config.password, plen)) {
+ if((ulen != strlen(s_config.user)) ||
+ (plen != strlen(s_config.password)) ||
+ memcmp(&buffer[SOCKS5_UNAME], s_config.user, ulen) ||
+ memcmp(&buffer[SOCKS5_UNAME + ulen + 1], s_config.password, plen)) {
/* no match! */
logmsg("mismatched credentials!");
login = FALSE;
@@ -475,18 +434,18 @@ static curl_socket_t sockit(curl_socket_t fd)
return CURL_SOCKET_BAD;
}
- if(buffer[SOCKS5_VERSION] != config.version) {
- logmsg("Request VERSION byte not %d", config.version);
+ if(buffer[SOCKS5_VERSION] != s_config.version) {
+ logmsg("Request VERSION byte not %d", s_config.version);
return CURL_SOCKET_BAD;
}
/* 1 == CONNECT */
- if(buffer[SOCKS5_REQCMD] != config.reqcmd) {
- logmsg("Request COMMAND byte not %d", config.reqcmd);
+ if(buffer[SOCKS5_REQCMD] != s_config.reqcmd) {
+ logmsg("Request COMMAND byte not %d", s_config.reqcmd);
return CURL_SOCKET_BAD;
}
/* reserved, should be zero */
if(buffer[SOCKS5_RESERVED]) {
- logmsg("Request COMMAND byte not %d", config.reqcmd);
+ logmsg("Request COMMAND byte not %d", s_config.reqcmd);
return CURL_SOCKET_BAD;
}
/* ATYP:
@@ -550,26 +509,26 @@ static curl_socket_t sockit(curl_socket_t fd)
}
}
- if(!config.port) {
+ if(!s_config.port) {
unsigned char *portp = &buffer[SOCKS5_DSTADDR + len];
s5port = (unsigned short)((portp[0] << 8) | (portp[1]));
}
else
- s5port = config.port;
+ s5port = s_config.port;
- if(!config.connectrep)
- connfd = socksconnect(s5port, config.addr);
+ if(!s_config.connectrep)
+ connfd = socksconnect(s5port, s_config.addr);
if(connfd == CURL_SOCKET_BAD) {
/* failed */
rep = 1;
}
else {
- rep = config.connectrep;
+ rep = s_config.connectrep;
}
/* */
- response[SOCKS5_VERSION] = config.responseversion;
+ response[SOCKS5_VERSION] = s_config.responseversion;
/*
o REP Reply field:
@@ -663,7 +622,7 @@ static int tunnel(struct perclient *cp, fd_set *fds)
if sockfd is CURL_SOCKET_BAD, listendfd is a listening socket we must
accept()
*/
-static bool incoming(curl_socket_t listenfd)
+static bool socksd_incoming(curl_socket_t listenfd)
{
fd_set fds_read;
fd_set fds_write;
@@ -799,12 +758,10 @@ static bool incoming(curl_socket_t listenfd)
return TRUE;
}
-static curl_socket_t sockdaemon(curl_socket_t sock,
- unsigned short *listenport
-#ifdef USE_UNIX_SOCKETS
- , const char *unix_socket
-#endif
- )
+static curl_socket_t socksd_sockdaemon(curl_socket_t sock,
+ unsigned short *listenport,
+ const char *unix_socket,
+ bool bind_only)
{
/* passive daemon style */
srvr_sockaddr_union_t listener;
@@ -816,6 +773,10 @@ static curl_socket_t sockdaemon(curl_socket_t sock,
int attempt = 0;
int error = 0;
+#ifndef USE_UNIX_SOCKETS
+ (void)unix_socket;
+#endif
+
do {
attempt++;
flag = 1;
@@ -938,6 +899,12 @@ static curl_socket_t sockdaemon(curl_socket_t sock,
}
}
+ /* bindonly option forces no listening */
+ if(bind_only) {
+ logmsg("instructed to bind port without listening");
+ return sock;
+ }
+
/* start accepting connections */
rc = listen(sock, 5);
if(0 != rc) {
@@ -958,18 +925,19 @@ int main(int argc, char *argv[])
curl_socket_t msgsock = CURL_SOCKET_BAD;
int wrotepidfile = 0;
int wroteportfile = 0;
- const char *pidname = ".socksd.pid";
- const char *portname = NULL; /* none by default */
bool juggle_again;
int error;
int arg = 1;
-#ifdef USE_UNIX_SOCKETS
const char *unix_socket = NULL;
+#ifdef USE_UNIX_SOCKETS
bool unlink_socket = false;
#endif
+ pidname = ".socksd.pid";
serverlogfile = "log/socksd.log";
+ configfile = "socksd.config";
+ server_port = 8905;
while(argc > arg) {
if(!strcmp("--version", argv[arg])) {
@@ -1054,7 +1022,7 @@ int main(int argc, char *argv[])
if(argc > arg) {
char *endptr;
unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
- port = util_ultous(ulnum);
+ server_port = util_ultous(ulnum);
arg++;
}
}
@@ -1099,11 +1067,7 @@ int main(int argc, char *argv[])
{
/* passive daemon style */
- sock = sockdaemon(sock, &port
-#ifdef USE_UNIX_SOCKETS
- , unix_socket
-#endif
- );
+ sock = socksd_sockdaemon(sock, &server_port, unix_socket, FALSE);
if(CURL_SOCKET_BAD == sock) {
goto socks5_cleanup;
}
@@ -1120,7 +1084,7 @@ int main(int argc, char *argv[])
logmsg("Listening on Unix socket %s", unix_socket);
else
#endif
- logmsg("Listening on port %hu", port);
+ logmsg("Listening on port %hu", server_port);
wrotepidfile = write_pidfile(pidname);
if(!wrotepidfile) {
@@ -1128,14 +1092,14 @@ int main(int argc, char *argv[])
}
if(portname) {
- wroteportfile = write_portfile(portname, port);
+ wroteportfile = write_portfile(portname, server_port);
if(!wroteportfile) {
goto socks5_cleanup;
}
}
do {
- juggle_again = incoming(sock);
+ juggle_again = socksd_incoming(sock);
} while(juggle_again);
socks5_cleanup:
tests/server/sws.c+56 -64
@@ -58,26 +58,26 @@
/* include memdebug.h last */
#include "memdebug.h"
-static int socket_domain = AF_INET;
static bool use_gopher = FALSE;
-static int serverlogslocked = 0;
static bool is_proxy = FALSE;
+#undef REQBUFSIZ
#define REQBUFSIZ (2*1024*1024)
#define MAX_SLEEP_TIME_MS 250
-static long prevtestno = -1; /* previous test number we served */
-static long prevpartno = -1; /* previous part number we served */
-static bool prevbounce = FALSE; /* instructs the server to override the
- requested part number to prevpartno + 1 when
- prevtestno and current test are the same */
+static long sws_prevtestno = -1; /* previous test number we served */
+static long sws_prevpartno = -1; /* previous part number we served */
+static bool sws_prevbounce = FALSE; /* instructs the server to override the
+ requested part number to
+ prevpartno + 1 when prevtestno and
+ current test are the same */
#define RCMD_NORMALREQ 0 /* default request, use the tests file normally */
#define RCMD_IDLE 1 /* told to sit idle */
#define RCMD_STREAM 2 /* told to stream */
-struct httprequest {
+struct sws_httprequest {
char reqbuf[REQBUFSIZ]; /* buffer area for the incoming request */
bool connect_request; /* if a CONNECT */
unsigned short connect_port; /* the port number CONNECT used */
@@ -101,7 +101,7 @@ struct httprequest {
- skip bytes. */
int rcmd; /* doing a special command, see defines above */
int prot_version; /* HTTP version * 10 */
- int callcount; /* times ProcessRequest() gets called */
+ int callcount; /* times sws_ProcessRequest() gets called */
bool skipall; /* skip all incoming data */
bool noexpect; /* refuse Expect: (don't read the body) */
bool connmon; /* monitor the state of the connection, log disconnects */
@@ -117,14 +117,6 @@ struct httprequest {
static curl_socket_t all_sockets[MAX_SOCKETS];
static size_t num_sockets = 0;
-static int ProcessRequest(struct httprequest *req);
-static void storerequest(const char *reqbuf, size_t totalsize);
-
-#define DEFAULT_PORT 8999
-
-static const char *logdir = "log";
-static char loglockfile[256];
-
#define SWSVERSION "curl test suite HTTP server/0.1"
#define REQUEST_DUMP "server.input"
@@ -136,8 +128,7 @@ static char loglockfile[256];
#define RESPONSE_PROXY_DUMP "proxy.response"
/* file in which additional instructions may be found */
-#define DEFAULT_CMDFILE "log/server.cmd"
-static const char *cmdfile = DEFAULT_CMDFILE;
+static const char *cmdfile = "log/server.cmd";
/* very-big-path support */
#define MAXDOCNAMELEN 140000
@@ -174,7 +165,7 @@ static const char *cmdfile = DEFAULT_CMDFILE;
static const char *end_of_headers = END_OF_HEADERS;
/* sent as reply to a QUIT */
-static const char *docquit =
+static const char *docquit_sws =
"HTTP/1.1 200 Goodbye" END_OF_HEADERS;
/* send back this on 404 file not found */
@@ -212,7 +203,7 @@ static bool socket_domain_is_ip(void)
#endif
/* parse the file on disk that might have a test number for us */
-static int parse_cmdfile(struct httprequest *req)
+static int parse_cmdfile(struct sws_httprequest *req)
{
FILE *f = fopen(cmdfile, FOPEN_READTEXT);
if(f) {
@@ -230,7 +221,7 @@ static int parse_cmdfile(struct httprequest *req)
}
/* based on the testno, parse the correct server commands */
-static int parse_servercmd(struct httprequest *req)
+static int sws_parse_servercmd(struct sws_httprequest *req)
{
FILE *stream;
int error;
@@ -334,7 +325,7 @@ static int parse_servercmd(struct httprequest *req)
return 0; /* OK! */
}
-static int ProcessRequest(struct httprequest *req)
+static int sws_ProcessRequest(struct sws_httprequest *req)
{
char *line = &req->reqbuf[req->checkindex];
bool chunked = FALSE;
@@ -515,7 +506,7 @@ static int ProcessRequest(struct httprequest *req)
req->testno = DOCNUMBER_404;
}
else
- parse_servercmd(req);
+ sws_parse_servercmd(req);
}
else if((req->offset >= 3)) {
unsigned char *l = (unsigned char *)line;
@@ -544,7 +535,7 @@ static int ProcessRequest(struct httprequest *req)
}
/* find and parse <servercmd> for this test */
- parse_servercmd(req);
+ sws_parse_servercmd(req);
if(use_gopher) {
/* when using gopher we cannot check the request until the entire
@@ -757,7 +748,7 @@ static int ProcessRequest(struct httprequest *req)
}
/* store the entire request in a file */
-static void storerequest(const char *reqbuf, size_t totalsize)
+static void sws_storerequest(const char *reqbuf, size_t totalsize)
{
int res;
int error = 0;
@@ -811,7 +802,7 @@ storerequest_cleanup:
dumpfile, errno, strerror(errno));
}
-static void init_httprequest(struct httprequest *req)
+static void init_httprequest(struct sws_httprequest *req)
{
req->checkindex = 0;
req->offset = 0;
@@ -838,11 +829,11 @@ static void init_httprequest(struct httprequest *req)
req->upgrade_request = 0;
}
-static int send_doc(curl_socket_t sock, struct httprequest *req);
+static int sws_send_doc(curl_socket_t sock, struct sws_httprequest *req);
/* returns 1 if the connection should be serviced again immediately, 0 if there
is no data waiting, or < 0 if it should be closed */
-static int get_request(curl_socket_t sock, struct httprequest *req)
+static int sws_get_request(curl_socket_t sock, struct sws_httprequest *req)
{
int fail = 0;
char *reqbuf = req->reqbuf;
@@ -852,11 +843,11 @@ static int get_request(curl_socket_t sock, struct httprequest *req)
if(req->upgrade_request) {
/* upgraded connection, work it differently until end of connection */
logmsg("Upgraded connection, this is no longer HTTP/1");
- send_doc(sock, req);
+ sws_send_doc(sock, req);
/* dump the request received so far to the external file */
reqbuf[req->offset] = '\0';
- storerequest(reqbuf, req->offset);
+ sws_storerequest(reqbuf, req->offset);
req->offset = 0;
/* read websocket traffic */
@@ -906,7 +897,7 @@ static int get_request(curl_socket_t sock, struct httprequest *req)
logmsg("log the websocket traffic");
/* dump the incoming websocket traffic to the external file */
reqbuf[req->offset] = '\0';
- storerequest(reqbuf, req->offset);
+ sws_storerequest(reqbuf, req->offset);
req->offset = 0;
}
init_httprequest(req);
@@ -945,7 +936,7 @@ static int get_request(curl_socket_t sock, struct httprequest *req)
if(fail) {
/* dump the request received so far to the external file */
reqbuf[req->offset] = '\0';
- storerequest(reqbuf, req->offset);
+ sws_storerequest(reqbuf, req->offset);
return -1;
}
@@ -954,7 +945,7 @@ static int get_request(curl_socket_t sock, struct httprequest *req)
req->offset += (size_t)got;
reqbuf[req->offset] = '\0';
- req->done_processing = ProcessRequest(req);
+ req->done_processing = sws_ProcessRequest(req);
if(got_exit_signal)
return -1;
}
@@ -976,7 +967,7 @@ static int get_request(curl_socket_t sock, struct httprequest *req)
/* at the end of a request dump it to an external file */
if(fail || req->done_processing)
- storerequest(reqbuf, req->offset);
+ sws_storerequest(reqbuf, req->offset);
if(got_exit_signal)
return -1;
@@ -984,7 +975,7 @@ static int get_request(curl_socket_t sock, struct httprequest *req)
}
/* returns -1 on failure */
-static int send_doc(curl_socket_t sock, struct httprequest *req)
+static int sws_send_doc(curl_socket_t sock, struct sws_httprequest *req)
{
ssize_t written;
size_t count;
@@ -1036,7 +1027,7 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
switch(req->testno) {
case DOCNUMBER_QUIT:
logmsg("Replying to QUIT");
- buffer = docquit;
+ buffer = docquit_sws;
break;
case DOCNUMBER_WERULEZ:
/* we got a "friends?" question, reply back that we sure are */
@@ -1130,11 +1121,11 @@ static int send_doc(curl_socket_t sock, struct httprequest *req)
logmsg("connection close instruction \"swsclose\" found in response");
}
if(strstr(buffer, "swsbounce")) {
- prevbounce = TRUE;
+ sws_prevbounce = TRUE;
logmsg("enable \"swsbounce\" in the next request");
}
else
- prevbounce = FALSE;
+ sws_prevbounce = FALSE;
dump = fopen(responsedump, "ab");
if(!dump) {
@@ -1204,8 +1195,8 @@ retry:
logmsg("Sending response failed. Only (%zu bytes) of (%zu bytes) "
"were sent",
responsesize-count, responsesize);
- prevtestno = req->testno;
- prevpartno = req->partno;
+ sws_prevtestno = req->testno;
+ sws_prevpartno = req->partno;
free(ptr);
free(cmd);
return -1;
@@ -1252,8 +1243,8 @@ retry:
free(cmd);
req->open = use_gopher ? FALSE : persistent;
- prevtestno = req->testno;
- prevpartno = req->partno;
+ sws_prevtestno = req->testno;
+ sws_prevpartno = req->partno;
return 0;
}
@@ -1586,7 +1577,7 @@ static void http_connect(curl_socket_t *infdp,
/* a new connection on listener socket (most likely from client) */
curl_socket_t datafd = accept(rootfd, NULL, NULL);
if(datafd != CURL_SOCKET_BAD) {
- static struct httprequest *req2;
+ static struct sws_httprequest *req2;
int err = 0;
if(!req2) {
req2 = malloc(sizeof(*req2));
@@ -1606,7 +1597,7 @@ static void http_connect(curl_socket_t *infdp,
#endif
init_httprequest(req2);
while(!req2->done_processing) {
- err = get_request(datafd, req2);
+ err = sws_get_request(datafd, req2);
if(err < 0) {
/* this socket must be closed, done or not */
break;
@@ -1615,7 +1606,7 @@ static void http_connect(curl_socket_t *infdp,
/* skip this and close the socket if err < 0 */
if(err >= 0) {
- err = send_doc(datafd, req2);
+ err = sws_send_doc(datafd, req2);
if(!err && req2->connect_request) {
/* sleep to prevent triggering libcurl known bug #39. */
for(loop = 2; (loop > 0) && !got_exit_signal; loop--)
@@ -1849,7 +1840,7 @@ http_connect_cleanup:
*infdp = CURL_SOCKET_BAD;
}
-static void http_upgrade(struct httprequest *req)
+static void http_upgrade(struct sws_httprequest *req)
{
(void)req;
logmsg("Upgraded to ... %u", req->upgrade_request);
@@ -1938,7 +1929,8 @@ static curl_socket_t accept_connection(curl_socket_t sock)
/* returns 1 if the connection should be serviced again immediately, 0 if there
is no data waiting, or < 0 if it should be closed */
-static int service_connection(curl_socket_t msgsock, struct httprequest *req,
+static int service_connection(curl_socket_t msgsock,
+ struct sws_httprequest *req,
curl_socket_t listensock,
const char *connecthost,
int keepalive_secs)
@@ -1947,27 +1939,27 @@ static int service_connection(curl_socket_t msgsock, struct httprequest *req,
return -1;
while(!req->done_processing) {
- int rc = get_request(msgsock, req);
+ int rc = sws_get_request(msgsock, req);
if(rc <= 0) {
/* Nothing further to read now, possibly because the socket was closed */
return rc;
}
}
- if(prevbounce) {
+ if(sws_prevbounce) {
/* bounce treatment requested */
- if(req->testno == prevtestno) {
- req->partno = prevpartno + 1;
+ if(req->testno == sws_prevtestno) {
+ req->partno = sws_prevpartno + 1;
logmsg("BOUNCE part number to %ld", req->partno);
}
else {
- prevbounce = FALSE;
- prevtestno = -1;
- prevpartno = -1;
+ sws_prevbounce = FALSE;
+ sws_prevtestno = -1;
+ sws_prevpartno = -1;
}
}
- send_doc(msgsock, req);
+ sws_send_doc(msgsock, req);
if(got_exit_signal)
return -1;
@@ -2019,19 +2011,16 @@ int main(int argc, char *argv[])
int wrotepidfile = 0;
int wroteportfile = 0;
int flag;
- unsigned short port = DEFAULT_PORT;
+ unsigned short port = 8999;
#ifdef USE_UNIX_SOCKETS
const char *unix_socket = NULL;
bool unlink_socket = false;
#endif
- const char *pidname = ".http.pid";
- const char *portname = ".http.port";
- struct httprequest *req = NULL;
+ struct sws_httprequest *req = NULL;
int rc = 0;
int error;
int arg = 1;
const char *connecthost = "127.0.0.1";
- const char *socket_type = "IPv4";
char port_str[11];
const char *location_str = port_str;
int keepalive_secs = 5;
@@ -2040,7 +2029,10 @@ int main(int argc, char *argv[])
/* a default CONNECT port is basically pointless but still ... */
size_t socket_idx;
+ pidname = ".http.pid";
+ portname = ".http.port";
serverlogfile = "log/sws.log";
+ serverlogslocked = 0;
while(argc > arg) {
if(!strcmp("--version", argv[arg])) {
@@ -2337,8 +2329,8 @@ int main(int argc, char *argv[])
if(!wroteportfile)
goto sws_cleanup;
- /* initialization of httprequest struct is done before get_request(), but
- the pipelining struct field must be initialized previously to FALSE
+ /* initialization of httprequest struct is done before sws_get_request(),
+ but the pipelining struct field must be initialized previously to FALSE
every time a new connection arrives. */
init_httprequest(req);
@@ -2440,7 +2432,7 @@ int main(int argc, char *argv[])
if(req->connmon) {
const char *keepopen = "[DISCONNECT]\n";
- storerequest(keepopen, strlen(keepopen));
+ sws_storerequest(keepopen, strlen(keepopen));
}
if(!req->open)
tests/server/tftpd.c+25 -35
@@ -152,8 +152,6 @@ struct bf {
#define REQUEST_DUMP "server.input"
-#define DEFAULT_PORT 8999 /* UDP */
-
/*****************************************************************************
* GLOBAL VARIABLES *
*****************************************************************************/
@@ -185,7 +183,7 @@ static int current; /* index of buffer in use */
static int newline = 0; /* fillbuf: in middle of newline expansion */
static int prevchar = -1; /* putbuf: previous char (cr check) */
-static tftphdr_storage_t buf;
+static tftphdr_storage_t trsbuf;
static tftphdr_storage_t ackbuf;
static srvr_sockaddr_union_t from;
@@ -196,18 +194,8 @@ static curl_socket_t peer = CURL_SOCKET_BAD;
static unsigned int timeout;
static unsigned int maxtimeout = 5 * TIMEOUT;
-#ifdef USE_IPV6
-static bool use_ipv6 = FALSE;
-#endif
-static const char *ipv_inuse = "IPv4";
-
-static const char *logdir = "log";
-static char loglockfile[256];
-static const char *pidname = ".tftpd.pid";
-static const char *portname = NULL; /* none by default */
-static int serverlogslocked = 0;
-static int wrotepidfile = 0;
-static int wroteportfile = 0;
+static int tftpd_wrotepidfile = 0;
+static int tftpd_wroteportfile = 0;
#ifdef HAVE_SIGSETJMP
static sigjmp_buf timeoutbuf;
@@ -282,12 +270,12 @@ static void timer(int signum)
timeout += rexmtval;
if(timeout >= maxtimeout) {
- if(wrotepidfile) {
- wrotepidfile = 0;
+ if(tftpd_wrotepidfile) {
+ tftpd_wrotepidfile = 0;
unlink(pidname);
}
- if(wroteportfile) {
- wroteportfile = 0;
+ if(tftpd_wroteportfile) {
+ tftpd_wroteportfile = 0;
unlink(portname);
}
if(serverlogslocked) {
@@ -549,7 +537,7 @@ int main(int argc, char **argv)
struct tftphdr *tp;
ssize_t n = 0;
int arg = 1;
- unsigned short port = DEFAULT_PORT;
+ unsigned short port = 8999; /* UDP */
curl_socket_t sock = CURL_SOCKET_BAD;
int flag;
int rc;
@@ -559,7 +547,9 @@ int main(int argc, char **argv)
memset(&test, 0, sizeof(test));
+ pidname = ".tftpd.pid";
serverlogfile = "log/tftpd.log";
+ serverlogslocked = 0;
while(argc > arg) {
if(!strcmp("--version", argv[arg])) {
@@ -743,15 +733,15 @@ int main(int argc, char **argv)
}
}
- wrotepidfile = write_pidfile(pidname);
- if(!wrotepidfile) {
+ tftpd_wrotepidfile = write_pidfile(pidname);
+ if(!tftpd_wrotepidfile) {
result = 1;
goto tftpd_cleanup;
}
if(portname) {
- wroteportfile = write_portfile(portname, port);
- if(!wroteportfile) {
+ tftpd_wroteportfile = write_portfile(portname, port);
+ if(!tftpd_wroteportfile) {
result = 1;
goto tftpd_cleanup;
}
@@ -769,7 +759,7 @@ int main(int argc, char **argv)
else
fromlen = sizeof(from.sa6);
#endif
- n = (ssize_t)recvfrom(sock, &buf.storage[0], sizeof(buf.storage), 0,
+ n = (ssize_t)recvfrom(sock, &trsbuf.storage[0], sizeof(trsbuf.storage), 0,
&from.sa, &fromlen);
if(got_exit_signal)
break;
@@ -817,7 +807,7 @@ int main(int argc, char **argv)
maxtimeout = 5*TIMEOUT;
- tp = &buf.hdr;
+ tp = &trsbuf.hdr;
tp->th_opcode = ntohs(tp->th_opcode);
if(tp->th_opcode == opcode_RRQ || tp->th_opcode == opcode_WRQ) {
memset(&test, 0, sizeof(test));
@@ -854,9 +844,9 @@ tftpd_cleanup:
if(got_exit_signal)
logmsg("signalled to die");
- if(wrotepidfile)
+ if(tftpd_wrotepidfile)
unlink(pidname);
- if(wroteportfile)
+ if(tftpd_wroteportfile)
unlink(portname);
if(serverlogslocked) {
@@ -916,7 +906,7 @@ static int do_tftp(struct testcase *test, struct tftphdr *tp, ssize_t size)
filename = cp;
do {
bool endofit = true;
- while(cp < &buf.storage[size]) {
+ while(cp < &trsbuf.storage[size]) {
if(*cp == '\0') {
endofit = false;
break;
@@ -929,7 +919,7 @@ static int do_tftp(struct testcase *test, struct tftphdr *tp, ssize_t size)
/* before increasing pointer, make sure it is still within the legal
space */
- if((cp + 1) < &buf.storage[size]) {
+ if((cp + 1) < &trsbuf.storage[size]) {
++cp;
if(first) {
/* store the mode since we need it later */
@@ -1003,7 +993,7 @@ static int do_tftp(struct testcase *test, struct tftphdr *tp, ssize_t size)
}
/* Based on the testno, parse the correct server commands. */
-static int parse_servercmd(struct testcase *req)
+static int tftpd_parse_servercmd(struct testcase *req)
{
FILE *stream;
int error;
@@ -1117,7 +1107,7 @@ static int validate_access(struct testcase *test,
test->testno = testno;
- (void)parse_servercmd(test);
+ (void)tftpd_parse_servercmd(test);
stream = test2fopen(testno, logdir);
@@ -1324,7 +1314,7 @@ send_ack:
alarm(rexmtval);
#endif
/* normally times out and quits */
- n = sread(peer, &buf.storage[0], sizeof(buf.storage));
+ n = sread(peer, &trsbuf.storage[0], sizeof(trsbuf.storage));
#ifdef HAVE_ALARM
alarm(0);
#endif
@@ -1354,7 +1344,7 @@ static void nak(int error)
int length;
struct errmsg *pe;
- tp = &buf.hdr;
+ tp = &trsbuf.hdr;
tp->th_opcode = htons(opcode_ERROR);
tp->th_code = htons((unsigned short)error);
for(pe = errmsgs; pe->e_code >= 0; pe++)
@@ -1370,6 +1360,6 @@ static void nak(int error)
* report from glibc with FORTIFY_SOURCE */
memcpy(tp->th_msg, pe->e_msg, length + 1);
length += 5;
- if(swrite(peer, &buf.storage[0], length) != length)
+ if(swrite(peer, &trsbuf.storage[0], length) != length)
logmsg("nak: fail\n");
}
tests/server/util.c+61 -34
@@ -36,11 +36,6 @@
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
-#ifdef HAVE_POLL_H
-#include <poll.h>
-#elif defined(HAVE_SYS_POLL_H)
-#include <sys/poll.h>
-#endif
#ifdef MSDOS
#include <dos.h> /* delay() */
@@ -53,10 +48,23 @@
#include "curlx.h" /* from the private lib dir */
#include "getpart.h"
#include "util.h"
-#include "timeval.h"
#include "timediff.h"
-const char *serverlogfile = NULL; /* needs init from main() */
+/* need init from main() */
+const char *pidname = NULL;
+const char *portname = NULL; /* none by default */
+const char *serverlogfile = NULL;
+int serverlogslocked;
+const char *configfile = NULL;
+const char *logdir = "log";
+char loglockfile[256];
+#ifdef USE_IPV6
+bool use_ipv6 = FALSE;
+#endif
+const char *ipv_inuse = "IPv4";
+unsigned short server_port = 0;
+const char *socket_type = "IPv4";
+int socket_domain = AF_INET;
static struct timeval tvnow(void);
@@ -137,6 +145,31 @@ void logmsg(const char *msg, ...)
}
}
+void loghex(unsigned char *buffer, ssize_t len)
+{
+ char data[12000];
+ ssize_t i;
+ unsigned char *ptr = buffer;
+ char *optr = data;
+ ssize_t width = 0;
+ int left = sizeof(data);
+
+ for(i = 0; i < len && (left >= 0); i++) {
+ msnprintf(optr, left, "%02x", ptr[i]);
+ width += 2;
+ optr += 2;
+ left -= 2;
+ }
+ if(width)
+ logmsg("'%s'", data);
+}
+
+unsigned char byteval(char *value)
+{
+ unsigned long num = strtoul(value, NULL, 10);
+ return num & 0xff;
+}
+
#ifdef _WIN32
/* use instead of perror() on generic Windows */
static void win32_perror(const char *msg)
@@ -239,13 +272,6 @@ static long timediff(struct timeval newer, struct timeval older)
*/
int wait_ms(int timeout_ms)
{
-#if !defined(MSDOS) && !defined(USE_WINSOCK)
-#ifndef HAVE_POLL
- struct timeval pending_tv;
-#endif
- struct timeval initial_tv;
- int pending_ms;
-#endif
int r = 0;
if(!timeout_ms)
@@ -259,26 +285,27 @@ int wait_ms(int timeout_ms)
#elif defined(USE_WINSOCK)
Sleep((DWORD)timeout_ms);
#else
- pending_ms = timeout_ms;
- initial_tv = tvnow();
- do {
- int error;
-#ifdef HAVE_POLL
- r = poll(NULL, 0, pending_ms);
-#else
- pending_tv.tv_sec = pending_ms / 1000;
- pending_tv.tv_usec = (pending_ms % 1000) * 1000;
- r = select(0, NULL, NULL, NULL, &pending_tv);
-#endif /* HAVE_POLL */
- if(r != -1)
- break;
- error = errno;
- if(error && (error != EINTR))
- break;
- pending_ms = timeout_ms - (int)timediff(tvnow(), initial_tv);
- if(pending_ms <= 0)
- break;
- } while(r == -1);
+ /* avoid using poll() for this since it behaves incorrectly with no sockets
+ on Apple operating systems */
+ {
+ struct timeval pending_tv;
+ struct timeval initial_tv = tvnow();
+ int pending_ms = timeout_ms;
+ do {
+ int error;
+ pending_tv.tv_sec = pending_ms / 1000;
+ pending_tv.tv_usec = (pending_ms % 1000) * 1000;
+ r = select(0, NULL, NULL, NULL, &pending_tv);
+ if(r != -1)
+ break;
+ error = errno;
+ if(error && (error != EINTR))
+ break;
+ pending_ms = timeout_ms - (int)timediff(tvnow(), initial_tv);
+ if(pending_ms <= 0)
+ break;
+ } while(r == -1);
+ }
#endif /* USE_WINSOCK */
if(r)
r = -1;
tests/server/util.h+18 -5
@@ -51,14 +51,27 @@ enum {
char *data_to_hex(char *data, size_t len);
void logmsg(const char *msg, ...) CURL_PRINTF(1, 2);
+void loghex(unsigned char *buffer, ssize_t len);
+unsigned char byteval(char *value);
#define SERVERLOGS_LOCKDIR "lock" /* within logdir */
-/* global variable, where to find the 'data' dir */
-extern const char *path;
-
-/* global variable, log file name */
-extern const char *serverlogfile;
+/* global variables */
+extern const char *path; /* where to find the 'data' dir */
+extern const char *pidname;
+extern const char *portname;
+extern const char *serverlogfile; /* log file name */
+extern int serverlogslocked;
+extern const char *configfile;
+extern const char *logdir;
+extern char loglockfile[256];
+#ifdef USE_IPV6
+extern bool use_ipv6;
+#endif
+extern const char *ipv_inuse;
+extern unsigned short server_port;
+extern const char *socket_type;
+extern int socket_domain;
#ifdef _WIN32
int win32_init(void);