lib: replace `getsock()` logic with pollsets
—
$ git checkout -f 5b80b4c0121b69e9a9209d6734098181356b3d23
Previous HEAD position was fadc487567 writeout: add %time{}
HEAD is now at 5b80b4c012 lib: replace `getsock()` logic with pollsets
$ git clean -fdx
Removing Makefile
Removing Makefile.in
Removing aclocal.m4
Removing autom4te.cache/
Removing buildinfo.txt
Removing compile
Removing config.guess
Removing config.log
Removing config.status
Removing config.sub
Removing configure
Removing curl-config
Removing depcomp
Removing docs/Makefile
Removing docs/Makefile.in
Removing docs/cmdline-opts/Makefile
Removing docs/cmdline-opts/Makefile.in
Removing docs/examples/.deps/
Removing docs/examples/Makefile
Removing docs/examples/Makefile.in
Removing docs/libcurl/Makefile
Removing docs/libcurl/Makefile.in
Removing docs/libcurl/opts/Makefile
Removing docs/libcurl/opts/Makefile.in
Removing include/Makefile
Removing include/Makefile.in
Removing include/curl/Makefile
Removing include/curl/Makefile.in
Removing install-sh
Removing lib/.deps/
Removing lib/.libs/
Removing lib/Makefile
Removing lib/Makefile.in
Removing lib/curl_config.h
Removing lib/curl_config.h.in
Removing lib/curlx/.deps/
Removing lib/curlx/.dirstamp
Removing lib/curlx/libcurl_la-base64.lo
Removing lib/curlx/libcurl_la-base64.o
Removing lib/curlx/libcurl_la-dynbuf.lo
Removing lib/curlx/libcurl_la-dynbuf.o
Removing lib/curlx/libcurl_la-inet_ntop.lo
Removing lib/curlx/libcurl_la-inet_ntop.o
Removing lib/curlx/libcurl_la-inet_pton.lo
Removing lib/curlx/libcurl_la-inet_pton.o
Removing lib/curlx/libcurl_la-multibyte.lo
Removing lib/curlx/libcurl_la-multibyte.o
Removing lib/curlx/libcurl_la-nonblock.lo
Removing lib/curlx/libcurl_la-nonblock.o
Removing lib/curlx/libcurl_la-strparse.lo
Removing lib/curlx/libcurl_la-strparse.o
Removing lib/curlx/libcurl_la-timediff.lo
Removing lib/curlx/libcurl_la-timediff.o
Removing lib/curlx/libcurl_la-timeval.lo
Removing lib/curlx/libcurl_la-timeval.o
Removing lib/curlx/libcurl_la-version_win32.lo
Removing lib/curlx/libcurl_la-version_win32.o
Removing lib/curlx/libcurl_la-wait.lo
Removing lib/curlx/libcurl_la-wait.o
Removing lib/curlx/libcurl_la-warnless.lo
Removing lib/curlx/libcurl_la-warnless.o
Removing lib/curlx/libcurl_la-winapi.lo
Removing lib/curlx/libcurl_la-winapi.o
Removing lib/curlx/libcurlu_la-base64.lo
Removing lib/curlx/libcurlu_la-base64.o
Removing lib/curlx/libcurlu_la-dynbuf.lo
Removing lib/curlx/libcurlu_la-dynbuf.o
Removing lib/curlx/libcurlu_la-inet_ntop.lo
Removing lib/curlx/libcurlu_la-inet_ntop.o
Removing lib/curlx/libcurlu_la-inet_pton.lo
Removing lib/curlx/libcurlu_la-inet_pton.o
Removing lib/curlx/libcurlu_la-multibyte.lo
Removing lib/curlx/libcurlu_la-multibyte.o
Removing lib/curlx/libcurlu_la-nonblock.lo
Removing lib/curlx/libcurlu_la-nonblock.o
Removing lib/curlx/libcurlu_la-strparse.lo
Removing lib/curlx/libcurlu_la-strparse.o
Removing lib/curlx/libcurlu_la-timediff.lo
Removing lib/curlx/libcurlu_la-timediff.o
Removing lib/curlx/libcurlu_la-timeval.lo
Removing lib/curlx/libcurlu_la-timeval.o
Removing lib/curlx/libcurlu_la-version_win32.lo
Removing lib/curlx/libcurlu_la-version_win32.o
Removing lib/curlx/libcurlu_la-wait.lo
Removing lib/curlx/libcurlu_la-wait.o
Removing lib/curlx/libcurlu_la-warnless.lo
Removing lib/curlx/libcurlu_la-warnless.o
Removing lib/curlx/libcurlu_la-winapi.lo
Removing lib/curlx/libcurlu_la-winapi.o
Removing lib/libcurl.la
Removing lib/libcurl.vers
Removing lib/libcurl_la-altsvc.lo
Removing lib/libcurl_la-altsvc.o
Removing lib/libcurl_la-amigaos.lo
Removing lib/libcurl_la-amigaos.o
Removing lib/libcurl_la-asyn-ares.lo
Removing lib/libcurl_la-asyn-ares.o
Removing lib/libcurl_la-asyn-base.lo
Removing lib/libcurl_la-asyn-base.o
Removing lib/libcurl_la-asyn-thrdd.lo
Removing lib/libcurl_la-asyn-thrdd.o
Removing lib/libcurl_la-bufq.lo
Removing lib/libcurl_la-bufq.o
Removing lib/libcurl_la-bufref.lo
Removing lib/libcurl_la-bufref.o
Removing lib/libcurl_la-cf-h1-proxy.lo
Removing lib/libcurl_la-cf-h1-proxy.o
Removing lib/libcurl_la-cf-h2-proxy.lo
Removing lib/libcurl_la-cf-h2-proxy.o
Removing lib/libcurl_la-cf-haproxy.lo
Removing lib/libcurl_la-cf-haproxy.o
Removing lib/libcurl_la-cf-https-connect.lo
Removing lib/libcurl_la-cf-https-connect.o
Removing lib/libcurl_la-cf-ip-happy.lo
Removing lib/libcurl_la-cf-ip-happy.o
Removing lib/libcurl_la-cf-socket.lo
Removing lib/libcurl_la-cf-socket.o
Removing lib/libcurl_la-cfilters.lo
Removing lib/libcurl_la-cfilters.o
Removing lib/libcurl_la-conncache.lo
Removing lib/libcurl_la-conncache.o
Removing lib/libcurl_la-connect.lo
Removing lib/libcurl_la-connect.o
Removing lib/libcurl_la-content_encoding.lo
Removing lib/libcurl_la-content_encoding.o
Removing lib/libcurl_la-cookie.lo
Removing lib/libcurl_la-cookie.o
Removing lib/libcurl_la-cshutdn.lo
Removing lib/libcurl_la-cshutdn.o
Removing lib/libcurl_la-curl_addrinfo.lo
Removing lib/libcurl_la-curl_addrinfo.o
Removing lib/libcurl_la-curl_des.lo
Removing lib/libcurl_la-curl_des.o
Removing lib/libcurl_la-curl_endian.lo
Removing lib/libcurl_la-curl_endian.o
Removing lib/libcurl_la-curl_fnmatch.lo
Removing lib/libcurl_la-curl_fnmatch.o
Removing lib/libcurl_la-curl_get_line.lo
Removing lib/libcurl_la-curl_get_line.o
Removing lib/libcurl_la-curl_gethostname.lo
Removing lib/libcurl_la-curl_gethostname.o
Removing lib/libcurl_la-curl_gssapi.lo
Removing lib/libcurl_la-curl_gssapi.o
Removing lib/libcurl_la-curl_memrchr.lo
Removing lib/libcurl_la-curl_memrchr.o
Removing lib/libcurl_la-curl_ntlm_core.lo
Removing lib/libcurl_la-curl_ntlm_core.o
Removing lib/libcurl_la-curl_range.lo
Removing lib/libcurl_la-curl_range.o
Removing lib/libcurl_la-curl_rtmp.lo
Removing lib/libcurl_la-curl_rtmp.o
Removing lib/libcurl_la-curl_sasl.lo
Removing lib/libcurl_la-curl_sasl.o
Removing lib/libcurl_la-curl_sha512_256.lo
Removing lib/libcurl_la-curl_sha512_256.o
Removing lib/libcurl_la-curl_sspi.lo
Removing lib/libcurl_la-curl_sspi.o
Removing lib/libcurl_la-curl_threads.lo
Removing lib/libcurl_la-curl_threads.o
Removing lib/libcurl_la-curl_trc.lo
Removing lib/libcurl_la-curl_trc.o
Removing lib/libcurl_la-cw-out.lo
Removing lib/libcurl_la-cw-out.o
Removing lib/libcurl_la-cw-pause.lo
Removing lib/libcurl_la-cw-pause.o
Removing lib/libcurl_la-dict.lo
Removing lib/libcurl_la-dict.o
Removing lib/libcurl_la-doh.lo
Removing lib/libcurl_la-doh.o
Removing lib/libcurl_la-dynhds.lo
Removing lib/libcurl_la-dynhds.o
Removing lib/libcurl_la-easy.lo
Removing lib/libcurl_la-easy.o
Removing lib/libcurl_la-easygetopt.lo
Removing lib/libcurl_la-easygetopt.o
Removing lib/libcurl_la-easyoptions.lo
Removing lib/libcurl_la-easyoptions.o
Removing lib/libcurl_la-escape.lo
Removing lib/libcurl_la-escape.o
Removing lib/libcurl_la-fake_addrinfo.lo
Removing lib/libcurl_la-fake_addrinfo.o
Removing lib/libcurl_la-file.lo
Removing lib/libcurl_la-file.o
Removing lib/libcurl_la-fileinfo.lo
Removing lib/libcurl_la-fileinfo.o
Removing lib/libcurl_la-fopen.lo
Removing lib/libcurl_la-fopen.o
Removing lib/libcurl_la-formdata.lo
Removing lib/libcurl_la-formdata.o
Removing lib/libcurl_la-ftp.lo
Removing lib/libcurl_la-ftp.o
Removing lib/libcurl_la-ftplistparser.lo
Removing lib/libcurl_la-ftplistparser.o
Removing lib/libcurl_la-getenv.lo
Removing lib/libcurl_la-getenv.o
Removing lib/libcurl_la-getinfo.lo
Removing lib/libcurl_la-getinfo.o
Removing lib/libcurl_la-gopher.lo
Removing lib/libcurl_la-gopher.o
Removing lib/libcurl_la-hash.lo
Removing lib/libcurl_la-hash.o
Removing lib/libcurl_la-headers.lo
Removing lib/libcurl_la-headers.o
Removing lib/libcurl_la-hmac.lo
Removing lib/libcurl_la-hmac.o
Removing lib/libcurl_la-hostip.lo
Removing lib/libcurl_la-hostip.o
Removing lib/libcurl_la-hostip4.lo
Removing lib/libcurl_la-hostip4.o
Removing lib/libcurl_la-hostip6.lo
Removing lib/libcurl_la-hostip6.o
Removing lib/libcurl_la-hsts.lo
Removing lib/libcurl_la-hsts.o
Removing lib/libcurl_la-http.lo
Removing lib/libcurl_la-http.o
Removing lib/libcurl_la-http1.lo
Removing lib/libcurl_la-http1.o
Removing lib/libcurl_la-http2.lo
Removing lib/libcurl_la-http2.o
Removing lib/libcurl_la-http_aws_sigv4.lo
Removing lib/libcurl_la-http_aws_sigv4.o
Removing lib/libcurl_la-http_chunks.lo
Removing lib/libcurl_la-http_chunks.o
Removing lib/libcurl_la-http_digest.lo
Removing lib/libcurl_la-http_digest.o
Removing lib/libcurl_la-http_negotiate.lo
Removing lib/libcurl_la-http_negotiate.o
Removing lib/libcurl_la-http_ntlm.lo
Removing lib/libcurl_la-http_ntlm.o
Removing lib/libcurl_la-http_proxy.lo
Removing lib/libcurl_la-http_proxy.o
Removing lib/libcurl_la-httpsrr.lo
Removing lib/libcurl_la-httpsrr.o
Removing lib/libcurl_la-idn.lo
Removing lib/libcurl_la-idn.o
Removing lib/libcurl_la-if2ip.lo
Removing lib/libcurl_la-if2ip.o
Removing lib/libcurl_la-imap.lo
Removing lib/libcurl_la-imap.o
Removing lib/libcurl_la-krb5.lo
Removing lib/libcurl_la-krb5.o
Removing lib/libcurl_la-ldap.lo
Removing lib/libcurl_la-ldap.o
Removing lib/libcurl_la-llist.lo
Removing lib/libcurl_la-llist.o
Removing lib/libcurl_la-macos.lo
Removing lib/libcurl_la-macos.o
Removing lib/libcurl_la-md4.lo
Removing lib/libcurl_la-md4.o
Removing lib/libcurl_la-md5.lo
Removing lib/libcurl_la-md5.o
Removing lib/libcurl_la-memdebug.lo
Removing lib/libcurl_la-memdebug.o
Removing lib/libcurl_la-mime.lo
Removing lib/libcurl_la-mime.o
Removing lib/libcurl_la-mprintf.lo
Removing lib/libcurl_la-mprintf.o
Removing lib/libcurl_la-mqtt.lo
Removing lib/libcurl_la-mqtt.o
Removing lib/libcurl_la-multi.lo
Removing lib/libcurl_la-multi.o
Removing lib/libcurl_la-multi_ev.lo
Removing lib/libcurl_la-multi_ev.o
Removing lib/libcurl_la-netrc.lo
Removing lib/libcurl_la-netrc.o
Removing lib/libcurl_la-noproxy.lo
Removing lib/libcurl_la-noproxy.o
Removing lib/libcurl_la-openldap.lo
Removing lib/libcurl_la-openldap.o
Removing lib/libcurl_la-parsedate.lo
Removing lib/libcurl_la-parsedate.o
Removing lib/libcurl_la-pingpong.lo
Removing lib/libcurl_la-pingpong.o
Removing lib/libcurl_la-pop3.lo
Removing lib/libcurl_la-pop3.o
Removing lib/libcurl_la-progress.lo
Removing lib/libcurl_la-progress.o
Removing lib/libcurl_la-psl.lo
Removing lib/libcurl_la-psl.o
Removing lib/libcurl_la-rand.lo
Removing lib/libcurl_la-rand.o
Removing lib/libcurl_la-rename.lo
Removing lib/libcurl_la-rename.o
Removing lib/libcurl_la-request.lo
Removing lib/libcurl_la-request.o
Removing lib/libcurl_la-rtsp.lo
Removing lib/libcurl_la-rtsp.o
Removing lib/libcurl_la-select.lo
Removing lib/libcurl_la-select.o
Removing lib/libcurl_la-sendf.lo
Removing lib/libcurl_la-sendf.o
Removing lib/libcurl_la-setopt.lo
Removing lib/libcurl_la-setopt.o
Removing lib/libcurl_la-sha256.lo
Removing lib/libcurl_la-sha256.o
Removing lib/libcurl_la-share.lo
Removing lib/libcurl_la-share.o
Removing lib/libcurl_la-slist.lo
Removing lib/libcurl_la-slist.o
Removing lib/libcurl_la-smb.lo
Removing lib/libcurl_la-smb.o
Removing lib/libcurl_la-smtp.lo
Removing lib/libcurl_la-smtp.o
Removing lib/libcurl_la-socketpair.lo
Removing lib/libcurl_la-socketpair.o
Removing lib/libcurl_la-socks.lo
Removing lib/libcurl_la-socks.o
Removing lib/libcurl_la-socks_gssapi.lo
Removing lib/libcurl_la-socks_gssapi.o
Removing lib/libcurl_la-socks_sspi.lo
Removing lib/libcurl_la-socks_sspi.o
Removing lib/libcurl_la-speedcheck.lo
Removing lib/libcurl_la-speedcheck.o
Removing lib/libcurl_la-splay.lo
Removing lib/libcurl_la-splay.o
Removing lib/libcurl_la-strcase.lo
Removing lib/libcurl_la-strcase.o
Removing lib/libcurl_la-strdup.lo
Removing lib/libcurl_la-strdup.o
Removing lib/libcurl_la-strequal.lo
Removing lib/libcurl_la-strequal.o
Removing lib/libcurl_la-strerror.lo
Removing lib/libcurl_la-strerror.o
Removing lib/libcurl_la-system_win32.lo
Removing lib/libcurl_la-system_win32.o
Removing lib/libcurl_la-telnet.lo
Removing lib/libcurl_la-telnet.o
Removing lib/libcurl_la-tftp.lo
Removing lib/libcurl_la-tftp.o
Removing lib/libcurl_la-transfer.lo
Removing lib/libcurl_la-transfer.o
Removing lib/libcurl_la-uint-bset.lo
Removing lib/libcurl_la-uint-bset.o
Removing lib/libcurl_la-uint-hash.lo
Removing lib/libcurl_la-uint-hash.o
Removing lib/libcurl_la-uint-spbset.lo
Removing lib/libcurl_la-uint-spbset.o
Removing lib/libcurl_la-uint-table.lo
Removing lib/libcurl_la-uint-table.o
Removing lib/libcurl_la-url.lo
Removing lib/libcurl_la-url.o
Removing lib/libcurl_la-urlapi.lo
Removing lib/libcurl_la-urlapi.o
Removing lib/libcurl_la-version.lo
Removing lib/libcurl_la-version.o
Removing lib/libcurl_la-ws.lo
Removing lib/libcurl_la-ws.o
Removing lib/libcurlu.la
Removing lib/libcurlu_la-altsvc.lo
Removing lib/libcurlu_la-altsvc.o
Removing lib/libcurlu_la-amigaos.lo
Removing lib/libcurlu_la-amigaos.o
Removing lib/libcurlu_la-asyn-ares.lo
Removing lib/libcurlu_la-asyn-ares.o
Removing lib/libcurlu_la-asyn-base.lo
Removing lib/libcurlu_la-asyn-base.o
Removing lib/libcurlu_la-asyn-thrdd.lo
Removing lib/libcurlu_la-asyn-thrdd.o
Removing lib/libcurlu_la-bufq.lo
Removing lib/libcurlu_la-bufq.o
Removing lib/libcurlu_la-bufref.lo
Removing lib/libcurlu_la-bufref.o
Removing lib/libcurlu_la-cf-h1-proxy.lo
Removing lib/libcurlu_la-cf-h1-proxy.o
Removing lib/libcurlu_la-cf-h2-proxy.lo
Removing lib/libcurlu_la-cf-h2-proxy.o
Removing lib/libcurlu_la-cf-haproxy.lo
Removing lib/libcurlu_la-cf-haproxy.o
Removing lib/libcurlu_la-cf-https-connect.lo
Removing lib/libcurlu_la-cf-https-connect.o
Removing lib/libcurlu_la-cf-ip-happy.lo
Removing lib/libcurlu_la-cf-ip-happy.o
Removing lib/libcurlu_la-cf-socket.lo
Removing lib/libcurlu_la-cf-socket.o
Removing lib/libcurlu_la-cfilters.lo
Removing lib/libcurlu_la-cfilters.o
Removing lib/libcurlu_la-conncache.lo
Removing lib/libcurlu_la-conncache.o
Removing lib/libcurlu_la-connect.lo
Removing lib/libcurlu_la-connect.o
Removing lib/libcurlu_la-content_encoding.lo
Removing lib/libcurlu_la-content_encoding.o
Removing lib/libcurlu_la-cookie.lo
Removing lib/libcurlu_la-cookie.o
Removing lib/libcurlu_la-cshutdn.lo
Removing lib/libcurlu_la-cshutdn.o
Removing lib/libcurlu_la-curl_addrinfo.lo
Removing lib/libcurlu_la-curl_addrinfo.o
Removing lib/libcurlu_la-curl_des.lo
Removing lib/libcurlu_la-curl_des.o
Removing lib/libcurlu_la-curl_endian.lo
Removing lib/libcurlu_la-curl_endian.o
Removing lib/libcurlu_la-curl_fnmatch.lo
Removing lib/libcurlu_la-curl_fnmatch.o
Removing lib/libcurlu_la-curl_get_line.lo
Removing lib/libcurlu_la-curl_get_line.o
Removing lib/libcurlu_la-curl_gethostname.lo
Removing lib/libcurlu_la-curl_gethostname.o
Removing lib/libcurlu_la-curl_gssapi.lo
Removing lib/libcurlu_la-curl_gssapi.o
Removing lib/libcurlu_la-curl_memrchr.lo
Removing lib/libcurlu_la-curl_memrchr.o
Removing lib/libcurlu_la-curl_ntlm_core.lo
Removing lib/libcurlu_la-curl_ntlm_core.o
Removing lib/libcurlu_la-curl_range.lo
Removing lib/libcurlu_la-curl_range.o
Removing lib/libcurlu_la-curl_rtmp.lo
Removing lib/libcurlu_la-curl_rtmp.o
Removing lib/libcurlu_la-curl_sasl.lo
Removing lib/libcurlu_la-curl_sasl.o
Removing lib/libcurlu_la-curl_sha512_256.lo
Removing lib/libcurlu_la-curl_sha512_256.o
Removing lib/libcurlu_la-curl_sspi.lo
Removing lib/libcurlu_la-curl_sspi.o
Removing lib/libcurlu_la-curl_threads.lo
Removing lib/libcurlu_la-curl_threads.o
Removing lib/libcurlu_la-curl_trc.lo
Removing lib/libcurlu_la-curl_trc.o
Removing lib/libcurlu_la-cw-out.lo
Removing lib/libcurlu_la-cw-out.o
Removing lib/libcurlu_la-cw-pause.lo
Removing lib/libcurlu_la-cw-pause.o
Removing lib/libcurlu_la-dict.lo
Removing lib/libcurlu_la-dict.o
Removing lib/libcurlu_la-doh.lo
Removing lib/libcurlu_la-doh.o
Removing lib/libcurlu_la-dynhds.lo
Removing lib/libcurlu_la-dynhds.o
Removing lib/libcurlu_la-easy.lo
Removing lib/libcurlu_la-easy.o
Removing lib/libcurlu_la-easygetopt.lo
Removing lib/libcurlu_la-easygetopt.o
Removing lib/libcurlu_la-easyoptions.lo
Removing lib/libcurlu_la-easyoptions.o
Removing lib/libcurlu_la-escape.lo
Removing lib/libcurlu_la-escape.o
Removing lib/libcurlu_la-fake_addrinfo.lo
Removing lib/libcurlu_la-fake_addrinfo.o
Removing lib/libcurlu_la-file.lo
Removing lib/libcurlu_la-file.o
Removing lib/libcurlu_la-fileinfo.lo
Removing lib/libcurlu_la-fileinfo.o
Removing lib/libcurlu_la-fopen.lo
Removing lib/libcurlu_la-fopen.o
Removing lib/libcurlu_la-formdata.lo
Removing lib/libcurlu_la-formdata.o
Removing lib/libcurlu_la-ftp.lo
Removing lib/libcurlu_la-ftp.o
Removing lib/libcurlu_la-ftplistparser.lo
Removing lib/libcurlu_la-ftplistparser.o
Removing lib/libcurlu_la-getenv.lo
Removing lib/libcurlu_la-getenv.o
Removing lib/libcurlu_la-getinfo.lo
Removing lib/libcurlu_la-getinfo.o
Removing lib/libcurlu_la-gopher.lo
Removing lib/libcurlu_la-gopher.o
Removing lib/libcurlu_la-hash.lo
Removing lib/libcurlu_la-hash.o
Removing lib/libcurlu_la-headers.lo
Removing lib/libcurlu_la-headers.o
Removing lib/libcurlu_la-hmac.lo
Removing lib/libcurlu_la-hmac.o
Removing lib/libcurlu_la-hostip.lo
Removing lib/libcurlu_la-hostip.o
Removing lib/libcurlu_la-hostip4.lo
Removing lib/libcurlu_la-hostip4.o
Removing lib/libcurlu_la-hostip6.lo
Removing lib/libcurlu_la-hostip6.o
Removing lib/libcurlu_la-hsts.lo
Removing lib/libcurlu_la-hsts.o
Removing lib/libcurlu_la-http.lo
Removing lib/libcurlu_la-http.o
Removing lib/libcurlu_la-http1.lo
Removing lib/libcurlu_la-http1.o
Removing lib/libcurlu_la-http2.lo
Removing lib/libcurlu_la-http2.o
Removing lib/libcurlu_la-http_aws_sigv4.lo
Removing lib/libcurlu_la-http_aws_sigv4.o
Removing lib/libcurlu_la-http_chunks.lo
Removing lib/libcurlu_la-http_chunks.o
Removing lib/libcurlu_la-http_digest.lo
Removing lib/libcurlu_la-http_digest.o
Removing lib/libcurlu_la-http_negotiate.lo
Removing lib/libcurlu_la-http_negotiate.o
Removing lib/libcurlu_la-http_ntlm.lo
Removing lib/libcurlu_la-http_ntlm.o
Removing lib/libcurlu_la-http_proxy.lo
Removing lib/libcurlu_la-http_proxy.o
Removing lib/libcurlu_la-httpsrr.lo
Removing lib/libcurlu_la-httpsrr.o
Removing lib/libcurlu_la-idn.lo
Removing lib/libcurlu_la-idn.o
Removing lib/libcurlu_la-if2ip.lo
Removing lib/libcurlu_la-if2ip.o
Removing lib/libcurlu_la-imap.lo
Removing lib/libcurlu_la-imap.o
Removing lib/libcurlu_la-krb5.lo
Removing lib/libcurlu_la-krb5.o
Removing lib/libcurlu_la-ldap.lo
Removing lib/libcurlu_la-ldap.o
Removing lib/libcurlu_la-llist.lo
Removing lib/libcurlu_la-llist.o
Removing lib/libcurlu_la-macos.lo
Removing lib/libcurlu_la-macos.o
Removing lib/libcurlu_la-md4.lo
Removing lib/libcurlu_la-md4.o
Removing lib/libcurlu_la-md5.lo
Removing lib/libcurlu_la-md5.o
Removing lib/libcurlu_la-memdebug.lo
Removing lib/libcurlu_la-memdebug.o
Removing lib/libcurlu_la-mime.lo
Removing lib/libcurlu_la-mime.o
Removing lib/libcurlu_la-mprintf.lo
Removing lib/libcurlu_la-mprintf.o
Removing lib/libcurlu_la-mqtt.lo
Removing lib/libcurlu_la-mqtt.o
Removing lib/libcurlu_la-multi.lo
Removing lib/libcurlu_la-multi.o
Removing lib/libcurlu_la-multi_ev.lo
Removing lib/libcurlu_la-multi_ev.o
Removing lib/libcurlu_la-netrc.lo
Removing lib/libcurlu_la-netrc.o
Removing lib/libcurlu_la-noproxy.lo
Removing lib/libcurlu_la-noproxy.o
Removing lib/libcurlu_la-openldap.lo
Removing lib/libcurlu_la-openldap.o
Removing lib/libcurlu_la-parsedate.lo
Removing lib/libcurlu_la-parsedate.o
Removing lib/libcurlu_la-pingpong.lo
Removing lib/libcurlu_la-pingpong.o
Removing lib/libcurlu_la-pop3.lo
Removing lib/libcurlu_la-pop3.o
Removing lib/libcurlu_la-progress.lo
Removing lib/libcurlu_la-progress.o
Removing lib/libcurlu_la-psl.lo
Removing lib/libcurlu_la-psl.o
Removing lib/libcurlu_la-rand.lo
Removing lib/libcurlu_la-rand.o
Removing lib/libcurlu_la-rename.lo
Removing lib/libcurlu_la-rename.o
Removing lib/libcurlu_la-request.lo
Removing lib/libcurlu_la-request.o
Removing lib/libcurlu_la-rtsp.lo
Removing lib/libcurlu_la-rtsp.o
Removing lib/libcurlu_la-select.lo
Removing lib/libcurlu_la-select.o
Removing lib/libcurlu_la-sendf.lo
Removing lib/libcurlu_la-sendf.o
Removing lib/libcurlu_la-setopt.lo
Removing lib/libcurlu_la-setopt.o
Removing lib/libcurlu_la-sha256.lo
Removing lib/libcurlu_la-sha256.o
Removing lib/libcurlu_la-share.lo
Removing lib/libcurlu_la-share.o
Removing lib/libcurlu_la-slist.lo
Removing lib/libcurlu_la-slist.o
Removing lib/libcurlu_la-smb.lo
Removing lib/libcurlu_la-smb.o
Removing lib/libcurlu_la-smtp.lo
Removing lib/libcurlu_la-smtp.o
Removing lib/libcurlu_la-socketpair.lo
Removing lib/libcurlu_la-socketpair.o
Removing lib/libcurlu_la-socks.lo
Removing lib/libcurlu_la-socks.o
Removing lib/libcurlu_la-socks_gssapi.lo
Removing lib/libcurlu_la-socks_gssapi.o
Removing lib/libcurlu_la-socks_sspi.lo
Removing lib/libcurlu_la-socks_sspi.o
Removing lib/libcurlu_la-speedcheck.lo
Removing lib/libcurlu_la-speedcheck.o
Removing lib/libcurlu_la-splay.lo
Removing lib/libcurlu_la-splay.o
Removing lib/libcurlu_la-strcase.lo
Removing lib/libcurlu_la-strcase.o
Removing lib/libcurlu_la-strdup.lo
Removing lib/libcurlu_la-strdup.o
Removing lib/libcurlu_la-strequal.lo
Removing lib/libcurlu_la-strequal.o
Removing lib/libcurlu_la-strerror.lo
Removing lib/libcurlu_la-strerror.o
Removing lib/libcurlu_la-system_win32.lo
Removing lib/libcurlu_la-system_win32.o
Removing lib/libcurlu_la-telnet.lo
Removing lib/libcurlu_la-telnet.o
Removing lib/libcurlu_la-tftp.lo
Removing lib/libcurlu_la-tftp.o
Removing lib/libcurlu_la-transfer.lo
Removing lib/libcurlu_la-transfer.o
Removing lib/libcurlu_la-uint-bset.lo
Removing lib/libcurlu_la-uint-bset.o
Removing lib/libcurlu_la-uint-hash.lo
Removing lib/libcurlu_la-uint-hash.o
Removing lib/libcurlu_la-uint-spbset.lo
Removing lib/libcurlu_la-uint-spbset.o
Removing lib/libcurlu_la-uint-table.lo
Removing lib/libcurlu_la-uint-table.o
Removing lib/libcurlu_la-url.lo
Removing lib/libcurlu_la-url.o
Removing lib/libcurlu_la-urlapi.lo
Removing lib/libcurlu_la-urlapi.o
Removing lib/libcurlu_la-version.lo
Removing lib/libcurlu_la-version.o
Removing lib/libcurlu_la-ws.lo
Removing lib/libcurlu_la-ws.o
Removing lib/stamp-h1
Removing lib/vauth/.deps/
Removing lib/vauth/.dirstamp
Removing lib/vauth/libcurl_la-cleartext.lo
Removing lib/vauth/libcurl_la-cleartext.o
Removing lib/vauth/libcurl_la-cram.lo
Removing lib/vauth/libcurl_la-cram.o
Removing lib/vauth/libcurl_la-digest.lo
Removing lib/vauth/libcurl_la-digest.o
Removing lib/vauth/libcurl_la-digest_sspi.lo
Removing lib/vauth/libcurl_la-digest_sspi.o
Removing lib/vauth/libcurl_la-gsasl.lo
Removing lib/vauth/libcurl_la-gsasl.o
Removing lib/vauth/libcurl_la-krb5_gssapi.lo
Removing lib/vauth/libcurl_la-krb5_gssapi.o
Removing lib/vauth/libcurl_la-krb5_sspi.lo
Removing lib/vauth/libcurl_la-krb5_sspi.o
Removing lib/vauth/libcurl_la-ntlm.lo
Removing lib/vauth/libcurl_la-ntlm.o
Removing lib/vauth/libcurl_la-ntlm_sspi.lo
Removing lib/vauth/libcurl_la-ntlm_sspi.o
Removing lib/vauth/libcurl_la-oauth2.lo
Removing lib/vauth/libcurl_la-oauth2.o
Removing lib/vauth/libcurl_la-spnego_gssapi.lo
Removing lib/vauth/libcurl_la-spnego_gssapi.o
Removing lib/vauth/libcurl_la-spnego_sspi.lo
Removing lib/vauth/libcurl_la-spnego_sspi.o
Removing lib/vauth/libcurl_la-vauth.lo
Removing lib/vauth/libcurl_la-vauth.o
Removing lib/vauth/libcurlu_la-cleartext.lo
Removing lib/vauth/libcurlu_la-cleartext.o
Removing lib/vauth/libcurlu_la-cram.lo
Removing lib/vauth/libcurlu_la-cram.o
Removing lib/vauth/libcurlu_la-digest.lo
Removing lib/vauth/libcurlu_la-digest.o
Removing lib/vauth/libcurlu_la-digest_sspi.lo
Removing lib/vauth/libcurlu_la-digest_sspi.o
Removing lib/vauth/libcurlu_la-gsasl.lo
Removing lib/vauth/libcurlu_la-gsasl.o
Removing lib/vauth/libcurlu_la-krb5_gssapi.lo
Removing lib/vauth/libcurlu_la-krb5_gssapi.o
Removing lib/vauth/libcurlu_la-krb5_sspi.lo
Removing lib/vauth/libcurlu_la-krb5_sspi.o
Removing lib/vauth/libcurlu_la-ntlm.lo
Removing lib/vauth/libcurlu_la-ntlm.o
Removing lib/vauth/libcurlu_la-ntlm_sspi.lo
Removing lib/vauth/libcurlu_la-ntlm_sspi.o
Removing lib/vauth/libcurlu_la-oauth2.lo
Removing lib/vauth/libcurlu_la-oauth2.o
Removing lib/vauth/libcurlu_la-spnego_gssapi.lo
Removing lib/vauth/libcurlu_la-spnego_gssapi.o
Removing lib/vauth/libcurlu_la-spnego_sspi.lo
Removing lib/vauth/libcurlu_la-spnego_sspi.o
Removing lib/vauth/libcurlu_la-vauth.lo
Removing lib/vauth/libcurlu_la-vauth.o
Removing lib/vquic/.deps/
Removing lib/vquic/.dirstamp
Removing lib/vquic/libcurl_la-curl_ngtcp2.lo
Removing lib/vquic/libcurl_la-curl_ngtcp2.o
Removing lib/vquic/libcurl_la-curl_osslq.lo
Removing lib/vquic/libcurl_la-curl_osslq.o
Removing lib/vquic/libcurl_la-curl_quiche.lo
Removing lib/vquic/libcurl_la-curl_quiche.o
Removing lib/vquic/libcurl_la-vquic-tls.lo
Removing lib/vquic/libcurl_la-vquic-tls.o
Removing lib/vquic/libcurl_la-vquic.lo
Removing lib/vquic/libcurl_la-vquic.o
Removing lib/vquic/libcurlu_la-curl_ngtcp2.lo
Removing lib/vquic/libcurlu_la-curl_ngtcp2.o
Removing lib/vquic/libcurlu_la-curl_osslq.lo
Removing lib/vquic/libcurlu_la-curl_osslq.o
Removing lib/vquic/libcurlu_la-curl_quiche.lo
Removing lib/vquic/libcurlu_la-curl_quiche.o
Removing lib/vquic/libcurlu_la-vquic-tls.lo
Removing lib/vquic/libcurlu_la-vquic-tls.o
Removing lib/vquic/libcurlu_la-vquic.lo
Removing lib/vquic/libcurlu_la-vquic.o
Removing lib/vssh/.deps/
Removing lib/vssh/.dirstamp
Removing lib/vssh/libcurl_la-curl_path.lo
Removing lib/vssh/libcurl_la-curl_path.o
Removing lib/vssh/libcurl_la-libssh.lo
Removing lib/vssh/libcurl_la-libssh.o
Removing lib/vssh/libcurl_la-libssh2.lo
Removing lib/vssh/libcurl_la-libssh2.o
Removing lib/vssh/libcurl_la-wolfssh.lo
Removing lib/vssh/libcurl_la-wolfssh.o
Removing lib/vssh/libcurlu_la-curl_path.lo
Removing lib/vssh/libcurlu_la-curl_path.o
Removing lib/vssh/libcurlu_la-libssh.lo
Removing lib/vssh/libcurlu_la-libssh.o
Removing lib/vssh/libcurlu_la-libssh2.lo
Removing lib/vssh/libcurlu_la-libssh2.o
Removing lib/vssh/libcurlu_la-wolfssh.lo
Removing lib/vssh/libcurlu_la-wolfssh.o
Removing lib/vtls/.deps/
Removing lib/vtls/.dirstamp
Removing lib/vtls/libcurl_la-cipher_suite.lo
Removing lib/vtls/libcurl_la-cipher_suite.o
Removing lib/vtls/libcurl_la-gtls.lo
Removing lib/vtls/libcurl_la-gtls.o
Removing lib/vtls/libcurl_la-hostcheck.lo
Removing lib/vtls/libcurl_la-hostcheck.o
Removing lib/vtls/libcurl_la-keylog.lo
Removing lib/vtls/libcurl_la-keylog.o
Removing lib/vtls/libcurl_la-mbedtls.lo
Removing lib/vtls/libcurl_la-mbedtls.o
Removing lib/vtls/libcurl_la-mbedtls_threadlock.lo
Removing lib/vtls/libcurl_la-mbedtls_threadlock.o
Removing lib/vtls/libcurl_la-openssl.lo
Removing lib/vtls/libcurl_la-openssl.o
Removing lib/vtls/libcurl_la-rustls.lo
Removing lib/vtls/libcurl_la-rustls.o
Removing lib/vtls/libcurl_la-schannel.lo
Removing lib/vtls/libcurl_la-schannel.o
Removing lib/vtls/libcurl_la-schannel_verify.lo
Removing lib/vtls/libcurl_la-schannel_verify.o
Removing lib/vtls/libcurl_la-vtls.lo
Removing lib/vtls/libcurl_la-vtls.o
Removing lib/vtls/libcurl_la-vtls_scache.lo
Removing lib/vtls/libcurl_la-vtls_scache.o
Removing lib/vtls/libcurl_la-vtls_spack.lo
Removing lib/vtls/libcurl_la-vtls_spack.o
Removing lib/vtls/libcurl_la-wolfssl.lo
Removing lib/vtls/libcurl_la-wolfssl.o
Removing lib/vtls/libcurl_la-x509asn1.lo
Removing lib/vtls/libcurl_la-x509asn1.o
Removing lib/vtls/libcurlu_la-cipher_suite.lo
Removing lib/vtls/libcurlu_la-cipher_suite.o
Removing lib/vtls/libcurlu_la-gtls.lo
Removing lib/vtls/libcurlu_la-gtls.o
Removing lib/vtls/libcurlu_la-hostcheck.lo
Removing lib/vtls/libcurlu_la-hostcheck.o
Removing lib/vtls/libcurlu_la-keylog.lo
Removing lib/vtls/libcurlu_la-keylog.o
Removing lib/vtls/libcurlu_la-mbedtls.lo
Removing lib/vtls/libcurlu_la-mbedtls.o
Removing lib/vtls/libcurlu_la-mbedtls_threadlock.lo
Removing lib/vtls/libcurlu_la-mbedtls_threadlock.o
Removing lib/vtls/libcurlu_la-openssl.lo
Removing lib/vtls/libcurlu_la-openssl.o
Removing lib/vtls/libcurlu_la-rustls.lo
Removing lib/vtls/libcurlu_la-rustls.o
Removing lib/vtls/libcurlu_la-schannel.lo
Removing lib/vtls/libcurlu_la-schannel.o
Removing lib/vtls/libcurlu_la-schannel_verify.lo
Removing lib/vtls/libcurlu_la-schannel_verify.o
Removing lib/vtls/libcurlu_la-vtls.lo
Removing lib/vtls/libcurlu_la-vtls.o
Removing lib/vtls/libcurlu_la-vtls_scache.lo
Removing lib/vtls/libcurlu_la-vtls_scache.o
Removing lib/vtls/libcurlu_la-vtls_spack.lo
Removing lib/vtls/libcurlu_la-vtls_spack.o
Removing lib/vtls/libcurlu_la-wolfssl.lo
Removing lib/vtls/libcurlu_la-wolfssl.o
Removing lib/vtls/libcurlu_la-x509asn1.lo
Removing lib/vtls/libcurlu_la-x509asn1.o
Removing libcurl.pc
Removing libtool
Removing ltmain.sh
Removing m4/libtool.m4
Removing m4/ltoptions.m4
Removing m4/ltsugar.m4
Removing m4/ltversion.m4
Removing m4/lt~obsolete.m4
Removing missing
Removing packages/Makefile
Removing packages/Makefile.in
Removing packages/vms/Makefile
Removing packages/vms/Makefile.in
Removing scripts/Makefile
Removing scripts/Makefile.in
Removing src/.deps/
Removing src/.libs/
Removing src/Makefile
Removing src/Makefile.in
Removing src/curl
Removing src/curl-config2setopts.o
Removing src/curl-slist_wc.o
Removing src/curl-terminal.o
Removing src/curl-tool_bname.o
Removing src/curl-tool_ca_embed.o
Removing src/curl-tool_cb_dbg.o
Removing src/curl-tool_cb_hdr.o
Removing src/curl-tool_cb_prg.o
Removing src/curl-tool_cb_rea.o
Removing src/curl-tool_cb_see.o
Removing src/curl-tool_cb_soc.o
Removing src/curl-tool_cb_wrt.o
Removing src/curl-tool_cfgable.o
Removing src/curl-tool_dirhie.o
Removing src/curl-tool_doswin.o
Removing src/curl-tool_easysrc.o
Removing src/curl-tool_filetime.o
Removing src/curl-tool_findfile.o
Removing src/curl-tool_formparse.o
Removing src/curl-tool_getparam.o
Removing src/curl-tool_getpass.o
Removing src/curl-tool_help.o
Removing src/curl-tool_helpers.o
Removing src/curl-tool_hugehelp.o
Removing src/curl-tool_ipfs.o
Removing src/curl-tool_libinfo.o
Removing src/curl-tool_listhelp.o
Removing src/curl-tool_main.o
Removing src/curl-tool_msgs.o
Removing src/curl-tool_operate.o
Removing src/curl-tool_operhlp.o
Removing src/curl-tool_paramhlp.o
Removing src/curl-tool_parsecfg.o
Removing src/curl-tool_progress.o
Removing src/curl-tool_setopt.o
Removing src/curl-tool_ssls.o
Removing src/curl-tool_stderr.o
Removing src/curl-tool_strdup.o
Removing src/curl-tool_urlglob.o
Removing src/curl-tool_util.o
Removing src/curl-tool_vms.o
Removing src/curl-tool_writeout.o
Removing src/curl-tool_writeout_json.o
Removing src/curl-tool_xattr.o
Removing src/curl-var.o
Removing src/curlinfo
Removing src/curlinfo.o
Removing src/libcurltool.la
Removing src/libcurltool_la-config2setopts.lo
Removing src/libcurltool_la-config2setopts.o
Removing src/libcurltool_la-slist_wc.lo
Removing src/libcurltool_la-slist_wc.o
Removing src/libcurltool_la-terminal.lo
Removing src/libcurltool_la-terminal.o
Removing src/libcurltool_la-tool_bname.lo
Removing src/libcurltool_la-tool_bname.o
Removing src/libcurltool_la-tool_cb_dbg.lo
Removing src/libcurltool_la-tool_cb_dbg.o
Removing src/libcurltool_la-tool_cb_hdr.lo
Removing src/libcurltool_la-tool_cb_hdr.o
Removing src/libcurltool_la-tool_cb_prg.lo
Removing src/libcurltool_la-tool_cb_prg.o
Removing src/libcurltool_la-tool_cb_rea.lo
Removing src/libcurltool_la-tool_cb_rea.o
Removing src/libcurltool_la-tool_cb_see.lo
Removing src/libcurltool_la-tool_cb_see.o
Removing src/libcurltool_la-tool_cb_soc.lo
Removing src/libcurltool_la-tool_cb_soc.o
Removing src/libcurltool_la-tool_cb_wrt.lo
Removing src/libcurltool_la-tool_cb_wrt.o
Removing src/libcurltool_la-tool_cfgable.lo
Removing src/libcurltool_la-tool_cfgable.o
Removing src/libcurltool_la-tool_dirhie.lo
Removing src/libcurltool_la-tool_dirhie.o
Removing src/libcurltool_la-tool_doswin.lo
Removing src/libcurltool_la-tool_doswin.o
Removing src/libcurltool_la-tool_easysrc.lo
Removing src/libcurltool_la-tool_easysrc.o
Removing src/libcurltool_la-tool_filetime.lo
Removing src/libcurltool_la-tool_filetime.o
Removing src/libcurltool_la-tool_findfile.lo
Removing src/libcurltool_la-tool_findfile.o
Removing src/libcurltool_la-tool_formparse.lo
Removing src/libcurltool_la-tool_formparse.o
Removing src/libcurltool_la-tool_getparam.lo
Removing src/libcurltool_la-tool_getparam.o
Removing src/libcurltool_la-tool_getpass.lo
Removing src/libcurltool_la-tool_getpass.o
Removing src/libcurltool_la-tool_help.lo
Removing src/libcurltool_la-tool_help.o
Removing src/libcurltool_la-tool_helpers.lo
Removing src/libcurltool_la-tool_helpers.o
Removing src/libcurltool_la-tool_ipfs.lo
Removing src/libcurltool_la-tool_ipfs.o
Removing src/libcurltool_la-tool_libinfo.lo
Removing src/libcurltool_la-tool_libinfo.o
Removing src/libcurltool_la-tool_listhelp.lo
Removing src/libcurltool_la-tool_listhelp.o
Removing src/libcurltool_la-tool_main.lo
Removing src/libcurltool_la-tool_main.o
Removing src/libcurltool_la-tool_msgs.lo
Removing src/libcurltool_la-tool_msgs.o
Removing src/libcurltool_la-tool_operate.lo
Removing src/libcurltool_la-tool_operate.o
Removing src/libcurltool_la-tool_operhlp.lo
Removing src/libcurltool_la-tool_operhlp.o
Removing src/libcurltool_la-tool_paramhlp.lo
Removing src/libcurltool_la-tool_paramhlp.o
Removing src/libcurltool_la-tool_parsecfg.lo
Removing src/libcurltool_la-tool_parsecfg.o
Removing src/libcurltool_la-tool_progress.lo
Removing src/libcurltool_la-tool_progress.o
Removing src/libcurltool_la-tool_setopt.lo
Removing src/libcurltool_la-tool_setopt.o
Removing src/libcurltool_la-tool_ssls.lo
Removing src/libcurltool_la-tool_ssls.o
Removing src/libcurltool_la-tool_stderr.lo
Removing src/libcurltool_la-tool_stderr.o
Removing src/libcurltool_la-tool_strdup.lo
Removing src/libcurltool_la-tool_strdup.o
Removing src/libcurltool_la-tool_urlglob.lo
Removing src/libcurltool_la-tool_urlglob.o
Removing src/libcurltool_la-tool_util.lo
Removing src/libcurltool_la-tool_util.o
Removing src/libcurltool_la-tool_vms.lo
Removing src/libcurltool_la-tool_vms.o
Removing src/libcurltool_la-tool_writeout.lo
Removing src/libcurltool_la-tool_writeout.o
Removing src/libcurltool_la-tool_writeout_json.lo
Removing src/libcurltool_la-tool_writeout_json.o
Removing src/libcurltool_la-tool_xattr.lo
Removing src/libcurltool_la-tool_xattr.o
Removing src/libcurltool_la-var.lo
Removing src/libcurltool_la-var.o
Removing src/tool_ca_embed.c
Removing src/tool_hugehelp.c
Removing tests/Makefile
Removing tests/Makefile.in
Removing tests/certs/Makefile
Removing tests/certs/Makefile.in
Removing tests/config
Removing tests/configurehelp.pm
Removing tests/data/Makefile
Removing tests/data/Makefile.in
Removing tests/http/Makefile
Removing tests/http/Makefile.in
Removing tests/http/config.ini
Removing tests/libtest/.deps/
Removing tests/libtest/Makefile
Removing tests/libtest/Makefile.in
Removing tests/server/.deps/
Removing tests/server/Makefile
Removing tests/server/Makefile.in
Removing tests/tunit/.deps/
Removing tests/tunit/Makefile
Removing tests/tunit/Makefile.in
Removing tests/unit/.deps/
Removing tests/unit/Makefile
Removing tests/unit/Makefile.in
$ autoreconf -fi
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
libtoolize: Remember to add 'LT_INIT' to configure.ac.
configure.ac:128: installing './compile'
configure.ac:452: installing './config.guess'
configure.ac:452: installing './config.sub'
configure.ac:128: installing './install-sh'
configure.ac:134: installing './missing'
docs/examples/Makefile.am: installing './depcomp'
$ bash -c find . -name config.guess -exec cp /usr/share/misc/config.guess {} \;
$ bash -c find . -name config.sub -exec cp /usr/share/misc/config.sub {} \;
$ chmod +x configure
$ ./configure --disable-shared --without-ssl --disable-docs
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking whether to enable debug build options... no
checking whether to enable compiler optimizer... (assumed) yes
checking whether to enable strict compiler warnings... no
checking whether to enable compiler warnings as errors... no
checking whether to enable curl debug memory tracking... no
checking whether to enable hiding of library internal symbols... yes
checking whether to enable c-ares for DNS lookups... no
checking whether to disable dependency on -lrt... (assumed no)
checking whether to enable HTTPSRR support... no
checking whether to enable ECH support... no
checking whether to enable SSL session export support... no
checking for path separator... :
checking for sed... /usr/bin/sed
checking for grep... /usr/bin/grep
checking that grep -E works... yes
checking for ar... /usr/bin/ar
checking for a BSD-compatible install... /usr/bin/install -c
checking for gcc... ccache gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether ccache gcc accepts -g... yes
checking for ccache gcc option to enable C11 features... none needed
checking whether ccache gcc understands -c and -o together... yes
checking how to run the C preprocessor... ccache gcc -E
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for stdatomic.h... yes
checking if _Atomic is available... yes
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for code coverage support... no
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of ccache gcc... gcc3
checking curl version... 8.16.0-DEV
checking for perl... /usr/bin/perl
checking for httpd... no
checking for apache2... no
checking for apxs... no
configure: httpd/apache2 not in PATH, http tests disabled
configure: apxs not in PATH, http tests disabled
checking for danted... no
checking for danted... no
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 if cpp -P is needed... yes
checking if cpp -P works... yes
checking if compiler is DEC/Compaq/HP C... no
checking if compiler is HP-UX C... no
checking if compiler is IBM C... no
checking if compiler is Intel C... no
checking if compiler is clang... no
checking if compiler is GNU C... yes
checking compiler version... gcc '1100' (raw: '11')
checking if compiler is SunPro C... no
checking if compiler is Tiny C... no
checking whether build target is a native Windows one... no
checking if compiler accepts some basic options... yes
configure: compiler options added: -Werror-implicit-function-declaration
checking if compiler optimizer assumed setting might be used... yes
checking if compiler accepts optimizer enabling options... yes
configure: compiler options added: -O2
checking if compiler accepts strict warning options... yes
configure: compiler options added: -Wno-system-headers
checking if compiler halts on compilation errors... yes
checking if compiler halts on negative sized arrays... yes
checking if compiler halts on function prototype mismatch... yes
checking if compiler supports hiding library internal symbols... yes
checking whether build target supports Win32 crypto API... no
checking whether to build libcurl and curl in "unity" mode... no
checking whether to support http... yes
checking whether to support ftp... yes
checking whether to support file... yes
checking whether to support IPFS... yes
checking whether to support ldap... yes
checking whether to support ldaps... yes
checking whether to support rtsp... yes
checking whether to support proxies... yes
checking whether to support dict... yes
checking whether to support telnet... yes
checking whether to support tftp... yes
checking whether to support pop3... yes
checking whether to support imap... yes
checking whether to support smb... yes
checking whether to support smtp... yes
checking whether to support gopher... yes
checking whether to support mqtt... no
checking whether to provide built-in manual... yes
checking whether to build documentation... no
checking whether to enable generation of C code... yes
checking whether to use libgcc... no
checking if X/Open network library is required... no
checking for gethostbyname... yes
checking whether build target is a native Windows one... (cached) no
checking for proto/bsdsocket.h... no
checking for connect in libraries... yes
checking for sys/types.h... (cached) yes
checking for 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 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 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 Amiga native SSL/TLS (AmiSSL v5)... no
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for libpsl options with pkg-config... found
checking for psl_builtin in -lpsl... yes
checking for libpsl.h... yes
checking for library containing gsasl_init... no
checking for lber.h... no
checking for ldap.h... no
checking for ldap_ssl.h... no
checking for LDAP libraries... cannot find LDAP libraries
checking for RTMP_Init in -lrtmp... no
checking whether versioned symbols are wanted... no
checking whether to build with libidn2... (assumed) yes
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for libidn2 options with pkg-config... no
configure: IDN_LIBS: "-lidn2"
configure: IDN_LDFLAGS: ""
configure: IDN_CPPFLAGS: ""
configure: IDN_DIR: ""
checking if idn2_lookup_ul can be linked... no
checking for idn2.h... no
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for libnghttp2 options with pkg-config... no
checking for nghttp2_session_get_stream_local_window_size in -lnghttp2... no
checking for sys/types.h... (cached) yes
checking for sys/select.h... yes
checking for sys/ioctl.h... yes
checking for unistd.h... (cached) yes
checking for arpa/inet.h... yes
checking for net/if.h... yes
checking for netinet/in.h... yes
checking for netinet/in6.h... no
checking for sys/un.h... yes
checking for linux/tcp.h... yes
checking for netinet/tcp.h... yes
checking for netinet/udp.h... yes
checking for netdb.h... yes
checking for sys/sockio.h... no
checking for sys/param.h... yes
checking for termios.h... yes
checking for termio.h... yes
checking for fcntl.h... yes
checking for io.h... no
checking for pwd.h... yes
checking for utime.h... yes
checking for sys/utime.h... no
checking for sys/poll.h... yes
checking for poll.h... yes
checking for sys/resource.h... yes
checking for libgen.h... yes
checking for locale.h... yes
checking for stdbool.h... yes
checking for stdint.h... (cached) yes
checking for sys/filio.h... no
checking for sys/eventfd.h... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for sys/types.h... (cached) yes
checking for struct timeval... yes
checking run-time libs availability... fine
checking size of size_t... 8
checking size of long... 8
checking size of int... 4
checking size of time_t... 8
checking size of off_t... 8
checking size of curl_off_t... 8
checking size of curl_socket_t... 4
checking for long long... yes
checking for ssize_t... yes
checking for bool... yes
checking for sa_family_t... yes
checking for suseconds_t... yes
checking if time_t is unsigned... no
checking for struct sockaddr_storage... yes
checking for sys/select.h... (cached) yes
checking for select... yes
checking for sys/types.h... (cached) yes
checking for recv... yes
checking for sys/types.h... (cached) yes
checking for send... yes
checking for sys/types.h... (cached) yes
checking for MSG_NOSIGNAL... yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking if alarm can be linked... yes
checking if alarm is prototyped... yes
checking if alarm is compilable... yes
checking if alarm usage allowed... yes
checking if alarm might be used... yes
checking for sys/types.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for libgen.h... (cached) yes
checking if basename can be linked... yes
checking if basename is prototyped... yes
checking if basename is compilable... yes
checking if basename usage allowed... yes
checking if basename might be used... yes
checking if closesocket can be linked... no
checking if closesocket might be used... no
checking for sys/types.h... (cached) yes
checking if CloseSocket can be linked... no
checking if CloseSocket might be used... no
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking for fcntl.h... (cached) yes
checking if fcntl can be linked... yes
checking if fcntl is prototyped... yes
checking if fcntl is compilable... yes
checking if fcntl usage allowed... yes
checking if fcntl might be used... yes
checking if fcntl O_NONBLOCK is compilable... yes
checking if fcntl O_NONBLOCK usage allowed... yes
checking if fcntl O_NONBLOCK might be used... yes
checking whether build target is a native Windows one... (cached) no
checking for sys/types.h... (cached) yes
checking for netdb.h... (cached) yes
checking if freeaddrinfo can be linked... yes
checking if freeaddrinfo is prototyped... yes
checking if freeaddrinfo is compilable... yes
checking if freeaddrinfo usage allowed... yes
checking if freeaddrinfo might be used... yes
checking for sys/types.h... (cached) yes
checking for sys/xattr.h... yes
checking if fsetxattr can be linked... yes
checking if fsetxattr is prototyped... yes
checking if fsetxattr takes 5 args.... yes
checking if fsetxattr is compilable... yes
checking if fsetxattr usage allowed... yes
checking if fsetxattr might be used... yes
checking if ftruncate can be linked... yes
checking if ftruncate is prototyped... yes
checking if ftruncate is compilable... yes
checking if ftruncate usage allowed... yes
checking if ftruncate might be used... yes
checking for sys/types.h... (cached) yes
checking if getaddrinfo can be linked... yes
checking if getaddrinfo is prototyped... yes
checking if getaddrinfo is compilable... yes
checking if getaddrinfo seems to work... yes
checking if getaddrinfo usage allowed... yes
checking if getaddrinfo might be used... yes
checking if getaddrinfo is threadsafe... yes
checking if gethostbyname_r can be linked... yes
checking if gethostbyname_r is prototyped... yes
checking if gethostbyname_r takes 3 args.... no
checking if gethostbyname_r takes 5 args.... no
checking if gethostbyname_r takes 6 args.... yes
checking if gethostbyname_r is compilable... yes
checking if gethostbyname_r usage allowed... yes
checking if gethostbyname_r might be used... yes
checking if gethostname can be linked... yes
checking if gethostname is prototyped... yes
checking if gethostname is compilable... yes
checking for gethostname arg 2 data type... size_t
checking if gethostname usage allowed... yes
checking if gethostname might be used... yes
checking for sys/types.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking for ifaddrs.h... yes
checking if getifaddrs can be linked... yes
checking if getifaddrs is prototyped... yes
checking if getifaddrs is compilable... yes
checking if getifaddrs seems to work... yes
checking if getifaddrs usage allowed... yes
checking if getifaddrs might be used... yes
checking if getpeername can be linked... yes
checking if getpeername is prototyped... yes
checking if getpeername is compilable... yes
checking if getpeername usage allowed... yes
checking if getpeername might be used... yes
checking if getsockname can be linked... yes
checking if getsockname is prototyped... yes
checking if getsockname is compilable... yes
checking if getsockname usage allowed... yes
checking if getsockname might be used... yes
checking for sys/types.h... (cached) yes
checking if gmtime_r can be linked... yes
checking if gmtime_r is prototyped... yes
checking if gmtime_r is compilable... yes
checking if gmtime_r seems to work... yes
checking if gmtime_r usage allowed... yes
checking if gmtime_r might be used... yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/ioctl.h... (cached) yes
checking for stropts.h... no
checking if ioctl can be linked... yes
checking if ioctl is prototyped... yes
checking if ioctl is compilable... yes
checking if ioctl usage allowed... yes
checking if ioctl might be used... yes
checking if ioctl FIONBIO is compilable... yes
checking if ioctl FIONBIO usage allowed... yes
checking if ioctl FIONBIO might be used... yes
checking if ioctl SIOCGIFADDR is compilable... yes
checking if ioctl SIOCGIFADDR usage allowed... yes
checking if ioctl SIOCGIFADDR might be used... yes
checking if ioctlsocket can be linked... no
checking if ioctlsocket might be used... no
checking if IoctlSocket can be linked... no
checking if IoctlSocket might be used... no
checking if memrchr can be linked... yes
checking if memrchr is prototyped... yes
checking if memrchr is compilable... yes
checking if memrchr usage allowed... yes
checking if memrchr might be used... yes
checking for sys/types.h... (cached) yes
checking if sigaction can be linked... yes
checking if sigaction is prototyped... yes
checking if sigaction is compilable... yes
checking if sigaction usage allowed... yes
checking if sigaction might be used... yes
checking if siginterrupt can be linked... yes
checking if siginterrupt is prototyped... yes
checking if siginterrupt is compilable... yes
checking if siginterrupt usage allowed... yes
checking if siginterrupt might be used... yes
checking if signal can be linked... yes
checking if signal is prototyped... yes
checking if signal is compilable... yes
checking if signal usage allowed... yes
checking if signal might be used... yes
checking for sys/types.h... (cached) yes
checking if sigsetjmp can be linked... no
checking if sigsetjmp seems a macro... yes
checking if sigsetjmp is compilable... yes
checking if sigsetjmp usage allowed... yes
checking if sigsetjmp might be used... yes
checking if socket can be linked... yes
checking if socket is prototyped... yes
checking if socket is compilable... yes
checking if socket usage allowed... yes
checking if socket might be used... yes
checking if socketpair can be linked... yes
checking if socketpair is prototyped... yes
checking if socketpair is compilable... yes
checking if socketpair usage allowed... yes
checking if socketpair might be used... yes
checking if strdup can be linked... yes
checking if strdup is prototyped... yes
checking if strdup is compilable... yes
checking if strdup usage allowed... yes
checking if strdup might be used... yes
checking if strerror_r can be linked... yes
checking if strerror_r is prototyped... yes
checking if strerror_r is compilable... yes
checking if strerror_r is glibc like... yes
checking if strerror_r seems to work... yes
checking if strerror_r usage allowed... yes
checking if strerror_r might be used... yes
checking for accept4... yes
checking for eventfd... yes
checking for fnmatch... yes
checking for geteuid... yes
checking for getpass_r... no
checking for getppid... yes
checking for getpwuid... yes
checking for getpwuid_r... yes
checking for getrlimit... yes
checking for gettimeofday... yes
checking for mach_absolute_time... no
checking for pipe... yes
checking for pipe2... yes
checking for poll... yes
checking for sendmmsg... yes
checking for sendmsg... yes
checking for setlocale... yes
checking for setrlimit... yes
checking for snprintf... yes
checking for utime... yes
checking for utimes... yes
checking for if_nametoindex... yes
checking for realpath... yes
checking for sched_yield... yes
checking for sys/types.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking for arpa/inet.h... (cached) yes
checking if inet_ntop can be linked... yes
checking if inet_ntop is prototyped... yes
checking if inet_ntop is compilable... yes
checking if inet_ntop seems to work... yes
checking if inet_ntop usage allowed... yes
checking if inet_ntop might be used... yes
checking if inet_pton can be linked... yes
checking if inet_pton is prototyped... yes
checking if inet_pton is compilable... yes
checking if inet_pton seems to work... yes
checking if inet_pton usage allowed... yes
checking if inet_pton might be used... yes
checking if strcasecmp can be linked... yes
checking if strcasecmp is prototyped... yes
checking if strcasecmp is compilable... yes
checking if strcasecmp usage allowed... yes
checking if strcasecmp might be used... yes
checking if strcmpi can be linked... no
checking if strcmpi might be used... no
checking if stricmp can be linked... no
checking if stricmp might be used... no
checking for setmode... no
checking for arc4random... no
checking for fseeko... yes
checking for ccache gcc options needed to detect all undeclared functions... none needed
checking whether fseeko is declared... yes
checking how to set a socket into non-blocking mode... fcntl O_NONBLOCK
checking whether to enable the threaded resolver... yes
checking for pthread.h... yes
checking for pthread_create... yes
checking for dirent.h... yes
checking for opendir... yes
checking convert -I options to -isystem... yes
checking whether to enable verbose strings... yes
checking whether to enable SSPI support (Windows native builds only)... no
checking whether to enable basic authentication method... yes
checking whether to enable bearer authentication method... yes
checking whether to enable digest authentication method... yes
checking whether to enable kerberos authentication method... yes
checking whether to enable negotiate authentication method... yes
checking whether to enable aws sig methods... yes
checking whether to support NTLM... yes
checking whether to enable TLS-SRP authentication... yes
checking whether to enable Unix domain sockets... auto
checking for struct sockaddr_un.sun_path... yes
checking whether to support cookies... yes
checking whether to support socketpair... yes
checking whether to support HTTP authentication... yes
checking whether to support DoH... yes
checking whether to support the MIME API... yes
checking whether to support binding connections locally... yes
checking whether to support the form API... yes
checking whether to support date parsing... yes
checking whether to support netrc parsing... yes
checking whether to support progress-meter... yes
checking whether to support the SHA-512/256 hash algorithm... yes
checking whether to support DNS shuffling... yes
checking whether to support curl_easy_option*... yes
checking whether to support alt-svc... yes
checking whether to support headers-api... yes
configure: disables HSTS due to lack of SSL
checking whether to enable HTTPS-RR support... no
checking whether to support WebSockets... yes
checking whether hiding of library internal symbols will actually happen... yes
checking if this build supports HTTPS-proxy... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating docs/Makefile
config.status: creating docs/examples/Makefile
config.status: creating docs/libcurl/Makefile
config.status: creating docs/libcurl/opts/Makefile
config.status: creating docs/cmdline-opts/Makefile
config.status: creating include/Makefile
config.status: creating include/curl/Makefile
config.status: creating src/Makefile
config.status: creating lib/Makefile
config.status: creating scripts/Makefile
config.status: creating lib/libcurl.vers
config.status: creating tests/Makefile
config.status: creating tests/config
config.status: creating tests/configurehelp.pm
config.status: creating tests/certs/Makefile
config.status: creating tests/data/Makefile
config.status: creating tests/server/Makefile
config.status: creating tests/libtest/Makefile
config.status: creating tests/unit/Makefile
config.status: creating tests/tunit/Makefile
config.status: creating tests/http/config.ini
config.status: creating tests/http/Makefile
config.status: creating packages/Makefile
config.status: creating packages/vms/Makefile
config.status: creating curl-config
config.status: creating libcurl.pc
config.status: creating lib/curl_config.h
config.status: executing depfiles commands
config.status: executing libtool commands
configure: Configured to build curl/libcurl:
Host setup: x86_64-pc-linux-gnu
Install prefix: /usr/local
Compiler: ccache gcc
CFLAGS: -Werror-implicit-function-declaration -O2 -Wno-system-headers
CFLAGS extras:
CPPFLAGS: -D_GNU_SOURCE
LDFLAGS:
curl-config:
LIBS: -lpsl -lz
curl version: 8.16.0-DEV
SSL: no (--with-{openssl,gnutls,mbedtls,wolfssl,schannel,amissl,rustls} )
SSH: no (--with-{libssh,libssh2})
zlib: enabled
brotli: no (--with-brotli)
zstd: no (--with-zstd)
GSS-API: no (--with-gssapi)
GSASL: no (libgsasl not found)
TLS-SRP: no (--enable-tls-srp)
resolver: POSIX threaded
IPv6: enabled
Unix sockets: enabled
IDN: no (--with-{libidn2,winidn})
Build docs: no
Build libcurl: Shared=no, Static=yes
Built-in manual: no (--enable-manual)
--libcurl option: enabled (--disable-libcurl-option)
Verbose errors: enabled (--disable-verbose)
Code coverage: disabled
SSPI: no (--enable-sspi)
ca cert bundle: no
ca cert path:
ca cert embed: no
ca fallback:
LDAP: no (--enable-ldap / --with-ldap-lib / --with-lber-lib)
LDAPS: no (--enable-ldaps)
IPFS/IPNS: enabled
RTSP: enabled
RTMP: no (--with-librtmp)
PSL: enabled
Alt-svc: enabled (--disable-alt-svc)
Headers API: enabled (--disable-headers-api)
HSTS: no (--enable-hsts)
HTTP1: enabled (internal)
HTTP2: no (--with-nghttp2)
HTTP3: no (--with-ngtcp2 --with-nghttp3, --with-quiche, --with-openssl-quic)
ECH: no (--enable-ech)
HTTPS RR: no (--enable-httpsrr)
SSLS-EXPORT: no (--enable-ssls-export)
Protocols: dict file ftp gopher http imap ipfs ipns mqtt pop3 rtsp smtp telnet tftp ws
Features: alt-svc AsynchDNS IPv6 Largefile libz PSL threadsafe UnixSockets
configure: WARNING: libgsasl was not found
configure: WARNING: Cannot find libraries for LDAP support: LDAP disabled
configure: WARNING: Cannot find libidn2
$ make -j3
Making all in lib
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/lib'
make all-am
make[2]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/lib'
CC libcurl_la-altsvc.lo
CC libcurl_la-amigaos.lo
CC libcurl_la-asyn-ares.lo
CC libcurl_la-asyn-base.lo
CC libcurl_la-asyn-thrdd.lo
CC libcurl_la-bufq.lo
CC libcurl_la-bufref.lo
CC libcurl_la-cf-h1-proxy.lo
CC libcurl_la-cf-h2-proxy.lo
CC libcurl_la-cf-haproxy.lo
CC libcurl_la-cf-https-connect.lo
CC libcurl_la-cf-ip-happy.lo
CC libcurl_la-cf-socket.lo
CC libcurl_la-cfilters.lo
CC libcurl_la-conncache.lo
CC libcurl_la-connect.lo
CC libcurl_la-content_encoding.lo
CC libcurl_la-cookie.lo
CC libcurl_la-cshutdn.lo
CC libcurl_la-curl_addrinfo.lo
CC libcurl_la-curl_des.lo
CC libcurl_la-curl_endian.lo
CC libcurl_la-curl_fnmatch.lo
CC libcurl_la-curl_get_line.lo
CC libcurl_la-curl_gethostname.lo
CC libcurl_la-curl_gssapi.lo
CC libcurl_la-curl_memrchr.lo
CC libcurl_la-curl_ntlm_core.lo
CC libcurl_la-curl_range.lo
CC libcurl_la-curl_rtmp.lo
CC libcurl_la-curl_sasl.lo
CC libcurl_la-curl_sha512_256.lo
CC libcurl_la-curl_sspi.lo
CC libcurl_la-curl_threads.lo
CC libcurl_la-curl_trc.lo
CC libcurl_la-cw-out.lo
CC libcurl_la-cw-pause.lo
CC libcurl_la-dict.lo
CC libcurl_la-doh.lo
CC libcurl_la-dynhds.lo
CC libcurl_la-easy.lo
CC libcurl_la-easygetopt.lo
CC libcurl_la-easyoptions.lo
CC libcurl_la-escape.lo
CC libcurl_la-fake_addrinfo.lo
CC libcurl_la-file.lo
CC libcurl_la-fileinfo.lo
CC libcurl_la-fopen.lo
CC libcurl_la-formdata.lo
CC libcurl_la-ftp.lo
CC libcurl_la-ftplistparser.lo
CC libcurl_la-getenv.lo
CC libcurl_la-getinfo.lo
CC libcurl_la-gopher.lo
CC libcurl_la-hash.lo
CC libcurl_la-headers.lo
CC libcurl_la-hmac.lo
CC libcurl_la-hostip.lo
CC libcurl_la-hostip4.lo
CC libcurl_la-hostip6.lo
CC libcurl_la-hsts.lo
CC libcurl_la-http.lo
CC libcurl_la-http2.lo
CC libcurl_la-http1.lo
CC libcurl_la-http_aws_sigv4.lo
CC libcurl_la-http_chunks.lo
CC libcurl_la-http_digest.lo
CC libcurl_la-http_negotiate.lo
CC libcurl_la-http_ntlm.lo
CC libcurl_la-http_proxy.lo
CC libcurl_la-httpsrr.lo
CC libcurl_la-idn.lo
CC libcurl_la-if2ip.lo
CC libcurl_la-imap.lo
CC libcurl_la-krb5.lo
CC libcurl_la-ldap.lo
CC libcurl_la-llist.lo
CC libcurl_la-macos.lo
CC libcurl_la-md4.lo
CC libcurl_la-md5.lo
CC libcurl_la-memdebug.lo
CC libcurl_la-mime.lo
CC libcurl_la-mprintf.lo
CC libcurl_la-mqtt.lo
CC libcurl_la-multi.lo
CC libcurl_la-multi_ev.lo
CC libcurl_la-netrc.lo
CC libcurl_la-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-splay.lo
CC libcurl_la-speedcheck.lo
CC libcurl_la-strcase.lo
CC libcurl_la-strdup.lo
CC libcurl_la-strequal.lo
CC libcurl_la-strerror.lo
CC libcurl_la-system_win32.lo
CC libcurl_la-telnet.lo
CC libcurl_la-tftp.lo
CC libcurl_la-transfer.lo
CC libcurl_la-uint-bset.lo
CC libcurl_la-uint-hash.lo
CC libcurl_la-uint-spbset.lo
CC libcurl_la-uint-table.lo
CC libcurl_la-url.lo
CC libcurl_la-urlapi.lo
CC libcurl_la-version.lo
CC libcurl_la-ws.lo
CC libcurlu_la-altsvc.lo
CC libcurlu_la-amigaos.lo
CC libcurlu_la-asyn-ares.lo
CC libcurlu_la-asyn-base.lo
CC libcurlu_la-asyn-thrdd.lo
CC libcurlu_la-bufq.lo
CC libcurlu_la-bufref.lo
CC libcurlu_la-cf-h1-proxy.lo
CC libcurlu_la-cf-h2-proxy.lo
CC libcurlu_la-cf-haproxy.lo
CC libcurlu_la-cf-https-connect.lo
CC libcurlu_la-cf-ip-happy.lo
CC libcurlu_la-cf-socket.lo
CC libcurlu_la-cfilters.lo
CC libcurlu_la-conncache.lo
CC libcurlu_la-connect.lo
CC libcurlu_la-content_encoding.lo
CC libcurlu_la-cookie.lo
CC libcurlu_la-cshutdn.lo
CC libcurlu_la-curl_addrinfo.lo
CC libcurlu_la-curl_des.lo
CC libcurlu_la-curl_endian.lo
CC libcurlu_la-curl_fnmatch.lo
CC libcurlu_la-curl_get_line.lo
CC libcurlu_la-curl_gethostname.lo
CC libcurlu_la-curl_gssapi.lo
CC libcurlu_la-curl_memrchr.lo
CC libcurlu_la-curl_ntlm_core.lo
CC libcurlu_la-curl_range.lo
CC libcurlu_la-curl_rtmp.lo
CC libcurlu_la-curl_sasl.lo
CC libcurlu_la-curl_sha512_256.lo
CC libcurlu_la-curl_sspi.lo
CC libcurlu_la-curl_threads.lo
CC libcurlu_la-curl_trc.lo
CC libcurlu_la-cw-out.lo
CC libcurlu_la-cw-pause.lo
CC libcurlu_la-dict.lo
CC libcurlu_la-doh.lo
CC libcurlu_la-dynhds.lo
CC libcurlu_la-easy.lo
CC libcurlu_la-easygetopt.lo
CC libcurlu_la-easyoptions.lo
CC libcurlu_la-escape.lo
CC libcurlu_la-fake_addrinfo.lo
CC libcurlu_la-file.lo
CC libcurlu_la-fileinfo.lo
CC libcurlu_la-fopen.lo
CC libcurlu_la-formdata.lo
CC libcurlu_la-ftp.lo
CC libcurlu_la-ftplistparser.lo
CC libcurlu_la-getenv.lo
CC libcurlu_la-getinfo.lo
CC libcurlu_la-gopher.lo
CC libcurlu_la-hash.lo
CC libcurlu_la-headers.lo
CC libcurlu_la-hmac.lo
CC libcurlu_la-hostip.lo
CC libcurlu_la-hostip4.lo
CC libcurlu_la-hostip6.lo
CC libcurlu_la-hsts.lo
CC libcurlu_la-http.lo
CC libcurlu_la-http1.lo
CC libcurlu_la-http2.lo
CC libcurlu_la-http_aws_sigv4.lo
CC libcurlu_la-http_chunks.lo
CC libcurlu_la-http_digest.lo
CC libcurlu_la-http_negotiate.lo
CC libcurlu_la-http_ntlm.lo
CC libcurlu_la-http_proxy.lo
CC libcurlu_la-httpsrr.lo
CC libcurlu_la-idn.lo
CC libcurlu_la-if2ip.lo
CC libcurlu_la-imap.lo
CC libcurlu_la-krb5.lo
CC libcurlu_la-ldap.lo
CC libcurlu_la-llist.lo
CC libcurlu_la-macos.lo
CC libcurlu_la-md4.lo
CC libcurlu_la-md5.lo
CC libcurlu_la-memdebug.lo
CC libcurlu_la-mime.lo
CC libcurlu_la-mprintf.lo
CC libcurlu_la-mqtt.lo
CC libcurlu_la-multi.lo
CC libcurlu_la-multi_ev.lo
CC libcurlu_la-netrc.lo
CC libcurlu_la-noproxy.lo
CC libcurlu_la-openldap.lo
CC libcurlu_la-parsedate.lo
CC libcurlu_la-pingpong.lo
CC libcurlu_la-pop3.lo
CC libcurlu_la-progress.lo
CC libcurlu_la-psl.lo
CC libcurlu_la-rand.lo
CC libcurlu_la-rename.lo
CC libcurlu_la-request.lo
CC libcurlu_la-rtsp.lo
CC libcurlu_la-select.lo
CC libcurlu_la-sendf.lo
CC libcurlu_la-setopt.lo
CC libcurlu_la-sha256.lo
CC libcurlu_la-share.lo
CC libcurlu_la-slist.lo
CC libcurlu_la-smb.lo
CC libcurlu_la-smtp.lo
CC libcurlu_la-socketpair.lo
CC libcurlu_la-socks.lo
CC libcurlu_la-socks_gssapi.lo
CC libcurlu_la-socks_sspi.lo
CC libcurlu_la-speedcheck.lo
CC libcurlu_la-splay.lo
CC libcurlu_la-strcase.lo
CC libcurlu_la-strdup.lo
CC libcurlu_la-strequal.lo
CC libcurlu_la-strerror.lo
CC libcurlu_la-system_win32.lo
CC libcurlu_la-telnet.lo
CC libcurlu_la-tftp.lo
CC libcurlu_la-transfer.lo
CC libcurlu_la-uint-bset.lo
CC libcurlu_la-uint-hash.lo
CC libcurlu_la-uint-spbset.lo
CC libcurlu_la-uint-table.lo
CC libcurlu_la-url.lo
CC libcurlu_la-urlapi.lo
CC libcurlu_la-version.lo
CC libcurlu_la-ws.lo
CC vauth/libcurlu_la-cleartext.lo
CC vauth/libcurlu_la-cram.lo
CC vauth/libcurlu_la-digest.lo
CC vauth/libcurlu_la-digest_sspi.lo
CC vauth/libcurlu_la-gsasl.lo
CC vauth/libcurlu_la-krb5_gssapi.lo
CC vauth/libcurlu_la-krb5_sspi.lo
CC vauth/libcurlu_la-ntlm.lo
CC vauth/libcurlu_la-ntlm_sspi.lo
CC vauth/libcurlu_la-oauth2.lo
CC vauth/libcurlu_la-spnego_gssapi.lo
CC vauth/libcurlu_la-spnego_sspi.lo
CC vauth/libcurlu_la-vauth.lo
CC vtls/libcurlu_la-cipher_suite.lo
CC vtls/libcurlu_la-gtls.lo
CC vtls/libcurlu_la-hostcheck.lo
CC vtls/libcurlu_la-keylog.lo
CC vtls/libcurlu_la-mbedtls.lo
CC vtls/libcurlu_la-mbedtls_threadlock.lo
CC vtls/libcurlu_la-openssl.lo
CC vtls/libcurlu_la-rustls.lo
CC vtls/libcurlu_la-schannel.lo
CC vtls/libcurlu_la-schannel_verify.lo
CC vtls/libcurlu_la-vtls.lo
CC vtls/libcurlu_la-vtls_scache.lo
CC vtls/libcurlu_la-vtls_spack.lo
CC vtls/libcurlu_la-wolfssl.lo
CC vtls/libcurlu_la-x509asn1.lo
CC vquic/libcurlu_la-curl_ngtcp2.lo
CC vquic/libcurlu_la-curl_osslq.lo
CC vquic/libcurlu_la-curl_quiche.lo
CC vquic/libcurlu_la-vquic.lo
CC vquic/libcurlu_la-vquic-tls.lo
CC vssh/libcurlu_la-libssh.lo
CC vssh/libcurlu_la-libssh2.lo
CC vssh/libcurlu_la-curl_path.lo
CC vssh/libcurlu_la-wolfssh.lo
CC curlx/libcurlu_la-base64.lo
CC curlx/libcurlu_la-dynbuf.lo
CC curlx/libcurlu_la-inet_ntop.lo
CC curlx/libcurlu_la-inet_pton.lo
CC curlx/libcurlu_la-multibyte.lo
CC curlx/libcurlu_la-nonblock.lo
CC curlx/libcurlu_la-strparse.lo
CC curlx/libcurlu_la-timediff.lo
CC curlx/libcurlu_la-timeval.lo
CC curlx/libcurlu_la-version_win32.lo
CC curlx/libcurlu_la-wait.lo
CC curlx/libcurlu_la-warnless.lo
CC curlx/libcurlu_la-winapi.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-ntlm.lo
CC vauth/libcurl_la-krb5_sspi.lo
CC vauth/libcurl_la-ntlm_sspi.lo
CC vauth/libcurl_la-oauth2.lo
CC vauth/libcurl_la-spnego_gssapi.lo
CC vauth/libcurl_la-spnego_sspi.lo
CC vauth/libcurl_la-vauth.lo
CC vtls/libcurl_la-cipher_suite.lo
CC vtls/libcurl_la-gtls.lo
CC vtls/libcurl_la-hostcheck.lo
CC vtls/libcurl_la-keylog.lo
CC vtls/libcurl_la-mbedtls.lo
CC vtls/libcurl_la-mbedtls_threadlock.lo
CC vtls/libcurl_la-openssl.lo
CC vtls/libcurl_la-rustls.lo
CC vtls/libcurl_la-schannel.lo
CC vtls/libcurl_la-schannel_verify.lo
CC vtls/libcurl_la-vtls.lo
CC vtls/libcurl_la-vtls_scache.lo
CC vtls/libcurl_la-vtls_spack.lo
CC vtls/libcurl_la-wolfssl.lo
CC vtls/libcurl_la-x509asn1.lo
CC vquic/libcurl_la-curl_ngtcp2.lo
CC vquic/libcurl_la-curl_osslq.lo
CC vquic/libcurl_la-curl_quiche.lo
CC vquic/libcurl_la-vquic.lo
CC vquic/libcurl_la-vquic-tls.lo
CC vssh/libcurl_la-libssh.lo
CC vssh/libcurl_la-libssh2.lo
CC vssh/libcurl_la-curl_path.lo
CC vssh/libcurl_la-wolfssh.lo
CC curlx/libcurl_la-base64.lo
CC curlx/libcurl_la-dynbuf.lo
CC curlx/libcurl_la-inet_ntop.lo
CC curlx/libcurl_la-inet_pton.lo
CC curlx/libcurl_la-multibyte.lo
CC curlx/libcurl_la-nonblock.lo
CC curlx/libcurl_la-strparse.lo
CC curlx/libcurl_la-timediff.lo
CC curlx/libcurl_la-timeval.lo
CC curlx/libcurl_la-version_win32.lo
CC curlx/libcurl_la-wait.lo
CC curlx/libcurl_la-warnless.lo
CC curlx/libcurl_la-winapi.lo
CCLD libcurlu.la
CCLD libcurl.la
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/lib'
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/lib'
Making all in docs
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
Making all in .
make[2]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
make[2]: Nothing to be done for 'all-am'.
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
Making all in cmdline-opts
make[2]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/cmdline-opts'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/cmdline-opts'
Making all in libcurl
make[2]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl'
Making all in opts
make[3]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl/opts'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl/opts'
make[3]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl'
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl'
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
Making all in src
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/src'
CC curl-config2setopts.o
CC curl-terminal.o
CC curl-slist_wc.o
CC curl-tool_bname.o
CC curl-tool_cb_dbg.o
CC curl-tool_cb_hdr.o
CC curl-tool_cb_prg.o
CC curl-tool_cb_rea.o
CC curl-tool_cb_see.o
CC curl-tool_cb_soc.o
CC curl-tool_cb_wrt.o
CC curl-tool_dirhie.o
CC curl-tool_cfgable.o
CC curl-tool_doswin.o
CC curl-tool_easysrc.o
CC curl-tool_filetime.o
CC curl-tool_findfile.o
CC curl-tool_formparse.o
CC curl-tool_getparam.o
CC curl-tool_help.o
CC curl-tool_getpass.o
CC curl-tool_helpers.o
CC curl-tool_ipfs.o
CC curl-tool_libinfo.o
CC curl-tool_listhelp.o
CC curl-tool_main.o
CC curl-tool_msgs.o
CC curl-tool_operate.o
CC curl-tool_operhlp.o
CC curl-tool_paramhlp.o
CC curl-tool_parsecfg.o
CC curl-tool_progress.o
CC curl-tool_setopt.o
CC curl-tool_ssls.o
CC curl-tool_stderr.o
CC curl-tool_strdup.o
CC curl-tool_util.o
CC curl-tool_urlglob.o
CC curl-tool_vms.o
CC curl-tool_writeout.o
CC curl-tool_writeout_json.o
CC curl-tool_xattr.o
CC curl-var.o
echo '/* !checksrc! disable COPYRIGHT all */' > tool_hugehelp.c; \
echo '#include "tool_hugehelp.h"' >> tool_hugehelp.c
echo '/* !checksrc! disable COPYRIGHT all */' > tool_ca_embed.c
echo 'extern const void *curl_ca_embed; const void *curl_ca_embed;' >> tool_ca_embed.c
CC curlinfo.o
CC libcurltool_la-config2setopts.lo
CC libcurltool_la-slist_wc.lo
CC libcurltool_la-terminal.lo
CC libcurltool_la-tool_bname.lo
CC libcurltool_la-tool_cb_dbg.lo
CC libcurltool_la-tool_cb_hdr.lo
CC libcurltool_la-tool_cb_prg.lo
CC libcurltool_la-tool_cb_rea.lo
CC libcurltool_la-tool_cb_see.lo
CC libcurltool_la-tool_cb_soc.lo
CC libcurltool_la-tool_cb_wrt.lo
CC libcurltool_la-tool_cfgable.lo
CC libcurltool_la-tool_dirhie.lo
CC libcurltool_la-tool_doswin.lo
CC libcurltool_la-tool_easysrc.lo
CC libcurltool_la-tool_filetime.lo
CC libcurltool_la-tool_findfile.lo
CC libcurltool_la-tool_formparse.lo
CC libcurltool_la-tool_getparam.lo
CC libcurltool_la-tool_getpass.lo
CC libcurltool_la-tool_help.lo
CC libcurltool_la-tool_helpers.lo
CC libcurltool_la-tool_ipfs.lo
CC libcurltool_la-tool_libinfo.lo
CC libcurltool_la-tool_listhelp.lo
CC libcurltool_la-tool_main.lo
CC libcurltool_la-tool_msgs.lo
CC libcurltool_la-tool_operate.lo
CC libcurltool_la-tool_operhlp.lo
CC libcurltool_la-tool_paramhlp.lo
CC libcurltool_la-tool_parsecfg.lo
CC libcurltool_la-tool_progress.lo
CC libcurltool_la-tool_setopt.lo
CC libcurltool_la-tool_ssls.lo
CC libcurltool_la-tool_stderr.lo
CC libcurltool_la-tool_strdup.lo
CC libcurltool_la-tool_urlglob.lo
CC libcurltool_la-tool_util.lo
CC libcurltool_la-tool_vms.lo
CC libcurltool_la-tool_writeout.lo
CC libcurltool_la-tool_writeout_json.lo
CC libcurltool_la-tool_xattr.lo
CC libcurltool_la-var.lo
CC curl-tool_hugehelp.o
CC curl-tool_ca_embed.o
CCLD curlinfo
CCLD curl
CCLD libcurltool.la
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'
| @@ -273,15 +273,15 @@ static void async_ares_cleanup(struct Curl_easy *data) | |
| } | |
| /* | |
| - | * Curl_async_getsock() is called when someone from the outside world |
| + | * Curl_async_pollset() is called when someone from the outside world |
| * (using curl_multi_fdset()) wants to get our fd_set setup. | |
| */ | |
| - | int Curl_async_getsock(struct Curl_easy *data, curl_socket_t *socks) |
| + | CURLcode Curl_async_pollset(struct Curl_easy *data, struct easy_pollset *ps) |
| { | |
| struct async_ares_ctx *ares = &data->state.async.ares; | |
| DEBUGASSERT(ares->channel); | |
| - | return Curl_ares_getsock(data, ares->channel, socks); |
| + | return Curl_ares_pollset(data, ares->channel, ps); |
| } | |
| /* | |
| @@ -70,7 +70,7 @@ | |
| #endif | |
| /* | |
| - | * Curl_ares_getsock() is called when the outside world (using |
| + | * Curl_ares_pollset() is called when the outside world (using |
| * curl_multi_fdset()) wants to get our fd_set setup and we are talking with | |
| * ares. The caller must make sure that this function is only called when we | |
| * have a working ares channel. | |
| @@ -78,18 +78,38 @@ | |
| * Returns: sockets-in-use-bitmap | |
| */ | |
| - | int Curl_ares_getsock(struct Curl_easy *data, |
| - | ares_channel channel, |
| - | curl_socket_t *socks) |
| + | |
| + | CURLcode Curl_ares_pollset(struct Curl_easy *data, |
| + | ares_channel channel, |
| + | struct easy_pollset *ps) |
| { | |
| struct timeval maxtime = { CURL_TIMEOUT_RESOLVE, 0 }; | |
| struct timeval timebuf; | |
| - | int max = ares_getsock(channel, |
| - | (ares_socket_t *)socks, MAX_SOCKSPEREASYHANDLE); |
| - | struct timeval *timeout = ares_timeout(channel, &maxtime, &timebuf); |
| - | timediff_t milli = curlx_tvtoms(timeout); |
| + | curl_socket_t sockets[16]; /* ARES documented limit */ |
| + | unsigned int bitmap, i; |
| + | struct timeval *timeout; |
| + | timediff_t milli; |
| + | CURLcode result = CURLE_OK; |
| + | |
| + | bitmap = ares_getsock(channel, (ares_socket_t *)sockets, |
| + | CURL_ARRAYSIZE(sockets)); |
| + | for(i = 0; i < CURL_ARRAYSIZE(sockets); ++i) { |
| + | int flags = 0; |
| + | if(ARES_GETSOCK_READABLE(bitmap, i)) |
| + | flags |= CURL_POLL_IN; |
| + | if(ARES_GETSOCK_WRITABLE(bitmap, i)) |
| + | flags |= CURL_POLL_OUT; |
| + | if(!flags) |
| + | break; |
| + | result = Curl_pollset_change(data, ps, sockets[i], flags, 0); |
| + | if(result) |
| + | return result; |
| + | } |
| + | |
| + | timeout = ares_timeout(channel, &maxtime, &timebuf); |
| + | milli = curlx_tvtoms(timeout); |
| Curl_expire(data, milli, EXPIRE_ASYNC_NAME); | |
| - | return max; |
| + | return result; |
| } | |
| /* | |
| @@ -63,6 +63,7 @@ | |
| #include "url.h" | |
| #include "multiif.h" | |
| #include "curl_threads.h" | |
| + | #include "select.h" |
| #include "strdup.h" | |
| #ifdef USE_ARES | |
| @@ -629,33 +630,25 @@ CURLcode Curl_async_is_resolved(struct Curl_easy *data, | |
| } | |
| } | |
| - | int Curl_async_getsock(struct Curl_easy *data, curl_socket_t *socks) |
| + | CURLcode Curl_async_pollset(struct Curl_easy *data, struct easy_pollset *ps) |
| { | |
| struct async_thrdd_ctx *thrdd = &data->state.async.thrdd; | |
| - | int ret_val = 0; |
| - | #if !defined(CURL_DISABLE_SOCKETPAIR) || defined(USE_HTTPSRR_ARES) |
| - | int socketi = 0; |
| - | #else |
| - | (void)socks; |
| - | #endif |
| + | CURLcode result = CURLE_OK; |
| #ifdef USE_HTTPSRR_ARES | |
| if(thrdd->rr.channel) { | |
| - | ret_val = Curl_ares_getsock(data, thrdd->rr.channel, socks); |
| - | for(socketi = 0; socketi < (MAX_SOCKSPEREASYHANDLE - 1); socketi++) |
| - | if(!ARES_GETSOCK_READABLE(ret_val, socketi) && |
| - | !ARES_GETSOCK_WRITABLE(ret_val, socketi)) |
| - | break; |
| + | result = Curl_ares_pollset(data, thrdd->rr.channel, ps); |
| + | if(result) |
| + | return result; |
| } | |
| #endif | |
| if(!thrdd->addr) | |
| - | return ret_val; |
| + | return result; |
| #ifndef CURL_DISABLE_SOCKETPAIR | |
| if(thrdd->addr) { | |
| /* return read fd to client for polling the DNS resolution status */ | |
| - | socks[socketi] = thrdd->addr->sock_pair[0]; |
| - | ret_val |= GETSOCK_READSOCK(socketi); |
| + | result = Curl_pollset_add_in(data, ps, thrdd->addr->sock_pair[0]); |
| } | |
| else | |
| #endif | |
| @@ -673,7 +666,7 @@ int Curl_async_getsock(struct Curl_easy *data, curl_socket_t *socks) | |
| Curl_expire(data, milli, EXPIRE_ASYNC_NAME); | |
| } | |
| - | return ret_val; |
| + | return result; |
| } | |
| #ifndef HAVE_GETADDRINFO | |
| @@ -37,6 +37,7 @@ struct Curl_dns_entry; | |
| struct addrinfo; | |
| struct hostent; | |
| struct connectdata; | |
| + | struct easy_pollset; |
| #if defined(CURLRES_ARES) && defined(CURLRES_THREADED) | |
| #error cannot have both CURLRES_ARES and CURLRES_THREADED defined | |
| @@ -70,15 +71,15 @@ void Curl_async_global_cleanup(void); | |
| */ | |
| CURLcode Curl_async_get_impl(struct Curl_easy *easy, void **impl); | |
| - | /* Curl_async_getsock() |
| + | /* Curl_async_pollset() |
| * | |
| - | * This function is called from the Curl_multi_getsock() function. 'sock' is a |
| + | * This function is called from the Curl_multi_pollset() function. 'sock' is a |
| * pointer to an array to hold the file descriptors, with 'numsock' being the | |
| * size of that array (in number of entries). This function is supposed to | |
| * return bitmask indicating what file descriptors (referring to array indexes | |
| * in the 'sock' array) to wait for, read/write. | |
| */ | |
| - | int Curl_async_getsock(struct Curl_easy *data, curl_socket_t *sock); |
| + | CURLcode Curl_async_pollset(struct Curl_easy *data, struct easy_pollset *ps); |
| /* | |
| * Curl_async_is_resolved() | |
| @@ -127,9 +128,10 @@ struct Curl_addrinfo *Curl_async_getaddrinfo(struct Curl_easy *data, | |
| /* common functions for c-ares and threaded resolver with HTTPSRR */ | |
| #include <ares.h> | |
| - | int Curl_ares_getsock(struct Curl_easy *data, |
| - | ares_channel channel, |
| - | curl_socket_t *socks); |
| + | CURLcode Curl_ares_pollset(struct Curl_easy *data, |
| + | ares_channel channel, |
| + | struct easy_pollset *ps); |
| + | |
| int Curl_ares_perform(ares_channel channel, | |
| timediff_t timeout_ms); | |
| #endif | |
| @@ -682,11 +682,12 @@ out: | |
| return result; | |
| } | |
| - | static void cf_h1_proxy_adjust_pollset(struct Curl_cfilter *cf, |
| - | struct Curl_easy *data, |
| - | struct easy_pollset *ps) |
| + | static CURLcode cf_h1_proxy_adjust_pollset(struct Curl_cfilter *cf, |
| + | struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| struct h1_tunnel_state *ts = cf->ctx; | |
| + | CURLcode result = CURLE_OK; |
| if(!cf->connected) { | |
| /* If we are not connected, but the filter "below" is | |
| @@ -698,13 +699,14 @@ static void cf_h1_proxy_adjust_pollset(struct Curl_cfilter *cf, | |
| response headers or if we are still sending the request, wait | |
| for write. */ | |
| if(tunnel_want_send(ts)) | |
| - | Curl_pollset_set_out_only(data, ps, sock); |
| + | result = Curl_pollset_set_out_only(data, ps, sock); |
| else | |
| - | Curl_pollset_set_in_only(data, ps, sock); |
| + | result = Curl_pollset_set_in_only(data, ps, sock); |
| } | |
| else | |
| - | Curl_pollset_set_out_only(data, ps, sock); |
| + | result = Curl_pollset_set_out_only(data, ps, sock); |
| } | |
| + | return result; |
| } | |
| static void cf_h1_proxy_destroy(struct Curl_cfilter *cf, | |
| @@ -41,6 +41,7 @@ | |
| #include "http_proxy.h" | |
| #include "multiif.h" | |
| #include "sendf.h" | |
| + | #include "select.h" |
| #include "cf-h2-proxy.h" | |
| /* The last 3 #include files should be in this order */ | |
| @@ -1202,14 +1203,15 @@ static bool cf_h2_proxy_data_pending(struct Curl_cfilter *cf, | |
| return cf->next ? cf->next->cft->has_data_pending(cf->next, data) : FALSE; | |
| } | |
| - | static void cf_h2_proxy_adjust_pollset(struct Curl_cfilter *cf, |
| - | struct Curl_easy *data, |
| - | struct easy_pollset *ps) |
| + | static CURLcode cf_h2_proxy_adjust_pollset(struct Curl_cfilter *cf, |
| + | struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| struct cf_h2_proxy_ctx *ctx = cf->ctx; | |
| struct cf_call_data save; | |
| curl_socket_t sock = Curl_conn_cf_get_socket(cf, data); | |
| bool want_recv, want_send; | |
| + | CURLcode result = CURLE_OK; |
| if(!cf->connected && ctx->h2) { | |
| want_send = nghttp2_session_want_write(ctx->h2) || | |
| @@ -1234,9 +1236,9 @@ static void cf_h2_proxy_adjust_pollset(struct Curl_cfilter *cf, | |
| !Curl_bufq_is_empty(&ctx->outbufq) || | |
| !Curl_bufq_is_empty(&ctx->tunnel.sendbuf); | |
| - | Curl_pollset_set(data, ps, sock, want_recv, want_send); |
| - | CURL_TRC_CF(data, cf, "adjust_pollset, want_recv=%d want_send=%d", |
| - | want_recv, want_send); |
| + | result = Curl_pollset_set(data, ps, sock, want_recv, want_send); |
| + | CURL_TRC_CF(data, cf, "adjust_pollset, want_recv=%d want_send=%d -> %d", |
| + | want_recv, want_send, result); |
| CF_DATA_RESTORE(cf, save); | |
| } | |
| else if(ctx->sent_goaway && !cf->shutdown) { | |
| @@ -1246,11 +1248,12 @@ static void cf_h2_proxy_adjust_pollset(struct Curl_cfilter *cf, | |
| !Curl_bufq_is_empty(&ctx->outbufq) || | |
| !Curl_bufq_is_empty(&ctx->tunnel.sendbuf); | |
| want_recv = nghttp2_session_want_read(ctx->h2); | |
| - | Curl_pollset_set(data, ps, sock, want_recv, want_send); |
| - | CURL_TRC_CF(data, cf, "adjust_pollset, want_recv=%d want_send=%d", |
| - | want_recv, want_send); |
| + | result = Curl_pollset_set(data, ps, sock, want_recv, want_send); |
| + | CURL_TRC_CF(data, cf, "adjust_pollset, want_recv=%d want_send=%d -> %d", |
| + | want_recv, want_send, result); |
| CF_DATA_RESTORE(cf, save); | |
| } | |
| + | return result; |
| } | |
| static CURLcode h2_handle_tunnel_close(struct Curl_cfilter *cf, | |
| @@ -32,6 +32,7 @@ | |
| #include "cf-haproxy.h" | |
| #include "curl_trc.h" | |
| #include "multiif.h" | |
| + | #include "select.h" |
| /* The last 3 #include files should be in this order */ | |
| #include "curl_printf.h" | |
| @@ -178,15 +179,17 @@ static void cf_haproxy_close(struct Curl_cfilter *cf, | |
| cf->next->cft->do_close(cf->next, data); | |
| } | |
| - | static void cf_haproxy_adjust_pollset(struct Curl_cfilter *cf, |
| - | struct Curl_easy *data, |
| - | struct easy_pollset *ps) |
| + | static CURLcode cf_haproxy_adjust_pollset(struct Curl_cfilter *cf, |
| + | struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| if(cf->next->connected && !cf->connected) { | |
| /* If we are not connected, but the filter "below" is | |
| * and not waiting on something, we are sending. */ | |
| - | Curl_pollset_set_out_only(data, ps, Curl_conn_cf_get_socket(cf, data)); |
| + | return Curl_pollset_set_out_only( |
| + | data, ps, Curl_conn_cf_get_socket(cf, data)); |
| } | |
| + | return CURLE_OK; |
| } | |
| struct Curl_cftype Curl_cft_haproxy = { | |
| @@ -35,6 +35,7 @@ | |
| #include "multiif.h" | |
| #include "cf-https-connect.h" | |
| #include "http2.h" | |
| + | #include "select.h" |
| #include "vquic/vquic.h" | |
| /* The last 3 #include files should be in this order */ | |
| @@ -426,22 +427,24 @@ static CURLcode cf_hc_shutdown(struct Curl_cfilter *cf, | |
| return result; | |
| } | |
| - | static void cf_hc_adjust_pollset(struct Curl_cfilter *cf, |
| - | struct Curl_easy *data, |
| - | struct easy_pollset *ps) |
| + | static CURLcode cf_hc_adjust_pollset(struct Curl_cfilter *cf, |
| + | struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| + | CURLcode result = CURLE_OK; |
| if(!cf->connected) { | |
| struct cf_hc_ctx *ctx = cf->ctx; | |
| size_t i; | |
| - | for(i = 0; i < ctx->baller_count; i++) { |
| + | for(i = 0; (i < ctx->baller_count) && !result; i++) { |
| struct cf_hc_baller *b = &ctx->ballers[i]; | |
| if(!cf_hc_baller_is_active(b)) | |
| continue; | |
| - | Curl_conn_cf_adjust_pollset(b->cf, data, ps); |
| + | result = Curl_conn_cf_adjust_pollset(b->cf, data, ps); |
| } | |
| - | CURL_TRC_CF(data, cf, "adjust_pollset -> %d socks", ps->num); |
| + | CURL_TRC_CF(data, cf, "adjust_pollset -> %d, %d socks", result, ps->n); |
| } | |
| + | return result; |
| } | |
| static bool cf_hc_data_pending(struct Curl_cfilter *cf, | |
| @@ -60,6 +60,7 @@ | |
| #include "curl_trc.h" | |
| #include "multiif.h" | |
| #include "progress.h" | |
| + | #include "select.h" |
| #include "vquic/vquic.h" /* for quic cfilters */ | |
| /* The last 3 #include files should be in this order */ | |
| @@ -533,16 +534,18 @@ static CURLcode cf_ip_ballers_shutdown(struct cf_ip_ballers *bs, | |
| return CURLE_OK; | |
| } | |
| - | static void cf_ip_ballers_pollset(struct cf_ip_ballers *bs, |
| - | struct Curl_easy *data, |
| - | struct easy_pollset *ps) |
| + | static CURLcode cf_ip_ballers_pollset(struct cf_ip_ballers *bs, |
| + | struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| struct cf_ip_attempt *a; | |
| - | for(a = bs->running; a; a = a->next) { |
| + | CURLcode result = CURLE_OK; |
| + | for(a = bs->running; a && !result; a = a->next) { |
| if(a->result) | |
| continue; | |
| - | Curl_conn_cf_adjust_pollset(a->cf, data, ps); |
| + | result = Curl_conn_cf_adjust_pollset(a->cf, data, ps); |
| } | |
| + | return result; |
| } | |
| static bool cf_ip_ballers_pending(struct cf_ip_ballers *bs, | |
| @@ -713,16 +716,18 @@ static CURLcode cf_ip_happy_shutdown(struct Curl_cfilter *cf, | |
| return result; | |
| } | |
| - | static void cf_ip_happy_adjust_pollset(struct Curl_cfilter *cf, |
| - | struct Curl_easy *data, |
| - | struct easy_pollset *ps) |
| + | static CURLcode cf_ip_happy_adjust_pollset(struct Curl_cfilter *cf, |
| + | struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| struct cf_ip_happy_ctx *ctx = cf->ctx; | |
| + | CURLcode result = CURLE_OK; |
| if(!cf->connected) { | |
| - | cf_ip_ballers_pollset(&ctx->ballers, data, ps); |
| - | CURL_TRC_CF(data, cf, "adjust_pollset -> %d socks", ps->num); |
| + | result = cf_ip_ballers_pollset(&ctx->ballers, data, ps); |
| + | CURL_TRC_CF(data, cf, "adjust_pollset -> %d, %d socks", result, ps->n); |
| } | |
| + | return result; |
| } | |
| static CURLcode cf_ip_happy_connect(struct Curl_cfilter *cf, | |
| @@ -1376,11 +1376,12 @@ out: | |
| return result; | |
| } | |
| - | static void cf_socket_adjust_pollset(struct Curl_cfilter *cf, |
| - | struct Curl_easy *data, |
| - | struct easy_pollset *ps) |
| + | static CURLcode cf_socket_adjust_pollset(struct Curl_cfilter *cf, |
| + | struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| struct cf_socket_ctx *ctx = cf->ctx; | |
| + | CURLcode result = CURLE_OK; |
| if(ctx->sock != CURL_SOCKET_BAD) { | |
| /* A listening socket filter needs to be connected before the accept | |
| @@ -1388,21 +1389,22 @@ static void cf_socket_adjust_pollset(struct Curl_cfilter *cf, | |
| * FTP no longer does the socket checks and accept calls and delegates | |
| * all that to the filter. */ | |
| if(ctx->listening) { | |
| - | Curl_pollset_set_in_only(data, ps, ctx->sock); |
| + | result = Curl_pollset_set_in_only(data, ps, ctx->sock); |
| CURL_TRC_CF(data, cf, "adjust_pollset, listening, POLLIN fd=%" | |
| FMT_SOCKET_T, ctx->sock); | |
| } | |
| else if(!cf->connected) { | |
| - | Curl_pollset_set_out_only(data, ps, ctx->sock); |
| + | result = Curl_pollset_set_out_only(data, ps, ctx->sock); |
| CURL_TRC_CF(data, cf, "adjust_pollset, !connected, POLLOUT fd=%" | |
| FMT_SOCKET_T, ctx->sock); | |
| } | |
| else if(!ctx->active) { | |
| - | Curl_pollset_add_in(data, ps, ctx->sock); |
| + | result = Curl_pollset_add_in(data, ps, ctx->sock); |
| CURL_TRC_CF(data, cf, "adjust_pollset, !active, POLLIN fd=%" | |
| FMT_SOCKET_T, ctx->sock); | |
| } | |
| } | |
| + | return result; |
| } | |
| #ifdef USE_WINSOCK | |
| @@ -67,14 +67,15 @@ CURLcode Curl_cf_def_shutdown(struct Curl_cfilter *cf, | |
| static void conn_report_connect_stats(struct Curl_easy *data, | |
| struct connectdata *conn); | |
| - | void Curl_cf_def_adjust_pollset(struct Curl_cfilter *cf, |
| - | struct Curl_easy *data, |
| - | struct easy_pollset *ps) |
| + | CURLcode Curl_cf_def_adjust_pollset(struct Curl_cfilter *cf, |
| + | struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| /* NOP */ | |
| (void)cf; | |
| (void)data; | |
| (void)ps; | |
| + | return CURLE_OK; |
| } | |
| bool Curl_cf_def_data_pending(struct Curl_cfilter *cf, | |
| @@ -469,6 +470,7 @@ CURLcode Curl_conn_connect(struct Curl_easy *data, | |
| { | |
| #define CF_CONN_NUM_POLLS_ON_STACK 5 | |
| struct pollfd a_few_on_stack[CF_CONN_NUM_POLLS_ON_STACK]; | |
| + | struct easy_pollset ps; |
| struct curl_pollfds cpfds; | |
| struct Curl_cfilter *cf; | |
| CURLcode result = CURLE_OK; | |
| @@ -486,6 +488,7 @@ CURLcode Curl_conn_connect(struct Curl_easy *data, | |
| if(*done) | |
| return CURLE_OK; | |
| + | Curl_pollset_init(&ps); |
| Curl_pollfds_init(&cpfds, a_few_on_stack, CF_CONN_NUM_POLLS_ON_STACK); | |
| while(!*done) { | |
| if(Curl_conn_needs_flush(data, sockindex)) { | |
| @@ -523,7 +526,6 @@ CURLcode Curl_conn_connect(struct Curl_easy *data, | |
| /* check allowed time left */ | |
| const timediff_t timeout_ms = Curl_timeleft(data, NULL, TRUE); | |
| curl_socket_t sockfd = Curl_conn_cf_get_socket(cf, data); | |
| - | struct easy_pollset ps; |
| int rc; | |
| if(timeout_ms < 0) { | |
| @@ -534,12 +536,14 @@ CURLcode Curl_conn_connect(struct Curl_easy *data, | |
| } | |
| CURL_TRC_CF(data, cf, "Curl_conn_connect(block=1), do poll"); | |
| + | Curl_pollset_reset(&ps); |
| Curl_pollfds_reset(&cpfds); | |
| - | memset(&ps, 0, sizeof(ps)); |
| /* In general, we want to send after connect, wait on that. */ | |
| if(sockfd != CURL_SOCKET_BAD) | |
| Curl_pollset_set_out_only(data, &ps, sockfd); | |
| - | Curl_conn_adjust_pollset(data, data->conn, &ps); |
| + | result = Curl_conn_adjust_pollset(data, data->conn, &ps); |
| + | if(result) |
| + | goto out; |
| result = Curl_pollfds_add_ps(&cpfds, &ps); | |
| if(result) | |
| goto out; | |
| @@ -557,6 +561,7 @@ CURLcode Curl_conn_connect(struct Curl_easy *data, | |
| } | |
| out: | |
| + | Curl_pollset_cleanup(&ps); |
| Curl_pollfds_cleanup(&cpfds); | |
| return result; | |
| } | |
| @@ -710,10 +715,11 @@ bool Curl_conn_needs_flush(struct Curl_easy *data, int sockindex) | |
| return Curl_conn_cf_needs_flush(data->conn->cfilter[sockindex], data); | |
| } | |
| - | void Curl_conn_cf_adjust_pollset(struct Curl_cfilter *cf, |
| - | struct Curl_easy *data, |
| - | struct easy_pollset *ps) |
| + | CURLcode Curl_conn_cf_adjust_pollset(struct Curl_cfilter *cf, |
| + | struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| + | CURLcode result = CURLE_OK; |
| /* Get the lowest not-connected filter, if there are any */ | |
| while(cf && !cf->connected && cf->next && !cf->next->connected) | |
| cf = cf->next; | |
| @@ -722,23 +728,26 @@ void Curl_conn_cf_adjust_pollset(struct Curl_cfilter *cf, | |
| cf = cf->next; | |
| /* From there on, give all filters a chance to adjust the pollset. | |
| * Lower filters are called later, so they may override */ | |
| - | while(cf) { |
| - | cf->cft->adjust_pollset(cf, data, ps); |
| + | while(cf && !result) { |
| + | result = cf->cft->adjust_pollset(cf, data, ps); |
| cf = cf->next; | |
| } | |
| + | return result; |
| } | |
| - | void Curl_conn_adjust_pollset(struct Curl_easy *data, |
| - | struct connectdata *conn, |
| - | struct easy_pollset *ps) |
| + | CURLcode Curl_conn_adjust_pollset(struct Curl_easy *data, |
| + | struct connectdata *conn, |
| + | struct easy_pollset *ps) |
| { | |
| + | CURLcode result = CURLE_OK; |
| int i; | |
| DEBUGASSERT(data); | |
| DEBUGASSERT(conn); | |
| - | for(i = 0; i < 2; ++i) { |
| - | Curl_conn_cf_adjust_pollset(conn->cfilter[i], data, ps); |
| + | for(i = 0; (i < 2) && !result; ++i) { |
| + | result = Curl_conn_cf_adjust_pollset(conn->cfilter[i], data, ps); |
| } | |
| + | return result; |
| } | |
| int Curl_conn_cf_poll(struct Curl_cfilter *cf, | |
| @@ -746,35 +755,18 @@ int Curl_conn_cf_poll(struct Curl_cfilter *cf, | |
| timediff_t timeout_ms) | |
| { | |
| struct easy_pollset ps; | |
| - | struct pollfd pfds[MAX_SOCKSPEREASYHANDLE]; |
| - | unsigned int i, npfds = 0; |
| + | int result; |
| DEBUGASSERT(cf); | |
| DEBUGASSERT(data); | |
| DEBUGASSERT(data->conn); | |
| - | memset(&ps, 0, sizeof(ps)); |
| - | memset(pfds, 0, sizeof(pfds)); |
| - | |
| - | Curl_conn_cf_adjust_pollset(cf, data, &ps); |
| - | DEBUGASSERT(ps.num <= MAX_SOCKSPEREASYHANDLE); |
| - | for(i = 0; i < ps.num; ++i) { |
| - | short events = 0; |
| - | if(ps.actions[i] & CURL_POLL_IN) { |
| - | events |= POLLIN; |
| - | } |
| - | if(ps.actions[i] & CURL_POLL_OUT) { |
| - | events |= POLLOUT; |
| - | } |
| - | if(events) { |
| - | pfds[npfds].fd = ps.sockets[i]; |
| - | pfds[npfds].events = events; |
| - | ++npfds; |
| - | } |
| - | } |
| + | Curl_pollset_init(&ps); |
| - | if(!npfds) |
| - | DEBUGF(infof(data, "no sockets to poll!")); |
| - | return Curl_poll(pfds, npfds, timeout_ms); |
| + | result = Curl_conn_cf_adjust_pollset(cf, data, &ps); |
| + | if(!result) |
| + | result = Curl_pollset_poll(data, &ps, timeout_ms); |
| + | Curl_pollset_cleanup(&ps); |
| + | return result; |
| } | |
| void Curl_conn_get_current_host(struct Curl_easy *data, int sockindex, | |
| @@ -1099,142 +1091,3 @@ CURLcode Curl_conn_send(struct Curl_easy *data, int sockindex, | |
| *pnwritten = 0; | |
| return CURLE_FAILED_INIT; | |
| } | |
| - | |
| - | void Curl_pollset_reset(struct Curl_easy *data, |
| - | struct easy_pollset *ps) |
| - | { |
| - | size_t i; |
| - | (void)data; |
| - | memset(ps, 0, sizeof(*ps)); |
| - | for(i = 0; i < MAX_SOCKSPEREASYHANDLE; i++) |
| - | ps->sockets[i] = CURL_SOCKET_BAD; |
| - | } |
| - | |
| - | /** |
| - | * |
| - | */ |
| - | void Curl_pollset_change(struct Curl_easy *data, |
| - | struct easy_pollset *ps, curl_socket_t sock, |
| - | int add_flags, int remove_flags) |
| - | { |
| - | unsigned int i; |
| - | |
| - | (void)data; |
| - | DEBUGASSERT(VALID_SOCK(sock)); |
| - | if(!VALID_SOCK(sock)) |
| - | return; |
| - | |
| - | DEBUGASSERT(add_flags <= (CURL_POLL_IN|CURL_POLL_OUT)); |
| - | DEBUGASSERT(remove_flags <= (CURL_POLL_IN|CURL_POLL_OUT)); |
| - | DEBUGASSERT((add_flags&remove_flags) == 0); /* no overlap */ |
| - | for(i = 0; i < ps->num; ++i) { |
| - | if(ps->sockets[i] == sock) { |
| - | ps->actions[i] &= (unsigned char)(~remove_flags); |
| - | ps->actions[i] |= (unsigned char)add_flags; |
| - | /* all gone? remove socket */ |
| - | if(!ps->actions[i]) { |
| - | if((i + 1) < ps->num) { |
| - | memmove(&ps->sockets[i], &ps->sockets[i + 1], |
| - | (ps->num - (i + 1)) * sizeof(ps->sockets[0])); |
| - | memmove(&ps->actions[i], &ps->actions[i + 1], |
| - | (ps->num - (i + 1)) * sizeof(ps->actions[0])); |
| - | } |
| - | --ps->num; |
| - | } |
| - | return; |
| - | } |
| - | } |
| - | /* not present */ |
| - | if(add_flags) { |
| - | /* Having more SOCKETS per easy handle than what is defined |
| - | * is a programming error. This indicates that we need |
| - | * to raise this limit, making easy_pollset larger. |
| - | * Since we use this in tight loops, we do not want to make |
| - | * the pollset dynamic unnecessarily. |
| - | * The current maximum in practise is HTTP/3 eyeballing where |
| - | * we have up to 4 sockets involved in connection setup. |
| - | */ |
| - | DEBUGASSERT(i < MAX_SOCKSPEREASYHANDLE); |
| - | if(i < MAX_SOCKSPEREASYHANDLE) { |
| - | ps->sockets[i] = sock; |
| - | ps->actions[i] = (unsigned char)add_flags; |
| - | ps->num = i + 1; |
| - | } |
| - | } |
| - | } |
| - | |
| - | void Curl_pollset_set(struct Curl_easy *data, |
| - | struct easy_pollset *ps, curl_socket_t sock, |
| - | bool do_in, bool do_out) |
| - | { |
| - | Curl_pollset_change(data, ps, sock, |
| - | (do_in ? CURL_POLL_IN : 0)| |
| - | (do_out ? CURL_POLL_OUT : 0), |
| - | (!do_in ? CURL_POLL_IN : 0)| |
| - | (!do_out ? CURL_POLL_OUT : 0)); |
| - | } |
| - | |
| - | static void ps_add(struct Curl_easy *data, struct easy_pollset *ps, |
| - | int bitmap, curl_socket_t *socks) |
| - | { |
| - | if(bitmap) { |
| - | int i; |
| - | for(i = 0; i < MAX_SOCKSPEREASYHANDLE; ++i) { |
| - | if(!(bitmap & GETSOCK_MASK_RW(i)) || !VALID_SOCK((socks[i]))) { |
| - | break; |
| - | } |
| - | if(bitmap & GETSOCK_READSOCK(i)) { |
| - | if(bitmap & GETSOCK_WRITESOCK(i)) |
| - | Curl_pollset_add_inout(data, ps, socks[i]); |
| - | else |
| - | /* is READ, since we checked MASK_RW above */ |
| - | Curl_pollset_add_in(data, ps, socks[i]); |
| - | } |
| - | else |
| - | Curl_pollset_add_out(data, ps, socks[i]); |
| - | } |
| - | } |
| - | } |
| - | |
| - | void Curl_pollset_add_socks(struct Curl_easy *data, |
| - | struct easy_pollset *ps, |
| - | int (*get_socks_cb)(struct Curl_easy *data, |
| - | curl_socket_t *socks)) |
| - | { |
| - | curl_socket_t socks[MAX_SOCKSPEREASYHANDLE]; |
| - | int bitmap; |
| - | |
| - | bitmap = get_socks_cb(data, socks); |
| - | ps_add(data, ps, bitmap, socks); |
| - | } |
| - | |
| - | void Curl_pollset_check(struct Curl_easy *data, |
| - | struct easy_pollset *ps, curl_socket_t sock, |
| - | bool *pwant_read, bool *pwant_write) |
| - | { |
| - | unsigned int i; |
| - | |
| - | (void)data; |
| - | DEBUGASSERT(VALID_SOCK(sock)); |
| - | for(i = 0; i < ps->num; ++i) { |
| - | if(ps->sockets[i] == sock) { |
| - | *pwant_read = !!(ps->actions[i] & CURL_POLL_IN); |
| - | *pwant_write = !!(ps->actions[i] & CURL_POLL_OUT); |
| - | return; |
| - | } |
| - | } |
| - | *pwant_read = *pwant_write = FALSE; |
| - | } |
| - | |
| - | bool Curl_pollset_want_read(struct Curl_easy *data, |
| - | struct easy_pollset *ps, |
| - | curl_socket_t sock) |
| - | { |
| - | unsigned int i; |
| - | (void)data; |
| - | for(i = 0; i < ps->num; ++i) { |
| - | if((ps->sockets[i] == sock) && (ps->actions[i] & CURL_POLL_IN)) |
| - | return TRUE; |
| - | } |
| - | return FALSE; |
| - | } |
| @@ -80,7 +80,7 @@ struct easy_pollset; | |
| * @param data the easy handle the pollset is about | |
| * @param ps the pollset (inout) for the easy handle | |
| */ | |
| - | typedef void Curl_cft_adjust_pollset(struct Curl_cfilter *cf, |
| + | typedef CURLcode Curl_cft_adjust_pollset(struct Curl_cfilter *cf, |
| struct Curl_easy *data, | |
| struct easy_pollset *ps); | |
| @@ -244,7 +244,7 @@ void Curl_cf_def_destroy_this(struct Curl_cfilter *cf, | |
| /* Default implementations for the type functions, implementing pass-through | |
| * the filter chain. */ | |
| - | void Curl_cf_def_adjust_pollset(struct Curl_cfilter *cf, |
| + | CURLcode Curl_cf_def_adjust_pollset(struct Curl_cfilter *cf, |
| struct Curl_easy *data, | |
| struct easy_pollset *ps); | |
| bool Curl_cf_def_data_pending(struct Curl_cfilter *cf, | |
| @@ -477,16 +477,16 @@ void Curl_conn_forget_socket(struct Curl_easy *data, int sockindex); | |
| /** | |
| * Adjust the pollset for the filter chain starting at `cf`. | |
| */ | |
| - | void Curl_conn_cf_adjust_pollset(struct Curl_cfilter *cf, |
| - | struct Curl_easy *data, |
| - | struct easy_pollset *ps); |
| + | CURLcode Curl_conn_cf_adjust_pollset(struct Curl_cfilter *cf, |
| + | struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| /** | |
| * Adjust pollset from filters installed at transfer's connection. | |
| */ | |
| - | void Curl_conn_adjust_pollset(struct Curl_easy *data, |
| - | struct connectdata *conn, |
| - | struct easy_pollset *ps); |
| + | CURLcode Curl_conn_adjust_pollset(struct Curl_easy *data, |
| + | struct connectdata *conn, |
| + | struct easy_pollset *ps); |
| /** | |
| * Curl_poll() the filter chain at `cf` with timeout `timeout_ms`. | |
| @@ -632,56 +632,6 @@ CURLcode Curl_conn_send(struct Curl_easy *data, int sockindex, | |
| size_t *pnwritten); | |
| - | void Curl_pollset_reset(struct Curl_easy *data, |
| - | struct easy_pollset *ps); |
| - | |
| - | /* Change the poll flags (CURL_POLL_IN/CURL_POLL_OUT) to the poll set for |
| - | * socket `sock`. If the socket is not already part of the poll set, it |
| - | * will be added. |
| - | * If the socket is present and all poll flags are cleared, it will be removed. |
| - | */ |
| - | void Curl_pollset_change(struct Curl_easy *data, |
| - | struct easy_pollset *ps, curl_socket_t sock, |
| - | int add_flags, int remove_flags); |
| - | |
| - | void Curl_pollset_set(struct Curl_easy *data, |
| - | struct easy_pollset *ps, curl_socket_t sock, |
| - | bool do_in, bool do_out); |
| - | |
| - | #define Curl_pollset_add_in(data, ps, sock) \ |
| - | Curl_pollset_change((data), (ps), (sock), CURL_POLL_IN, 0) |
| - | #define Curl_pollset_add_out(data, ps, sock) \ |
| - | Curl_pollset_change((data), (ps), (sock), CURL_POLL_OUT, 0) |
| - | #define Curl_pollset_add_inout(data, ps, sock) \ |
| - | Curl_pollset_change((data), (ps), (sock), \ |
| - | CURL_POLL_IN|CURL_POLL_OUT, 0) |
| - | #define Curl_pollset_set_in_only(data, ps, sock) \ |
| - | Curl_pollset_change((data), (ps), (sock), \ |
| - | CURL_POLL_IN, CURL_POLL_OUT) |
| - | #define Curl_pollset_set_out_only(data, ps, sock) \ |
| - | Curl_pollset_change((data), (ps), (sock), \ |
| - | CURL_POLL_OUT, CURL_POLL_IN) |
| - | |
| - | void Curl_pollset_add_socks(struct Curl_easy *data, |
| - | struct easy_pollset *ps, |
| - | int (*get_socks_cb)(struct Curl_easy *data, |
| - | curl_socket_t *socks)); |
| - | |
| - | /** |
| - | * Check if the pollset, as is, wants to read and/or write regarding |
| - | * the given socket. |
| - | */ |
| - | void Curl_pollset_check(struct Curl_easy *data, |
| - | struct easy_pollset *ps, curl_socket_t sock, |
| - | bool *pwant_read, bool *pwant_write); |
| - | |
| - | /** |
| - | * Return TRUE if the pollset contains socket with CURL_POLL_IN. |
| - | */ |
| - | bool Curl_pollset_want_read(struct Curl_easy *data, |
| - | struct easy_pollset *ps, |
| - | curl_socket_t sock); |
| - | |
| /** | |
| * Types and macros used to keep the current easy handle in filter calls, | |
| * allowing for nested invocations. See #10336. | |
| @@ -486,18 +486,24 @@ void Curl_cshutdn_setfds(struct cshutdn *cshutdn, | |
| { | |
| if(Curl_llist_head(&cshutdn->list)) { | |
| struct Curl_llist_node *e; | |
| + | struct easy_pollset ps; |
| + | Curl_pollset_init(&ps); |
| for(e = Curl_llist_head(&cshutdn->list); e; | |
| e = Curl_node_next(e)) { | |
| - | struct easy_pollset ps; |
| unsigned int i; | |
| struct connectdata *conn = Curl_node_elem(e); | |
| - | memset(&ps, 0, sizeof(ps)); |
| + | CURLcode result; |
| + | |
| + | Curl_pollset_reset(&ps); |
| Curl_attach_connection(data, conn); | |
| - | Curl_conn_adjust_pollset(data, conn, &ps); |
| + | result = Curl_conn_adjust_pollset(data, conn, &ps); |
| Curl_detach_connection(data); | |
| - | for(i = 0; i < ps.num; i++) { |
| + | if(result) |
| + | continue; |
| + | |
| + | for(i = 0; i < ps.n; i++) { |
| #ifdef __DJGPP__ | |
| #pragma GCC diagnostic push | |
| #pragma GCC diagnostic ignored "-Warith-conversion" | |
| @@ -514,6 +520,7 @@ void Curl_cshutdn_setfds(struct cshutdn *cshutdn, | |
| *maxfd = (int)ps.sockets[i]; | |
| } | |
| } | |
| + | Curl_pollset_cleanup(&ps); |
| } | |
| } | |
| @@ -528,17 +535,21 @@ unsigned int Curl_cshutdn_add_waitfds(struct cshutdn *cshutdn, | |
| struct Curl_llist_node *e; | |
| struct easy_pollset ps; | |
| struct connectdata *conn; | |
| + | CURLcode result; |
| + | Curl_pollset_init(&ps); |
| for(e = Curl_llist_head(&cshutdn->list); e; | |
| e = Curl_node_next(e)) { | |
| conn = Curl_node_elem(e); | |
| - | memset(&ps, 0, sizeof(ps)); |
| + | Curl_pollset_reset(&ps); |
| Curl_attach_connection(data, conn); | |
| - | Curl_conn_adjust_pollset(data, conn, &ps); |
| + | result = Curl_conn_adjust_pollset(data, conn, &ps); |
| Curl_detach_connection(data); | |
| - | need += Curl_waitfds_add_ps(cwfds, &ps); |
| + | if(!result) |
| + | need += Curl_waitfds_add_ps(cwfds, &ps); |
| } | |
| + | Curl_pollset_cleanup(&ps); |
| } | |
| return need; | |
| } | |
| @@ -554,20 +565,24 @@ CURLcode Curl_cshutdn_add_pollfds(struct cshutdn *cshutdn, | |
| struct easy_pollset ps; | |
| struct connectdata *conn; | |
| + | Curl_pollset_init(&ps); |
| for(e = Curl_llist_head(&cshutdn->list); e; | |
| e = Curl_node_next(e)) { | |
| conn = Curl_node_elem(e); | |
| - | memset(&ps, 0, sizeof(ps)); |
| + | Curl_pollset_reset(&ps); |
| Curl_attach_connection(data, conn); | |
| - | Curl_conn_adjust_pollset(data, conn, &ps); |
| + | result = Curl_conn_adjust_pollset(data, conn, &ps); |
| Curl_detach_connection(data); | |
| - | result = Curl_pollfds_add_ps(cpfds, &ps); |
| + | if(!result) |
| + | result = Curl_pollfds_add_ps(cpfds, &ps); |
| if(result) { | |
| + | Curl_pollset_cleanup(&ps); |
| Curl_pollfds_cleanup(cpfds); | |
| goto out; | |
| } | |
| } | |
| + | Curl_pollset_cleanup(&ps); |
| } | |
| out: | |
| return result; | |
| @@ -81,10 +81,10 @@ const struct Curl_handler Curl_handler_rtmp = { | |
| rtmp_connect, /* connect_it */ | |
| ZERO_NULL, /* connecting */ | |
| ZERO_NULL, /* doing */ | |
| - | ZERO_NULL, /* proto_getsock */ |
| - | ZERO_NULL, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ZERO_NULL, /* proto_pollset */ |
| + | ZERO_NULL, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| rtmp_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -106,10 +106,10 @@ const struct Curl_handler Curl_handler_rtmpt = { | |
| rtmp_connect, /* connect_it */ | |
| ZERO_NULL, /* connecting */ | |
| ZERO_NULL, /* doing */ | |
| - | ZERO_NULL, /* proto_getsock */ |
| - | ZERO_NULL, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ZERO_NULL, /* proto_pollset */ |
| + | ZERO_NULL, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| rtmp_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -131,10 +131,10 @@ const struct Curl_handler Curl_handler_rtmpe = { | |
| rtmp_connect, /* connect_it */ | |
| ZERO_NULL, /* connecting */ | |
| ZERO_NULL, /* doing */ | |
| - | ZERO_NULL, /* proto_getsock */ |
| - | ZERO_NULL, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ZERO_NULL, /* proto_pollset */ |
| + | ZERO_NULL, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| rtmp_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -156,10 +156,10 @@ const struct Curl_handler Curl_handler_rtmpte = { | |
| rtmp_connect, /* connect_it */ | |
| ZERO_NULL, /* connecting */ | |
| ZERO_NULL, /* doing */ | |
| - | ZERO_NULL, /* proto_getsock */ |
| - | ZERO_NULL, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ZERO_NULL, /* proto_pollset */ |
| + | ZERO_NULL, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| rtmp_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -181,10 +181,10 @@ const struct Curl_handler Curl_handler_rtmps = { | |
| rtmp_connect, /* connect_it */ | |
| ZERO_NULL, /* connecting */ | |
| ZERO_NULL, /* doing */ | |
| - | ZERO_NULL, /* proto_getsock */ |
| - | ZERO_NULL, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ZERO_NULL, /* proto_pollset */ |
| + | ZERO_NULL, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| rtmp_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -206,10 +206,10 @@ const struct Curl_handler Curl_handler_rtmpts = { | |
| rtmp_connect, /* connect_it */ | |
| ZERO_NULL, /* connecting */ | |
| ZERO_NULL, /* doing */ | |
| - | ZERO_NULL, /* proto_getsock */ |
| - | ZERO_NULL, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ZERO_NULL, /* proto_pollset */ |
| + | ZERO_NULL, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| rtmp_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -92,10 +92,10 @@ const struct Curl_handler Curl_handler_dict = { | |
| ZERO_NULL, /* connect_it */ | |
| ZERO_NULL, /* connecting */ | |
| ZERO_NULL, /* doing */ | |
| - | ZERO_NULL, /* proto_getsock */ |
| - | ZERO_NULL, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ZERO_NULL, /* proto_pollset */ |
| + | ZERO_NULL, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| ZERO_NULL, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -120,10 +120,10 @@ const struct Curl_handler Curl_handler_file = { | |
| file_connect, /* connect_it */ | |
| ZERO_NULL, /* connecting */ | |
| ZERO_NULL, /* doing */ | |
| - | ZERO_NULL, /* proto_getsock */ |
| - | ZERO_NULL, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ZERO_NULL, /* proto_pollset */ |
| + | ZERO_NULL, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| file_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -214,10 +214,10 @@ static CURLcode ftp_disconnect(struct Curl_easy *data, | |
| struct connectdata *conn, bool dead_connection); | |
| static CURLcode ftp_do_more(struct Curl_easy *data, int *completed); | |
| static CURLcode ftp_multi_statemach(struct Curl_easy *data, bool *done); | |
| - | static int ftp_getsock(struct Curl_easy *data, struct connectdata *conn, |
| - | curl_socket_t *socks); |
| - | static int ftp_domore_getsock(struct Curl_easy *data, |
| - | struct connectdata *conn, curl_socket_t *socks); |
| + | static CURLcode ftp_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| + | static CURLcode ftp_domore_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| static CURLcode ftp_doing(struct Curl_easy *data, | |
| bool *dophase_done); | |
| static CURLcode ftp_setup_connection(struct Curl_easy *data, | |
| @@ -257,10 +257,10 @@ const struct Curl_handler Curl_handler_ftp = { | |
| ftp_connect, /* connect_it */ | |
| ftp_multi_statemach, /* connecting */ | |
| ftp_doing, /* doing */ | |
| - | ftp_getsock, /* proto_getsock */ |
| - | ftp_getsock, /* doing_getsock */ |
| - | ftp_domore_getsock, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ftp_pollset, /* proto_pollset */ |
| + | ftp_pollset, /* doing_pollset */ |
| + | ftp_domore_pollset, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| ftp_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -290,10 +290,10 @@ const struct Curl_handler Curl_handler_ftps = { | |
| ftp_connect, /* connect_it */ | |
| ftp_multi_statemach, /* connecting */ | |
| ftp_doing, /* doing */ | |
| - | ftp_getsock, /* proto_getsock */ |
| - | ftp_getsock, /* doing_getsock */ |
| - | ftp_domore_getsock, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ftp_pollset, /* proto_pollset */ |
| + | ftp_pollset, /* doing_pollset */ |
| + | ftp_domore_pollset, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| ftp_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -781,42 +781,39 @@ static CURLcode ftp_state_pwd(struct Curl_easy *data, | |
| } | |
| /* For the FTP "protocol connect" and "doing" phases only */ | |
| - | static int ftp_getsock(struct Curl_easy *data, |
| - | struct connectdata *conn, |
| - | curl_socket_t *socks) |
| + | static CURLcode ftp_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| - | struct ftp_conn *ftpc = Curl_conn_meta_get(conn, CURL_META_FTP_CONN); |
| - | return ftpc ? Curl_pp_getsock(data, &ftpc->pp, socks) : GETSOCK_BLANK; |
| + | struct ftp_conn *ftpc = Curl_conn_meta_get(data->conn, CURL_META_FTP_CONN); |
| + | return ftpc ? Curl_pp_pollset(data, &ftpc->pp, ps) : CURLE_OK; |
| } | |
| /* For the FTP "DO_MORE" phase only */ | |
| - | static int ftp_domore_getsock(struct Curl_easy *data, |
| - | struct connectdata *conn, curl_socket_t *socks) |
| + | static CURLcode ftp_domore_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| - | struct ftp_conn *ftpc = Curl_conn_meta_get(conn, CURL_META_FTP_CONN); |
| - | (void)data; |
| + | struct ftp_conn *ftpc = Curl_conn_meta_get(data->conn, CURL_META_FTP_CONN); |
| if(!ftpc) | |
| - | return GETSOCK_BLANK; |
| + | return CURLE_OK; |
| /* When in DO_MORE state, we could be either waiting for us to connect to a | |
| * remote site, or we could wait for that site to connect to us. Or just | |
| * handle ordinary commands. | |
| */ | |
| - | CURL_TRC_FTP(data, "[%s] ftp_domore_getsock()", FTP_CSTATE(ftpc)); |
| + | CURL_TRC_FTP(data, "[%s] ftp_domore_pollset()", FTP_CSTATE(ftpc)); |
| if(FTP_STOP == ftpc->state) { | |
| /* if stopped and still in this state, then we are also waiting for a | |
| connect on the secondary connection */ | |
| - | DEBUGASSERT(conn->sock[SECONDARYSOCKET] != CURL_SOCKET_BAD || |
| - | (conn->cfilter[SECONDARYSOCKET] && |
| - | !Curl_conn_is_connected(conn, SECONDARYSOCKET))); |
| - | socks[0] = conn->sock[FIRSTSOCKET]; |
| + | DEBUGASSERT(data->conn->sock[SECONDARYSOCKET] != CURL_SOCKET_BAD || |
| + | (data->conn->cfilter[SECONDARYSOCKET] && |
| + | !Curl_conn_is_connected(data->conn, SECONDARYSOCKET))); |
| /* An unconnected SECONDARY will add its socket by itself | |
| * via its adjust_pollset() */ | |
| - | return GETSOCK_READSOCK(0); |
| + | return Curl_pollset_add_in(data, ps, data->conn->sock[FIRSTSOCKET]); |
| } | |
| - | return Curl_pp_getsock(data, &ftpc->pp, socks); |
| + | return Curl_pp_pollset(data, &ftpc->pp, ps); |
| } | |
| /* This is called after the FTP_QUOTE state is passed. | |
| @@ -70,10 +70,10 @@ const struct Curl_handler Curl_handler_gopher = { | |
| ZERO_NULL, /* connect_it */ | |
| ZERO_NULL, /* connecting */ | |
| ZERO_NULL, /* doing */ | |
| - | ZERO_NULL, /* proto_getsock */ |
| - | ZERO_NULL, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ZERO_NULL, /* proto_pollset */ |
| + | ZERO_NULL, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| ZERO_NULL, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -96,10 +96,10 @@ const struct Curl_handler Curl_handler_gophers = { | |
| gopher_connect, /* connect_it */ | |
| gopher_connecting, /* connecting */ | |
| ZERO_NULL, /* doing */ | |
| - | ZERO_NULL, /* proto_getsock */ |
| - | ZERO_NULL, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ZERO_NULL, /* proto_pollset */ |
| + | ZERO_NULL, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| ZERO_NULL, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -1527,21 +1527,21 @@ CURLcode Curl_resolv_check(struct Curl_easy *data, | |
| } | |
| #endif | |
| - | int Curl_resolv_getsock(struct Curl_easy *data, |
| - | curl_socket_t *socks) |
| + | CURLcode Curl_resolv_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| #ifdef CURLRES_ASYNCH | |
| #ifndef CURL_DISABLE_DOH | |
| if(data->conn->bits.doh) | |
| /* nothing to wait for during DoH resolve, those handles have their own | |
| sockets */ | |
| - | return GETSOCK_BLANK; |
| + | return CURLE_OK; |
| #endif | |
| - | return Curl_async_getsock(data, socks); |
| + | return Curl_async_pollset(data, ps); |
| #else | |
| (void)data; | |
| - | (void)socks; |
| - | return GETSOCK_BLANK; |
| + | (void)ps; |
| + | return CURLE_OK; |
| #endif | |
| } | |
| @@ -53,6 +53,7 @@ struct addrinfo; | |
| struct hostent; | |
| struct Curl_easy; | |
| struct connectdata; | |
| + | struct easy_pollset; |
| enum alpnid { | |
| ALPN_none = 0, | |
| @@ -199,8 +200,8 @@ CURLcode Curl_resolv_check(struct Curl_easy *data, | |
| #else | |
| #define Curl_resolv_check(x,y) CURLE_NOT_BUILT_IN | |
| #endif | |
| - | int Curl_resolv_getsock(struct Curl_easy *data, |
| - | curl_socket_t *socks); |
| + | CURLcode Curl_resolv_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| CURLcode Curl_resolver_error(struct Curl_easy *data); | |
| @@ -137,10 +137,10 @@ const struct Curl_handler Curl_handler_http = { | |
| Curl_http_connect, /* connect_it */ | |
| ZERO_NULL, /* connecting */ | |
| ZERO_NULL, /* doing */ | |
| - | ZERO_NULL, /* proto_getsock */ |
| - | Curl_http_getsock_do, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ZERO_NULL, /* proto_pollset */ |
| + | Curl_http_do_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| ZERO_NULL, /* disconnect */ | |
| Curl_http_write_resp, /* write_resp */ | |
| Curl_http_write_resp_hd, /* write_resp_hd */ | |
| @@ -167,10 +167,10 @@ const struct Curl_handler Curl_handler_https = { | |
| Curl_http_connect, /* connect_it */ | |
| NULL, /* connecting */ | |
| ZERO_NULL, /* doing */ | |
| - | NULL, /* proto_getsock */ |
| - | Curl_http_getsock_do, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | NULL, /* proto_pollset */ |
| + | Curl_http_do_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| ZERO_NULL, /* disconnect */ | |
| Curl_http_write_resp, /* write_resp */ | |
| Curl_http_write_resp_hd, /* write_resp_hd */ | |
| @@ -1524,14 +1524,12 @@ CURLcode Curl_http_connect(struct Curl_easy *data, bool *done) | |
| /* this returns the socket to wait for in the DO and DOING state for the multi | |
| interface and then we are always _sending_ a request and thus we wait for | |
| the single socket to become writable only */ | |
| - | int Curl_http_getsock_do(struct Curl_easy *data, |
| - | struct connectdata *conn, |
| - | curl_socket_t *socks) |
| + | CURLcode Curl_http_do_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| /* write mode */ | |
| - | (void)conn; |
| - | socks[0] = Curl_conn_get_socket(data, FIRSTSOCKET); |
| - | return GETSOCK_WRITESOCK(0); |
| + | curl_socket_t sock = Curl_conn_get_socket(data, FIRSTSOCKET); |
| + | return Curl_pollset_add_out(data, ps, sock); |
| } | |
| /* | |
| @@ -115,8 +115,8 @@ CURLcode Curl_http_setup_conn(struct Curl_easy *data, | |
| CURLcode Curl_http(struct Curl_easy *data, bool *done); | |
| CURLcode Curl_http_done(struct Curl_easy *data, CURLcode, bool premature); | |
| CURLcode Curl_http_connect(struct Curl_easy *data, bool *done); | |
| - | int Curl_http_getsock_do(struct Curl_easy *data, struct connectdata *conn, |
| - | curl_socket_t *socks); |
| + | CURLcode Curl_http_do_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| CURLcode Curl_http_write_resp(struct Curl_easy *data, | |
| const char *buf, size_t blen, | |
| bool is_eos); | |
| @@ -2465,17 +2465,18 @@ out: | |
| return result; | |
| } | |
| - | static void cf_h2_adjust_pollset(struct Curl_cfilter *cf, |
| - | struct Curl_easy *data, |
| - | struct easy_pollset *ps) |
| + | static CURLcode cf_h2_adjust_pollset(struct Curl_cfilter *cf, |
| + | struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| struct cf_h2_ctx *ctx = cf->ctx; | |
| struct cf_call_data save; | |
| curl_socket_t sock; | |
| bool want_recv, want_send; | |
| + | CURLcode result = CURLE_OK; |
| if(!ctx->h2) | |
| - | return; |
| + | return CURLE_OK; |
| sock = Curl_conn_cf_get_socket(cf, data); | |
| Curl_pollset_check(data, ps, sock, &want_recv, &want_send); | |
| @@ -2493,7 +2494,7 @@ static void cf_h2_adjust_pollset(struct Curl_cfilter *cf, | |
| (!c_exhaust && nghttp2_session_want_write(ctx->h2)) || | |
| !Curl_bufq_is_empty(&ctx->outbufq); | |
| - | Curl_pollset_set(data, ps, sock, want_recv, want_send); |
| + | result = Curl_pollset_set(data, ps, sock, want_recv, want_send); |
| CF_DATA_RESTORE(cf, save); | |
| } | |
| else if(ctx->sent_goaway && !cf->shutdown) { | |
| @@ -2502,9 +2503,10 @@ static void cf_h2_adjust_pollset(struct Curl_cfilter *cf, | |
| want_send = nghttp2_session_want_write(ctx->h2) || | |
| !Curl_bufq_is_empty(&ctx->outbufq); | |
| want_recv = nghttp2_session_want_read(ctx->h2); | |
| - | Curl_pollset_set(data, ps, sock, want_recv, want_send); |
| + | result = Curl_pollset_set(data, ps, sock, want_recv, want_send); |
| CF_DATA_RESTORE(cf, save); | |
| } | |
| + | return result; |
| } | |
| static CURLcode cf_h2_connect(struct Curl_cfilter *cf, | |
| @@ -157,8 +157,8 @@ static CURLcode imap_connect(struct Curl_easy *data, bool *done); | |
| static CURLcode imap_disconnect(struct Curl_easy *data, | |
| struct connectdata *conn, bool dead); | |
| static CURLcode imap_multi_statemach(struct Curl_easy *data, bool *done); | |
| - | static int imap_getsock(struct Curl_easy *data, struct connectdata *conn, |
| - | curl_socket_t *socks); |
| + | static CURLcode imap_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| static CURLcode imap_doing(struct Curl_easy *data, bool *dophase_done); | |
| static CURLcode imap_setup_connection(struct Curl_easy *data, | |
| struct connectdata *conn); | |
| @@ -196,10 +196,10 @@ const struct Curl_handler Curl_handler_imap = { | |
| imap_connect, /* connect_it */ | |
| imap_multi_statemach, /* connecting */ | |
| imap_doing, /* doing */ | |
| - | imap_getsock, /* proto_getsock */ |
| - | imap_getsock, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | imap_pollset, /* proto_pollset */ |
| + | imap_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| imap_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -227,10 +227,10 @@ const struct Curl_handler Curl_handler_imaps = { | |
| imap_connect, /* connect_it */ | |
| imap_multi_statemach, /* connecting */ | |
| imap_doing, /* doing */ | |
| - | imap_getsock, /* proto_getsock */ |
| - | imap_getsock, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | imap_pollset, /* proto_pollset */ |
| + | imap_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| imap_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -1560,13 +1560,12 @@ static CURLcode imap_block_statemach(struct Curl_easy *data, | |
| } | |
| /* For the IMAP "protocol connect" and "doing" phases only */ | |
| - | static int imap_getsock(struct Curl_easy *data, |
| - | struct connectdata *conn, |
| - | curl_socket_t *socks) |
| + | static CURLcode imap_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| - | struct imap_conn *imapc = Curl_conn_meta_get(conn, CURL_META_IMAP_CONN); |
| - | return imapc ? |
| - | Curl_pp_getsock(data, &imapc->pp, socks) : GETSOCK_BLANK; |
| + | struct imap_conn *imapc = |
| + | Curl_conn_meta_get(data->conn, CURL_META_IMAP_CONN); |
| + | return imapc ? Curl_pp_pollset(data, &imapc->pp, ps) : CURLE_OK; |
| } | |
| /*********************************************************************** | |
| @@ -177,10 +177,10 @@ const struct Curl_handler Curl_handler_ldap = { | |
| ZERO_NULL, /* connect_it */ | |
| ZERO_NULL, /* connecting */ | |
| ZERO_NULL, /* doing */ | |
| - | ZERO_NULL, /* proto_getsock */ |
| - | ZERO_NULL, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ZERO_NULL, /* proto_pollset */ |
| + | ZERO_NULL, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| ZERO_NULL, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -207,10 +207,10 @@ const struct Curl_handler Curl_handler_ldaps = { | |
| ZERO_NULL, /* connect_it */ | |
| ZERO_NULL, /* connecting */ | |
| ZERO_NULL, /* doing */ | |
| - | ZERO_NULL, /* proto_getsock */ |
| - | ZERO_NULL, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ZERO_NULL, /* proto_pollset */ |
| + | ZERO_NULL, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| ZERO_NULL, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -107,8 +107,8 @@ static CURLcode mqtt_do(struct Curl_easy *data, bool *done); | |
| static CURLcode mqtt_done(struct Curl_easy *data, | |
| CURLcode status, bool premature); | |
| static CURLcode mqtt_doing(struct Curl_easy *data, bool *done); | |
| - | static int mqtt_getsock(struct Curl_easy *data, struct connectdata *conn, |
| - | curl_socket_t *sock); |
| + | static CURLcode mqtt_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| static CURLcode mqtt_setup_conn(struct Curl_easy *data, | |
| struct connectdata *conn); | |
| @@ -125,10 +125,10 @@ const struct Curl_handler Curl_handler_mqtt = { | |
| ZERO_NULL, /* connect_it */ | |
| ZERO_NULL, /* connecting */ | |
| mqtt_doing, /* doing */ | |
| - | ZERO_NULL, /* proto_getsock */ |
| - | mqtt_getsock, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ZERO_NULL, /* proto_pollset */ |
| + | mqtt_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| ZERO_NULL, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -213,13 +213,10 @@ static CURLcode mqtt_send(struct Curl_easy *data, | |
| /* Generic function called by the multi interface to figure out what socket(s) | |
| to wait for and for what actions during the DOING and PROTOCONNECT | |
| states */ | |
| - | static int mqtt_getsock(struct Curl_easy *data, |
| - | struct connectdata *conn, |
| - | curl_socket_t *sock) |
| + | static CURLcode mqtt_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| - | (void)data; |
| - | sock[0] = conn->sock[FIRSTSOCKET]; |
| - | return GETSOCK_READSOCK(FIRSTSOCKET); |
| + | return Curl_pollset_add_in(data, ps, data->conn->sock[FIRSTSOCKET]); |
| } | |
| static int mqtt_encode_len(char *buf, size_t len) | |
| @@ -907,118 +907,103 @@ void Curl_attach_connection(struct Curl_easy *data, | |
| conn->handler->attach(data, conn); | |
| } | |
| - | static int connecting_getsock(struct Curl_easy *data, curl_socket_t *socks) |
| + | static CURLcode mstate_connecting_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| - | struct connectdata *conn = data->conn; |
| - | curl_socket_t sockfd; |
| - | |
| - | if(!conn) |
| - | return GETSOCK_BLANK; |
| - | sockfd = Curl_conn_get_socket(data, FIRSTSOCKET); |
| - | if(sockfd != CURL_SOCKET_BAD) { |
| - | /* Default is to wait to something from the server */ |
| - | socks[0] = sockfd; |
| - | return GETSOCK_READSOCK(0); |
| + | if(data->conn) { |
| + | curl_socket_t sockfd = Curl_conn_get_socket(data, FIRSTSOCKET); |
| + | if(sockfd != CURL_SOCKET_BAD) { |
| + | /* Default is to wait to something from the server */ |
| + | return Curl_pollset_change(data, ps, sockfd, CURL_POLL_IN, 0); |
| + | } |
| } | |
| - | return GETSOCK_BLANK; |
| + | return CURLE_OK; |
| } | |
| - | static int protocol_getsock(struct Curl_easy *data, curl_socket_t *socks) |
| + | static CURLcode mstate_protocol_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| - | struct connectdata *conn = data->conn; |
| - | curl_socket_t sockfd; |
| - | |
| - | if(!conn) |
| - | return GETSOCK_BLANK; |
| - | if(conn->handler->proto_getsock) |
| - | return conn->handler->proto_getsock(data, conn, socks); |
| - | sockfd = Curl_conn_get_socket(data, FIRSTSOCKET); |
| - | if(sockfd != CURL_SOCKET_BAD) { |
| - | /* Default is to wait to something from the server */ |
| - | socks[0] = sockfd; |
| - | return GETSOCK_READSOCK(0); |
| + | if(data->conn) { |
| + | curl_socket_t sockfd; |
| + | if(data->conn->handler->proto_pollset) |
| + | return data->conn->handler->proto_pollset(data, ps); |
| + | sockfd = Curl_conn_get_socket(data, FIRSTSOCKET); |
| + | if(sockfd != CURL_SOCKET_BAD) { |
| + | /* Default is to wait to something from the server */ |
| + | return Curl_pollset_change(data, ps, sockfd, CURL_POLL_IN, 0); |
| + | } |
| } | |
| - | return GETSOCK_BLANK; |
| + | return CURLE_OK; |
| } | |
| - | static int domore_getsock(struct Curl_easy *data, curl_socket_t *socks) |
| + | static CURLcode mstate_do_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| struct connectdata *conn = data->conn; | |
| - | if(!conn) |
| - | return GETSOCK_BLANK; |
| - | if(conn->handler->domore_getsock) |
| - | return conn->handler->domore_getsock(data, conn, socks); |
| - | else if(conn->sockfd != CURL_SOCKET_BAD) { |
| - | /* Default is that we want to send something to the server */ |
| - | socks[0] = conn->sockfd; |
| - | return GETSOCK_WRITESOCK(0); |
| + | if(data->conn) { |
| + | if(data->conn->handler->doing_pollset) |
| + | return data->conn->handler->doing_pollset(data, ps); |
| + | else if(conn->sockfd != CURL_SOCKET_BAD) { |
| + | /* Default is that we want to send something to the server */ |
| + | return Curl_pollset_add_out(data, ps, conn->sockfd); |
| + | } |
| } | |
| - | return GETSOCK_BLANK; |
| + | return CURLE_OK; |
| } | |
| - | static int doing_getsock(struct Curl_easy *data, curl_socket_t *socks) |
| + | static CURLcode mstate_domore_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| - | struct connectdata *conn = data->conn; |
| - | if(!conn) |
| - | return GETSOCK_BLANK; |
| - | if(conn->handler->doing_getsock) |
| - | return conn->handler->doing_getsock(data, conn, socks); |
| - | else if(conn->sockfd != CURL_SOCKET_BAD) { |
| - | /* Default is that we want to send something to the server */ |
| - | socks[0] = conn->sockfd; |
| - | return GETSOCK_WRITESOCK(0); |
| + | if(data->conn) { |
| + | if(data->conn->handler->domore_pollset) |
| + | return data->conn->handler->domore_pollset(data, ps); |
| + | else if(data->conn->sockfd != CURL_SOCKET_BAD) { |
| + | /* Default is that we want to send something to the server */ |
| + | return Curl_pollset_add_out(data, ps, data->conn->sockfd); |
| + | } |
| } | |
| - | return GETSOCK_BLANK; |
| + | return CURLE_OK; |
| } | |
| - | static int perform_getsock(struct Curl_easy *data, curl_socket_t *sock) |
| + | static CURLcode mstate_perform_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| - | struct connectdata *conn = data->conn; |
| - | if(!conn) |
| - | return GETSOCK_BLANK; |
| - | else if(conn->handler->perform_getsock) |
| - | return conn->handler->perform_getsock(data, conn, sock); |
| + | if(!data->conn) |
| + | return CURLE_OK; |
| + | else if(data->conn->handler->perform_pollset) |
| + | return data->conn->handler->perform_pollset(data, ps); |
| else { | |
| /* Default is to obey the data->req.keepon flags for send/recv */ | |
| - | int bitmap = GETSOCK_BLANK; |
| - | unsigned sockindex = 0; |
| + | CURLcode result = CURLE_OK; |
| if(CURL_WANT_RECV(data)) { | |
| - | DEBUGASSERT(conn->sockfd != CURL_SOCKET_BAD); |
| - | bitmap |= GETSOCK_READSOCK(sockindex); |
| - | sock[sockindex] = conn->sockfd; |
| + | DEBUGASSERT(data->conn->sockfd != CURL_SOCKET_BAD); |
| + | result = Curl_pollset_add_in(data, ps, data->conn->sockfd); |
| } | |
| - | if(Curl_req_want_send(data)) { |
| - | if((conn->sockfd != conn->writesockfd) || |
| - | bitmap == GETSOCK_BLANK) { |
| - | /* only if they are not the same socket and we have a readable |
| - | one, we increase index */ |
| - | if(bitmap != GETSOCK_BLANK) |
| - | sockindex++; /* increase index if we need two entries */ |
| - | |
| - | DEBUGASSERT(conn->writesockfd != CURL_SOCKET_BAD); |
| - | sock[sockindex] = conn->writesockfd; |
| - | } |
| - | bitmap |= GETSOCK_WRITESOCK(sockindex); |
| + | if(!result && Curl_req_want_send(data)) { |
| + | DEBUGASSERT(data->conn->writesockfd != CURL_SOCKET_BAD); |
| + | result = Curl_pollset_add_out(data, ps, data->conn->writesockfd); |
| } | |
| - | return bitmap; |
| + | return result; |
| } | |
| } | |
| /* Initializes `poll_set` with the current socket poll actions needed | |
| * for transfer `data`. */ | |
| - | void Curl_multi_getsock(struct Curl_easy *data, |
| - | struct easy_pollset *ps, |
| - | const char *caller) |
| + | CURLMcode Curl_multi_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps, |
| + | const char *caller) |
| { | |
| + | CURLMcode mresult = CURLM_OK; |
| + | CURLcode result = CURLE_OK; |
| bool expect_sockets = TRUE; | |
| /* If the transfer has no connection, this is fine. Happens when | |
| called via curl_multi_remove_handle() => Curl_multi_ev_assess() => | |
| - | Curl_multi_getsock(). */ |
| - | Curl_pollset_reset(data, ps); |
| + | Curl_multi_pollset(). */ |
| + | Curl_pollset_reset(ps); |
| if(!data->conn) | |
| - | return; |
| + | return CURLM_OK; |
| switch(data->mstate) { | |
| case MSTATE_INIT: | |
| @@ -1030,7 +1015,7 @@ void Curl_multi_getsock(struct Curl_easy *data, | |
| break; | |
| case MSTATE_RESOLVING: | |
| - | Curl_pollset_add_socks(data, ps, Curl_resolv_getsock); |
| + | result = Curl_resolv_pollset(data, ps); |
| /* connection filters are not involved in this phase. It's ok if we get no | |
| * sockets to wait for. Resolving can wake up from other sources. */ | |
| expect_sockets = FALSE; | |
| @@ -1038,31 +1023,36 @@ void Curl_multi_getsock(struct Curl_easy *data, | |
| case MSTATE_CONNECTING: | |
| case MSTATE_TUNNELING: | |
| - | Curl_pollset_add_socks(data, ps, connecting_getsock); |
| - | Curl_conn_adjust_pollset(data, data->conn, ps); |
| + | result = mstate_connecting_pollset(data, ps); |
| + | if(!result) |
| + | result = Curl_conn_adjust_pollset(data, data->conn, ps); |
| break; | |
| case MSTATE_PROTOCONNECT: | |
| case MSTATE_PROTOCONNECTING: | |
| - | Curl_pollset_add_socks(data, ps, protocol_getsock); |
| - | Curl_conn_adjust_pollset(data, data->conn, ps); |
| + | result = mstate_protocol_pollset(data, ps); |
| + | if(!result) |
| + | result = Curl_conn_adjust_pollset(data, data->conn, ps); |
| break; | |
| case MSTATE_DO: | |
| case MSTATE_DOING: | |
| - | Curl_pollset_add_socks(data, ps, doing_getsock); |
| - | Curl_conn_adjust_pollset(data, data->conn, ps); |
| + | result = mstate_do_pollset(data, ps); |
| + | if(!result) |
| + | result = Curl_conn_adjust_pollset(data, data->conn, ps); |
| break; | |
| case MSTATE_DOING_MORE: | |
| - | Curl_pollset_add_socks(data, ps, domore_getsock); |
| - | Curl_conn_adjust_pollset(data, data->conn, ps); |
| + | result = mstate_domore_pollset(data, ps); |
| + | if(!result) |
| + | result = Curl_conn_adjust_pollset(data, data->conn, ps); |
| break; | |
| case MSTATE_DID: /* same as PERFORMING in regard to polling */ | |
| case MSTATE_PERFORMING: | |
| - | Curl_pollset_add_socks(data, ps, perform_getsock); |
| - | Curl_conn_adjust_pollset(data, data->conn, ps); |
| + | result = mstate_perform_pollset(data, ps); |
| + | if(!result) |
| + | result = Curl_conn_adjust_pollset(data, data->conn, ps); |
| break; | |
| case MSTATE_RATELIMITING: | |
| @@ -1084,6 +1074,15 @@ void Curl_multi_getsock(struct Curl_easy *data, | |
| break; | |
| } | |
| + | if(result) { |
| + | if(result == CURLE_OUT_OF_MEMORY) |
| + | mresult = CURLM_OUT_OF_MEMORY; |
| + | else { |
| + | failf(data, "error determining pollset: %d", result); |
| + | mresult = CURLM_INTERNAL_ERROR; |
| + | } |
| + | goto out; |
| + | } |
| /* Unblocked and waiting to receive with buffered input. | |
| * Make transfer run again at next opportunity. */ | |
| @@ -1097,7 +1096,7 @@ void Curl_multi_getsock(struct Curl_easy *data, | |
| Curl_multi_mark_dirty(data); | |
| } | |
| - | switch(ps->num) { |
| + | switch(ps->n) { |
| case 0: | |
| CURL_TRC_M(data, "%s pollset[], timeouts=%zu, paused %d/%d (r/w)", | |
| caller, Curl_llist_count(&data->state.timeoutlist), | |
| @@ -1124,10 +1123,10 @@ void Curl_multi_getsock(struct Curl_easy *data, | |
| break; | |
| default: | |
| CURL_TRC_M(data, "%s pollset[fds=%u], timeouts=%zu", | |
| - | caller, ps->num, Curl_llist_count(&data->state.timeoutlist)); |
| + | caller, ps->n, Curl_llist_count(&data->state.timeoutlist)); |
| break; | |
| } | |
| - | if(expect_sockets && !ps->num && data->multi && |
| + | if(expect_sockets && !ps->n && data->multi && |
| !Curl_uint_bset_contains(&data->multi->dirty, data->mid) && | |
| !Curl_llist_count(&data->state.timeoutlist) && | |
| !Curl_cwriter_is_paused(data) && !Curl_creader_is_paused(data) && | |
| @@ -1140,6 +1139,8 @@ void Curl_multi_getsock(struct Curl_easy *data, | |
| infof(data, "WARNING: no socket in pollset or timer, transfer may stall!"); | |
| DEBUGASSERT(0); | |
| } | |
| + | out: |
| + | return mresult; |
| } | |
| CURLMcode curl_multi_fdset(CURLM *m, | |
| @@ -1151,6 +1152,7 @@ CURLMcode curl_multi_fdset(CURLM *m, | |
| and then we must make sure that is done. */ | |
| int this_max_fd = -1; | |
| struct Curl_multi *multi = m; | |
| + | struct easy_pollset ps; |
| unsigned int i, mid; | |
| (void)exc_fd_set; /* not used */ | |
| @@ -1160,18 +1162,18 @@ CURLMcode curl_multi_fdset(CURLM *m, | |
| if(multi->in_callback) | |
| return CURLM_RECURSIVE_API_CALL; | |
| + | Curl_pollset_init(&ps); |
| if(Curl_uint_bset_first(&multi->process, &mid)) { | |
| do { | |
| struct Curl_easy *data = Curl_multi_get_easy(multi, mid); | |
| - | struct easy_pollset ps; |
| if(!data) { | |
| DEBUGASSERT(0); | |
| continue; | |
| } | |
| - | Curl_multi_getsock(data, &ps, "curl_multi_fdset"); |
| - | for(i = 0; i < ps.num; i++) { |
| + | Curl_multi_pollset(data, &ps, "curl_multi_fdset"); |
| + | for(i = 0; i < ps.n; i++) { |
| if(!FDSET_SOCK(ps.sockets[i])) | |
| /* pretend it does not exist */ | |
| continue; | |
| @@ -1197,6 +1199,7 @@ CURLMcode curl_multi_fdset(CURLM *m, | |
| read_fd_set, write_fd_set, &this_max_fd); | |
| *max_fd = this_max_fd; | |
| + | Curl_pollset_cleanup(&ps); |
| return CURLM_OK; | |
| } | |
| @@ -1209,6 +1212,7 @@ CURLMcode curl_multi_waitfds(CURLM *m, | |
| struct Curl_waitfds cwfds; | |
| CURLMcode result = CURLM_OK; | |
| struct Curl_multi *multi = m; | |
| + | struct easy_pollset ps; |
| unsigned int need = 0, mid; | |
| if(!ufds && (size || !fd_count)) | |
| @@ -1220,18 +1224,18 @@ CURLMcode curl_multi_waitfds(CURLM *m, | |
| if(multi->in_callback) | |
| return CURLM_RECURSIVE_API_CALL; | |
| + | Curl_pollset_init(&ps); |
| Curl_waitfds_init(&cwfds, ufds, size); | |
| if(Curl_uint_bset_first(&multi->process, &mid)) { | |
| do { | |
| struct Curl_easy *data = Curl_multi_get_easy(multi, mid); | |
| - | struct easy_pollset ps; |
| if(!data) { | |
| DEBUGASSERT(0); | |
| Curl_uint_bset_remove(&multi->process, mid); | |
| Curl_uint_bset_remove(&multi->dirty, mid); | |
| continue; | |
| } | |
| - | Curl_multi_getsock(data, &ps, "curl_multi_waitfds"); |
| + | Curl_multi_pollset(data, &ps, "curl_multi_waitfds"); |
| need += Curl_waitfds_add_ps(&cwfds, &ps); | |
| } | |
| while(Curl_uint_bset_next(&multi->process, mid, &mid)); | |
| @@ -1245,6 +1249,7 @@ CURLMcode curl_multi_waitfds(CURLM *m, | |
| if(fd_count) | |
| *fd_count = need; | |
| + | Curl_pollset_cleanup(&ps); |
| return result; | |
| } | |
| @@ -1278,6 +1283,7 @@ static CURLMcode multi_wait(struct Curl_multi *multi, | |
| struct curltime expire_time; | |
| long timeout_internal; | |
| int retcode = 0; | |
| + | struct easy_pollset ps; |
| struct pollfd a_few_on_stack[NUM_POLLS_ON_STACK]; | |
| struct curl_pollfds cpfds; | |
| unsigned int curl_nfds = 0; /* how many pfds are for curl transfers */ | |
| @@ -1302,12 +1308,12 @@ static CURLMcode multi_wait(struct Curl_multi *multi, | |
| if(timeout_ms < 0) | |
| return CURLM_BAD_FUNCTION_ARGUMENT; | |
| + | Curl_pollset_init(&ps); |
| Curl_pollfds_init(&cpfds, a_few_on_stack, NUM_POLLS_ON_STACK); | |
| /* Add the curl handles to our pollfds first */ | |
| if(Curl_uint_bset_first(&multi->process, &mid)) { | |
| do { | |
| - | struct easy_pollset ps; |
| data = Curl_multi_get_easy(multi, mid); | |
| if(!data) { | |
| DEBUGASSERT(0); | |
| @@ -1315,7 +1321,7 @@ static CURLMcode multi_wait(struct Curl_multi *multi, | |
| Curl_uint_bset_remove(&multi->dirty, mid); | |
| continue; | |
| } | |
| - | Curl_multi_getsock(data, &ps, "multi_wait"); |
| + | Curl_multi_pollset(data, &ps, "multi_wait"); |
| if(Curl_pollfds_add_ps(&cpfds, &ps)) { | |
| result = CURLM_OUT_OF_MEMORY; | |
| goto out; | |
| @@ -1514,6 +1520,7 @@ static CURLMcode multi_wait(struct Curl_multi *multi, | |
| } | |
| out: | |
| + | Curl_pollset_cleanup(&ps); |
| Curl_pollfds_cleanup(&cpfds); | |
| return result; | |
| } | |
| @@ -317,7 +317,7 @@ static CURLMcode mev_pollset_diff(struct Curl_multi *multi, | |
| DEBUGASSERT(prev_ps); | |
| /* Handle changes to sockets the transfer is interested in. */ | |
| - | for(i = 0; i < ps->num; i++) { |
| + | for(i = 0; i < ps->n; i++) { |
| unsigned char last_action; | |
| bool first_time = FALSE; /* data/conn appears first time on socket */ | |
| @@ -362,7 +362,7 @@ static CURLMcode mev_pollset_diff(struct Curl_multi *multi, | |
| entry->conn ? 1 : 0); | |
| } | |
| else { | |
| - | for(j = 0; j < prev_ps->num; j++) { |
| + | for(j = 0; j < prev_ps->n; j++) { |
| if(s == prev_ps->sockets[j]) { | |
| last_action = prev_ps->actions[j]; | |
| break; | |
| @@ -377,11 +377,11 @@ static CURLMcode mev_pollset_diff(struct Curl_multi *multi, | |
| } | |
| /* Handle changes to sockets the transfer is NO LONGER interested in. */ | |
| - | for(i = 0; i < prev_ps->num; i++) { |
| + | for(i = 0; i < prev_ps->n; i++) { |
| bool stillused = FALSE; | |
| s = prev_ps->sockets[i]; | |
| - | for(j = 0; j < ps->num; j++) { |
| + | for(j = 0; j < ps->n; j++) { |
| if(s == ps->sockets[j]) { | |
| /* socket is still supervised */ | |
| stillused = TRUE; | |
| @@ -437,15 +437,19 @@ static CURLMcode mev_pollset_diff(struct Curl_multi *multi, | |
| } /* for loop over num */ | |
| /* Remember for next time */ | |
| - | memcpy(prev_ps, ps, sizeof(*prev_ps)); |
| + | Curl_pollset_move(prev_ps, ps); |
| return CURLM_OK; | |
| } | |
| static void mev_pollset_dtor(void *key, size_t klen, void *entry) | |
| { | |
| + | struct easy_pollset *ps = entry; |
| (void)key; | |
| (void)klen; | |
| - | free(entry); |
| + | if(ps) { |
| + | Curl_pollset_cleanup(ps); |
| + | free(ps); |
| + | } |
| } | |
| static struct easy_pollset* | |
| @@ -453,7 +457,7 @@ mev_add_new_conn_pollset(struct connectdata *conn) | |
| { | |
| struct easy_pollset *ps; | |
| - | ps = calloc(1, sizeof(*ps)); |
| + | ps = Curl_pollset_create(); |
| if(!ps) | |
| return NULL; | |
| if(Curl_conn_meta_set(conn, CURL_META_MEV_POLLSET, ps, mev_pollset_dtor)) | |
| @@ -466,7 +470,7 @@ mev_add_new_xfer_pollset(struct Curl_easy *data) | |
| { | |
| struct easy_pollset *ps; | |
| - | ps = calloc(1, sizeof(*ps)); |
| + | ps = Curl_pollset_create(); |
| if(!ps) | |
| return NULL; | |
| if(Curl_meta_set(data, CURL_META_MEV_POLLSET, ps, mev_pollset_dtor)) | |
| @@ -486,42 +490,47 @@ mev_get_last_pollset(struct Curl_easy *data, | |
| return NULL; | |
| } | |
| - | static void mev_init_cur_pollset(struct easy_pollset *ps, |
| - | struct Curl_easy *data, |
| - | struct connectdata *conn) |
| - | { |
| - | memset(ps, 0, sizeof(*ps)); |
| - | if(conn) |
| - | Curl_conn_adjust_pollset(data, conn, ps); |
| - | else if(data) |
| - | Curl_multi_getsock(data, ps, "ev assess"); |
| - | } |
| - | |
| static CURLMcode mev_assess(struct Curl_multi *multi, | |
| struct Curl_easy *data, | |
| struct connectdata *conn) | |
| { | |
| - | if(multi && multi->socket_cb) { |
| - | struct easy_pollset ps, *last_ps; |
| + | struct easy_pollset ps, *last_ps; |
| + | CURLMcode res = CURLM_OK; |
| - | mev_init_cur_pollset(&ps, data, conn); |
| - | last_ps = mev_get_last_pollset(data, conn); |
| + | if(!multi || !multi->socket_cb) |
| + | return CURLM_OK; |
| - | if(!last_ps && ps.num) { |
| - | if(conn) |
| - | last_ps = mev_add_new_conn_pollset(conn); |
| - | else |
| - | last_ps = mev_add_new_xfer_pollset(data); |
| - | if(!last_ps) |
| - | return CURLM_OUT_OF_MEMORY; |
| + | Curl_pollset_init(&ps); |
| + | if(conn) { |
| + | CURLcode r = Curl_conn_adjust_pollset(data, conn, &ps); |
| + | if(r) { |
| + | res = (r == CURLE_OUT_OF_MEMORY) ? |
| + | CURLM_OUT_OF_MEMORY : CURLM_INTERNAL_ERROR; |
| + | goto out; |
| } | |
| + | } |
| + | else if(data) |
| + | Curl_multi_pollset(data, &ps, "ev assess"); |
| + | last_ps = mev_get_last_pollset(data, conn); |
| - | if(last_ps) |
| - | return mev_pollset_diff(multi, data, conn, &ps, last_ps); |
| + | if(!last_ps && ps.n) { |
| + | if(conn) |
| + | last_ps = mev_add_new_conn_pollset(conn); |
| else | |
| - | DEBUGASSERT(!ps.num); |
| + | last_ps = mev_add_new_xfer_pollset(data); |
| + | if(!last_ps) { |
| + | res = CURLM_OUT_OF_MEMORY; |
| + | goto out; |
| + | } |
| } | |
| - | return CURLM_OK; |
| + | |
| + | if(last_ps) |
| + | res = mev_pollset_diff(multi, data, conn, &ps, last_ps); |
| + | else |
| + | DEBUGASSERT(!ps.n); |
| + | out: |
| + | Curl_pollset_cleanup(&ps); |
| + | return res; |
| } | |
| CURLMcode Curl_multi_ev_assess_xfer(struct Curl_multi *multi, | |
| @@ -72,12 +72,6 @@ typedef enum { | |
| MSTATE_LAST /* 18 - not a true state, never use this */ | |
| } CURLMstate; | |
| - | /* we support N sockets per easy handle. Set the corresponding bit to what |
| - | action we should wait for */ |
| - | #define MAX_SOCKSPEREASYHANDLE 5 |
| - | #define GETSOCK_READABLE (0x00ff) |
| - | #define GETSOCK_WRITABLE (0xff00) |
| - | |
| #define CURLPIPE_ANY (CURLPIPE_MULTIPLEX) | |
| #ifndef CURL_DISABLE_SOCKETPAIR | |
| @@ -53,20 +53,6 @@ struct Curl_multi *Curl_multi_handle(unsigned int xfer_table_size, | |
| size_t dnssize, | |
| size_t sesssize); | |
| - | /* the write bits start at bit 16 for the *getsock() bitmap */ |
| - | #define GETSOCK_WRITEBITSTART 16 |
| - | |
| - | #define GETSOCK_BLANK 0 /* no bits set */ |
| - | |
| - | /* set the bit for the given sock number to make the bitmap for writable */ |
| - | #define GETSOCK_WRITESOCK(x) (1 << (GETSOCK_WRITEBITSTART + (x))) |
| - | |
| - | /* set the bit for the given sock number to make the bitmap for readable */ |
| - | #define GETSOCK_READSOCK(x) (1 << (x)) |
| - | |
| - | /* mask for checking if read and/or write is set for index x */ |
| - | #define GETSOCK_MASK_RW(x) (GETSOCK_READSOCK(x)|GETSOCK_WRITESOCK(x)) |
| - | |
| /** | |
| * Let the multi handle know that the socket is about to be closed. | |
| * The multi will then remove anything it knows about the socket, so | |
| @@ -86,9 +72,9 @@ CURLMcode Curl_multi_add_perform(struct Curl_multi *multi, | |
| /* Return the value of the CURLMOPT_MAX_CONCURRENT_STREAMS option */ | |
| unsigned int Curl_multi_max_concurrent_streams(struct Curl_multi *multi); | |
| - | void Curl_multi_getsock(struct Curl_easy *data, |
| - | struct easy_pollset *ps, |
| - | const char *caller); |
| + | CURLMcode Curl_multi_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps, |
| + | const char *caller); |
| /** | |
| * Borrow the transfer buffer from the multi, suitable | |
| @@ -126,10 +126,10 @@ const struct Curl_handler Curl_handler_ldap = { | |
| oldap_connect, /* connect_it */ | |
| oldap_connecting, /* connecting */ | |
| ZERO_NULL, /* doing */ | |
| - | ZERO_NULL, /* proto_getsock */ |
| - | ZERO_NULL, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ZERO_NULL, /* proto_pollset */ |
| + | ZERO_NULL, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| oldap_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -156,10 +156,10 @@ const struct Curl_handler Curl_handler_ldaps = { | |
| oldap_connect, /* connect_it */ | |
| oldap_connecting, /* connecting */ | |
| ZERO_NULL, /* doing */ | |
| - | ZERO_NULL, /* proto_getsock */ |
| - | ZERO_NULL, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ZERO_NULL, /* proto_pollset */ |
| + | ZERO_NULL, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| oldap_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -397,19 +397,13 @@ CURLcode Curl_pp_readresp(struct Curl_easy *data, | |
| return result; | |
| } | |
| - | int Curl_pp_getsock(struct Curl_easy *data, |
| - | struct pingpong *pp, curl_socket_t *socks) |
| + | CURLcode Curl_pp_pollset(struct Curl_easy *data, |
| + | struct pingpong *pp, |
| + | struct easy_pollset *ps) |
| { | |
| - | struct connectdata *conn = data->conn; |
| - | socks[0] = conn->sock[FIRSTSOCKET]; |
| - | |
| - | if(pp->sendleft) { |
| - | /* write mode */ |
| - | return GETSOCK_WRITESOCK(0); |
| - | } |
| - | |
| - | /* read mode */ |
| - | return GETSOCK_READSOCK(0); |
| + | int flags = pp->sendleft ? CURL_POLL_OUT : CURL_POLL_IN; |
| + | return Curl_pollset_change(data, ps, data->conn->sock[FIRSTSOCKET], |
| + | flags, 0); |
| } | |
| bool Curl_pp_needs_flush(struct Curl_easy *data, | |
| @@ -147,8 +147,9 @@ CURLcode Curl_pp_flushsend(struct Curl_easy *data, | |
| /* call this when a pingpong connection is disconnected */ | |
| CURLcode Curl_pp_disconnect(struct pingpong *pp); | |
| - | int Curl_pp_getsock(struct Curl_easy *data, struct pingpong *pp, |
| - | curl_socket_t *socks); |
| + | CURLcode Curl_pp_pollset(struct Curl_easy *data, |
| + | struct pingpong *pp, |
| + | struct easy_pollset *ps); |
| /*********************************************************************** | |
| @@ -153,8 +153,8 @@ static CURLcode pop3_connect(struct Curl_easy *data, bool *done); | |
| static CURLcode pop3_disconnect(struct Curl_easy *data, | |
| struct connectdata *conn, bool dead); | |
| static CURLcode pop3_multi_statemach(struct Curl_easy *data, bool *done); | |
| - | static int pop3_getsock(struct Curl_easy *data, |
| - | struct connectdata *conn, curl_socket_t *socks); |
| + | static CURLcode pop3_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| static CURLcode pop3_doing(struct Curl_easy *data, bool *dophase_done); | |
| static CURLcode pop3_setup_connection(struct Curl_easy *data, | |
| struct connectdata *conn); | |
| @@ -186,10 +186,10 @@ const struct Curl_handler Curl_handler_pop3 = { | |
| pop3_connect, /* connect_it */ | |
| pop3_multi_statemach, /* connecting */ | |
| pop3_doing, /* doing */ | |
| - | pop3_getsock, /* proto_getsock */ |
| - | pop3_getsock, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | pop3_pollset, /* proto_pollset */ |
| + | pop3_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| pop3_disconnect, /* disconnect */ | |
| pop3_write, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -217,10 +217,10 @@ const struct Curl_handler Curl_handler_pop3s = { | |
| pop3_connect, /* connect_it */ | |
| pop3_multi_statemach, /* connecting */ | |
| pop3_doing, /* doing */ | |
| - | pop3_getsock, /* proto_getsock */ |
| - | pop3_getsock, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | pop3_pollset, /* proto_pollset */ |
| + | pop3_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| pop3_disconnect, /* disconnect */ | |
| pop3_write, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -1269,13 +1269,12 @@ static CURLcode pop3_block_statemach(struct Curl_easy *data, | |
| } | |
| /* For the POP3 "protocol connect" and "doing" phases only */ | |
| - | static int pop3_getsock(struct Curl_easy *data, |
| - | struct connectdata *conn, curl_socket_t *socks) |
| + | static CURLcode pop3_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| - | struct pop3_conn *pop3c = Curl_conn_meta_get(conn, CURL_META_POP3_CONN); |
| - | if(pop3c) |
| - | return Curl_pp_getsock(data, &pop3c->pp, socks); |
| - | return GETSOCK_BLANK; |
| + | struct pop3_conn *pop3c = |
| + | Curl_conn_meta_get(data->conn, CURL_META_POP3_CONN); |
| + | return pop3c ? Curl_pp_pollset(data, &pop3c->pp, ps) : CURLE_OK; |
| } | |
| /*********************************************************************** | |
| @@ -83,8 +83,8 @@ struct RTSP { | |
| static CURLcode rtsp_do(struct Curl_easy *data, bool *done); | |
| static CURLcode rtsp_done(struct Curl_easy *data, CURLcode, bool premature); | |
| static CURLcode rtsp_connect(struct Curl_easy *data, bool *done); | |
| - | static int rtsp_getsock_do(struct Curl_easy *data, |
| - | struct connectdata *conn, curl_socket_t *socks); |
| + | static CURLcode rtsp_do_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| /* | |
| * Parse and write out an RTSP response. | |
| @@ -110,13 +110,11 @@ static unsigned int rtsp_conncheck(struct Curl_easy *data, | |
| /* this returns the socket to wait for in the DO and DOING state for the multi | |
| interface and then we are always _sending_ a request and thus we wait for | |
| the single socket to become writable only */ | |
| - | static int rtsp_getsock_do(struct Curl_easy *data, struct connectdata *conn, |
| - | curl_socket_t *socks) |
| + | static CURLcode rtsp_do_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| /* write mode */ | |
| - | (void)data; |
| - | socks[0] = conn->sock[FIRSTSOCKET]; |
| - | return GETSOCK_WRITESOCK(0); |
| + | return Curl_pollset_add_out(data, ps, data->conn->sock[FIRSTSOCKET]); |
| } | |
| static | |
| @@ -137,10 +135,10 @@ const struct Curl_handler Curl_handler_rtsp = { | |
| rtsp_connect, /* connect_it */ | |
| ZERO_NULL, /* connecting */ | |
| ZERO_NULL, /* doing */ | |
| - | ZERO_NULL, /* proto_getsock */ |
| - | rtsp_getsock_do, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ZERO_NULL, /* proto_pollset */ |
| + | rtsp_do_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| ZERO_NULL, /* disconnect */ | |
| rtsp_rtp_write_resp, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -41,6 +41,7 @@ | |
| #include "urldata.h" | |
| #include "connect.h" | |
| #include "select.h" | |
| + | #include "curl_trc.h" |
| #include "curlx/timediff.h" | |
| #include "curlx/wait.h" | |
| #include "curlx/warnless.h" | |
| @@ -423,7 +424,7 @@ CURLcode Curl_pollfds_add_ps(struct curl_pollfds *cpfds, | |
| DEBUGASSERT(cpfds); | |
| DEBUGASSERT(ps); | |
| - | for(i = 0; i < ps->num; i++) { |
| + | for(i = 0; i < ps->n; i++) { |
| short events = 0; | |
| if(ps->actions[i] & CURL_POLL_IN) | |
| events |= POLLIN; | |
| @@ -481,7 +482,7 @@ unsigned int Curl_waitfds_add_ps(struct Curl_waitfds *cwfds, | |
| DEBUGASSERT(cwfds); | |
| DEBUGASSERT(ps); | |
| - | for(i = 0; i < ps->num; i++) { |
| + | for(i = 0; i < ps->n; i++) { |
| short events = 0; | |
| if(ps->actions[i] & CURL_POLL_IN) | |
| events |= CURL_WAIT_POLLIN; | |
| @@ -492,3 +493,233 @@ unsigned int Curl_waitfds_add_ps(struct Curl_waitfds *cwfds, | |
| } | |
| return need; | |
| } | |
| + | |
| + | void Curl_pollset_reset(struct easy_pollset *ps) |
| + | { |
| + | unsigned int i; |
| + | ps->n = 0; |
| + | #ifdef DEBUGBUILD |
| + | DEBUGASSERT(ps->init == CURL_EASY_POLLSET_MAGIC); |
| + | #endif |
| + | DEBUGASSERT(ps->count); |
| + | for(i = 0; i < ps->count; i++) |
| + | ps->sockets[i] = CURL_SOCKET_BAD; |
| + | memset(ps->actions, 0, ps->count * sizeof(ps->actions[0])); |
| + | } |
| + | |
| + | void Curl_pollset_init(struct easy_pollset *ps) |
| + | { |
| + | #ifdef DEBUGBUILD |
| + | ps->init = CURL_EASY_POLLSET_MAGIC; |
| + | #endif |
| + | ps->sockets = ps->def_sockets; |
| + | ps->actions = ps->def_actions; |
| + | ps->count = CURL_ARRAYSIZE(ps->def_sockets); |
| + | ps->n = 0; |
| + | Curl_pollset_reset(ps); |
| + | } |
| + | |
| + | struct easy_pollset *Curl_pollset_create(void) |
| + | { |
| + | struct easy_pollset *ps = calloc(1, sizeof(*ps)); |
| + | if(ps) |
| + | Curl_pollset_init(ps); |
| + | return ps; |
| + | } |
| + | |
| + | void Curl_pollset_cleanup(struct easy_pollset *ps) |
| + | { |
| + | #ifdef DEBUGBUILD |
| + | DEBUGASSERT(ps->init == CURL_EASY_POLLSET_MAGIC); |
| + | #endif |
| + | if(ps->sockets != ps->def_sockets) { |
| + | free(ps->sockets); |
| + | ps->sockets = ps->def_sockets; |
| + | } |
| + | if(ps->actions != ps->def_actions) { |
| + | free(ps->actions); |
| + | ps->actions = ps->def_actions; |
| + | } |
| + | ps->count = CURL_ARRAYSIZE(ps->def_sockets); |
| + | Curl_pollset_reset(ps); |
| + | } |
| + | |
| + | void Curl_pollset_move(struct easy_pollset *to, struct easy_pollset *from) |
| + | { |
| + | Curl_pollset_cleanup(to); /* deallocate anything in to */ |
| + | if(from->sockets != from->def_sockets) { |
| + | DEBUGASSERT(from->actions != from->def_actions); |
| + | to->sockets = from->sockets; |
| + | to->actions = from->actions; |
| + | to->count = from->count; |
| + | to->n = from->n; |
| + | Curl_pollset_init(from); |
| + | } |
| + | else { |
| + | DEBUGASSERT(to->sockets == to->def_sockets); |
| + | DEBUGASSERT(to->actions == to->def_actions); |
| + | memcpy(to->sockets, from->sockets, to->count * sizeof(to->sockets[0])); |
| + | memcpy(to->actions, from->actions, to->count * sizeof(to->actions[0])); |
| + | to->n = from->n; |
| + | Curl_pollset_init(from); |
| + | } |
| + | } |
| + | |
| + | /** |
| + | * |
| + | */ |
| + | CURLcode Curl_pollset_change(struct Curl_easy *data, |
| + | struct easy_pollset *ps, curl_socket_t sock, |
| + | int add_flags, int remove_flags) |
| + | { |
| + | unsigned int i; |
| + | |
| + | #ifdef DEBUGBUILD |
| + | DEBUGASSERT(ps->init == CURL_EASY_POLLSET_MAGIC); |
| + | #endif |
| + | |
| + | (void)data; |
| + | DEBUGASSERT(VALID_SOCK(sock)); |
| + | if(!VALID_SOCK(sock)) |
| + | return CURLE_BAD_FUNCTION_ARGUMENT; |
| + | |
| + | DEBUGASSERT(add_flags <= (CURL_POLL_IN|CURL_POLL_OUT)); |
| + | DEBUGASSERT(remove_flags <= (CURL_POLL_IN|CURL_POLL_OUT)); |
| + | DEBUGASSERT((add_flags&remove_flags) == 0); /* no overlap */ |
| + | for(i = 0; i < ps->n; ++i) { |
| + | if(ps->sockets[i] == sock) { |
| + | ps->actions[i] &= (unsigned char)(~remove_flags); |
| + | ps->actions[i] |= (unsigned char)add_flags; |
| + | /* all gone? remove socket */ |
| + | if(!ps->actions[i]) { |
| + | if((i + 1) < ps->n) { |
| + | memmove(&ps->sockets[i], &ps->sockets[i + 1], |
| + | (ps->n - (i + 1)) * sizeof(ps->sockets[0])); |
| + | memmove(&ps->actions[i], &ps->actions[i + 1], |
| + | (ps->n - (i + 1)) * sizeof(ps->actions[0])); |
| + | } |
| + | --ps->n; |
| + | } |
| + | return CURLE_OK; |
| + | } |
| + | } |
| + | /* not present */ |
| + | if(add_flags) { |
| + | if(i >= ps->count) { /* need to grow */ |
| + | unsigned int new_count = CURLMAX(ps->count * 2, 8); |
| + | curl_socket_t *nsockets; |
| + | unsigned char *nactions; |
| + | |
| + | CURL_TRC_M(data, "growing pollset capacity from %u to %u", |
| + | ps->count, new_count); |
| + | if(new_count <= ps->count) |
| + | return CURLE_OUT_OF_MEMORY; |
| + | nsockets = calloc(new_count, sizeof(nsockets[0])); |
| + | if(!nsockets) |
| + | return CURLE_OUT_OF_MEMORY; |
| + | nactions = calloc(new_count, sizeof(nactions[0])); |
| + | if(!nactions) { |
| + | free(nsockets); |
| + | return CURLE_OUT_OF_MEMORY; |
| + | } |
| + | memcpy(nsockets, ps->sockets, ps->count * sizeof(ps->sockets[0])); |
| + | memcpy(nactions, ps->actions, ps->count * sizeof(ps->actions[0])); |
| + | if(ps->sockets != ps->def_sockets) |
| + | free(ps->sockets); |
| + | ps->sockets = nsockets; |
| + | if(ps->actions != ps->def_actions) |
| + | free(ps->actions); |
| + | ps->actions = nactions; |
| + | ps->count = new_count; |
| + | } |
| + | DEBUGASSERT(i < ps->count); |
| + | if(i < ps->count) { |
| + | ps->sockets[i] = sock; |
| + | ps->actions[i] = (unsigned char)add_flags; |
| + | ps->n = i + 1; |
| + | } |
| + | } |
| + | return CURLE_OK; |
| + | } |
| + | |
| + | CURLcode Curl_pollset_set(struct Curl_easy *data, |
| + | struct easy_pollset *ps, curl_socket_t sock, |
| + | bool do_in, bool do_out) |
| + | { |
| + | return Curl_pollset_change(data, ps, sock, |
| + | (do_in ? CURL_POLL_IN : 0)| |
| + | (do_out ? CURL_POLL_OUT : 0), |
| + | (!do_in ? CURL_POLL_IN : 0)| |
| + | (!do_out ? CURL_POLL_OUT : 0)); |
| + | } |
| + | |
| + | int Curl_pollset_poll(struct Curl_easy *data, |
| + | struct easy_pollset *ps, |
| + | timediff_t timeout_ms) |
| + | { |
| + | struct pollfd *pfds; |
| + | unsigned int i, npfds; |
| + | int result; |
| + | |
| + | (void)data; |
| + | DEBUGASSERT(data); |
| + | DEBUGASSERT(data->conn); |
| + | |
| + | if(!ps->n) |
| + | return curlx_wait_ms(timeout_ms); |
| + | |
| + | pfds = calloc(ps->n, sizeof(*pfds)); |
| + | if(!pfds) |
| + | return -1; |
| + | |
| + | npfds = 0; |
| + | for(i = 0; i < ps->n; ++i) { |
| + | short events = 0; |
| + | if(ps->actions[i] & CURL_POLL_IN) { |
| + | events |= POLLIN; |
| + | } |
| + | if(ps->actions[i] & CURL_POLL_OUT) { |
| + | events |= POLLOUT; |
| + | } |
| + | if(events) { |
| + | pfds[npfds].fd = ps->sockets[i]; |
| + | pfds[npfds].events = events; |
| + | ++npfds; |
| + | } |
| + | } |
| + | |
| + | result = Curl_poll(pfds, npfds, timeout_ms); |
| + | free(pfds); |
| + | return result; |
| + | } |
| + | |
| + | void Curl_pollset_check(struct Curl_easy *data, |
| + | struct easy_pollset *ps, curl_socket_t sock, |
| + | bool *pwant_read, bool *pwant_write) |
| + | { |
| + | unsigned int i; |
| + | |
| + | (void)data; |
| + | DEBUGASSERT(VALID_SOCK(sock)); |
| + | for(i = 0; i < ps->n; ++i) { |
| + | if(ps->sockets[i] == sock) { |
| + | *pwant_read = !!(ps->actions[i] & CURL_POLL_IN); |
| + | *pwant_write = !!(ps->actions[i] & CURL_POLL_OUT); |
| + | return; |
| + | } |
| + | } |
| + | *pwant_read = *pwant_write = FALSE; |
| + | } |
| + | |
| + | bool Curl_pollset_want_read(struct Curl_easy *data, |
| + | struct easy_pollset *ps, |
| + | curl_socket_t sock) |
| + | { |
| + | unsigned int i; |
| + | (void)data; |
| + | for(i = 0; i < ps->n; ++i) { |
| + | if((ps->sockets[i] == sock) && (ps->actions[i] & CURL_POLL_IN)) |
| + | return TRUE; |
| + | } |
| + | return FALSE; |
| + | } |
| @@ -110,6 +110,90 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, timediff_t timeout_ms); | |
| } while(0) | |
| #endif | |
| + | |
| + | /* Keep the sockets to poll for an easy handle. |
| + | * `actions` are bitmaps of CURL_POLL_IN and CURL_POLL_OUT. |
| + | * Starts with small capacity, grows on demand. |
| + | */ |
| + | #define EZ_POLLSET_DEF_COUNT 2 |
| + | |
| + | struct easy_pollset { |
| + | curl_socket_t *sockets; |
| + | unsigned char *actions; |
| + | unsigned int n; |
| + | unsigned int count; |
| + | #ifdef DEBUGBUILD |
| + | int init; |
| + | #endif |
| + | curl_socket_t def_sockets[EZ_POLLSET_DEF_COUNT]; |
| + | unsigned char def_actions[EZ_POLLSET_DEF_COUNT]; |
| + | }; |
| + | |
| + | #ifdef DEBUGBUILD |
| + | #define CURL_EASY_POLLSET_MAGIC 0x7a657370 |
| + | #endif |
| + | |
| + | |
| + | /* allocate and initialise */ |
| + | struct easy_pollset *Curl_pollset_create(void); |
| + | |
| + | /* Initialize before first use */ |
| + | void Curl_pollset_init(struct easy_pollset *ps); |
| + | /* Free any allocated resources */ |
| + | void Curl_pollset_cleanup(struct easy_pollset *ps); |
| + | /* Reset to an empty pollset */ |
| + | void Curl_pollset_reset(struct easy_pollset *ps); |
| + | /* Move pollset from to pollset to, replacing all in to, |
| + | * leaving from empty. */ |
| + | void Curl_pollset_move(struct easy_pollset *to, struct easy_pollset *from); |
| + | |
| + | /* Change the poll flags (CURL_POLL_IN/CURL_POLL_OUT) to the poll set for |
| + | * socket `sock`. If the socket is not already part of the poll set, it |
| + | * will be added. |
| + | * If the socket is present and all poll flags are cleared, it will be removed. |
| + | */ |
| + | CURLcode Curl_pollset_change(struct Curl_easy *data, |
| + | struct easy_pollset *ps, curl_socket_t sock, |
| + | int add_flags, int remove_flags); |
| + | |
| + | CURLcode Curl_pollset_set(struct Curl_easy *data, |
| + | struct easy_pollset *ps, curl_socket_t sock, |
| + | bool do_in, bool do_out); |
| + | |
| + | #define Curl_pollset_add_in(data, ps, sock) \ |
| + | Curl_pollset_change((data), (ps), (sock), CURL_POLL_IN, 0) |
| + | #define Curl_pollset_add_out(data, ps, sock) \ |
| + | Curl_pollset_change((data), (ps), (sock), CURL_POLL_OUT, 0) |
| + | #define Curl_pollset_add_inout(data, ps, sock) \ |
| + | Curl_pollset_change((data), (ps), (sock), \ |
| + | CURL_POLL_IN|CURL_POLL_OUT, 0) |
| + | #define Curl_pollset_set_in_only(data, ps, sock) \ |
| + | Curl_pollset_change((data), (ps), (sock), \ |
| + | CURL_POLL_IN, CURL_POLL_OUT) |
| + | #define Curl_pollset_set_out_only(data, ps, sock) \ |
| + | Curl_pollset_change((data), (ps), (sock), \ |
| + | CURL_POLL_OUT, CURL_POLL_IN) |
| + | |
| + | /* return < = on error, 0 on timeout or how many sockets are ready */ |
| + | int Curl_pollset_poll(struct Curl_easy *data, |
| + | struct easy_pollset *ps, |
| + | timediff_t timeout_ms); |
| + | |
| + | /** |
| + | * Check if the pollset, as is, wants to read and/or write regarding |
| + | * the given socket. |
| + | */ |
| + | void Curl_pollset_check(struct Curl_easy *data, |
| + | struct easy_pollset *ps, curl_socket_t sock, |
| + | bool *pwant_read, bool *pwant_write); |
| + | |
| + | /** |
| + | * Return TRUE if the pollset contains socket with CURL_POLL_IN. |
| + | */ |
| + | bool Curl_pollset_want_read(struct Curl_easy *data, |
| + | struct easy_pollset *ps, |
| + | curl_socket_t sock); |
| + | |
| struct curl_pollfds { | |
| struct pollfd *pfds; | |
| unsigned int n; | |
| @@ -36,6 +36,7 @@ | |
| #include "connect.h" | |
| #include "progress.h" | |
| #include "transfer.h" | |
| + | #include "select.h" |
| #include "vtls/vtls.h" | |
| #include "curl_ntlm_core.h" | |
| #include "escape.h" | |
| @@ -298,8 +299,8 @@ static CURLcode smb_connect(struct Curl_easy *data, bool *done); | |
| static CURLcode smb_connection_state(struct Curl_easy *data, bool *done); | |
| static CURLcode smb_do(struct Curl_easy *data, bool *done); | |
| static CURLcode smb_request_state(struct Curl_easy *data, bool *done); | |
| - | static int smb_getsock(struct Curl_easy *data, struct connectdata *conn, |
| - | curl_socket_t *socks); |
| + | static CURLcode smb_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| static CURLcode smb_parse_url_path(struct Curl_easy *data, | |
| struct smb_conn *smbc, | |
| struct smb_request *req); | |
| @@ -316,10 +317,10 @@ const struct Curl_handler Curl_handler_smb = { | |
| smb_connect, /* connect_it */ | |
| smb_connection_state, /* connecting */ | |
| smb_request_state, /* doing */ | |
| - | smb_getsock, /* proto_getsock */ |
| - | smb_getsock, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | smb_pollset, /* proto_pollset */ |
| + | smb_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| ZERO_NULL, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -345,10 +346,10 @@ const struct Curl_handler Curl_handler_smbs = { | |
| smb_connect, /* connect_it */ | |
| smb_connection_state, /* connecting */ | |
| smb_request_state, /* doing */ | |
| - | smb_getsock, /* proto_getsock */ |
| - | smb_getsock, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | smb_pollset, /* proto_pollset */ |
| + | smb_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| ZERO_NULL, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -1204,12 +1205,10 @@ static CURLcode smb_request_state(struct Curl_easy *data, bool *done) | |
| return CURLE_OK; | |
| } | |
| - | static int smb_getsock(struct Curl_easy *data, |
| - | struct connectdata *conn, curl_socket_t *socks) |
| + | static CURLcode smb_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| - | (void)data; |
| - | socks[0] = conn->sock[FIRSTSOCKET]; |
| - | return GETSOCK_READSOCK(0) | GETSOCK_WRITESOCK(0); |
| + | return Curl_pollset_add_inout(data, ps, data->conn->sock[FIRSTSOCKET]); |
| } | |
| static CURLcode smb_do(struct Curl_easy *data, bool *done) | |
| @@ -157,8 +157,8 @@ static CURLcode smtp_connect(struct Curl_easy *data, bool *done); | |
| static CURLcode smtp_disconnect(struct Curl_easy *data, | |
| struct connectdata *conn, bool dead); | |
| static CURLcode smtp_multi_statemach(struct Curl_easy *data, bool *done); | |
| - | static int smtp_getsock(struct Curl_easy *data, |
| - | struct connectdata *conn, curl_socket_t *socks); |
| + | static CURLcode smtp_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| static CURLcode smtp_doing(struct Curl_easy *data, bool *dophase_done); | |
| static CURLcode smtp_setup_connection(struct Curl_easy *data, | |
| struct connectdata *conn); | |
| @@ -192,10 +192,10 @@ const struct Curl_handler Curl_handler_smtp = { | |
| smtp_connect, /* connect_it */ | |
| smtp_multi_statemach, /* connecting */ | |
| smtp_doing, /* doing */ | |
| - | smtp_getsock, /* proto_getsock */ |
| - | smtp_getsock, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | smtp_pollset, /* proto_pollset */ |
| + | smtp_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| smtp_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -223,10 +223,10 @@ const struct Curl_handler Curl_handler_smtps = { | |
| smtp_connect, /* connect_it */ | |
| smtp_multi_statemach, /* connecting */ | |
| smtp_doing, /* doing */ | |
| - | smtp_getsock, /* proto_getsock */ |
| - | smtp_getsock, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | smtp_pollset, /* proto_pollset */ |
| + | smtp_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| smtp_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -1413,12 +1413,12 @@ static CURLcode smtp_block_statemach(struct Curl_easy *data, | |
| } | |
| /* For the SMTP "protocol connect" and "doing" phases only */ | |
| - | static int smtp_getsock(struct Curl_easy *data, |
| - | struct connectdata *conn, curl_socket_t *socks) |
| + | static CURLcode smtp_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| - | struct smtp_conn *smtpc = Curl_conn_meta_get(conn, CURL_META_SMTP_CONN); |
| - | return smtpc ? |
| - | Curl_pp_getsock(data, &smtpc->pp, socks) : GETSOCK_BLANK; |
| + | struct smtp_conn *smtpc = |
| + | Curl_conn_meta_get(data->conn, CURL_META_SMTP_CONN); |
| + | return smtpc ? Curl_pp_pollset(data, &smtpc->pp, ps) : CURLE_OK; |
| } | |
| /*********************************************************************** | |
| @@ -1161,11 +1161,12 @@ static CURLcode socks_proxy_cf_connect(struct Curl_cfilter *cf, | |
| return result; | |
| } | |
| - | static void socks_cf_adjust_pollset(struct Curl_cfilter *cf, |
| - | struct Curl_easy *data, |
| - | struct easy_pollset *ps) |
| + | static CURLcode socks_cf_adjust_pollset(struct Curl_cfilter *cf, |
| + | struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| struct socks_state *sx = cf->ctx; | |
| + | CURLcode result = CURLE_OK; |
| if(!cf->connected && sx) { | |
| /* If we are not connected, the filter below is and has nothing | |
| @@ -1177,13 +1178,14 @@ static void socks_cf_adjust_pollset(struct Curl_cfilter *cf, | |
| case CONNECT_AUTH_READ: | |
| case CONNECT_REQ_READ: | |
| case CONNECT_REQ_READ_MORE: | |
| - | Curl_pollset_set_in_only(data, ps, sock); |
| + | result = Curl_pollset_set_in_only(data, ps, sock); |
| break; | |
| default: | |
| - | Curl_pollset_set_out_only(data, ps, sock); |
| + | result = Curl_pollset_set_out_only(data, ps, sock); |
| break; | |
| } | |
| } | |
| + | return result; |
| } | |
| static void socks_proxy_cf_close(struct Curl_cfilter *cf, | |
| @@ -188,10 +188,10 @@ const struct Curl_handler Curl_handler_telnet = { | |
| ZERO_NULL, /* connect_it */ | |
| ZERO_NULL, /* connecting */ | |
| ZERO_NULL, /* doing */ | |
| - | ZERO_NULL, /* proto_getsock */ |
| - | ZERO_NULL, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ZERO_NULL, /* proto_pollset */ |
| + | ZERO_NULL, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| ZERO_NULL, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -160,8 +160,8 @@ static CURLcode tftp_setup_connection(struct Curl_easy *data, | |
| struct connectdata *conn); | |
| static CURLcode tftp_multi_statemach(struct Curl_easy *data, bool *done); | |
| static CURLcode tftp_doing(struct Curl_easy *data, bool *dophase_done); | |
| - | static int tftp_getsock(struct Curl_easy *data, struct connectdata *conn, |
| - | curl_socket_t *socks); |
| + | static CURLcode tftp_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| static CURLcode tftp_translate_code(tftp_error_t error); | |
| @@ -178,10 +178,10 @@ const struct Curl_handler Curl_handler_tftp = { | |
| tftp_connect, /* connect_it */ | |
| tftp_multi_statemach, /* connecting */ | |
| tftp_doing, /* doing */ | |
| - | tftp_getsock, /* proto_getsock */ |
| - | tftp_getsock, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | tftp_pollset, /* proto_pollset */ |
| + | tftp_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| ZERO_NULL, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -1074,19 +1074,10 @@ static CURLcode tftp_done(struct Curl_easy *data, CURLcode status, | |
| return result; | |
| } | |
| - | /********************************************************** |
| - | * |
| - | * tftp_getsock |
| - | * |
| - | * The getsock callback |
| - | * |
| - | **********************************************************/ |
| - | static int tftp_getsock(struct Curl_easy *data, |
| - | struct connectdata *conn, curl_socket_t *socks) |
| + | static CURLcode tftp_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| - | (void)data; |
| - | socks[0] = conn->sock[FIRSTSOCKET]; |
| - | return GETSOCK_READSOCK(0); |
| + | return Curl_pollset_add_in(data, ps, data->conn->sock[FIRSTSOCKET]); |
| } | |
| /********************************************************** | |
| @@ -34,8 +34,6 @@ void Curl_init_CONNECT(struct Curl_easy *data); | |
| CURLcode Curl_pretransfer(struct Curl_easy *data); | |
| CURLcode Curl_sendrecv(struct Curl_easy *data, struct curltime *nowp); | |
| - | 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); | |
| @@ -471,15 +471,6 @@ struct hostname { | |
| #define FIRSTSOCKET 0 | |
| #define SECONDARYSOCKET 1 | |
| - | /* Polling requested by an easy handle. |
| - | * `action` is CURL_POLL_IN, CURL_POLL_OUT or CURL_POLL_INOUT. |
| - | */ |
| - | struct easy_pollset { |
| - | curl_socket_t sockets[MAX_SOCKSPEREASYHANDLE]; |
| - | unsigned int num; |
| - | unsigned char actions[MAX_SOCKSPEREASYHANDLE]; |
| - | }; |
| - | |
| /* | |
| * Specific protocol handler. | |
| */ | |
| @@ -516,24 +507,24 @@ struct Curl_handler { | |
| /* Called from the multi interface during the PROTOCONNECT phase, and it | |
| should then return a proper fd set */ | |
| - | int (*proto_getsock)(struct Curl_easy *data, |
| - | struct connectdata *conn, curl_socket_t *socks); |
| + | CURLcode (*proto_pollset)(struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| /* Called from the multi interface during the DOING phase, and it should | |
| then return a proper fd set */ | |
| - | int (*doing_getsock)(struct Curl_easy *data, |
| - | struct connectdata *conn, curl_socket_t *socks); |
| + | CURLcode (*doing_pollset)(struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| /* Called from the multi interface during the DO_MORE phase, and it should | |
| then return a proper fd set */ | |
| - | int (*domore_getsock)(struct Curl_easy *data, |
| - | struct connectdata *conn, curl_socket_t *socks); |
| + | CURLcode (*domore_pollset)(struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| /* Called from the multi interface during the DO_DONE, PERFORM and | |
| WAITPERFORM phases, and it should then return a proper fd set. Not setting | |
| this will make libcurl use the generic default one. */ | |
| - | int (*perform_getsock)(struct Curl_easy *data, |
| - | struct connectdata *conn, curl_socket_t *socks); |
| + | CURLcode (*perform_pollset)(struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| /* This function *MAY* be set to a protocol-dependent function that is run | |
| * by the curl_disconnect(), as a step in the disconnection. If the handler | |
| @@ -898,15 +898,16 @@ static CURLcode check_and_set_expiry(struct Curl_cfilter *cf, | |
| return CURLE_OK; | |
| } | |
| - | static void cf_ngtcp2_adjust_pollset(struct Curl_cfilter *cf, |
| - | struct Curl_easy *data, |
| - | struct easy_pollset *ps) |
| + | static CURLcode cf_ngtcp2_adjust_pollset(struct Curl_cfilter *cf, |
| + | struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| struct cf_ngtcp2_ctx *ctx = cf->ctx; | |
| bool want_recv, want_send; | |
| + | CURLcode result = CURLE_OK; |
| if(!ctx->qconn) | |
| - | return; |
| + | return CURLE_OK; |
| Curl_pollset_check(data, ps, ctx->q.sockfd, &want_recv, &want_send); | |
| if(!want_send && !Curl_bufq_is_empty(&ctx->q.sendbuf)) | |
| @@ -926,9 +927,10 @@ static void cf_ngtcp2_adjust_pollset(struct Curl_cfilter *cf, | |
| want_send = (!s_exhaust && want_send) || | |
| !Curl_bufq_is_empty(&ctx->q.sendbuf); | |
| - | Curl_pollset_set(data, ps, ctx->q.sockfd, want_recv, want_send); |
| + | result = Curl_pollset_set(data, ps, ctx->q.sockfd, want_recv, want_send); |
| CF_DATA_RESTORE(cf, save); | |
| } | |
| + | return result; |
| } | |
| static int cb_h3_stream_close(nghttp3_conn *conn, int64_t sid, | |
| @@ -2266,11 +2266,12 @@ out: | |
| return alive; | |
| } | |
| - | static void cf_osslq_adjust_pollset(struct Curl_cfilter *cf, |
| - | struct Curl_easy *data, |
| - | struct easy_pollset *ps) |
| + | static CURLcode cf_osslq_adjust_pollset(struct Curl_cfilter *cf, |
| + | struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| struct cf_osslq_ctx *ctx = cf->ctx; | |
| + | CURLcode result = CURLE_OK; |
| if(!ctx->tls.ossl.ssl) { | |
| /* NOP */ | |
| @@ -2278,9 +2279,9 @@ static void cf_osslq_adjust_pollset(struct Curl_cfilter *cf, | |
| else if(!cf->connected) { | |
| /* during handshake, transfer has not started yet. we always | |
| * add our socket for polling if SSL wants to send/recv */ | |
| - | Curl_pollset_set(data, ps, ctx->q.sockfd, |
| - | SSL_net_read_desired(ctx->tls.ossl.ssl), |
| - | SSL_net_write_desired(ctx->tls.ossl.ssl)); |
| + | result = Curl_pollset_set(data, ps, ctx->q.sockfd, |
| + | SSL_net_read_desired(ctx->tls.ossl.ssl), |
| + | SSL_net_write_desired(ctx->tls.ossl.ssl)); |
| } | |
| else { | |
| /* once connected, we only modify the socket if it is present. | |
| @@ -2288,15 +2289,16 @@ static void cf_osslq_adjust_pollset(struct Curl_cfilter *cf, | |
| bool want_recv, want_send; | |
| Curl_pollset_check(data, ps, ctx->q.sockfd, &want_recv, &want_send); | |
| if(want_recv || want_send) { | |
| - | Curl_pollset_set(data, ps, ctx->q.sockfd, |
| - | SSL_net_read_desired(ctx->tls.ossl.ssl), |
| - | SSL_net_write_desired(ctx->tls.ossl.ssl)); |
| + | result = Curl_pollset_set(data, ps, ctx->q.sockfd, |
| + | SSL_net_read_desired(ctx->tls.ossl.ssl), |
| + | SSL_net_write_desired(ctx->tls.ossl.ssl)); |
| } | |
| else if(ctx->need_recv || ctx->need_send) { | |
| - | Curl_pollset_set(data, ps, ctx->q.sockfd, |
| - | ctx->need_recv, ctx->need_send); |
| + | result = Curl_pollset_set(data, ps, ctx->q.sockfd, |
| + | ctx->need_recv, ctx->need_send); |
| } | |
| } | |
| + | return result; |
| } | |
| static CURLcode cf_osslq_query(struct Curl_cfilter *cf, | |
| @@ -1142,15 +1142,16 @@ static bool stream_is_writeable(struct Curl_cfilter *cf, | |
| ctx->qconn, (curl_uint64_t)stream->id, 1) > 0); | |
| } | |
| - | static void cf_quiche_adjust_pollset(struct Curl_cfilter *cf, |
| - | struct Curl_easy *data, |
| - | struct easy_pollset *ps) |
| + | static CURLcode cf_quiche_adjust_pollset(struct Curl_cfilter *cf, |
| + | struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| struct cf_quiche_ctx *ctx = cf->ctx; | |
| bool want_recv, want_send; | |
| + | CURLcode result = CURLE_OK; |
| if(!ctx->qconn) | |
| - | return; |
| + | return CURLE_OK; |
| Curl_pollset_check(data, ps, ctx->q.sockfd, &want_recv, &want_send); | |
| if(want_recv || want_send) { | |
| @@ -1165,8 +1166,9 @@ static void cf_quiche_adjust_pollset(struct Curl_cfilter *cf, | |
| want_send = (!s_exhaust && want_send) || | |
| !Curl_bufq_is_empty(&ctx->q.sendbuf); | |
| - | Curl_pollset_set(data, ps, ctx->q.sockfd, want_recv, want_send); |
| + | result = Curl_pollset_set(data, ps, ctx->q.sockfd, want_recv, want_send); |
| } | |
| + | return result; |
| } | |
| /* | |
| @@ -125,8 +125,8 @@ CURLcode sftp_perform(struct Curl_easy *data, | |
| bool *connected, | |
| bool *dophase_done); | |
| - | static int myssh_getsock(struct Curl_easy *data, |
| - | struct connectdata *conn, curl_socket_t *sock); |
| + | static CURLcode myssh_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| static void myssh_block2waitfor(struct connectdata *conn, | |
| struct ssh_conn *sshc, | |
| bool block); | |
| @@ -148,10 +148,10 @@ const struct Curl_handler Curl_handler_scp = { | |
| myssh_connect, /* connect_it */ | |
| myssh_multi_statemach, /* connecting */ | |
| scp_doing, /* doing */ | |
| - | myssh_getsock, /* proto_getsock */ |
| - | myssh_getsock, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | myssh_getsock, /* perform_getsock */ |
| + | myssh_pollset, /* proto_pollset */ |
| + | myssh_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | myssh_pollset, /* perform_pollset */ |
| scp_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -177,10 +177,10 @@ const struct Curl_handler Curl_handler_sftp = { | |
| myssh_connect, /* connect_it */ | |
| myssh_multi_statemach, /* connecting */ | |
| sftp_doing, /* doing */ | |
| - | myssh_getsock, /* proto_getsock */ |
| - | myssh_getsock, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | myssh_getsock, /* perform_getsock */ |
| + | myssh_pollset, /* proto_pollset */ |
| + | myssh_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | myssh_pollset, /* perform_pollset */ |
| sftp_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -2390,25 +2390,19 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, | |
| /* called by the multi interface to figure out what socket(s) to wait for and | |
| for what actions in the DO_DONE, PERFORM and WAITPERFORM states */ | |
| - | static int myssh_getsock(struct Curl_easy *data, |
| - | struct connectdata *conn, |
| - | curl_socket_t *sock) |
| + | static CURLcode myssh_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| - | int bitmap = GETSOCK_BLANK; |
| - | (void)data; |
| - | sock[0] = conn->sock[FIRSTSOCKET]; |
| - | |
| - | if(conn->waitfor & KEEP_RECV) |
| - | bitmap |= GETSOCK_READSOCK(FIRSTSOCKET); |
| - | |
| - | if(conn->waitfor & KEEP_SEND) |
| - | bitmap |= GETSOCK_WRITESOCK(FIRSTSOCKET); |
| - | |
| - | if(!conn->waitfor) |
| - | bitmap |= GETSOCK_WRITESOCK(FIRSTSOCKET); |
| - | |
| - | DEBUGF(infof(data, "ssh_getsock -> %x", bitmap)); |
| - | return bitmap; |
| + | int flags = 0; |
| + | if(data->conn->waitfor & KEEP_RECV) |
| + | flags |= CURL_POLL_IN; |
| + | if(data->conn->waitfor & KEEP_SEND) |
| + | flags |= CURL_POLL_OUT; |
| + | if(!data->conn->waitfor) |
| + | flags |= CURL_POLL_OUT; |
| + | return flags ? |
| + | Curl_pollset_change(data, ps, data->conn->sock[FIRSTSOCKET], flags, 0) : |
| + | CURLE_OK; |
| } | |
| static void myssh_block2waitfor(struct connectdata *conn, | |
| @@ -2437,7 +2431,7 @@ static CURLcode myssh_multi_statemach(struct Curl_easy *data, | |
| struct connectdata *conn = data->conn; | |
| struct ssh_conn *sshc = Curl_conn_meta_get(conn, CURL_META_SSH_CONN); | |
| struct SSHPROTO *sshp = Curl_meta_get(data, CURL_META_SSH_EASY); | |
| - | bool block; /* we store the status and use that to provide a ssh_getsock() |
| + | bool block; /* we store the status and use that to provide a ssh_pollset() |
| implementation */ | |
| CURLcode result; | |
| @@ -99,8 +99,8 @@ static CURLcode sftp_disconnect(struct Curl_easy *data, | |
| struct connectdata *conn, bool dead); | |
| static CURLcode sftp_perform(struct Curl_easy *data, bool *connected, | |
| bool *dophase_done); | |
| - | static int ssh_getsock(struct Curl_easy *data, struct connectdata *conn, |
| - | curl_socket_t *sock); |
| + | static CURLcode ssh_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| static CURLcode ssh_setup_connection(struct Curl_easy *data, | |
| struct connectdata *conn); | |
| static void ssh_attach(struct Curl_easy *data, struct connectdata *conn); | |
| @@ -119,10 +119,10 @@ const struct Curl_handler Curl_handler_scp = { | |
| ssh_connect, /* connect_it */ | |
| ssh_multi_statemach, /* connecting */ | |
| scp_doing, /* doing */ | |
| - | ssh_getsock, /* proto_getsock */ |
| - | ssh_getsock, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ssh_getsock, /* perform_getsock */ |
| + | ssh_pollset, /* proto_pollset */ |
| + | ssh_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ssh_pollset, /* perform_pollset */ |
| scp_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -150,10 +150,10 @@ const struct Curl_handler Curl_handler_sftp = { | |
| ssh_connect, /* connect_it */ | |
| ssh_multi_statemach, /* connecting */ | |
| sftp_doing, /* doing */ | |
| - | ssh_getsock, /* proto_getsock */ |
| - | ssh_getsock, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ssh_getsock, /* perform_getsock */ |
| + | ssh_pollset, /* proto_pollset */ |
| + | ssh_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ssh_pollset, /* perform_pollset */ |
| sftp_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -3087,22 +3087,17 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, | |
| /* called by the multi interface to figure out what socket(s) to wait for and | |
| for what actions in the DO_DONE, PERFORM and WAITPERFORM states */ | |
| - | static int ssh_getsock(struct Curl_easy *data, |
| - | struct connectdata *conn, |
| - | curl_socket_t *sock) |
| + | static CURLcode ssh_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| - | int bitmap = GETSOCK_BLANK; |
| - | (void)data; |
| - | |
| - | sock[0] = conn->sock[FIRSTSOCKET]; |
| - | |
| - | if(conn->waitfor & KEEP_RECV) |
| - | bitmap |= GETSOCK_READSOCK(FIRSTSOCKET); |
| - | |
| - | if(conn->waitfor & KEEP_SEND) |
| - | bitmap |= GETSOCK_WRITESOCK(FIRSTSOCKET); |
| - | |
| - | return bitmap; |
| + | int flags = 0; |
| + | if(data->conn->waitfor & KEEP_RECV) |
| + | flags |= CURL_POLL_IN; |
| + | if(data->conn->waitfor & KEEP_SEND) |
| + | flags |= CURL_POLL_OUT; |
| + | return flags ? |
| + | Curl_pollset_change(data, ps, data->conn->sock[FIRSTSOCKET], flags, 0) : |
| + | CURLE_OK; |
| } | |
| /* | |
| @@ -3139,7 +3134,7 @@ static CURLcode ssh_multi_statemach(struct Curl_easy *data, bool *done) | |
| struct ssh_conn *sshc = Curl_conn_meta_get(conn, CURL_META_SSH_CONN); | |
| struct SSHPROTO *sshp = Curl_meta_get(data, CURL_META_SSH_EASY); | |
| CURLcode result = CURLE_OK; | |
| - | bool block; /* we store the status and use that to provide a ssh_getsock() |
| + | bool block; /* we store the status and use that to provide a ssh_pollset() |
| implementation */ | |
| if(!sshc || !sshp) | |
| return CURLE_FAILED_INIT; | |
| @@ -66,9 +66,8 @@ static CURLcode wsftp_doing(struct Curl_easy *data, | |
| static CURLcode wsftp_disconnect(struct Curl_easy *data, | |
| struct connectdata *conn, | |
| bool dead); | |
| - | static int wssh_getsock(struct Curl_easy *data, |
| - | struct connectdata *conn, |
| - | curl_socket_t *sock); |
| + | static CURLcode wssh_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| static CURLcode wssh_setup_connection(struct Curl_easy *data, | |
| struct connectdata *conn); | |
| static void wssh_sshc_cleanup(struct ssh_conn *sshc); | |
| @@ -87,10 +86,10 @@ const struct Curl_handler Curl_handler_scp = { | |
| wssh_connect, /* connect_it */ | |
| wssh_multi_statemach, /* connecting */ | |
| wscp_doing, /* doing */ | |
| - | wssh_getsock, /* proto_getsock */ |
| - | wssh_getsock, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | wssh_getsock, /* perform_getsock */ |
| + | wssh_pollset, /* proto_pollset */ |
| + | wssh_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | wssh_pollset, /* perform_pollset */ |
| wscp_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -118,10 +117,10 @@ const struct Curl_handler Curl_handler_sftp = { | |
| wssh_connect, /* connect_it */ | |
| wssh_multi_statemach, /* connecting */ | |
| wsftp_doing, /* doing */ | |
| - | wssh_getsock, /* proto_getsock */ |
| - | wssh_getsock, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | wssh_getsock, /* perform_getsock */ |
| + | wssh_pollset, /* proto_pollset */ |
| + | wssh_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | wssh_pollset, /* perform_pollset */ |
| wsftp_disconnect, /* disconnect */ | |
| ZERO_NULL, /* write_resp */ | |
| ZERO_NULL, /* write_resp_hd */ | |
| @@ -932,7 +931,7 @@ static CURLcode wssh_multi_statemach(struct Curl_easy *data, bool *done) | |
| struct connectdata *conn = data->conn; | |
| struct ssh_conn *sshc = Curl_conn_meta_get(conn, CURL_META_SSH_CONN); | |
| CURLcode result = CURLE_OK; | |
| - | bool block; /* we store the status and use that to provide a ssh_getsock() |
| + | bool block; /* we store the status and use that to provide a ssh_pollset() |
| implementation */ | |
| if(!sshc) | |
| return CURLE_FAILED_INIT; | |
| @@ -1185,21 +1184,17 @@ static CURLcode wsftp_disconnect(struct Curl_easy *data, | |
| return result; | |
| } | |
| - | static int wssh_getsock(struct Curl_easy *data, |
| - | struct connectdata *conn, |
| - | curl_socket_t *sock) |
| + | static CURLcode wssh_pollset(struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| - | int bitmap = GETSOCK_BLANK; |
| - | int dir = conn->waitfor; |
| - | (void)data; |
| - | sock[0] = conn->sock[FIRSTSOCKET]; |
| - | |
| - | if(dir == KEEP_RECV) |
| - | bitmap |= GETSOCK_READSOCK(FIRSTSOCKET); |
| - | else if(dir == KEEP_SEND) |
| - | bitmap |= GETSOCK_WRITESOCK(FIRSTSOCKET); |
| - | |
| - | return bitmap; |
| + | int flags = 0; |
| + | if(data->conn->waitfor & KEEP_RECV) |
| + | flags |= CURL_POLL_IN; |
| + | if(data->conn->waitfor & KEEP_SEND) |
| + | flags |= CURL_POLL_OUT; |
| + | return flags ? |
| + | Curl_pollset_change(data, ps, data->conn->sock[FIRSTSOCKET], flags, 0) : |
| + | CURLE_OK; |
| } | |
| void Curl_ssh_version(char *buffer, size_t buflen) | |
| @@ -503,26 +503,30 @@ void Curl_ssl_close_all(struct Curl_easy *data) | |
| Curl_ssl->close_all(data); | |
| } | |
| - | void Curl_ssl_adjust_pollset(struct Curl_cfilter *cf, struct Curl_easy *data, |
| - | struct easy_pollset *ps) |
| + | CURLcode Curl_ssl_adjust_pollset(struct Curl_cfilter *cf, |
| + | struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| struct ssl_connect_data *connssl = cf->ctx; | |
| if(connssl->io_need) { | |
| curl_socket_t sock = Curl_conn_cf_get_socket(cf->next, data); | |
| + | CURLcode result = CURLE_OK; |
| if(sock != CURL_SOCKET_BAD) { | |
| if(connssl->io_need & CURL_SSL_IO_NEED_SEND) { | |
| - | Curl_pollset_set_out_only(data, ps, sock); |
| + | result = Curl_pollset_set_out_only(data, ps, sock); |
| CURL_TRC_CF(data, cf, "adjust_pollset, POLLOUT fd=%" FMT_SOCKET_T, | |
| sock); | |
| } | |
| else { | |
| - | Curl_pollset_set_in_only(data, ps, sock); |
| + | result = Curl_pollset_set_in_only(data, ps, sock); |
| CURL_TRC_CF(data, cf, "adjust_pollset, POLLIN fd=%" FMT_SOCKET_T, | |
| sock); | |
| } | |
| } | |
| + | return result; |
| } | |
| + | return CURLE_OK; |
| } | |
| /* Selects an SSL crypto engine | |
| @@ -902,13 +906,13 @@ static CURLcode multissl_connect(struct Curl_cfilter *cf, | |
| return Curl_ssl->do_connect(cf, data, done); | |
| } | |
| - | static void multissl_adjust_pollset(struct Curl_cfilter *cf, |
| - | struct Curl_easy *data, |
| - | struct easy_pollset *ps) |
| + | static CURLcode multissl_adjust_pollset(struct Curl_cfilter *cf, |
| + | struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| if(multissl_setup(NULL)) | |
| - | return; |
| - | Curl_ssl->adjust_pollset(cf, data, ps); |
| + | return CURLE_OK; |
| + | return Curl_ssl->adjust_pollset(cf, data, ps); |
| } | |
| static void *multissl_get_internals(struct ssl_connect_data *connssl, | |
| @@ -1545,16 +1549,18 @@ static CURLcode ssl_cf_shutdown(struct Curl_cfilter *cf, | |
| return result; | |
| } | |
| - | static void ssl_cf_adjust_pollset(struct Curl_cfilter *cf, |
| - | struct Curl_easy *data, |
| - | struct easy_pollset *ps) |
| + | static CURLcode ssl_cf_adjust_pollset(struct Curl_cfilter *cf, |
| + | struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| struct ssl_connect_data *connssl = cf->ctx; | |
| struct cf_call_data save; | |
| + | CURLcode result; |
| CF_DATA_SAVE(save, cf, data); | |
| - | connssl->ssl_impl->adjust_pollset(cf, data, ps); |
| + | result = connssl->ssl_impl->adjust_pollset(cf, data, ps); |
| CF_DATA_RESTORE(cf, save); | |
| + | return result; |
| } | |
| static CURLcode ssl_cf_query(struct Curl_cfilter *cf, | |
| @@ -166,8 +166,8 @@ struct Curl_ssl { | |
| /* During handshake/shutdown, adjust the pollset to include the socket | |
| * for POLLOUT or POLLIN as needed. Mandatory. */ | |
| - | void (*adjust_pollset)(struct Curl_cfilter *cf, struct Curl_easy *data, |
| - | struct easy_pollset *ps); |
| + | CURLcode (*adjust_pollset)(struct Curl_cfilter *cf, struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| void *(*get_internals)(struct ssl_connect_data *connssl, CURLINFO info); | |
| void (*close)(struct Curl_cfilter *cf, struct Curl_easy *data); | |
| void (*close_all)(struct Curl_easy *data); | |
| @@ -190,8 +190,9 @@ struct Curl_ssl { | |
| extern const struct Curl_ssl *Curl_ssl; | |
| - | void Curl_ssl_adjust_pollset(struct Curl_cfilter *cf, struct Curl_easy *data, |
| - | struct easy_pollset *ps); |
| + | CURLcode Curl_ssl_adjust_pollset(struct Curl_cfilter *cf, |
| + | struct Curl_easy *data, |
| + | struct easy_pollset *ps); |
| /** | |
| * Get the SSL filter below the given one or NULL if there is none. | |
| @@ -1552,10 +1552,10 @@ const struct Curl_handler Curl_handler_ws = { | |
| Curl_http_connect, /* connect_it */ | |
| ZERO_NULL, /* connecting */ | |
| ZERO_NULL, /* doing */ | |
| - | ZERO_NULL, /* proto_getsock */ |
| - | Curl_http_getsock_do, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | ZERO_NULL, /* proto_pollset */ |
| + | Curl_http_do_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| ZERO_NULL, /* disconnect */ | |
| Curl_http_write_resp, /* write_resp */ | |
| Curl_http_write_resp_hd, /* write_resp_hd */ | |
| @@ -1579,10 +1579,10 @@ const struct Curl_handler Curl_handler_wss = { | |
| Curl_http_connect, /* connect_it */ | |
| NULL, /* connecting */ | |
| ZERO_NULL, /* doing */ | |
| - | NULL, /* proto_getsock */ |
| - | Curl_http_getsock_do, /* doing_getsock */ |
| - | ZERO_NULL, /* domore_getsock */ |
| - | ZERO_NULL, /* perform_getsock */ |
| + | NULL, /* proto_pollset */ |
| + | Curl_http_do_pollset, /* doing_pollset */ |
| + | ZERO_NULL, /* domore_pollset */ |
| + | ZERO_NULL, /* perform_pollset */ |
| ZERO_NULL, /* disconnect */ | |
| Curl_http_write_resp, /* write_resp */ | |
| Curl_http_write_resp_hd, /* write_resp_hd */ | |
| @@ -105,8 +105,10 @@ struct test_result { | |
| static const struct test_case *current_tc; | |
| static struct test_result *current_tr; | |
| + | static int test_idx; |
| struct cf_test_ctx { | |
| + | int idx; |
| int ai_family; | |
| int transport; | |
| char id[16]; | |
| @@ -151,13 +153,13 @@ static CURLcode cf_test_connect(struct Curl_cfilter *cf, | |
| return CURLE_OK; | |
| } | |
| - | static void cf_test_adjust_pollset(struct Curl_cfilter *cf, |
| - | struct Curl_easy *data, |
| - | struct easy_pollset *ps) |
| + | static CURLcode cf_test_adjust_pollset(struct Curl_cfilter *cf, |
| + | struct Curl_easy *data, |
| + | struct easy_pollset *ps) |
| { | |
| + | struct cf_test_ctx *ctx = cf->ctx; |
| /* just for testing, give one socket with events back */ | |
| - | (void)cf; |
| - | Curl_pollset_set(data, ps, 1, TRUE, TRUE); |
| + | return Curl_pollset_set(data, ps, ctx->idx, TRUE, TRUE); |
| } | |
| static CURLcode cf_test_create(struct Curl_cfilter **pcf, | |
| @@ -196,6 +198,7 @@ static CURLcode cf_test_create(struct Curl_cfilter **pcf, | |
| result = CURLE_OUT_OF_MEMORY; | |
| goto out; | |
| } | |
| + | ctx->idx = test_idx++; |
| ctx->ai_family = ai->ai_family; | |
| ctx->transport = transport; | |
| ctx->started = curlx_now(); | |