]> git.ipfire.org Git - thirdparty/bind9.git/commit
refactor outgoing HTTP connection support
authorEvan Hunt <each@isc.org>
Thu, 4 Feb 2021 00:59:49 +0000 (16:59 -0800)
committerArtem Boldariev <artem@boldariev.com>
Fri, 5 Mar 2021 11:29:26 +0000 (13:29 +0200)
commit88752b1121e29d82daf0ea0943258f597c35faae
tree42b0ffef8422d9ebe853608a67b7532ce4049d73
parent9c8b7a5c450d54332f25830aa47035d87490bb3a
refactor outgoing HTTP connection support

- style, cleanup, and removal of unnecessary code.
- combined isc_nm_http_add_endpoint() and isc_nm_http_add_doh_endpoint()
  into one function, renamed isc_http_endpoint().
- moved isc_nm_http_connect_send_request() into doh_test.c as a helper
  function; remove it from the public API.
- renamed isc_http2 and isc_nm_http2 types and functions to just isc_http
  and isc_nm_http, for consistency with other existing names.
- shortened a number of long names.
- the caller is now responsible for determining the peer address.
  in isc_nm_httpconnect(); this eliminates the need to parse the URI
  and the dependency on an external resolver.
- the caller is also now responsible for creating the SSL client context,
  for consistency with isc_nm_tlsdnsconnect().
- added setter functions for HTTP/2 ALPN. instead of setting up ALPN in
  isc_tlsctx_createclient(), we now have a function
  isc_tlsctx_enable_http2client_alpn() that can be run from
  isc_nm_httpconnect().
- refactored isc_nm_httprequest() into separate read and send functions.
  isc_nm_send() or isc_nm_read() is called on an http socket, it will
  be stored until a corresponding isc_nm_read() or _send() arrives; when
  we have both halves of the pair the HTTP request will be initiated.
- isc_nm_httprequest() is renamed isc__nm_http_request() for use as an
  internal helper function by the DoH unit test. (eventually doh_test
  should be rewritten to use read and send, and this function should
  be removed.)
- added implementations of isc__nm_tls_settimeout() and
  isc__nm_http_settimeout().
- increased NGHTTP2 header block length for client connections to 128K.
- use isc_mem_t for internal memory allocations inside nghttp2, to
  help track memory leaks.
- send "Cache-Control" header in requests and responses. (note:
  currently we try to bypass HTTP caching proxies, but ideally we should
  interact with them: https://tools.ietf.org/html/rfc8484#section-5.1)
17 files changed:
bin/named/transportconf.c
lib/dns/include/dns/transport.h
lib/dns/transport.c
lib/isc/include/isc/netmgr.h
lib/isc/include/isc/result.h
lib/isc/include/isc/tls.h
lib/isc/netmgr/http.c
lib/isc/netmgr/netmgr-int.h
lib/isc/netmgr/netmgr.c
lib/isc/netmgr/tcp.c
lib/isc/netmgr/tlsdns.c
lib/isc/netmgr/tlsstream.c
lib/isc/result.c
lib/isc/tests/doh_test.c
lib/isc/tls.c
lib/isc/win32/libisc.def.in
lib/ns/interfacemgr.c