2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

DoH: Add isc_nm_set_min_answer_ttl()

This commit adds an isc_nm_set_min_answer_ttl() function which is
intended to to be used to give a hint to the underlying transport
regarding the answer TTL.

The interface is intentionally kept generic because over time more
transports might benefit from this functionality, but currently it is
intended for DoH to set "max-age" value within "Cache-Control" HTTP
header (as recommended in the RFC8484, section 5.1 "Cache
Interaction").

It is no-op for other DNS transports for the time being.
This commit is contained in:
Artem Boldariev
2021-10-06 14:09:53 +03:00
parent b69dfd6a75
commit 80482f8d3e
4 changed files with 101 additions and 14 deletions

View File

@@ -815,12 +815,16 @@ typedef struct isc_nmsocket_h2 {
/* maximum concurrent streams (server-side) */
uint32_t max_concurrent_streams;
uint32_t min_ttl; /* used to set "max-age" in responses */
isc_http_request_type_t request_type;
isc_http_scheme_type_t request_scheme;
size_t content_length;
char clenbuf[128];
char cache_control_buf[128];
int headers_error_code;
size_t headers_data_processed;
@@ -1706,6 +1710,9 @@ isc__nm_http_bad_request(isc_nmhandle_t *handle);
* socket
*/
void
isc__nm_http_set_maxage(isc_nmhandle_t *handle, const uint32_t ttl);
void
isc__nm_async_httpsend(isc__networker_t *worker, isc__netievent_t *ev0);