lib: further send/upload handling polish
—
$ git checkout -f e3905de8196d67b89df1602feb84c1f993211b20
Previous HEAD position was 9454757508 cookie: if psl fails, reject the cookie
HEAD is now at e3905de819 lib: further send/upload handling polish
$ git clean -fdx
Removing Makefile
Removing Makefile.in
Removing aclocal.m4
Removing autom4te.cache/
Removing compile
Removing config.guess
Removing config.log
Removing config.status
Removing config.sub
Removing configure
Removing curl-config
Removing depcomp
Removing docs/Makefile
Removing docs/Makefile.in
Removing docs/cmdline-opts/Makefile
Removing docs/cmdline-opts/Makefile.in
Removing docs/curl-config.1
Removing docs/curl.1
Removing docs/examples/.deps/
Removing docs/examples/Makefile
Removing docs/examples/Makefile.in
Removing docs/libcurl/Makefile
Removing docs/libcurl/Makefile.in
Removing docs/libcurl/opts/Makefile
Removing docs/libcurl/opts/Makefile.in
Removing include/Makefile
Removing include/Makefile.in
Removing include/curl/Makefile
Removing include/curl/Makefile.in
Removing install-sh
Removing lib/.deps/
Removing lib/.dirstamp
Removing lib/.libs/
Removing lib/Makefile
Removing lib/Makefile.in
Removing lib/base64.o
Removing lib/curl_config.h
Removing lib/curl_config.h.in
Removing lib/curl_multibyte.o
Removing lib/dynbuf.o
Removing lib/libcurl.la
Removing lib/libcurl.plist
Removing lib/libcurl.vers
Removing lib/libcurl_la-altsvc.lo
Removing lib/libcurl_la-altsvc.o
Removing lib/libcurl_la-amigaos.lo
Removing lib/libcurl_la-amigaos.o
Removing lib/libcurl_la-asyn-ares.lo
Removing lib/libcurl_la-asyn-ares.o
Removing lib/libcurl_la-asyn-thread.lo
Removing lib/libcurl_la-asyn-thread.o
Removing lib/libcurl_la-base64.lo
Removing lib/libcurl_la-base64.o
Removing lib/libcurl_la-bufq.lo
Removing lib/libcurl_la-bufq.o
Removing lib/libcurl_la-bufref.lo
Removing lib/libcurl_la-bufref.o
Removing lib/libcurl_la-c-hyper.lo
Removing lib/libcurl_la-c-hyper.o
Removing lib/libcurl_la-cf-h1-proxy.lo
Removing lib/libcurl_la-cf-h1-proxy.o
Removing lib/libcurl_la-cf-h2-proxy.lo
Removing lib/libcurl_la-cf-h2-proxy.o
Removing lib/libcurl_la-cf-haproxy.lo
Removing lib/libcurl_la-cf-haproxy.o
Removing lib/libcurl_la-cf-https-connect.lo
Removing lib/libcurl_la-cf-https-connect.o
Removing lib/libcurl_la-cf-socket.lo
Removing lib/libcurl_la-cf-socket.o
Removing lib/libcurl_la-cfilters.lo
Removing lib/libcurl_la-cfilters.o
Removing lib/libcurl_la-conncache.lo
Removing lib/libcurl_la-conncache.o
Removing lib/libcurl_la-connect.lo
Removing lib/libcurl_la-connect.o
Removing lib/libcurl_la-content_encoding.lo
Removing lib/libcurl_la-content_encoding.o
Removing lib/libcurl_la-cookie.lo
Removing lib/libcurl_la-cookie.o
Removing lib/libcurl_la-curl_addrinfo.lo
Removing lib/libcurl_la-curl_addrinfo.o
Removing lib/libcurl_la-curl_des.lo
Removing lib/libcurl_la-curl_des.o
Removing lib/libcurl_la-curl_endian.lo
Removing lib/libcurl_la-curl_endian.o
Removing lib/libcurl_la-curl_fnmatch.lo
Removing lib/libcurl_la-curl_fnmatch.o
Removing lib/libcurl_la-curl_get_line.lo
Removing lib/libcurl_la-curl_get_line.o
Removing lib/libcurl_la-curl_gethostname.lo
Removing lib/libcurl_la-curl_gethostname.o
Removing lib/libcurl_la-curl_gssapi.lo
Removing lib/libcurl_la-curl_gssapi.o
Removing lib/libcurl_la-curl_memrchr.lo
Removing lib/libcurl_la-curl_memrchr.o
Removing lib/libcurl_la-curl_multibyte.lo
Removing lib/libcurl_la-curl_multibyte.o
Removing lib/libcurl_la-curl_ntlm_core.lo
Removing lib/libcurl_la-curl_ntlm_core.o
Removing lib/libcurl_la-curl_ntlm_wb.lo
Removing lib/libcurl_la-curl_ntlm_wb.o
Removing lib/libcurl_la-curl_path.lo
Removing lib/libcurl_la-curl_path.o
Removing lib/libcurl_la-curl_range.lo
Removing lib/libcurl_la-curl_range.o
Removing lib/libcurl_la-curl_rtmp.lo
Removing lib/libcurl_la-curl_rtmp.o
Removing lib/libcurl_la-curl_sasl.lo
Removing lib/libcurl_la-curl_sasl.o
Removing lib/libcurl_la-curl_sha512_256.lo
Removing lib/libcurl_la-curl_sha512_256.o
Removing lib/libcurl_la-curl_sspi.lo
Removing lib/libcurl_la-curl_sspi.o
Removing lib/libcurl_la-curl_threads.lo
Removing lib/libcurl_la-curl_threads.o
Removing lib/libcurl_la-curl_trc.lo
Removing lib/libcurl_la-curl_trc.o
Removing lib/libcurl_la-cw-out.lo
Removing lib/libcurl_la-cw-out.o
Removing lib/libcurl_la-dict.lo
Removing lib/libcurl_la-dict.o
Removing lib/libcurl_la-doh.lo
Removing lib/libcurl_la-doh.o
Removing lib/libcurl_la-dynbuf.lo
Removing lib/libcurl_la-dynbuf.o
Removing lib/libcurl_la-dynhds.lo
Removing lib/libcurl_la-dynhds.o
Removing lib/libcurl_la-easy.lo
Removing lib/libcurl_la-easy.o
Removing lib/libcurl_la-easygetopt.lo
Removing lib/libcurl_la-easygetopt.o
Removing lib/libcurl_la-easyoptions.lo
Removing lib/libcurl_la-easyoptions.o
Removing lib/libcurl_la-escape.lo
Removing lib/libcurl_la-escape.o
Removing lib/libcurl_la-file.lo
Removing lib/libcurl_la-file.o
Removing lib/libcurl_la-fileinfo.lo
Removing lib/libcurl_la-fileinfo.o
Removing lib/libcurl_la-fopen.lo
Removing lib/libcurl_la-fopen.o
Removing lib/libcurl_la-formdata.lo
Removing lib/libcurl_la-formdata.o
Removing lib/libcurl_la-ftp.lo
Removing lib/libcurl_la-ftp.o
Removing lib/libcurl_la-ftplistparser.lo
Removing lib/libcurl_la-ftplistparser.o
Removing lib/libcurl_la-getenv.lo
Removing lib/libcurl_la-getenv.o
Removing lib/libcurl_la-getinfo.lo
Removing lib/libcurl_la-getinfo.o
Removing lib/libcurl_la-gopher.lo
Removing lib/libcurl_la-gopher.o
Removing lib/libcurl_la-hash.lo
Removing lib/libcurl_la-hash.o
Removing lib/libcurl_la-headers.lo
Removing lib/libcurl_la-headers.o
Removing lib/libcurl_la-hmac.lo
Removing lib/libcurl_la-hmac.o
Removing lib/libcurl_la-hostasyn.lo
Removing lib/libcurl_la-hostasyn.o
Removing lib/libcurl_la-hostip.lo
Removing lib/libcurl_la-hostip.o
Removing lib/libcurl_la-hostip4.lo
Removing lib/libcurl_la-hostip4.o
Removing lib/libcurl_la-hostip6.lo
Removing lib/libcurl_la-hostip6.o
Removing lib/libcurl_la-hostsyn.lo
Removing lib/libcurl_la-hostsyn.o
Removing lib/libcurl_la-hsts.lo
Removing lib/libcurl_la-hsts.o
Removing lib/libcurl_la-http.lo
Removing lib/libcurl_la-http.o
Removing lib/libcurl_la-http1.lo
Removing lib/libcurl_la-http1.o
Removing lib/libcurl_la-http2.lo
Removing lib/libcurl_la-http2.o
Removing lib/libcurl_la-http_aws_sigv4.lo
Removing lib/libcurl_la-http_aws_sigv4.o
Removing lib/libcurl_la-http_chunks.lo
Removing lib/libcurl_la-http_chunks.o
Removing lib/libcurl_la-http_digest.lo
Removing lib/libcurl_la-http_digest.o
Removing lib/libcurl_la-http_negotiate.lo
Removing lib/libcurl_la-http_negotiate.o
Removing lib/libcurl_la-http_ntlm.lo
Removing lib/libcurl_la-http_ntlm.o
Removing lib/libcurl_la-http_proxy.lo
Removing lib/libcurl_la-http_proxy.o
Removing lib/libcurl_la-idn.lo
Removing lib/libcurl_la-idn.o
Removing lib/libcurl_la-if2ip.lo
Removing lib/libcurl_la-if2ip.o
Removing lib/libcurl_la-imap.lo
Removing lib/libcurl_la-imap.o
Removing lib/libcurl_la-inet_ntop.lo
Removing lib/libcurl_la-inet_ntop.o
Removing lib/libcurl_la-inet_pton.lo
Removing lib/libcurl_la-inet_pton.o
Removing lib/libcurl_la-krb5.lo
Removing lib/libcurl_la-krb5.o
Removing lib/libcurl_la-ldap.lo
Removing lib/libcurl_la-ldap.o
Removing lib/libcurl_la-llist.lo
Removing lib/libcurl_la-llist.o
Removing lib/libcurl_la-macos.lo
Removing lib/libcurl_la-macos.o
Removing lib/libcurl_la-md4.lo
Removing lib/libcurl_la-md4.o
Removing lib/libcurl_la-md5.lo
Removing lib/libcurl_la-md5.o
Removing lib/libcurl_la-memdebug.lo
Removing lib/libcurl_la-memdebug.o
Removing lib/libcurl_la-mime.lo
Removing lib/libcurl_la-mime.o
Removing lib/libcurl_la-mprintf.lo
Removing lib/libcurl_la-mprintf.o
Removing lib/libcurl_la-mqtt.lo
Removing lib/libcurl_la-mqtt.o
Removing lib/libcurl_la-multi.lo
Removing lib/libcurl_la-multi.o
Removing lib/libcurl_la-netrc.lo
Removing lib/libcurl_la-netrc.o
Removing lib/libcurl_la-nonblock.lo
Removing lib/libcurl_la-nonblock.o
Removing lib/libcurl_la-noproxy.lo
Removing lib/libcurl_la-noproxy.o
Removing lib/libcurl_la-openldap.lo
Removing lib/libcurl_la-openldap.o
Removing lib/libcurl_la-parsedate.lo
Removing lib/libcurl_la-parsedate.o
Removing lib/libcurl_la-pingpong.lo
Removing lib/libcurl_la-pingpong.o
Removing lib/libcurl_la-pop3.lo
Removing lib/libcurl_la-pop3.o
Removing lib/libcurl_la-progress.lo
Removing lib/libcurl_la-progress.o
Removing lib/libcurl_la-psl.lo
Removing lib/libcurl_la-psl.o
Removing lib/libcurl_la-rand.lo
Removing lib/libcurl_la-rand.o
Removing lib/libcurl_la-rename.lo
Removing lib/libcurl_la-rename.o
Removing lib/libcurl_la-request.lo
Removing lib/libcurl_la-request.o
Removing lib/libcurl_la-rtsp.lo
Removing lib/libcurl_la-rtsp.o
Removing lib/libcurl_la-select.lo
Removing lib/libcurl_la-select.o
Removing lib/libcurl_la-sendf.lo
Removing lib/libcurl_la-sendf.o
Removing lib/libcurl_la-setopt.lo
Removing lib/libcurl_la-setopt.o
Removing lib/libcurl_la-sha256.lo
Removing lib/libcurl_la-sha256.o
Removing lib/libcurl_la-share.lo
Removing lib/libcurl_la-share.o
Removing lib/libcurl_la-slist.lo
Removing lib/libcurl_la-slist.o
Removing lib/libcurl_la-smb.lo
Removing lib/libcurl_la-smb.o
Removing lib/libcurl_la-smtp.lo
Removing lib/libcurl_la-smtp.o
Removing lib/libcurl_la-socketpair.lo
Removing lib/libcurl_la-socketpair.o
Removing lib/libcurl_la-socks.lo
Removing lib/libcurl_la-socks.o
Removing lib/libcurl_la-socks_gssapi.lo
Removing lib/libcurl_la-socks_gssapi.o
Removing lib/libcurl_la-socks_sspi.lo
Removing lib/libcurl_la-socks_sspi.o
Removing lib/libcurl_la-speedcheck.lo
Removing lib/libcurl_la-speedcheck.o
Removing lib/libcurl_la-splay.lo
Removing lib/libcurl_la-splay.o
Removing lib/libcurl_la-strcase.lo
Removing lib/libcurl_la-strcase.o
Removing lib/libcurl_la-strdup.lo
Removing lib/libcurl_la-strdup.o
Removing lib/libcurl_la-strerror.lo
Removing lib/libcurl_la-strerror.o
Removing lib/libcurl_la-strtok.lo
Removing lib/libcurl_la-strtok.o
Removing lib/libcurl_la-strtoofft.lo
Removing lib/libcurl_la-strtoofft.o
Removing lib/libcurl_la-system_win32.lo
Removing lib/libcurl_la-system_win32.o
Removing lib/libcurl_la-telnet.lo
Removing lib/libcurl_la-telnet.o
Removing lib/libcurl_la-tftp.lo
Removing lib/libcurl_la-tftp.o
Removing lib/libcurl_la-timediff.lo
Removing lib/libcurl_la-timediff.o
Removing lib/libcurl_la-timeval.lo
Removing lib/libcurl_la-timeval.o
Removing lib/libcurl_la-transfer.lo
Removing lib/libcurl_la-transfer.o
Removing lib/libcurl_la-url.lo
Removing lib/libcurl_la-url.o
Removing lib/libcurl_la-urlapi.lo
Removing lib/libcurl_la-urlapi.o
Removing lib/libcurl_la-version.lo
Removing lib/libcurl_la-version.o
Removing lib/libcurl_la-version_win32.lo
Removing lib/libcurl_la-version_win32.o
Removing lib/libcurl_la-warnless.lo
Removing lib/libcurl_la-warnless.o
Removing lib/libcurl_la-ws.lo
Removing lib/libcurl_la-ws.o
Removing lib/nonblock.o
Removing lib/stamp-h1
Removing lib/strtoofft.o
Removing lib/timediff.o
Removing lib/vauth/.deps/
Removing lib/vauth/.dirstamp
Removing lib/vauth/libcurl_la-cleartext.lo
Removing lib/vauth/libcurl_la-cleartext.o
Removing lib/vauth/libcurl_la-cram.lo
Removing lib/vauth/libcurl_la-cram.o
Removing lib/vauth/libcurl_la-digest.lo
Removing lib/vauth/libcurl_la-digest.o
Removing lib/vauth/libcurl_la-digest_sspi.lo
Removing lib/vauth/libcurl_la-digest_sspi.o
Removing lib/vauth/libcurl_la-gsasl.lo
Removing lib/vauth/libcurl_la-gsasl.o
Removing lib/vauth/libcurl_la-krb5_gssapi.lo
Removing lib/vauth/libcurl_la-krb5_gssapi.o
Removing lib/vauth/libcurl_la-krb5_sspi.lo
Removing lib/vauth/libcurl_la-krb5_sspi.o
Removing lib/vauth/libcurl_la-ntlm.lo
Removing lib/vauth/libcurl_la-ntlm.o
Removing lib/vauth/libcurl_la-ntlm_sspi.lo
Removing lib/vauth/libcurl_la-ntlm_sspi.o
Removing lib/vauth/libcurl_la-oauth2.lo
Removing lib/vauth/libcurl_la-oauth2.o
Removing lib/vauth/libcurl_la-spnego_gssapi.lo
Removing lib/vauth/libcurl_la-spnego_gssapi.o
Removing lib/vauth/libcurl_la-spnego_sspi.lo
Removing lib/vauth/libcurl_la-spnego_sspi.o
Removing lib/vauth/libcurl_la-vauth.lo
Removing lib/vauth/libcurl_la-vauth.o
Removing lib/version_win32.o
Removing lib/vquic/.deps/
Removing lib/vquic/.dirstamp
Removing lib/vquic/libcurl_la-curl_msh3.lo
Removing lib/vquic/libcurl_la-curl_msh3.o
Removing lib/vquic/libcurl_la-curl_ngtcp2.lo
Removing lib/vquic/libcurl_la-curl_ngtcp2.o
Removing lib/vquic/libcurl_la-curl_osslq.lo
Removing lib/vquic/libcurl_la-curl_osslq.o
Removing lib/vquic/libcurl_la-curl_quiche.lo
Removing lib/vquic/libcurl_la-curl_quiche.o
Removing lib/vquic/libcurl_la-vquic-tls.lo
Removing lib/vquic/libcurl_la-vquic-tls.o
Removing lib/vquic/libcurl_la-vquic.lo
Removing lib/vquic/libcurl_la-vquic.o
Removing lib/vssh/.deps/
Removing lib/vssh/.dirstamp
Removing lib/vssh/libcurl_la-libssh.lo
Removing lib/vssh/libcurl_la-libssh.o
Removing lib/vssh/libcurl_la-libssh2.lo
Removing lib/vssh/libcurl_la-libssh2.o
Removing lib/vssh/libcurl_la-wolfssh.lo
Removing lib/vssh/libcurl_la-wolfssh.o
Removing lib/vtls/.deps/
Removing lib/vtls/.dirstamp
Removing lib/vtls/libcurl_la-bearssl.lo
Removing lib/vtls/libcurl_la-bearssl.o
Removing lib/vtls/libcurl_la-gtls.lo
Removing lib/vtls/libcurl_la-gtls.o
Removing lib/vtls/libcurl_la-hostcheck.lo
Removing lib/vtls/libcurl_la-hostcheck.o
Removing lib/vtls/libcurl_la-keylog.lo
Removing lib/vtls/libcurl_la-keylog.o
Removing lib/vtls/libcurl_la-mbedtls.lo
Removing lib/vtls/libcurl_la-mbedtls.o
Removing lib/vtls/libcurl_la-mbedtls_threadlock.lo
Removing lib/vtls/libcurl_la-mbedtls_threadlock.o
Removing lib/vtls/libcurl_la-openssl.lo
Removing lib/vtls/libcurl_la-openssl.o
Removing lib/vtls/libcurl_la-rustls.lo
Removing lib/vtls/libcurl_la-rustls.o
Removing lib/vtls/libcurl_la-schannel.lo
Removing lib/vtls/libcurl_la-schannel.o
Removing lib/vtls/libcurl_la-schannel_verify.lo
Removing lib/vtls/libcurl_la-schannel_verify.o
Removing lib/vtls/libcurl_la-sectransp.lo
Removing lib/vtls/libcurl_la-sectransp.o
Removing lib/vtls/libcurl_la-vtls.lo
Removing lib/vtls/libcurl_la-vtls.o
Removing lib/vtls/libcurl_la-wolfssl.lo
Removing lib/vtls/libcurl_la-wolfssl.o
Removing lib/vtls/libcurl_la-x509asn1.lo
Removing lib/vtls/libcurl_la-x509asn1.o
Removing lib/warnless.o
Removing libcurl.pc
Removing libtool
Removing ltmain.sh
Removing m4/libtool.m4
Removing m4/ltoptions.m4
Removing m4/ltsugar.m4
Removing m4/ltversion.m4
Removing m4/lt~obsolete.m4
Removing missing
Removing packages/Makefile
Removing packages/Makefile.in
Removing packages/vms/Makefile
Removing packages/vms/Makefile.in
Removing scripts/Makefile
Removing scripts/Makefile.in
Removing src/.deps/
Removing src/.libs/
Removing src/Makefile
Removing src/Makefile.in
Removing src/curl
Removing src/slist_wc.o
Removing src/tool_binmode.o
Removing src/tool_bname.o
Removing src/tool_cb_dbg.o
Removing src/tool_cb_hdr.o
Removing src/tool_cb_prg.o
Removing src/tool_cb_rea.o
Removing src/tool_cb_see.o
Removing src/tool_cb_wrt.o
Removing src/tool_cfgable.o
Removing src/tool_dirhie.o
Removing src/tool_doswin.o
Removing src/tool_easysrc.o
Removing src/tool_filetime.o
Removing src/tool_findfile.o
Removing src/tool_formparse.o
Removing src/tool_getparam.o
Removing src/tool_getpass.o
Removing src/tool_help.o
Removing src/tool_helpers.o
Removing src/tool_hugehelp.c
Removing src/tool_hugehelp.o
Removing src/tool_ipfs.o
Removing src/tool_libinfo.o
Removing src/tool_listhelp.o
Removing src/tool_main.o
Removing src/tool_msgs.o
Removing src/tool_operate.o
Removing src/tool_operhlp.o
Removing src/tool_paramhlp.o
Removing src/tool_parsecfg.o
Removing src/tool_progress.o
Removing src/tool_setopt.o
Removing src/tool_sleep.o
Removing src/tool_stderr.o
Removing src/tool_strdup.o
Removing src/tool_urlglob.o
Removing src/tool_util.o
Removing src/tool_vms.o
Removing src/tool_writeout.o
Removing src/tool_writeout_json.o
Removing src/tool_xattr.o
Removing src/var.o
Removing tests/Makefile
Removing tests/Makefile.in
Removing tests/certs/Makefile
Removing tests/certs/Makefile.in
Removing tests/certs/scripts/Makefile
Removing tests/certs/scripts/Makefile.in
Removing tests/config
Removing tests/configurehelp.pm
Removing tests/data/Makefile
Removing tests/data/Makefile.in
Removing tests/http/Makefile
Removing tests/http/Makefile.in
Removing tests/http/clients/.deps/
Removing tests/http/clients/Makefile
Removing tests/http/clients/Makefile.in
Removing tests/http/config.ini
Removing tests/libtest/.deps/
Removing tests/libtest/Makefile
Removing tests/libtest/Makefile.in
Removing tests/server/.deps/
Removing tests/server/Makefile
Removing tests/server/Makefile.in
Removing tests/unit/.deps/
Removing tests/unit/Makefile
Removing tests/unit/Makefile.in
$ autoreconf -fi
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
libtoolize: Remember to add 'LT_INIT' to configure.ac.
configure.ac:123: installing './compile'
configure.ac:425: installing './config.guess'
configure.ac:425: installing './config.sub'
configure.ac:123: installing './install-sh'
configure.ac:129: 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 ECH support... no
checking for path separator... :
checking for sed... /usr/bin/sed
checking for grep... /usr/bin/grep
checking that grep -E works... yes
checking for ar... /usr/bin/ar
checking for a BSD-compatible install... /usr/bin/install -c
checking for gcc... ccache gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether ccache gcc accepts -g... yes
checking for ccache gcc option to enable C11 features... none needed
checking whether ccache gcc understands -c and -o together... yes
checking how to run the C preprocessor... ccache gcc -E
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for stdatomic.h... yes
checking if _Atomic is available... yes
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for code coverage support... no
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of ccache gcc... gcc3
checking curl version... 8.7.0-DEV
checking for httpd... no
checking for apache2... no
checking for apachectl... no
checking for apxs... no
configure: httpd/apache2 not in PATH, http tests disabled
configure: apxs not in PATH, http tests disabled
checking for nghttpx... no
checking for caddy... no
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 for inline... inline
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 SGI MIPSpro C... no
checking if compiler is SGI MIPS C... no
checking if compiler is SunPro C... no
checking if compiler is Tiny C... no
checking whether build target is a native Windows one... no
checking if compiler accepts some basic options... yes
configure: compiler options added: -Werror-implicit-function-declaration
checking if compiler optimizer assumed setting might be used... yes
checking if compiler accepts optimizer enabling options... yes
configure: compiler options added: -O2
checking if compiler accepts strict warning options... yes
configure: compiler options added: -Wno-system-headers
checking if compiler halts on compilation errors... yes
checking if compiler halts on negative sized arrays... yes
checking if compiler halts on function prototype mismatch... yes
checking if compiler supports hiding library internal symbols... yes
checking whether build target supports WIN32 file API... no
checking whether build target supports WIN32 crypto API... no
checking for good-to-use Darwin CFLAGS... no
checking whether to link macOS CoreFoundation, CoreServices, and SystemConfiguration frameworks... no
checking to see if the compiler supports __builtin_available()... no
checking whether to support http... yes
checking whether to support ftp... yes
checking whether to support file... yes
checking whether to support ldap... yes
checking whether to support ldaps... yes
checking whether to support rtsp... yes
checking whether to support proxies... yes
checking whether to support dict... yes
checking whether to support telnet... yes
checking whether to support tftp... yes
checking whether to support pop3... yes
checking whether to support imap... yes
checking whether to support smb... yes
checking whether to support smtp... yes
checking whether to support gopher... yes
checking whether to support mqtt... no
checking whether to build documentation... no
checking whether to provide built-in manual... yes
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 psl_builtin in -lpsl... yes
checking for libpsl.h... yes
checking for library containing gsasl_init... no
checking for RTMP_Init in -lrtmp... no
checking whether versioned symbols are wanted... no
checking whether to enable Windows native IDN (Windows native builds only)... no
checking whether to build with libidn2... (assumed) yes
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for libidn2 options with pkg-config... no
configure: IDN_LIBS: "-lidn2"
configure: IDN_LDFLAGS: ""
configure: IDN_CPPFLAGS: ""
configure: IDN_DIR: ""
checking if idn2_lookup_ul can be linked... no
checking for idn2.h... no
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for libnghttp2 options with pkg-config... no
checking for nghttp2_session_get_stream_local_window_size in -lnghttp2... no
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for sys/select.h... yes
checking for sys/socket.h... yes
checking for sys/ioctl.h... yes
checking for unistd.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for arpa/inet.h... yes
checking for net/if.h... yes
checking for netinet/in.h... yes
checking for netinet/in6.h... no
checking for sys/un.h... yes
checking for linux/tcp.h... yes
checking for netinet/tcp.h... yes
checking for netinet/udp.h... yes
checking for netdb.h... yes
checking for sys/sockio.h... no
checking for sys/stat.h... (cached) yes
checking for sys/param.h... yes
checking for termios.h... yes
checking for termio.h... yes
checking for fcntl.h... yes
checking for io.h... no
checking for pwd.h... yes
checking for utime.h... yes
checking for sys/utime.h... no
checking for sys/poll.h... yes
checking for poll.h... yes
checking for socket.h... no
checking for sys/resource.h... yes
checking for libgen.h... yes
checking for locale.h... yes
checking for stdbool.h... yes
checking for sys/filio.h... no
checking for sys/wait.h... yes
checking for setjmp.h... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for struct timeval... yes
checking run-time libs availability... fine
checking size of size_t... 8
checking size of long... 8
checking size of int... 4
checking size of time_t... 8
checking size of off_t... 8
checking size of curl_off_t... 8
checking size of curl_socket_t... 4
checking for long long... yes
checking for ssize_t... yes
checking for bool... yes
checking for sa_family_t... yes
checking for suseconds_t... yes
checking if time_t is unsigned... no
checking for in_addr_t... yes
checking for struct sockaddr_storage... yes
checking for sys/select.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for select... yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for recv... yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for send... yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for MSG_NOSIGNAL... yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking if alarm can be linked... yes
checking if alarm is prototyped... yes
checking if alarm is compilable... yes
checking if alarm usage allowed... yes
checking if alarm might be used... yes
checking for sys/types.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for libgen.h... (cached) yes
checking if basename can be linked... yes
checking if basename is prototyped... yes
checking if basename is compilable... yes
checking if basename usage allowed... yes
checking if basename might be used... yes
checking for sys/types.h... (cached) yes
checking for socket.h... (cached) no
checking if closesocket can be linked... no
checking if closesocket might be used... no
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking if CloseSocket can be linked... no
checking if CloseSocket might be used... no
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking for fcntl.h... (cached) yes
checking if fcntl can be linked... yes
checking if fcntl is prototyped... yes
checking if fcntl is compilable... yes
checking if fcntl usage allowed... yes
checking if fcntl might be used... yes
checking if fcntl O_NONBLOCK is compilable... yes
checking if fcntl O_NONBLOCK usage allowed... yes
checking if fcntl O_NONBLOCK might be used... yes
checking whether build target is a native Windows one... (cached) no
checking for sys/types.h... (cached) yes
checking for netdb.h... (cached) yes
checking if freeaddrinfo can be linked... yes
checking if freeaddrinfo is prototyped... yes
checking if freeaddrinfo is compilable... yes
checking if freeaddrinfo usage allowed... yes
checking if freeaddrinfo might be used... yes
checking for sys/types.h... (cached) yes
checking for sys/xattr.h... yes
checking if fsetxattr can be linked... yes
checking if fsetxattr is prototyped... yes
checking if fsetxattr takes 5 args.... yes
checking if fsetxattr is compilable... yes
checking if fsetxattr usage allowed... yes
checking if fsetxattr might be used... yes
checking if ftruncate can be linked... yes
checking if ftruncate is prototyped... yes
checking if ftruncate is compilable... yes
checking if ftruncate usage allowed... yes
checking if ftruncate might be used... yes
checking for sys/types.h... (cached) yes
checking if getaddrinfo can be linked... yes
checking if getaddrinfo is prototyped... yes
checking if getaddrinfo is compilable... yes
checking if getaddrinfo seems to work... yes
checking if getaddrinfo usage allowed... yes
checking if getaddrinfo might be used... yes
checking if getaddrinfo is threadsafe... yes
checking if gethostbyname can be linked... yes
checking if gethostbyname is prototyped... yes
checking if gethostbyname is compilable... yes
checking if gethostbyname usage allowed... yes
checking if gethostbyname might be used... yes
checking if gethostbyname_r can be linked... yes
checking if gethostbyname_r is prototyped... yes
checking if gethostbyname_r takes 3 args.... no
checking if gethostbyname_r takes 5 args.... no
checking if gethostbyname_r takes 6 args.... yes
checking if gethostbyname_r is compilable... yes
checking if gethostbyname_r usage allowed... yes
checking if gethostbyname_r might be used... yes
checking if gethostname can be linked... yes
checking if gethostname is prototyped... yes
checking if gethostname is compilable... yes
checking for gethostname arg 2 data type... size_t
checking if gethostname usage allowed... yes
checking if gethostname might be used... yes
checking if getpeername can be linked... yes
checking if getpeername is prototyped... yes
checking if getpeername is compilable... yes
checking if getpeername usage allowed... yes
checking if getpeername might be used... yes
checking if getsockname can be linked... yes
checking if getsockname is prototyped... yes
checking if getsockname is compilable... yes
checking if getsockname usage allowed... yes
checking if getsockname might be used... yes
checking for net/if.h... (cached) yes
checking if if_nametoindex can be linked... yes
checking if if_nametoindex is prototyped... yes
checking if if_nametoindex is compilable... yes
checking if if_nametoindex usage allowed... yes
checking if if_nametoindex might be used... yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking for ifaddrs.h... yes
checking if getifaddrs can be linked... yes
checking if getifaddrs is prototyped... yes
checking if getifaddrs is compilable... yes
checking if getifaddrs seems to work... yes
checking if getifaddrs usage allowed... yes
checking if getifaddrs might be used... yes
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) yes
checking if gmtime_r can be linked... yes
checking if gmtime_r is prototyped... yes
checking if gmtime_r is compilable... yes
checking if gmtime_r seems to work... yes
checking if gmtime_r usage allowed... yes
checking if gmtime_r might be used... yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking for arpa/inet.h... (cached) yes
checking if inet_ntop can be linked... yes
checking if inet_ntop is prototyped... yes
checking if inet_ntop is compilable... yes
checking if inet_ntop seems to work... yes
checking if inet_ntop usage allowed... yes
checking if inet_ntop might be used... yes
checking if inet_pton can be linked... yes
checking if inet_pton is prototyped... yes
checking if inet_pton is compilable... yes
checking if inet_pton seems to work... yes
checking if inet_pton usage allowed... yes
checking if inet_pton might be used... yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for sys/ioctl.h... (cached) yes
checking for stropts.h... no
checking if ioctl can be linked... yes
checking if ioctl is prototyped... yes
checking if ioctl is compilable... yes
checking if ioctl usage allowed... yes
checking if ioctl might be used... yes
checking if ioctl FIONBIO is compilable... yes
checking if ioctl FIONBIO usage allowed... yes
checking if ioctl FIONBIO might be used... yes
checking if ioctl SIOCGIFADDR is compilable... yes
checking if ioctl SIOCGIFADDR usage allowed... yes
checking if ioctl SIOCGIFADDR might be used... yes
checking if ioctlsocket can be linked... no
checking if ioctlsocket might be used... no
checking if IoctlSocket can be linked... no
checking if IoctlSocket might be used... no
checking if memrchr can be linked... yes
checking if memrchr is prototyped... no
checking if memrchr might be used... no
checking for sys/types.h... (cached) yes
checking for poll.h... (cached) yes
checking for sys/poll.h... (cached) yes
checking if poll can be linked... yes
checking if poll is prototyped... yes
checking if poll is compilable... yes
checking if poll seems to work... yes
checking if poll usage allowed... yes
checking if poll might be used... yes
checking for sys/types.h... (cached) yes
checking if sigaction can be linked... yes
checking if sigaction is prototyped... yes
checking if sigaction is compilable... yes
checking if sigaction usage allowed... yes
checking if sigaction might be used... yes
checking if siginterrupt can be linked... yes
checking if siginterrupt is prototyped... yes
checking if siginterrupt is compilable... yes
checking if siginterrupt usage allowed... yes
checking if siginterrupt might be used... yes
checking if signal can be linked... yes
checking if signal is prototyped... yes
checking if signal is compilable... yes
checking if signal usage allowed... yes
checking if signal might be used... yes
checking for sys/types.h... (cached) yes
checking if sigsetjmp can be linked... no
checking if sigsetjmp seems a macro... yes
checking if sigsetjmp is compilable... yes
checking if sigsetjmp usage allowed... yes
checking if sigsetjmp might be used... yes
checking if socket can be linked... yes
checking if socket is prototyped... yes
checking if socket is compilable... yes
checking if socket usage allowed... yes
checking if socket might be used... yes
checking if socketpair can be linked... yes
checking if socketpair is prototyped... yes
checking if socketpair is compilable... yes
checking if socketpair usage allowed... yes
checking if socketpair might be used... yes
checking if strcasecmp can be linked... yes
checking if strcasecmp is prototyped... yes
checking if strcasecmp is compilable... yes
checking if strcasecmp usage allowed... yes
checking if strcasecmp might be used... yes
checking if strcmpi can be linked... no
checking if strcmpi might be used... no
checking if strdup can be linked... yes
checking if strdup is prototyped... yes
checking if strdup is compilable... yes
checking if strdup usage allowed... yes
checking if strdup might be used... yes
checking if strerror_r can be linked... yes
checking if strerror_r is prototyped... yes
checking if strerror_r is compilable... yes
checking if strerror_r is glibc like... no
checking if strerror_r is POSIX like... yes
checking if strerror_r seems to work... yes
checking if strerror_r usage allowed... yes
checking if strerror_r might be used... yes
checking if stricmp can be linked... no
checking if stricmp might be used... no
checking if strtok_r can be linked... yes
checking if strtok_r is prototyped... yes
checking if strtok_r is compilable... yes
checking if strtok_r usage allowed... yes
checking if strtok_r might be used... yes
checking if strtoll can be linked... yes
checking if strtoll is prototyped... yes
checking if strtoll is compilable... yes
checking if strtoll usage allowed... yes
checking if strtoll might be used... yes
checking for ccache gcc options needed to detect all undeclared functions... none needed
checking whether getpwuid_r is declared... yes
checking for _fseeki64... no
checking deeper for _fseeki64... but still no
checking for arc4random... no
checking deeper for arc4random... but still no
checking for fnmatch... yes
checking for fseeko... yes
checking for geteuid... yes
checking for getpass_r... no
checking deeper for getpass_r... but still no
checking for getppid... yes
checking for getpwuid... yes
checking for getpwuid_r... yes
checking for getrlimit... yes
checking for gettimeofday... yes
checking for if_nametoindex... yes
checking for mach_absolute_time... no
checking deeper for mach_absolute_time... but still no
checking for pipe... yes
checking for sched_yield... yes
checking for sendmsg... yes
checking for setlocale... yes
checking for setmode... no
checking deeper for setmode... but still no
checking for setrlimit... yes
checking for snprintf... yes
checking for utime... yes
checking for utimes... yes
checking whether fseeko is declared... yes
checking how to set a socket into non-blocking mode... fcntl O_NONBLOCK
checking for perl... /usr/bin/perl
checking for gnroff... no
checking for nroff... /usr/bin/nroff
checking how to use *nroff to get plain text from man pages... -man
checking whether to enable the threaded resolver... yes
checking whether to use POSIX threads for threaded resolver... auto
checking for pthread.h... yes
checking for pthread_create... 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 NTLM delegation to winbind's helper... no
checking whether to enable TLS-SRP authentication... yes
checking whether to enable Unix domain sockets... auto
checking for struct sockaddr_un.sun_path... yes
checking whether to support cookies... yes
checking whether to support socketpair... yes
checking whether to support HTTP authentication... yes
checking whether to support DoH... yes
checking whether to support the MIME API... yes
checking whether to support binding connections locally... yes
checking whether to support the form API... yes
checking whether to support date parsing... yes
checking whether to support netrc parsing... yes
checking whether to support progress-meter... yes
checking whether to support DNS shuffling... yes
checking whether to support curl_easy_option*... yes
checking whether to support alt-svc... yes
checking whether to support headers-api... yes
configure: disables HSTS due to lack of SSL
checking whether to support WebSockets... no
checking whether hiding of library internal symbols will actually happen... yes
checking if this build supports HTTPS-proxy... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating docs/Makefile
config.status: creating docs/examples/Makefile
config.status: creating docs/libcurl/Makefile
config.status: creating docs/libcurl/opts/Makefile
config.status: creating docs/cmdline-opts/Makefile
config.status: creating include/Makefile
config.status: creating include/curl/Makefile
config.status: creating src/Makefile
config.status: creating lib/Makefile
config.status: creating scripts/Makefile
config.status: creating lib/libcurl.vers
config.status: creating lib/libcurl.plist
config.status: creating tests/Makefile
config.status: creating tests/config
config.status: creating tests/certs/Makefile
config.status: creating tests/certs/scripts/Makefile
config.status: creating tests/data/Makefile
config.status: creating tests/server/Makefile
config.status: creating tests/libtest/Makefile
config.status: creating tests/unit/Makefile
config.status: creating tests/http/config.ini
config.status: creating tests/http/Makefile
config.status: creating tests/http/clients/Makefile
config.status: creating packages/Makefile
config.status: creating packages/vms/Makefile
config.status: creating curl-config
config.status: creating libcurl.pc
config.status: creating lib/curl_config.h
config.status: executing depfiles commands
config.status: executing libtool commands
configure: Configured to build curl/libcurl:
Host setup: x86_64-pc-linux-gnu
Install prefix: /usr/local
Compiler: ccache gcc
CFLAGS: -Werror-implicit-function-declaration -O2 -Wno-system-headers
CPPFLAGS:
LDFLAGS:
LIBS: -lpsl -lz
curl version: 8.7.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: enabled
--libcurl option: enabled (--disable-libcurl-option)
Verbose errors: enabled (--disable-verbose)
Code coverage: disabled
SSPI: no (--enable-sspi)
ca cert bundle: no
ca cert path:
ca fallback:
LDAP: no (--enable-ldap / --with-ldap-lib / --with-lber-lib)
LDAPS: no (--enable-ldaps)
RTSP: enabled
RTMP: no (--with-librtmp)
PSL: enabled
Alt-svc: enabled (--disable-alt-svc)
Headers API: enabled (--disable-headers-api)
HSTS: no (--enable-hsts)
HTTP1: enabled (internal)
HTTP2: no (--with-nghttp2)
HTTP3: no (--with-ngtcp2 --with-nghttp3, --with-quiche, --with-openssl-quic, --with-msh3)
ECH: no (--enable-ech)
WebSockets: no (--enable-websockets)
Protocols: DICT FILE FTP GOPHER HTTP IMAP IPFS IPNS MQTT POP3 RTSP SMTP TELNET TFTP
Features: AsynchDNS IPv6 Largefile PSL UnixSockets alt-svc libz threadsafe
configure: WARNING: Cannot find libraries for LDAP support: LDAP disabled
configure: WARNING: libgsasl was not found
configure: WARNING: Cannot find libraries for IDN support: IDN disabled
$ 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-c-hyper.lo
CC libcurl_la-cf-h2-proxy.lo
CC libcurl_la-cf-haproxy.lo
CC libcurl_la-cf-https-connect.lo
CC libcurl_la-cf-socket.lo
CC libcurl_la-cfilters.lo
CC libcurl_la-conncache.lo
CC libcurl_la-connect.lo
CC libcurl_la-content_encoding.lo
CC libcurl_la-cookie.lo
CC libcurl_la-curl_addrinfo.lo
CC libcurl_la-curl_des.lo
CC libcurl_la-curl_endian.lo
CC libcurl_la-curl_fnmatch.lo
CC libcurl_la-curl_get_line.lo
CC libcurl_la-curl_gethostname.lo
CC libcurl_la-curl_gssapi.lo
CC libcurl_la-curl_memrchr.lo
CC libcurl_la-curl_multibyte.lo
CC libcurl_la-curl_ntlm_core.lo
CC libcurl_la-curl_ntlm_wb.lo
CC libcurl_la-curl_path.lo
CC libcurl_la-curl_range.lo
CC libcurl_la-curl_rtmp.lo
CC libcurl_la-curl_sasl.lo
CC libcurl_la-curl_sha512_256.lo
CC libcurl_la-curl_sspi.lo
CC libcurl_la-curl_threads.lo
CC libcurl_la-curl_trc.lo
CC libcurl_la-cw-out.lo
CC libcurl_la-dict.lo
CC libcurl_la-doh.lo
CC libcurl_la-dynbuf.lo
CC libcurl_la-dynhds.lo
CC libcurl_la-easy.lo
CC libcurl_la-easygetopt.lo
CC libcurl_la-easyoptions.lo
CC libcurl_la-escape.lo
CC libcurl_la-file.lo
CC libcurl_la-fileinfo.lo
CC libcurl_la-fopen.lo
CC libcurl_la-formdata.lo
CC libcurl_la-ftp.lo
CC libcurl_la-ftplistparser.lo
CC libcurl_la-getenv.lo
CC libcurl_la-getinfo.lo
CC libcurl_la-gopher.lo
CC libcurl_la-hash.lo
CC libcurl_la-headers.lo
CC libcurl_la-hmac.lo
CC libcurl_la-hostasyn.lo
CC libcurl_la-hostip.lo
CC libcurl_la-hostip4.lo
CC libcurl_la-hostip6.lo
CC libcurl_la-hostsyn.lo
CC libcurl_la-hsts.lo
CC libcurl_la-http.lo
CC libcurl_la-http1.lo
CC libcurl_la-http2.lo
CC libcurl_la-http_aws_sigv4.lo
CC libcurl_la-http_chunks.lo
CC libcurl_la-http_digest.lo
CC libcurl_la-http_negotiate.lo
CC libcurl_la-http_ntlm.lo
CC libcurl_la-http_proxy.lo
CC libcurl_la-idn.lo
CC libcurl_la-if2ip.lo
CC libcurl_la-imap.lo
CC libcurl_la-inet_ntop.lo
CC libcurl_la-inet_pton.lo
CC libcurl_la-krb5.lo
CC libcurl_la-ldap.lo
CC libcurl_la-llist.lo
CC libcurl_la-macos.lo
CC libcurl_la-md4.lo
CC libcurl_la-md5.lo
CC libcurl_la-memdebug.lo
CC libcurl_la-mime.lo
CC libcurl_la-mprintf.lo
CC libcurl_la-mqtt.lo
CC libcurl_la-multi.lo
CC libcurl_la-netrc.lo
CC libcurl_la-nonblock.lo
CC libcurl_la-noproxy.lo
CC libcurl_la-openldap.lo
CC libcurl_la-parsedate.lo
CC libcurl_la-pingpong.lo
CC libcurl_la-pop3.lo
CC libcurl_la-progress.lo
CC libcurl_la-psl.lo
CC libcurl_la-rand.lo
CC libcurl_la-rename.lo
CC libcurl_la-request.lo
CC libcurl_la-rtsp.lo
CC libcurl_la-select.lo
CC libcurl_la-sendf.lo
CC libcurl_la-setopt.lo
CC libcurl_la-sha256.lo
CC libcurl_la-share.lo
CC libcurl_la-slist.lo
CC libcurl_la-smb.lo
CC libcurl_la-smtp.lo
CC libcurl_la-socketpair.lo
CC libcurl_la-socks.lo
CC libcurl_la-socks_gssapi.lo
CC libcurl_la-socks_sspi.lo
CC libcurl_la-speedcheck.lo
CC libcurl_la-splay.lo
CC libcurl_la-strcase.lo
CC libcurl_la-strdup.lo
CC libcurl_la-strerror.lo
CC libcurl_la-strtok.lo
CC libcurl_la-strtoofft.lo
CC libcurl_la-system_win32.lo
CC libcurl_la-telnet.lo
CC libcurl_la-tftp.lo
CC libcurl_la-timediff.lo
CC libcurl_la-timeval.lo
CC libcurl_la-transfer.lo
CC libcurl_la-url.lo
CC libcurl_la-urlapi.lo
CC libcurl_la-version.lo
CC libcurl_la-version_win32.lo
CC libcurl_la-warnless.lo
CC libcurl_la-ws.lo
CC vauth/libcurl_la-cleartext.lo
CC vauth/libcurl_la-cram.lo
CC vauth/libcurl_la-digest.lo
CC vauth/libcurl_la-digest_sspi.lo
CC vauth/libcurl_la-gsasl.lo
CC vauth/libcurl_la-krb5_gssapi.lo
CC vauth/libcurl_la-krb5_sspi.lo
CC vauth/libcurl_la-ntlm.lo
CC vauth/libcurl_la-ntlm_sspi.lo
CC vauth/libcurl_la-oauth2.lo
CC vauth/libcurl_la-spnego_gssapi.lo
CC vauth/libcurl_la-spnego_sspi.lo
CC vtls/libcurl_la-bearssl.lo
CC vauth/libcurl_la-vauth.lo
CC vtls/libcurl_la-gtls.lo
CC vtls/libcurl_la-hostcheck.lo
CC vtls/libcurl_la-keylog.lo
CC vtls/libcurl_la-mbedtls.lo
CC vtls/libcurl_la-mbedtls_threadlock.lo
CC vtls/libcurl_la-openssl.lo
CC vtls/libcurl_la-rustls.lo
CC vtls/libcurl_la-schannel.lo
CC vtls/libcurl_la-schannel_verify.lo
CC vtls/libcurl_la-sectransp.lo
CC vtls/libcurl_la-vtls.lo
CC vtls/libcurl_la-wolfssl.lo
CC vtls/libcurl_la-x509asn1.lo
CC vquic/libcurl_la-curl_msh3.lo
CC vquic/libcurl_la-curl_ngtcp2.lo
CC vquic/libcurl_la-curl_osslq.lo
CC vquic/libcurl_la-curl_quiche.lo
CC vquic/libcurl_la-vquic.lo
CC vquic/libcurl_la-vquic-tls.lo
CC vssh/libcurl_la-libssh.lo
CC vssh/libcurl_la-libssh2.lo
CC vssh/libcurl_la-wolfssh.lo
CCLD libcurl.la
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/lib'
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/lib'
Making all in src
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/src'
make[2]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/src'
CC slist_wc.o
CC tool_binmode.o
CC tool_bname.o
CC tool_cb_dbg.o
CC tool_cb_prg.o
CC tool_cb_hdr.o
CC tool_cb_rea.o
CC tool_cb_see.o
CC tool_cb_wrt.o
CC tool_cfgable.o
CC tool_doswin.o
CC tool_dirhie.o
CC tool_easysrc.o
CC tool_filetime.o
CC tool_findfile.o
CC tool_formparse.o
CC tool_getparam.o
CC tool_getpass.o
CC tool_help.o
CC tool_helpers.o
cd ../docs && make
make[3]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
Making all in .
make[4]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
if test "..x" != "..x" -a -e "./curl.1"; then \
/usr/bin/install -c -m 644 "./curl.1" /root/asi_db/builds/curl/_worktrees/w0/docs/curl.1 \
&& touch -r "./curl.1" /root/asi_db/builds/curl/_worktrees/w0/docs/curl.1; fi
CC tool_ipfs.o
cd cmdline-opts && make
CC tool_libinfo.o
make[5]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/cmdline-opts'
GENERATE ../../docs/curl.1
CC tool_listhelp.o
CC tool_main.o
CC tool_msgs.o
CC tool_operate.o
CC tool_operhlp.o
RENDER curl-config.1
CC tool_paramhlp.o
CC tool_parsecfg.o
CC tool_progress.o
CC tool_setopt.o
CC tool_sleep.o
CC tool_stderr.o
CC tool_strdup.o
CC tool_urlglob.o
CC tool_util.o
CC tool_vms.o
CC tool_writeout.o
CC tool_writeout_json.o
CC tool_xattr.o
CC var.o
CC ../lib/base64.o
CC ../lib/curl_multibyte.o
CC ../lib/dynbuf.o
CC ../lib/nonblock.o
CC ../lib/strtoofft.o
CC ../lib/timediff.o
CC ../lib/version_win32.o
CC ../lib/warnless.o
make[5]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/cmdline-opts'
make[4]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
Making all in cmdline-opts
make[4]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/cmdline-opts'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/cmdline-opts'
Making all in libcurl
make[4]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl'
Making all in opts
make[5]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl/opts'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl/opts'
make[5]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl'
make[5]: Nothing to be done for 'all-am'.
make[5]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl'
make[4]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl'
make[3]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
HUGE tool_hugehelp.c
CC tool_hugehelp.o
CCLD curl
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/src'
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'
| @@ -469,7 +469,7 @@ CURLcode Curl_hyper_stream(struct Curl_easy *data, | |
| infof(data, "Got 417 while waiting for a 100"); | |
| data->state.disableexpect = TRUE; | |
| data->req.newurl = strdup(data->state.url); | |
| - | Curl_done_sending(data, k); |
| + | Curl_req_abort_sending(data); |
| } | |
| result = status_line(data, conn, | |
| @@ -663,7 +663,10 @@ static int uploadstreamed(void *userdata, hyper_context *ctx, | |
| size_t fillcount; | |
| struct Curl_easy *data = (struct Curl_easy *)userdata; | |
| CURLcode result; | |
| + | char *xfer_ulbuf; |
| + | size_t xfer_ulblen; |
| bool eos; | |
| + | int rc = HYPER_POLL_ERROR; |
| (void)ctx; | |
| if(data->req.exp100 > EXP100_SEND_DATA) { | |
| @@ -677,39 +680,44 @@ static int uploadstreamed(void *userdata, hyper_context *ctx, | |
| return HYPER_POLL_PENDING; | |
| } | |
| - | result = Curl_client_read(data, data->state.ulbuf, |
| - | data->set.upload_buffer_size, |
| - | &fillcount, &eos); |
| - | if(result) { |
| - | data->state.hresult = result; |
| - | return HYPER_POLL_ERROR; |
| - | } |
| + | result = Curl_multi_xfer_ulbuf_borrow(data, &xfer_ulbuf, &xfer_ulblen); |
| + | if(result) |
| + | goto out; |
| + | |
| + | result = Curl_client_read(data, xfer_ulbuf, xfer_ulblen, &fillcount, &eos); |
| + | if(result) |
| + | goto out; |
| if(fillcount) { | |
| - | hyper_buf *copy = hyper_buf_copy((uint8_t *)data->state.ulbuf, fillcount); |
| + | hyper_buf *copy = hyper_buf_copy((uint8_t *)xfer_ulbuf, fillcount); |
| if(copy) | |
| *chunk = copy; | |
| else { | |
| - | data->state.hresult = CURLE_OUT_OF_MEMORY; |
| - | return HYPER_POLL_ERROR; |
| + | result = CURLE_OUT_OF_MEMORY; |
| + | goto out; |
| } | |
| /* increasing the writebytecount here is a little premature but we | |
| don't know exactly when the body is sent */ | |
| data->req.writebytecount += fillcount; | |
| Curl_pgrsSetUploadCounter(data, data->req.writebytecount); | |
| - | return HYPER_POLL_READY; |
| + | rc = HYPER_POLL_READY; |
| } | |
| else if(eos) { | |
| *chunk = NULL; | |
| - | return HYPER_POLL_READY; |
| + | rc = HYPER_POLL_READY; |
| } | |
| else { | |
| /* paused, save a waker */ | |
| if(data->hyp.send_body_waker) | |
| hyper_waker_free(data->hyp.send_body_waker); | |
| data->hyp.send_body_waker = hyper_context_waker(ctx); | |
| - | return HYPER_POLL_PENDING; |
| + | rc = HYPER_POLL_PENDING; |
| } | |
| + | |
| + | out: |
| + | Curl_multi_xfer_ulbuf_release(data, xfer_ulbuf); |
| + | data->state.hresult = result; |
| + | return rc; |
| } | |
| /* | |
| @@ -722,7 +730,6 @@ static CURLcode bodysend(struct Curl_easy *data, | |
| hyper_request *hyperreq, | |
| Curl_HttpReq httpreq) | |
| { | |
| - | struct HTTP *http = data->req.p.http; |
| CURLcode result = CURLE_OK; | |
| struct dynbuf req; | |
| if((httpreq == HTTPREQ_GET) || (httpreq == HTTPREQ_HEAD)) | |
| @@ -731,21 +738,21 @@ static CURLcode bodysend(struct Curl_easy *data, | |
| hyper_body *body; | |
| Curl_dyn_init(&req, DYN_HTTP_REQUEST); | |
| result = Curl_http_req_complete(data, &req, httpreq); | |
| + | if(result) |
| + | return result; |
| - | if(!result) |
| + | /* if the "complete" above did produce more than the closing line, |
| + | parse the added headers */ |
| + | if(Curl_dyn_len(&req) != 2 || strcmp(Curl_dyn_ptr(&req), "\r\n")) { |
| result = Curl_hyper_header(data, headers, Curl_dyn_ptr(&req)); | |
| + | if(result) |
| + | return result; |
| + | } |
| Curl_dyn_free(&req); | |
| body = hyper_body_new(); | |
| hyper_body_set_userdata(body, data); | |
| - | result = Curl_get_upload_buffer(data); |
| - | if(result) { |
| - | hyper_body_free(body); |
| - | return result; |
| - | } |
| - | /* init the "upload from here" pointer */ |
| - | data->req.upload_fromhere = data->state.ulbuf; |
| hyper_body_set_data_func(body, uploadstreamed); | |
| if(HYPERE_OK != hyper_request_set_body(hyperreq, body)) { | |
| @@ -753,7 +760,6 @@ static CURLcode bodysend(struct Curl_easy *data, | |
| result = CURLE_OUT_OF_MEMORY; | |
| } | |
| } | |
| - | http->sending = HTTPSEND_BODY; |
| return result; | |
| } | |
| @@ -114,18 +114,12 @@ static CURLcode tunnel_init(struct Curl_cfilter *cf, | |
| struct h1_tunnel_state **pts) | |
| { | |
| struct h1_tunnel_state *ts; | |
| - | CURLcode result; |
| if(cf->conn->handler->flags & PROTOPT_NOTCPPROXY) { | |
| failf(data, "%s cannot be done over CONNECT", cf->conn->handler->scheme); | |
| return CURLE_UNSUPPORTED_PROTOCOL; | |
| } | |
| - | /* we might need the upload buffer for streaming a partial request */ |
| - | result = Curl_get_upload_buffer(data); |
| - | if(result) |
| - | return result; |
| - | |
| ts = calloc(1, sizeof(*ts)); | |
| if(!ts) | |
| return CURLE_OUT_OF_MEMORY; | |
| @@ -291,8 +291,8 @@ static CURLcode file_upload(struct Curl_easy *data) | |
| int fd; | |
| int mode; | |
| CURLcode result = CURLE_OK; | |
| - | char *xfer_buf; |
| - | size_t xfer_blen; |
| + | char *xfer_ulbuf; |
| + | size_t xfer_ulblen; |
| curl_off_t bytecount = 0; | |
| struct_stat file_stat; | |
| const char *sendbuf; | |
| @@ -340,7 +340,7 @@ static CURLcode file_upload(struct Curl_easy *data) | |
| data->state.resume_from = (curl_off_t)file_stat.st_size; | |
| } | |
| - | result = Curl_multi_xfer_buf_borrow(data, &xfer_buf, &xfer_blen); |
| + | result = Curl_multi_xfer_ulbuf_borrow(data, &xfer_ulbuf, &xfer_ulblen); |
| if(result) | |
| goto out; | |
| @@ -349,7 +349,7 @@ static CURLcode file_upload(struct Curl_easy *data) | |
| ssize_t nwrite; | |
| size_t readcount; | |
| - | result = Curl_client_read(data, xfer_buf, xfer_blen, &readcount, &eos); |
| + | result = Curl_client_read(data, xfer_ulbuf, xfer_ulblen, &readcount, &eos); |
| if(result) | |
| break; | |
| @@ -363,16 +363,16 @@ static CURLcode file_upload(struct Curl_easy *data) | |
| if((curl_off_t)nread <= data->state.resume_from) { | |
| data->state.resume_from -= nread; | |
| nread = 0; | |
| - | sendbuf = xfer_buf; |
| + | sendbuf = xfer_ulbuf; |
| } | |
| else { | |
| - | sendbuf = xfer_buf + data->state.resume_from; |
| + | sendbuf = xfer_ulbuf + data->state.resume_from; |
| nread -= (size_t)data->state.resume_from; | |
| data->state.resume_from = 0; | |
| } | |
| } | |
| else | |
| - | sendbuf = xfer_buf; |
| + | sendbuf = xfer_ulbuf; |
| /* write the data to the target */ | |
| nwrite = write(fd, sendbuf, nread); | |
| @@ -395,7 +395,7 @@ static CURLcode file_upload(struct Curl_easy *data) | |
| out: | |
| close(fd); | |
| - | Curl_multi_xfer_buf_release(data, xfer_buf); |
| + | Curl_multi_xfer_ulbuf_release(data, xfer_ulbuf); |
| return result; | |
| } | |
| @@ -1283,7 +1283,6 @@ CURLcode Curl_http_done(struct Curl_easy *data, | |
| if(!http) | |
| return CURLE_OK; | |
| - | Curl_dyn_free(&http->send_buffer); |
| Curl_dyn_reset(&data->state.headerb); | |
| Curl_hyper_done(data); | |
| Curl_ws_done(data); | |
| @@ -2151,6 +2150,12 @@ CURLcode Curl_http_req_complete(struct Curl_easy *data, | |
| CURLcode result = CURLE_OK; | |
| struct HTTP *http = data->req.p.http; | |
| + | if(data->req.upload_chunky) { |
| + | result = Curl_httpchunk_add_reader(data); |
| + | if(result) |
| + | return result; |
| + | } |
| + | |
| DEBUGASSERT(data->conn); | |
| switch(httpreq) { | |
| case HTTPREQ_PUT: /* Let's PUT the data to the server! */ | |
| @@ -2252,7 +2257,6 @@ CURLcode Curl_http_req_complete(struct Curl_easy *data, | |
| data->state.in = (void *) data->state.mimepost; | |
| result = Client_reader_set_fread(data, data->state.infilesize); | |
| } | |
| - | http->sending = HTTPSEND_BODY; |
| break; | |
| #endif | |
| case HTTPREQ_POST: | |
| @@ -2294,19 +2298,21 @@ CURLcode Curl_http_req_complete(struct Curl_easy *data, | |
| goto out; | |
| if(!http->postsize) { | |
| - | Curl_pgrsSetUploadSize(data, -1); |
| + | Curl_pgrsSetUploadSize(data, 0); |
| result = Client_reader_set_null(data); | |
| } | |
| - | else if(data->set.postfields) { /* we have the bytes */ |
| + | else if(data->set.postfields) { |
| Curl_pgrsSetUploadSize(data, http->postsize); | |
| - | result = Client_reader_set_buf(data, data->set.postfields, |
| - | (size_t)http->postsize); |
| + | if(http->postsize > 0) |
| + | result = Client_reader_set_buf(data, data->set.postfields, |
| + | (size_t)http->postsize); |
| + | else |
| + | result = Client_reader_set_null(data); |
| } | |
| else { /* we read the bytes from the callback */ | |
| Curl_pgrsSetUploadSize(data, http->postsize); | |
| result = Client_reader_set_fread(data, http->postsize); | |
| } | |
| - | http->sending = HTTPSEND_BODY; |
| break; | |
| default: | |
| @@ -2647,7 +2653,6 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) | |
| { | |
| struct connectdata *conn = data->conn; | |
| CURLcode result = CURLE_OK; | |
| - | struct HTTP *http; |
| Curl_HttpReq httpreq; | |
| const char *te = ""; /* transfer-encoding */ | |
| const char *request; | |
| @@ -2699,9 +2704,6 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) | |
| if(result) | |
| goto fail; | |
| - | http = data->req.p.http; |
| - | DEBUGASSERT(http); |
| - | |
| result = Curl_http_host(data, conn); | |
| if(result) | |
| goto fail; | |
| @@ -2880,7 +2882,6 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) | |
| result = Curl_add_custom_headers(data, FALSE, &req); | |
| if(!result) { | |
| - | http->postdata = NULL; /* nothing to post at this point */ |
| if((httpreq == HTTPREQ_GET) || | |
| (httpreq == HTTPREQ_HEAD)) | |
| Curl_pgrsSetUploadSize(data, 0); /* nothing */ | |
| @@ -2896,29 +2897,6 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done) | |
| if(result) | |
| goto fail; | |
| - | if(data->req.writebytecount) { |
| - | /* if a request-body has been sent off, we make sure this progress is noted |
| - | properly */ |
| - | Curl_pgrsSetUploadCounter(data, data->req.writebytecount); |
| - | if(Curl_pgrsUpdate(data)) |
| - | result = CURLE_ABORTED_BY_CALLBACK; |
| - | |
| - | if(!http->postsize) { |
| - | /* already sent the entire request body, mark the "upload" as |
| - | complete */ |
| - | infof(data, "upload completely sent off: %" CURL_FORMAT_CURL_OFF_T |
| - | " out of %" CURL_FORMAT_CURL_OFF_T " bytes", |
| - | data->req.writebytecount, http->postsize); |
| - | data->req.upload_done = TRUE; |
| - | data->req.keepon &= ~KEEP_SEND; /* we're done writing */ |
| - | data->req.exp100 = EXP100_SEND_DATA; /* already sent */ |
| - | Curl_expire_done(data, EXPIRE_100_TIMEOUT); |
| - | } |
| - | } |
| - | |
| - | if(data->req.upload_done) |
| - | Curl_conn_ev_data_done_send(data); |
| - | |
| if((conn->httpversion >= 20) && data->req.upload_chunky) | |
| /* upload_chunky was set above to set up the request in a chunky fashion, | |
| but is disabled here again to avoid that the chunked encoded version is | |
| @@ -3782,7 +3760,7 @@ static CURLcode http_rw_headers(struct Curl_easy *data, | |
| * connection for closure after we've read the entire response. | |
| */ | |
| Curl_expire_done(data, EXPIRE_100_TIMEOUT); | |
| - | if(!k->upload_done) { |
| + | if(!Curl_req_done_sending(data)) { |
| if((k->httpcode == 417) && data->state.expect100header) { | |
| /* 417 Expectation Failed - try again without the Expect | |
| header */ | |
| @@ -3801,7 +3779,7 @@ static CURLcode http_rw_headers(struct Curl_easy *data, | |
| data->state.disableexpect = TRUE; | |
| DEBUGASSERT(!data->req.newurl); | |
| data->req.newurl = strdup(data->state.url); | |
| - | Curl_done_sending(data, k); |
| + | Curl_req_abort_sending(data); |
| } | |
| else if(data->set.http_keep_sending_on_error) { | |
| infof(data, "HTTP error before end of send, keep sending"); | |
| @@ -3813,10 +3791,9 @@ static CURLcode http_rw_headers(struct Curl_easy *data, | |
| else { | |
| infof(data, "HTTP error before end of send, stop sending"); | |
| streamclose(conn, "Stop sending data before everything sent"); | |
| - | result = Curl_done_sending(data, k); |
| + | result = Curl_req_abort_sending(data); |
| if(result) | |
| return result; | |
| - | k->upload_done = TRUE; |
| if(data->state.expect100header) | |
| k->exp100 = EXP100_FAILED; | |
| } | |
| @@ -3828,8 +3805,7 @@ static CURLcode http_rw_headers(struct Curl_easy *data, | |
| } | |
| } | |
| - | if(data->state.rewindbeforesend && |
| - | (conn->writesockfd != CURL_SOCKET_BAD)) { |
| + | if(data->state.rewindbeforesend && !Curl_req_done_sending(data)) { |
| /* We rewind before next send, continue sending now */ | |
| infof(data, "Keep sending data to get tossed away"); | |
| k->keepon |= KEEP_SEND; | |
| @@ -189,27 +189,10 @@ CURLcode Curl_http_auth_act(struct Curl_easy *data); | |
| ***************************************************************************/ | |
| struct HTTP { | |
| curl_off_t postsize; /* off_t to handle large file sizes */ | |
| - | const char *postdata; |
| - | struct back { |
| - | curl_read_callback fread_func; /* backup storage for fread pointer */ |
| - | void *fread_in; /* backup storage for fread_in pointer */ |
| - | const char *postdata; |
| - | curl_off_t postsize; |
| - | struct Curl_easy *data; |
| - | } backup; |
| - | |
| - | enum { |
| - | HTTPSEND_NADA, /* init */ |
| - | HTTPSEND_REQUEST, /* sending a request */ |
| - | HTTPSEND_BODY /* sending body */ |
| - | } sending; |
| #ifndef CURL_DISABLE_HTTP | |
| void *h2_ctx; /* HTTP/2 implementation context */ | |
| void *h3_ctx; /* HTTP/3 implementation context */ | |
| - | struct dynbuf send_buffer; /* used if the request couldn't be sent in one |
| - | chunk, points to an allocated send_buffer |
| - | struct */ |
| #endif | |
| }; | |
| @@ -94,7 +94,7 @@ static CURLMcode add_next_timeout(struct curltime now, | |
| static CURLMcode multi_timeout(struct Curl_multi *multi, | |
| long *timeout_ms); | |
| static void process_pending_handles(struct Curl_multi *multi); | |
| - | static void multi_xfer_buf_free(struct Curl_multi *multi); |
| + | static void multi_xfer_bufs_free(struct Curl_multi *multi); |
| #ifdef DEBUGBUILD | |
| static const char * const multi_statename[]={ | |
| @@ -192,7 +192,7 @@ static void mstate(struct Curl_easy *data, CURLMstate state | |
| data->multi->num_alive--; | |
| if(!data->multi->num_alive) { | |
| /* free the transfer buffer when we have no more active transfers */ | |
| - | multi_xfer_buf_free(data->multi); |
| + | multi_xfer_bufs_free(data->multi); |
| } | |
| } | |
| @@ -716,8 +716,6 @@ static CURLcode multi_done(struct Curl_easy *data, | |
| if(!result) | |
| result = Curl_req_done(&data->req, data, premature); | |
| - | Curl_safefree(data->state.ulbuf); |
| - | |
| CONNCACHE_LOCK(data); | |
| Curl_detach_connection(data); | |
| if(CONN_INUSE(conn)) { | |
| @@ -2900,7 +2898,7 @@ CURLMcode curl_multi_cleanup(struct Curl_multi *multi) | |
| Curl_free_multi_ssl_backend_data(multi->ssl_backend_data); | |
| #endif | |
| - | multi_xfer_buf_free(multi); |
| + | multi_xfer_bufs_free(multi); |
| free(multi); | |
| return CURLM_OK; | |
| @@ -3891,10 +3889,66 @@ void Curl_multi_xfer_buf_release(struct Curl_easy *data, char *buf) | |
| data->multi->xfer_buf_borrowed = FALSE; | |
| } | |
| - | static void multi_xfer_buf_free(struct Curl_multi *multi) |
| + | CURLcode Curl_multi_xfer_ulbuf_borrow(struct Curl_easy *data, |
| + | char **pbuf, size_t *pbuflen) |
| + | { |
| + | DEBUGASSERT(data); |
| + | DEBUGASSERT(data->multi); |
| + | *pbuf = NULL; |
| + | *pbuflen = 0; |
| + | if(!data->multi) { |
| + | failf(data, "transfer has no multi handle"); |
| + | return CURLE_FAILED_INIT; |
| + | } |
| + | if(!data->set.upload_buffer_size) { |
| + | failf(data, "transfer upload buffer size is 0"); |
| + | return CURLE_FAILED_INIT; |
| + | } |
| + | if(data->multi->xfer_ulbuf_borrowed) { |
| + | failf(data, "attempt to borrow xfer_ulbuf when already borrowed"); |
| + | return CURLE_AGAIN; |
| + | } |
| + | |
| + | if(data->multi->xfer_ulbuf && |
| + | data->set.upload_buffer_size > data->multi->xfer_ulbuf_len) { |
| + | /* not large enough, get a new one */ |
| + | free(data->multi->xfer_ulbuf); |
| + | data->multi->xfer_ulbuf = NULL; |
| + | data->multi->xfer_ulbuf_len = 0; |
| + | } |
| + | |
| + | if(!data->multi->xfer_ulbuf) { |
| + | data->multi->xfer_ulbuf = malloc((size_t)data->set.upload_buffer_size); |
| + | if(!data->multi->xfer_ulbuf) { |
| + | failf(data, "could not allocate xfer_ulbuf of %zu bytes", |
| + | (size_t)data->set.upload_buffer_size); |
| + | return CURLE_OUT_OF_MEMORY; |
| + | } |
| + | data->multi->xfer_ulbuf_len = data->set.upload_buffer_size; |
| + | } |
| + | |
| + | data->multi->xfer_ulbuf_borrowed = TRUE; |
| + | *pbuf = data->multi->xfer_ulbuf; |
| + | *pbuflen = data->multi->xfer_ulbuf_len; |
| + | return CURLE_OK; |
| + | } |
| + | |
| + | void Curl_multi_xfer_ulbuf_release(struct Curl_easy *data, char *buf) |
| + | { |
| + | (void)buf; |
| + | DEBUGASSERT(data); |
| + | DEBUGASSERT(data->multi); |
| + | DEBUGASSERT(!buf || data->multi->xfer_ulbuf == buf); |
| + | data->multi->xfer_ulbuf_borrowed = FALSE; |
| + | } |
| + | |
| + | static void multi_xfer_bufs_free(struct Curl_multi *multi) |
| { | |
| DEBUGASSERT(multi); | |
| Curl_safefree(multi->xfer_buf); | |
| multi->xfer_buf_len = 0; | |
| multi->xfer_buf_borrowed = FALSE; | |
| + | Curl_safefree(multi->xfer_ulbuf); |
| + | multi->xfer_ulbuf_len = 0; |
| + | multi->xfer_ulbuf_borrowed = FALSE; |
| } | |
| @@ -127,6 +127,9 @@ struct Curl_multi { | |
| /* buffer used for transfer data, lazy initialized */ | |
| char *xfer_buf; /* the actual buffer */ | |
| size_t xfer_buf_len; /* the allocated length */ | |
| + | /* buffer used for upload data, lazy initialized */ |
| + | char *xfer_ulbuf; /* the actual buffer */ |
| + | size_t xfer_ulbuf_len; /* the allocated length */ |
| #if defined(USE_SSL) | |
| struct multi_ssl_backend_data *ssl_backend_data; | |
| @@ -176,6 +179,7 @@ struct Curl_multi { | |
| BIT(dead); /* a callback returned error, everything needs to crash and | |
| burn */ | |
| BIT(xfer_buf_borrowed); /* xfer_buf is currently being borrowed */ | |
| + | BIT(xfer_ulbuf_borrowed); /* xfer_buf is currently being borrowed */ |
| #ifdef DEBUGBUILD | |
| BIT(warned); /* true after user warned of DEBUGBUILD */ | |
| #endif | |
| @@ -118,4 +118,29 @@ CURLcode Curl_multi_xfer_buf_borrow(struct Curl_easy *data, | |
| */ | |
| void Curl_multi_xfer_buf_release(struct Curl_easy *data, char *buf); | |
| + | /** |
| + | * Borrow the upload buffer from the multi, suitable |
| + | * for the given transfer `data`. The buffer may only be used in one |
| + | * multi processing of the easy handle. It MUST be returned to the |
| + | * multi before it can be borrowed again. |
| + | * Pointers into the buffer remain only valid as long as it is borrowed. |
| + | * |
| + | * @param data the easy handle |
| + | * @param pbuf on return, the buffer to use or NULL on error |
| + | * @param pbuflen on return, the size of *pbuf or 0 on error |
| + | * @return CURLE_OK when buffer is available and is returned. |
| + | * CURLE_OUT_OF_MEMORy on failure to allocate the buffer, |
| + | * CURLE_FAILED_INIT if the easy handle is without multi. |
| + | * CURLE_AGAIN if the buffer is borrowed already. |
| + | */ |
| + | CURLcode Curl_multi_xfer_ulbuf_borrow(struct Curl_easy *data, |
| + | char **pbuf, size_t *pbuflen); |
| + | |
| + | /** |
| + | * Release the borrowed upload buffer. All references into the buffer become |
| + | * invalid after this. |
| + | * @param buf the upload buffer pointer borrowed for coding error checks. |
| + | */ |
| + | void Curl_multi_xfer_ulbuf_release(struct Curl_easy *data, char *buf); |
| + | |
| #endif /* HEADER_CURL_MULTIIF_H */ | |
| @@ -25,6 +25,7 @@ | |
| #include "curl_setup.h" | |
| #include "urldata.h" | |
| + | #include "cfilters.h" |
| #include "dynbuf.h" | |
| #include "doh.h" | |
| #include "multiif.h" | |
| @@ -67,12 +68,14 @@ CURLcode Curl_req_start(struct SingleRequest *req, | |
| return CURLE_OK; | |
| } | |
| + | static CURLcode req_flush(struct Curl_easy *data); |
| + | |
| CURLcode Curl_req_done(struct SingleRequest *req, | |
| struct Curl_easy *data, bool aborted) | |
| { | |
| (void)req; | |
| if(!aborted) | |
| - | (void)Curl_req_flush(data); |
| + | (void)req_flush(data); |
| Curl_client_reset(data); | |
| return CURLE_OK; | |
| } | |
| @@ -129,9 +132,9 @@ void Curl_req_free(struct SingleRequest *req, struct Curl_easy *data) | |
| #endif | |
| } | |
| - | static CURLcode req_send(struct Curl_easy *data, |
| - | const char *buf, size_t blen, |
| - | size_t hds_len, size_t *pnwritten) |
| + | static CURLcode xfer_send(struct Curl_easy *data, |
| + | const char *buf, size_t blen, |
| + | size_t hds_len, size_t *pnwritten) |
| { | |
| CURLcode result = CURLE_OK; | |
| @@ -180,7 +183,7 @@ static CURLcode req_send_buffer_flush(struct Curl_easy *data) | |
| while(Curl_bufq_peek(&data->req.sendbuf, &buf, &blen)) { | |
| size_t nwritten, hds_len = CURLMIN(data->req.sendbuf_hds_len, blen); | |
| - | result = req_send(data, (const char *)buf, blen, hds_len, &nwritten); |
| + | result = xfer_send(data, (const char *)buf, blen, hds_len, &nwritten); |
| if(result) | |
| break; | |
| @@ -206,7 +209,33 @@ static CURLcode req_send_buffer_flush(struct Curl_easy *data) | |
| return result; | |
| } | |
| - | CURLcode Curl_req_flush(struct Curl_easy *data) |
| + | static CURLcode req_set_upload_done(struct Curl_easy *data) |
| + | { |
| + | DEBUGASSERT(!data->req.upload_done); |
| + | data->req.upload_done = TRUE; |
| + | data->req.keepon &= ~KEEP_SEND; /* we're done sending */ |
| + | |
| + | /* FIXME: http specific stuff, need to go somewhere else */ |
| + | data->req.exp100 = EXP100_SEND_DATA; |
| + | Curl_expire_done(data, EXPIRE_100_TIMEOUT); |
| + | |
| + | if(data->req.upload_aborted) { |
| + | if(data->req.writebytecount) |
| + | infof(data, "abort upload after having sent %" CURL_FORMAT_CURL_OFF_T |
| + | " bytes", data->req.writebytecount); |
| + | else |
| + | infof(data, "abort upload"); |
| + | } |
| + | else if(data->req.writebytecount) |
| + | infof(data, "upload completely sent off: %" CURL_FORMAT_CURL_OFF_T |
| + | " bytes", data->req.writebytecount); |
| + | else |
| + | infof(data, "We are completely uploaded and fine"); |
| + | |
| + | return Curl_xfer_send_close(data); |
| + | } |
| + | |
| + | static CURLcode req_flush(struct Curl_easy *data) |
| { | |
| CURLcode result; | |
| @@ -221,9 +250,30 @@ CURLcode Curl_req_flush(struct Curl_easy *data) | |
| return CURLE_AGAIN; | |
| } | |
| } | |
| + | |
| + | if(!data->req.upload_done && data->req.eos_read && |
| + | Curl_bufq_is_empty(&data->req.sendbuf)) { |
| + | return req_set_upload_done(data); |
| + | } |
| return CURLE_OK; | |
| } | |
| + | static ssize_t add_from_client(void *reader_ctx, |
| + | unsigned char *buf, size_t buflen, |
| + | CURLcode *err) |
| + | { |
| + | struct Curl_easy *data = reader_ctx; |
| + | size_t nread; |
| + | bool eos; |
| + | |
| + | *err = Curl_client_read(data, (char *)buf, buflen, &nread, &eos); |
| + | if(*err) |
| + | return -1; |
| + | if(eos) |
| + | data->req.eos_read = TRUE; |
| + | return (ssize_t)nread; |
| + | } |
| + | |
| #ifndef USE_HYPER | |
| static CURLcode req_send_buffer_add(struct Curl_easy *data, | |
| @@ -242,22 +292,6 @@ static CURLcode req_send_buffer_add(struct Curl_easy *data, | |
| return CURLE_OK; | |
| } | |
| - | static ssize_t add_from_client(void *reader_ctx, |
| - | unsigned char *buf, size_t buflen, |
| - | CURLcode *err) |
| - | { |
| - | struct Curl_easy *data = reader_ctx; |
| - | size_t nread; |
| - | bool eos; |
| - | |
| - | *err = Curl_client_read(data, (char *)buf, buflen, &nread, &eos); |
| - | if(*err) |
| - | return -1; |
| - | if(eos) |
| - | data->req.eos_read = TRUE; |
| - | return (ssize_t)nread; |
| - | } |
| - | |
| CURLcode Curl_req_send(struct Curl_easy *data, struct dynbuf *buf) | |
| { | |
| CURLcode result; | |
| @@ -275,22 +309,50 @@ CURLcode Curl_req_send(struct Curl_easy *data, struct dynbuf *buf) | |
| if(result) | |
| return result; | |
| - | if((data->req.exp100 == EXP100_SEND_DATA) && |
| - | !Curl_bufq_is_full(&data->req.sendbuf)) { |
| + | return Curl_req_send_more(data); |
| + | } |
| + | #endif /* !USE_HYPER */ |
| + | |
| + | bool Curl_req_want_send(struct Curl_easy *data) |
| + | { |
| + | return data->req.sendbuf_init && !Curl_bufq_is_empty(&data->req.sendbuf); |
| + | } |
| + | |
| + | bool Curl_req_done_sending(struct Curl_easy *data) |
| + | { |
| + | if(data->req.upload_done) { |
| + | DEBUGASSERT(Curl_bufq_is_empty(&data->req.sendbuf)); |
| + | return TRUE; |
| + | } |
| + | return FALSE; |
| + | } |
| + | |
| + | CURLcode Curl_req_send_more(struct Curl_easy *data) |
| + | { |
| + | CURLcode result; |
| + | |
| + | /* Fill our send buffer if more from client can be read and |
| + | * we are not in a "expect-100" situation. */ |
| + | if(!data->req.eos_read && !Curl_bufq_is_full(&data->req.sendbuf) && |
| + | (data->req.exp100 == EXP100_SEND_DATA)) { |
| ssize_t nread = Curl_bufq_sipn(&data->req.sendbuf, 0, | |
| add_from_client, data, &result); | |
| if(nread < 0 && result != CURLE_AGAIN) | |
| return result; | |
| } | |
| - | result = req_send_buffer_flush(data); |
| + | result = req_flush(data); |
| if(result == CURLE_AGAIN) | |
| result = CURLE_OK; | |
| return result; | |
| } | |
| - | #endif /* !USE_HYPER */ |
| - | bool Curl_req_want_send(struct Curl_easy *data) |
| + | CURLcode Curl_req_abort_sending(struct Curl_easy *data) |
| { | |
| - | return data->req.sendbuf_init && !Curl_bufq_is_empty(&data->req.sendbuf); |
| + | if(!data->req.upload_done) { |
| + | Curl_bufq_reset(&data->req.sendbuf); |
| + | data->req.upload_aborted = TRUE; |
| + | return req_set_upload_done(data); |
| + | } |
| + | return CURLE_OK; |
| } | |
| @@ -100,16 +100,6 @@ struct SingleRequest { | |
| char *newurl; /* Set to the new URL to use when a redirect or a retry is | |
| wanted */ | |
| - | /* 'upload_present' is used to keep a byte counter of how much data there is |
| - | still left in the buffer, aimed for upload. */ |
| - | size_t upload_present; |
| - | |
| - | /* 'upload_fromhere' is used as a read-pointer when we uploaded parts of a |
| - | buffer, so the next read should read from where this pointer points to, |
| - | and the 'upload_present' contains the number of bytes available at this |
| - | position */ |
| - | char *upload_fromhere; |
| - | |
| /* Allocated protocol-specific data. Each protocol handler makes sure this | |
| points to data it needs. */ | |
| union { | |
| @@ -139,8 +129,9 @@ struct SingleRequest { | |
| BIT(download_done); /* set to TRUE when download is complete */ | |
| BIT(eos_written); /* iff EOS has been written to client */ | |
| BIT(eos_read); /* iff EOS has been read from the client */ | |
| - | BIT(upload_done); /* set to TRUE when doing chunked transfer-encoding |
| - | upload and we're uploading the last chunk */ |
| + | BIT(upload_done); /* set to TRUE when all request data has been sent */ |
| + | BIT(upload_aborted); /* set to TRUE when upload was aborted. Will also |
| + | * show `upload_done` as TRUE. */ |
| BIT(ignorebody); /* we read a response-body but we ignore it! */ | |
| BIT(http_bodyless); /* HTTP response status code is between 100 and 199, | |
| 204 or 304 */ | |
| @@ -206,15 +197,26 @@ CURLcode Curl_req_send(struct Curl_easy *data, struct dynbuf *buf); | |
| #endif /* !USE_HYPER */ | |
| /** | |
| - | * Flush all buffered request bytes. |
| - | * @return CURLE_OK on success, CURLE_AGAIN if sending was blocked, |
| - | * or the error on the sending. |
| + | * TRUE iff the request has sent all request headers and data. |
| + | */ |
| + | bool Curl_req_done_sending(struct Curl_easy *data); |
| + | |
| + | /* |
| + | * Read more from client and flush all buffered request bytes. |
| + | * @return CURLE_OK on success or the error on the sending. |
| + | * Never returns CURLE_AGAIN. |
| */ | |
| - | CURLcode Curl_req_flush(struct Curl_easy *data); |
| + | CURLcode Curl_req_send_more(struct Curl_easy *data); |
| /** | |
| * TRUE iff the request wants to send, e.g. has buffered bytes. | |
| */ | |
| bool Curl_req_want_send(struct Curl_easy *data); | |
| + | /** |
| + | * Stop sending any more request data to the server. |
| + | * Will clear the send buffer and mark request sending as done. |
| + | */ |
| + | CURLcode Curl_req_abort_sending(struct Curl_easy *data); |
| + | |
| #endif /* HEADER_CURL_REQUEST_H */ | |
| @@ -577,6 +577,8 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) | |
| if(result) | |
| goto out; | |
| + | Curl_xfer_setup(data, FIRSTSOCKET, -1, TRUE, FIRSTSOCKET); |
| + | |
| /* issue the request */ | |
| result = Curl_req_send(data, &req_buffer); | |
| if(result) { | |
| @@ -584,8 +586,6 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done) | |
| goto out; | |
| } | |
| - | Curl_xfer_setup(data, FIRSTSOCKET, -1, TRUE, FIRSTSOCKET); |
| - | |
| /* Increment the CSeq on success */ | |
| data->state.rtsp_next_client_CSeq++; | |
| @@ -576,8 +576,10 @@ static CURLcode cr_in_read(struct Curl_easy *data, | |
| return CURLE_READ_ERROR; | |
| } | |
| ctx->read_len += nread; | |
| + | if(ctx->total_len >= 0) |
| + | ctx->seen_eos = (ctx->read_len >= ctx->total_len); |
| *pnread = nread; | |
| - | *peos = FALSE; |
| + | *peos = ctx->seen_eos; |
| break; | |
| } | |
| DEBUGF(infof(data, "cr_in_read(len=%zu, total=%"CURL_FORMAT_CURL_OFF_T | |
| @@ -743,7 +745,7 @@ static CURLcode cr_lc_add(struct Curl_easy *data) | |
| CURLcode result; | |
| result = Curl_creader_create(&reader, data, &cr_lc, | |
| - | CURL_CR_TRANSFER_ENCODE); |
| + | CURL_CR_CONTENT_ENCODE); |
| if(!result) | |
| result = Curl_creader_add(data, reader); | |
| @@ -2239,7 +2239,6 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) | |
| arg = UPLOADBUFFER_MIN; | |
| data->set.upload_buffer_size = (unsigned int)arg; | |
| - | Curl_safefree(data->state.ulbuf); /* force a realloc next opportunity */ |
| break; | |
| case CURLOPT_NOSIGNAL: | |
| @@ -456,6 +456,9 @@ static CURLcode smb_connect(struct Curl_easy *data, bool *done) | |
| smbc->recv_buf = malloc(MAX_MESSAGE_SIZE); | |
| if(!smbc->recv_buf) | |
| return CURLE_OUT_OF_MEMORY; | |
| + | smbc->send_buf = malloc(MAX_MESSAGE_SIZE); |
| + | if(!smbc->send_buf) |
| + | return CURLE_OUT_OF_MEMORY; |
| /* Multiple requests are allowed with this connection */ | |
| connkeep(conn, "SMB default"); | |
| @@ -567,7 +570,7 @@ static CURLcode smb_send(struct Curl_easy *data, size_t len, | |
| size_t bytes_written; | |
| CURLcode result; | |
| - | result = Curl_xfer_send(data, data->state.ulbuf, len, &bytes_written); |
| + | result = Curl_xfer_send(data, smbc->send_buf, len, &bytes_written); |
| if(result) | |
| return result; | |
| @@ -592,7 +595,7 @@ static CURLcode smb_flush(struct Curl_easy *data) | |
| if(!smbc->send_size) | |
| return CURLE_OK; | |
| - | result = Curl_xfer_send(data, data->state.ulbuf + smbc->sent, len, |
| + | result = Curl_xfer_send(data, smbc->send_buf + smbc->sent, len, |
| &bytes_written); | |
| if(result) | |
| return result; | |
| @@ -608,13 +611,13 @@ static CURLcode smb_flush(struct Curl_easy *data) | |
| static CURLcode smb_send_message(struct Curl_easy *data, unsigned char cmd, | |
| const void *msg, size_t msg_len) | |
| { | |
| - | CURLcode result = Curl_get_upload_buffer(data); |
| - | if(result) |
| - | return result; |
| - | smb_format_message(data, (struct smb_header *)data->state.ulbuf, |
| + | struct connectdata *conn = data->conn; |
| + | struct smb_conn *smbc = &conn->proto.smbc; |
| + | |
| + | smb_format_message(data, (struct smb_header *)smbc->send_buf, |
| cmd, msg_len); | |
| - | memcpy(data->state.ulbuf + sizeof(struct smb_header), |
| - | msg, msg_len); |
| + | DEBUGASSERT((sizeof(struct smb_header) + msg_len) <= MAX_MESSAGE_SIZE); |
| + | memcpy(smbc->send_buf + sizeof(struct smb_header), msg, msg_len); |
| return smb_send(data, sizeof(struct smb_header) + msg_len, 0); | |
| } | |
| @@ -772,15 +775,14 @@ static CURLcode smb_send_read(struct Curl_easy *data) | |
| static CURLcode smb_send_write(struct Curl_easy *data) | |
| { | |
| + | struct connectdata *conn = data->conn; |
| + | struct smb_conn *smbc = &conn->proto.smbc; |
| struct smb_write *msg; | |
| struct smb_request *req = data->req.p.smb; | |
| curl_off_t offset = data->req.offset; | |
| curl_off_t upload_size = data->req.size - data->req.bytecount; | |
| - | CURLcode result = Curl_get_upload_buffer(data); |
| - | if(result) |
| - | return result; |
| - | msg = (struct smb_write *)data->state.ulbuf; |
| + | msg = (struct smb_write *)smbc->send_buf; |
| if(upload_size >= MAX_PAYLOAD_SIZE - 1) /* There is one byte of padding */ | |
| upload_size = MAX_PAYLOAD_SIZE - 1; | |
| @@ -809,11 +811,11 @@ static CURLcode smb_send_and_recv(struct Curl_easy *data, void **msg) | |
| /* Check if there is data in the transfer buffer */ | |
| if(!smbc->send_size && smbc->upload_size) { | |
| - | size_t nread = smbc->upload_size > (size_t)data->set.upload_buffer_size ? |
| - | (size_t)data->set.upload_buffer_size : smbc->upload_size; |
| + | size_t nread = smbc->upload_size > (size_t)MAX_MESSAGE_SIZE ? |
| + | (size_t)MAX_MESSAGE_SIZE : smbc->upload_size; |
| bool eos; | |
| - | result = Curl_client_read(data, data->state.ulbuf, nread, &nread, &eos); |
| + | result = Curl_client_read(data, smbc->send_buf, nread, &nread, &eos); |
| if(result && result != CURLE_AGAIN) | |
| return result; | |
| if(!nread) | |
| @@ -1131,6 +1133,7 @@ static CURLcode smb_disconnect(struct Curl_easy *data, | |
| Curl_safefree(smbc->share); | |
| Curl_safefree(smbc->domain); | |
| Curl_safefree(smbc->recv_buf); | |
| + | Curl_safefree(smbc->send_buf); |
| return CURLE_OK; | |
| } | |
| @@ -42,6 +42,7 @@ struct smb_conn { | |
| unsigned int session_key; | |
| unsigned short uid; | |
| char *recv_buf; | |
| + | char *send_buf; |
| size_t upload_size; | |
| size_t send_size; | |
| size_t sent; | |
| @@ -111,6 +111,7 @@ static CURLcode smtp_continue_auth(struct Curl_easy *data, const char *mech, | |
| const struct bufref *resp); | |
| static CURLcode smtp_cancel_auth(struct Curl_easy *data, const char *mech); | |
| static CURLcode smtp_get_message(struct Curl_easy *data, struct bufref *out); | |
| + | static CURLcode cr_eob_add(struct Curl_easy *data); |
| /* | |
| * SMTP protocol handler. | |
| @@ -618,7 +619,7 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data) | |
| result = smtp_parse_address(data->set.str[STRING_MAIL_FROM], | |
| &address, &host); | |
| if(result) | |
| - | return result; |
| + | goto out; |
| /* Establish whether we should report SMTPUTF8 to the server for this | |
| mailbox as per RFC-6531 sect. 3.1 point 4 and sect. 3.4 */ | |
| @@ -642,8 +643,10 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data) | |
| /* Null reverse-path, RFC-5321, sect. 3.6.3 */ | |
| from = strdup("<>"); | |
| - | if(!from) |
| - | return CURLE_OUT_OF_MEMORY; |
| + | if(!from) { |
| + | result = CURLE_OUT_OF_MEMORY; |
| + | goto out; |
| + | } |
| /* Calculate the optional AUTH parameter */ | |
| if(data->set.str[STRING_MAIL_AUTH] && conn->proto.smtpc.sasl.authused) { | |
| @@ -655,10 +658,8 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data) | |
| converting the host name to an IDN A-label if necessary */ | |
| result = smtp_parse_address(data->set.str[STRING_MAIL_AUTH], | |
| &address, &host); | |
| - | if(result) { |
| - | free(from); |
| - | return result; |
| - | } |
| + | if(result) |
| + | goto out; |
| /* Establish whether we should report SMTPUTF8 to the server for this | |
| mailbox as per RFC-6531 sect. 3.1 point 4 and sect. 3.4 */ | |
| @@ -676,17 +677,14 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data) | |
| /* An invalid mailbox was provided but we'll simply let the server | |
| worry about it */ | |
| auth = aprintf("<%s>", address); | |
| - | |
| - | free(address); |
| } | |
| else | |
| /* Empty AUTH, RFC-2554, sect. 5 */ | |
| auth = strdup("<>"); | |
| if(!auth) { | |
| - | free(from); |
| - | |
| - | return CURLE_OUT_OF_MEMORY; |
| + | result = CURLE_OUT_OF_MEMORY; |
| + | goto out; |
| } | |
| } | |
| @@ -710,12 +708,8 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data) | |
| if(!result) | |
| result = Curl_mime_rewind(&data->set.mimepost); | |
| - | if(result) { |
| - | free(from); |
| - | free(auth); |
| - | |
| - | return result; |
| - | } |
| + | if(result) |
| + | goto out; |
| data->state.infilesize = Curl_mime_size(&data->set.mimepost); | |
| @@ -730,10 +724,8 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data) | |
| size = aprintf("%" CURL_FORMAT_CURL_OFF_T, data->state.infilesize); | |
| if(!size) { | |
| - | free(from); |
| - | free(auth); |
| - | |
| - | return CURLE_OUT_OF_MEMORY; |
| + | result = CURLE_OUT_OF_MEMORY; |
| + | goto out; |
| } | |
| } | |
| @@ -754,6 +746,15 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data) | |
| } | |
| } | |
| + | /* Setup client reader for size and EOB conversion */ |
| + | result = Client_reader_set_fread(data, data->state.infilesize); |
| + | if(result) |
| + | goto out; |
| + | /* Add the client reader doing STMP EOB escaping */ |
| + | result = cr_eob_add(data); |
| + | if(result) |
| + | goto out; |
| + | |
| /* Send the MAIL command */ | |
| result = Curl_pp_sendf(data, &conn->proto.smtpc.pp, | |
| "MAIL FROM:%s%s%s%s%s%s", | |
| @@ -765,6 +766,7 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data) | |
| utf8 ? " SMTPUTF8" /* Internationalised mailbox */ | |
| : ""); /* included in our envelope */ | |
| + | out: |
| free(from); | |
| free(auth); | |
| free(size); | |
| @@ -1393,9 +1395,6 @@ static CURLcode smtp_done(struct Curl_easy *data, CURLcode status, | |
| CURLcode result = CURLE_OK; | |
| struct connectdata *conn = data->conn; | |
| struct SMTP *smtp = data->req.p.smtp; | |
| - | struct pingpong *pp = &conn->proto.smtpc.pp; |
| - | char *eob; |
| - | size_t len, bytes_written; |
| (void)premature; | |
| @@ -1411,46 +1410,6 @@ static CURLcode smtp_done(struct Curl_easy *data, CURLcode status, | |
| } | |
| else if(!data->set.connect_only && data->set.mail_rcpt && | |
| (data->state.upload || IS_MIME_POST(data))) { | |
| - | /* Calculate the EOB taking into account any terminating CRLF from the |
| - | previous line of the email or the CRLF of the DATA command when there |
| - | is "no mail data". RFC-5321, sect. 4.1.1.4. |
| - | |
| - | Note: As some SSL backends, such as OpenSSL, will cause Curl_write() to |
| - | fail when using a different pointer following a previous write, that |
| - | returned CURLE_AGAIN, we duplicate the EOB now rather than when the |
| - | bytes written doesn't equal len. */ |
| - | if(smtp->trailing_crlf || !data->state.infilesize) { |
| - | eob = strdup(&SMTP_EOB[2]); |
| - | len = SMTP_EOB_LEN - 2; |
| - | } |
| - | else { |
| - | eob = strdup(SMTP_EOB); |
| - | len = SMTP_EOB_LEN; |
| - | } |
| - | |
| - | if(!eob) |
| - | return CURLE_OUT_OF_MEMORY; |
| - | |
| - | /* Send the end of block data */ |
| - | result = Curl_xfer_send(data, eob, len, &bytes_written); |
| - | if(result) { |
| - | free(eob); |
| - | return result; |
| - | } |
| - | |
| - | if(bytes_written != len) { |
| - | /* The whole chunk was not sent so keep it around and adjust the |
| - | pingpong structure accordingly */ |
| - | pp->sendthis = eob; |
| - | pp->sendsize = len; |
| - | pp->sendleft = len - bytes_written; |
| - | } |
| - | else { |
| - | /* Successfully sent so adjust the response timeout relative to now */ |
| - | pp->response = Curl_now(); |
| - | |
| - | free(eob); |
| - | } |
| smtp_state(data, SMTP_POSTDATA); | |
| @@ -1818,108 +1777,159 @@ static CURLcode smtp_parse_address(const char *fqma, char **address, | |
| return result; | |
| } | |
| - | CURLcode Curl_smtp_escape_eob(struct Curl_easy *data, |
| - | const ssize_t nread, |
| - | const ssize_t offset) |
| + | struct cr_eob_ctx { |
| + | struct Curl_creader super; |
| + | struct bufq buf; |
| + | size_t n_eob; /* how many EOB bytes we matched so far */ |
| + | size_t eob; /* Number of bytes of the EOB (End Of Body) that |
| + | have been received so far */ |
| + | BIT(read_eos); /* we read an EOS from the next reader */ |
| + | BIT(eos); /* we have returned an EOS */ |
| + | }; |
| + | |
| + | static CURLcode cr_eob_init(struct Curl_easy *data, |
| + | struct Curl_creader *reader) |
| { | |
| - | /* When sending a SMTP payload we must detect CRLF. sequences making sure |
| - | they are sent as CRLF.. instead, as a . on the beginning of a line will |
| - | be deleted by the server when not part of an EOB terminator and a |
| - | genuine CRLF.CRLF which isn't escaped will wrongly be detected as end of |
| - | data by the server |
| - | */ |
| - | ssize_t i; |
| - | ssize_t si; |
| - | struct SMTP *smtp = data->req.p.smtp; |
| - | char *scratch = data->state.scratch; |
| - | char *newscratch = NULL; |
| - | char *oldscratch = NULL; |
| - | size_t eob_sent; |
| + | struct cr_eob_ctx *ctx = (struct cr_eob_ctx *)reader; |
| + | (void)data; |
| + | /* The first char we read is the first on a line, as if we had |
| + | * read CRLF just before */ |
| + | ctx->n_eob = 2; |
| + | Curl_bufq_init2(&ctx->buf, (16 * 1024), 1, BUFQ_OPT_SOFT_LIMIT); |
| + | return CURLE_OK; |
| + | } |
| - | /* Do we need to allocate a scratch buffer? */ |
| - | if(!scratch || data->set.crlf) { |
| - | oldscratch = scratch; |
| + | static void cr_eob_close(struct Curl_easy *data, struct Curl_creader *reader) |
| + | { |
| + | struct cr_eob_ctx *ctx = (struct cr_eob_ctx *)reader; |
| + | (void)data; |
| + | Curl_bufq_free(&ctx->buf); |
| + | } |
| - | scratch = newscratch = malloc(2 * data->set.upload_buffer_size); |
| - | if(!newscratch) { |
| - | failf(data, "Failed to alloc scratch buffer"); |
| + | /* this is the 5-bytes End-Of-Body marker for SMTP */ |
| + | #define SMTP_EOB "\r\n.\r\n" |
| + | #define SMTP_EOB_FIND_LEN 3 |
| - | return CURLE_OUT_OF_MEMORY; |
| - | } |
| - | } |
| - | DEBUGASSERT((size_t)data->set.upload_buffer_size >= (size_t)nread); |
| - | |
| - | /* Have we already sent part of the EOB? */ |
| - | eob_sent = smtp->eob; |
| - | |
| - | /* This loop can be improved by some kind of Boyer-Moore style of |
| - | approach but that is saved for later... */ |
| - | if(offset) |
| - | memcpy(scratch, data->req.upload_fromhere, offset); |
| - | for(i = offset, si = offset; i < nread; i++) { |
| - | if(SMTP_EOB[smtp->eob] == data->req.upload_fromhere[i]) { |
| - | smtp->eob++; |
| - | |
| - | /* Is the EOB potentially the terminating CRLF? */ |
| - | if(2 == smtp->eob || SMTP_EOB_LEN == smtp->eob) |
| - | smtp->trailing_crlf = TRUE; |
| - | else |
| - | smtp->trailing_crlf = FALSE; |
| - | } |
| - | else if(smtp->eob) { |
| - | /* A previous substring matched so output that first */ |
| - | memcpy(&scratch[si], &SMTP_EOB[eob_sent], smtp->eob - eob_sent); |
| - | si += smtp->eob - eob_sent; |
| - | |
| - | /* Then compare the first byte */ |
| - | if(SMTP_EOB[0] == data->req.upload_fromhere[i]) |
| - | smtp->eob = 1; |
| - | else |
| - | smtp->eob = 0; |
| + | /* client reader doing SMTP End-Of-Body escaping. */ |
| + | static CURLcode cr_eob_read(struct Curl_easy *data, |
| + | struct Curl_creader *reader, |
| + | char *buf, size_t blen, |
| + | size_t *pnread, bool *peos) |
| + | { |
| + | struct cr_eob_ctx *ctx = (struct cr_eob_ctx *)reader; |
| + | CURLcode result = CURLE_OK; |
| + | size_t nread, i, start, n; |
| + | bool eos; |
| + | |
| + | if(!ctx->read_eos && Curl_bufq_is_empty(&ctx->buf)) { |
| + | /* Get more and convert it when needed */ |
| + | result = Curl_creader_read(data, reader->next, buf, blen, &nread, &eos); |
| + | if(result) |
| + | return result; |
| + | |
| + | ctx->read_eos = eos; |
| + | if(nread) { |
| + | if(!ctx->n_eob && !memchr(buf, SMTP_EOB[0], nread)) { |
| + | /* not in the middle of a match, no EOB start found, just pass */ |
| + | *pnread = nread; |
| + | *peos = FALSE; |
| + | return CURLE_OK; |
| + | } |
| + | /* scan for EOB (continuation) and convert */ |
| + | for(i = start = 0; i < nread; ++i) { |
| + | if(ctx->n_eob >= SMTP_EOB_FIND_LEN) { |
| + | /* matched the EOB prefix and seeing additional char, add '.' */ |
| + | result = Curl_bufq_cwrite(&ctx->buf, buf + start, i - start, &n); |
| + | if(result) |
| + | return result; |
| + | result = Curl_bufq_cwrite(&ctx->buf, ".", 1, &n); |
| + | if(result) |
| + | return result; |
| + | ctx->n_eob = 0; |
| + | start = i; |
| + | if(data->state.infilesize > 0) |
| + | data->state.infilesize++; |
| + | } |
| + | |
| + | if(buf[i] != SMTP_EOB[ctx->n_eob]) |
| + | ctx->n_eob = 0; |
| - | eob_sent = 0; |
| + | if(buf[i] == SMTP_EOB[ctx->n_eob]) { |
| + | /* matching another char of the EOB */ |
| + | ++ctx->n_eob; |
| + | } |
| + | } |
| - | /* Reset the trailing CRLF flag as there was more data */ |
| - | smtp->trailing_crlf = FALSE; |
| + | /* add any remainder to buf */ |
| + | if(start < nread) { |
| + | result = Curl_bufq_cwrite(&ctx->buf, buf + start, nread - start, &n); |
| + | if(result) |
| + | return result; |
| + | } |
| } | |
| - | /* Do we have a match for CRLF. as per RFC-5321, sect. 4.5.2 */ |
| - | if(SMTP_EOB_FIND_LEN == smtp->eob) { |
| - | /* Copy the replacement data to the target buffer */ |
| - | memcpy(&scratch[si], &SMTP_EOB_REPL[eob_sent], |
| - | SMTP_EOB_REPL_LEN - eob_sent); |
| - | si += SMTP_EOB_REPL_LEN - eob_sent; |
| - | smtp->eob = 0; |
| - | eob_sent = 0; |
| + | if(ctx->read_eos) { |
| + | /* if we last matched a CRLF or if the data was empty, add ".\r\n" |
| + | * to end the body. If we sent something and it did not end with "\r\n", |
| + | * add "\r\n.\r\n" to end the body */ |
| + | const char *eob = SMTP_EOB; |
| + | switch(ctx->n_eob) { |
| + | case 2: |
| + | /* seen a CRLF at the end, just add the remainder */ |
| + | eob = &SMTP_EOB[2]; |
| + | break; |
| + | case 3: |
| + | /* ended with '\r\n.', we should escpe the last '.' */ |
| + | eob = "." SMTP_EOB; |
| + | break; |
| + | default: |
| + | break; |
| + | } |
| + | result = Curl_bufq_cwrite(&ctx->buf, eob, strlen(eob), &n); |
| + | if(result) |
| + | return result; |
| } | |
| - | else if(!smtp->eob) |
| - | scratch[si++] = data->req.upload_fromhere[i]; |
| } | |
| - | if(smtp->eob - eob_sent) { |
| - | /* A substring matched before processing ended so output that now */ |
| - | memcpy(&scratch[si], &SMTP_EOB[eob_sent], smtp->eob - eob_sent); |
| - | si += smtp->eob - eob_sent; |
| + | *peos = FALSE; |
| + | if(!Curl_bufq_is_empty(&ctx->buf)) { |
| + | result = Curl_bufq_cread(&ctx->buf, buf, blen, pnread); |
| } | |
| + | else |
| + | *pnread = 0; |
| - | /* Only use the new buffer if we replaced something */ |
| - | if(si != nread) { |
| - | /* Upload from the new (replaced) buffer instead */ |
| - | data->req.upload_fromhere = scratch; |
| + | if(ctx->read_eos && Curl_bufq_is_empty(&ctx->buf)) { |
| + | /* no more data, read all, done. */ |
| + | ctx->eos = TRUE; |
| + | } |
| + | *peos = ctx->eos; |
| + | DEBUGF(infof(data, "cr_eob_read(%zu) -> %d, %zd, %d", |
| + | blen, result, *pnread, *peos)); |
| + | return CURLE_OK; |
| + | } |
| - | /* Save the buffer so it can be freed later */ |
| - | data->state.scratch = scratch; |
| + | static const struct Curl_crtype cr_eob = { |
| + | "cr-smtp-eob", |
| + | cr_eob_init, |
| + | cr_eob_read, |
| + | cr_eob_close, |
| + | Curl_creader_def_needs_rewind, |
| + | sizeof(struct cr_eob_ctx) |
| + | }; |
| - | /* Free the old scratch buffer */ |
| - | free(oldscratch); |
| + | static CURLcode cr_eob_add(struct Curl_easy *data) |
| + | { |
| + | struct Curl_creader *reader = NULL; |
| + | CURLcode result; |
| - | /* Set the new amount too */ |
| - | data->req.upload_present = si; |
| - | } |
| - | else |
| - | free(newscratch); |
| + | result = Curl_creader_create(&reader, data, &cr_eob, |
| + | CURL_CR_CONTENT_ENCODE); |
| + | if(!result) |
| + | result = Curl_creader_add(data, reader); |
| - | return CURLE_OK; |
| + | if(result && reader) |
| + | Curl_creader_free(data, reader); |
| + | return result; |
| } | |
| #endif /* CURL_DISABLE_SMTP */ | |
| @@ -84,17 +84,4 @@ struct smtp_conn { | |
| extern const struct Curl_handler Curl_handler_smtp; | |
| extern const struct Curl_handler Curl_handler_smtps; | |
| - | /* this is the 5-bytes End-Of-Body marker for SMTP */ |
| - | #define SMTP_EOB "\x0d\x0a\x2e\x0d\x0a" |
| - | #define SMTP_EOB_LEN 5 |
| - | #define SMTP_EOB_FIND_LEN 3 |
| - | |
| - | /* if found in data, replace it with this string instead */ |
| - | #define SMTP_EOB_REPL "\x0d\x0a\x2e\x2e" |
| - | #define SMTP_EOB_REPL_LEN 4 |
| - | |
| - | CURLcode Curl_smtp_escape_eob(struct Curl_easy *data, |
| - | const ssize_t nread, |
| - | const ssize_t offset); |
| - | |
| #endif /* HEADER_CURL_SMTP_H */ | |
| @@ -452,8 +452,6 @@ static CURLcode tftp_send_first(struct tftp_state_data *state, | |
| if(data->state.upload) { | |
| /* If we are uploading, send an WRQ */ | |
| setpacketevent(&state->spacket, TFTP_EVENT_WRQ); | |
| - | state->data->req.upload_fromhere = |
| - | (char *)state->spacket.data + 4; |
| if(data->state.infilesize != -1) | |
| Curl_pgrsSetUploadSize(data, data->state.infilesize); | |
| } | |
| @@ -115,16 +115,6 @@ char *Curl_checkheaders(const struct Curl_easy *data, | |
| } | |
| #endif | |
| - | CURLcode Curl_get_upload_buffer(struct Curl_easy *data) |
| - | { |
| - | if(!data->state.ulbuf) { |
| - | data->state.ulbuf = malloc(data->set.upload_buffer_size); |
| - | if(!data->state.ulbuf) |
| - | return CURLE_OUT_OF_MEMORY; |
| - | } |
| - | return CURLE_OK; |
| - | } |
| - | |
| static int data_pending(struct Curl_easy *data) | |
| { | |
| struct connectdata *conn = data->conn; | |
| @@ -330,17 +320,6 @@ out: | |
| return result; | |
| } | |
| - | CURLcode Curl_done_sending(struct Curl_easy *data, |
| - | struct SingleRequest *k) |
| - | { |
| - | k->keepon &= ~KEEP_SEND; /* we're done writing */ |
| - | |
| - | /* These functions should be moved into the handler struct! */ |
| - | Curl_conn_ev_data_done_send(data); |
| - | |
| - | return CURLE_OK; |
| - | } |
| - | |
| #if defined(_WIN32) && defined(USE_WINSOCK) | |
| #ifndef SIO_IDEAL_SEND_BACKLOG_QUERY | |
| #define SIO_IDEAL_SEND_BACKLOG_QUERY 0x4004747B | |
| @@ -368,174 +347,37 @@ static void win_update_buffer_size(curl_socket_t sockfd) | |
| /* | |
| * Send data to upload to the server, when the socket is writable. | |
| */ | |
| - | static CURLcode readwrite_upload(struct Curl_easy *data, |
| - | struct connectdata *conn, |
| - | int *didwhat) |
| + | static CURLcode readwrite_upload(struct Curl_easy *data, int *didwhat) |
| { | |
| - | size_t bytes_written; |
| - | CURLcode result; |
| - | ssize_t nread; /* number of bytes read */ |
| - | struct SingleRequest *k = &data->req; |
| - | |
| - | (void)conn; |
| - | *didwhat |= KEEP_SEND; |
| - | |
| - | if(!(k->keepon & KEEP_SEND_PAUSE)) { |
| - | result = Curl_req_flush(data); |
| - | if(result == CURLE_AGAIN) /* unable to send all we have */ |
| - | return CURLE_OK; |
| - | else if(result) |
| - | return result; |
| - | } |
| - | |
| - | do { |
| - | curl_off_t nbody; |
| - | ssize_t offset = 0; |
| - | bool eos; |
| - | |
| - | if(0 != k->upload_present && |
| - | k->upload_present < curl_upload_refill_watermark(data) && |
| - | !k->upload_chunky &&/*(variable sized chunked header; append not safe)*/ |
| - | !k->upload_done && /*!(k->upload_done once k->upload_present sent)*/ |
| - | !(k->writebytecount + (curl_off_t)k->upload_present == |
| - | data->state.infilesize)) { |
| - | offset = k->upload_present; |
| - | } |
| - | |
| - | /* only read more data if there's no upload data already |
| - | present in the upload buffer, or if appending to upload buffer */ |
| - | if(0 == k->upload_present || offset) { |
| - | result = Curl_get_upload_buffer(data); |
| - | if(result) |
| - | return result; |
| - | if(offset && k->upload_fromhere != data->state.ulbuf) |
| - | memmove(data->state.ulbuf, k->upload_fromhere, offset); |
| - | /* init the "upload from here" pointer */ |
| - | k->upload_fromhere = data->state.ulbuf; |
| - | |
| - | if(!k->upload_done) { |
| - | /* HTTP pollution, this should be written nicer to become more |
| - | protocol agnostic. */ |
| - | size_t fillcount; |
| - | |
| - | if(k->exp100 == EXP100_SENDING_REQUEST) { |
| - | /* If this call is to send body data, we must take some action: |
| - | We have sent off the full HTTP 1.1 request, and we shall now |
| - | go into the Expect: 100 state and await such a header */ |
| - | k->exp100 = EXP100_AWAITING_CONTINUE; /* wait for the header */ |
| - | k->keepon &= ~KEEP_SEND; /* disable writing */ |
| - | k->start100 = Curl_now(); /* timeout count starts now */ |
| - | *didwhat &= ~KEEP_SEND; /* we didn't write anything actually */ |
| - | /* set a timeout for the multi interface */ |
| - | Curl_expire(data, data->set.expect_100_timeout, EXPIRE_100_TIMEOUT); |
| - | break; |
| - | } |
| - | |
| - | k->upload_fromhere += offset; |
| - | result = Curl_client_read(data, k->upload_fromhere, |
| - | data->set.upload_buffer_size-offset, |
| - | &fillcount, &eos); |
| - | k->upload_fromhere -= offset; |
| - | if(result) |
| - | return result; |
| - | |
| - | nread = offset + fillcount; |
| - | } |
| - | else |
| - | nread = 0; /* we're done uploading/reading */ |
| - | |
| - | if(!nread && (k->keepon & KEEP_SEND_PAUSE)) { |
| - | /* this is a paused transfer */ |
| - | break; |
| - | } |
| - | if(nread <= 0) { |
| - | result = Curl_done_sending(data, k); |
| - | if(result) |
| - | return result; |
| - | break; |
| - | } |
| + | CURLcode result = CURLE_OK; |
| - | /* store number of bytes available for upload */ |
| - | k->upload_present = nread; |
| + | if((data->req.keepon & KEEP_SEND_PAUSE)) |
| + | return CURLE_OK; |
| - | #ifndef CURL_DISABLE_SMTP |
| - | if(conn->handler->protocol & PROTO_FAMILY_SMTP) { |
| - | result = Curl_smtp_escape_eob(data, nread, offset); |
| - | if(result) |
| - | return result; |
| - | } |
| - | #endif /* CURL_DISABLE_SMTP */ |
| - | } /* if 0 == k->upload_present or appended to upload buffer */ |
| - | else { |
| - | /* We have a partial buffer left from a previous "round". Use |
| - | that instead of reading more data */ |
| - | } |
| + | /* We should not get here when the sending is already done. It |
| + | * probably means that someone set `data-req.keepon |= KEEP_SEND` |
| + | * when it should not. */ |
| + | DEBUGASSERT(!Curl_req_done_sending(data)); |
| - | /* write to socket (send away data) */ |
| - | result = Curl_xfer_send(data, |
| - | k->upload_fromhere, /* buffer pointer */ |
| - | k->upload_present, /* buffer size */ |
| - | &bytes_written); /* actually sent */ |
| + | if(!Curl_req_done_sending(data)) { |
| + | *didwhat |= KEEP_SEND; |
| + | result = Curl_req_send_more(data); |
| if(result) | |
| return result; | |
| #if defined(_WIN32) && defined(USE_WINSOCK) | |
| + | /* FIXME: this looks like it would fit better into cf-socket.c |
| + | * but then I do not know enough Windows to say... */ |
| { | |
| struct curltime n = Curl_now(); | |
| - | if(Curl_timediff(n, conn->last_sndbuf_update) > 1000) { |
| - | win_update_buffer_size(conn->writesockfd); |
| - | conn->last_sndbuf_update = n; |
| + | if(Curl_timediff(n, data->conn->last_sndbuf_update) > 1000) { |
| + | win_update_buffer_size(data->conn->writesockfd); |
| + | data->conn->last_sndbuf_update = n; |
| } | |
| } | |
| #endif | |
| - | |
| - | nbody = bytes_written; |
| - | if(nbody) { |
| - | /* show the data before we change the pointer upload_fromhere */ |
| - | Curl_debug(data, CURLINFO_DATA_OUT, |
| - | &k->upload_fromhere[bytes_written - nbody], |
| - | (size_t)nbody); |
| - | |
| - | k->writebytecount += nbody; |
| - | Curl_pgrsSetUploadCounter(data, k->writebytecount); |
| - | } |
| - | |
| - | if((!k->upload_chunky || k->forbidchunk) && |
| - | (k->writebytecount == data->state.infilesize)) { |
| - | /* we have sent all data we were supposed to */ |
| - | k->upload_done = TRUE; |
| - | infof(data, "We are completely uploaded and fine"); |
| - | } |
| - | |
| - | if(k->upload_present != bytes_written) { |
| - | /* we only wrote a part of the buffer (if anything), deal with it! */ |
| - | |
| - | /* store the amount of bytes left in the buffer to write */ |
| - | k->upload_present -= bytes_written; |
| - | |
| - | /* advance the pointer where to find the buffer when the next send |
| - | is to happen */ |
| - | k->upload_fromhere += bytes_written; |
| - | } |
| - | else { |
| - | /* we've uploaded that buffer now */ |
| - | result = Curl_get_upload_buffer(data); |
| - | if(result) |
| - | return result; |
| - | k->upload_fromhere = data->state.ulbuf; |
| - | k->upload_present = 0; /* no more bytes left */ |
| - | |
| - | if(k->upload_done) { |
| - | result = Curl_done_sending(data, k); |
| - | if(result) |
| - | return result; |
| - | } |
| - | } |
| - | |
| - | |
| - | } while(0); /* just to break out from! */ |
| - | |
| - | return CURLE_OK; |
| + | } |
| + | return result; |
| } | |
| static int select_bits_paused(struct Curl_easy *data, int select_bits) | |
| @@ -626,7 +468,7 @@ CURLcode Curl_readwrite(struct Curl_easy *data, | |
| if((k->keepon & KEEP_SEND) && (select_bits & CURL_CSELECT_OUT)) { | |
| /* write */ | |
| - | result = readwrite_upload(data, conn, &didwhat); |
| + | result = readwrite_upload(data, &didwhat); |
| if(result) | |
| goto out; | |
| } | |
| @@ -1458,3 +1300,9 @@ CURLcode Curl_xfer_recv(struct Curl_easy *data, | |
| blen = (size_t)data->set.buffer_size; | |
| return Curl_conn_recv(data, sockindex, buf, blen, pnrcvd); | |
| } | |
| + | |
| + | CURLcode Curl_xfer_send_close(struct Curl_easy *data) |
| + | { |
| + | Curl_conn_ev_data_done_send(data); |
| + | return CURLE_OK; |
| + | } |
| @@ -50,10 +50,6 @@ int Curl_single_getsock(struct Curl_easy *data, | |
| struct connectdata *conn, curl_socket_t *socks); | |
| CURLcode Curl_retry_request(struct Curl_easy *data, char **url); | |
| bool Curl_meets_timecondition(struct Curl_easy *data, time_t timeofdoc); | |
| - | CURLcode Curl_get_upload_buffer(struct Curl_easy *data); |
| - | |
| - | CURLcode Curl_done_sending(struct Curl_easy *data, |
| - | struct SingleRequest *k); |
| /** | |
| * Write the transfer raw response bytes, as received from the connection. | |
| @@ -106,4 +102,6 @@ CURLcode Curl_xfer_recv(struct Curl_easy *data, | |
| char *buf, size_t blen, | |
| ssize_t *pnrcvd); | |
| + | CURLcode Curl_xfer_send_close(struct Curl_easy *data); |
| + | |
| #endif /* HEADER_CURL_TRANSFER_H */ | |
| @@ -277,7 +277,6 @@ CURLcode Curl_close(struct Curl_easy **datap) | |
| up_free(data); | |
| Curl_dyn_free(&data->state.headerb); | |
| - | Curl_safefree(data->state.ulbuf); |
| Curl_flush_cookies(data, TRUE); | |
| Curl_altsvc_save(data, data->asi, data->set.str[STRING_ALTSVC]); | |
| Curl_altsvc_cleanup(&data->asi); | |
| @@ -1215,7 +1215,6 @@ struct UrlState { | |
| struct dynbuf headerb; /* buffer to store headers in */ | |
| struct curl_slist *hstslist; /* list of HSTS files set by | |
| curl_easy_setopt(HSTS) calls */ | |
| - | char *ulbuf; /* allocated upload buffer or NULL */ |
| curl_off_t current_speed; /* the ProgressShow() function sets this, | |
| bytes / second */ | |