|
|
68a0fa |
diff --git a/modules/http2/h2_push.c b/modules/http2/h2_push.c
|
|
|
68a0fa |
index 9a3b19b..f0c0437 100644
|
|
|
68a0fa |
--- a/modules/http2/h2_push.c
|
|
|
68a0fa |
+++ b/modules/http2/h2_push.c
|
|
|
68a0fa |
@@ -464,33 +464,6 @@ apr_array_header_t *h2_push_collect(apr_pool_t *p, const h2_request *req,
|
|
|
68a0fa |
return NULL;
|
|
|
68a0fa |
}
|
|
|
68a0fa |
|
|
|
68a0fa |
-/*******************************************************************************
|
|
|
68a0fa |
- * push diary
|
|
|
68a0fa |
- *
|
|
|
68a0fa |
- * - The push diary keeps track of resources already PUSHed via HTTP/2 on this
|
|
|
68a0fa |
- * connection. It records a hash value from the absolute URL of the resource
|
|
|
68a0fa |
- * pushed.
|
|
|
68a0fa |
- * - Lacking openssl, it uses 'apr_hashfunc_default' for the value
|
|
|
68a0fa |
- * - with openssl, it uses SHA256 to calculate the hash value
|
|
|
68a0fa |
- * - whatever the method to generate the hash, the diary keeps a maximum of 64
|
|
|
68a0fa |
- * bits per hash, limiting the memory consumption to about
|
|
|
68a0fa |
- * H2PushDiarySize * 8
|
|
|
68a0fa |
- * bytes. Entries are sorted by most recently used and oldest entries are
|
|
|
68a0fa |
- * forgotten first.
|
|
|
68a0fa |
- * - Clients can initialize/replace the push diary by sending a 'Cache-Digest'
|
|
|
68a0fa |
- * header. Currently, this is the base64url encoded value of the cache digest
|
|
|
68a0fa |
- * as specified in https://datatracker.ietf.org/doc/draft-kazuho-h2-cache-digest/
|
|
|
68a0fa |
- * This draft can be expected to evolve and the definition of the header
|
|
|
68a0fa |
- * will be added there and refined.
|
|
|
68a0fa |
- * - The cache digest header is a Golomb Coded Set of hash values, but it may
|
|
|
68a0fa |
- * limit the amount of bits per hash value even further. For a good description
|
|
|
68a0fa |
- * of GCS, read here:
|
|
|
68a0fa |
- * http://giovanni.bajo.it/post/47119962313/golomb-coded-sets-smaller-than-bloom-filters
|
|
|
68a0fa |
- * - The means that the push diary might be initialized with hash values of much
|
|
|
68a0fa |
- * less than 64 bits, leading to more false positives, but smaller digest size.
|
|
|
68a0fa |
- ******************************************************************************/
|
|
|
68a0fa |
-
|
|
|
68a0fa |
-
|
|
|
68a0fa |
#define GCSLOG_LEVEL APLOG_TRACE1
|
|
|
68a0fa |
|
|
|
68a0fa |
typedef struct h2_push_diary_entry {
|
|
|
68a0fa |
@@ -617,38 +590,49 @@ static int h2_push_diary_find(h2_push_diary *diary, apr_uint64_t hash)
|
|
|
68a0fa |
return -1;
|
|
|
68a0fa |
}
|
|
|
68a0fa |
|
|
|
68a0fa |
-static h2_push_diary_entry *move_to_last(h2_push_diary *diary, apr_size_t idx)
|
|
|
68a0fa |
+static void move_to_last(h2_push_diary *diary, apr_size_t idx)
|
|
|
68a0fa |
{
|
|
|
68a0fa |
h2_push_diary_entry *entries = (h2_push_diary_entry*)diary->entries->elts;
|
|
|
68a0fa |
h2_push_diary_entry e;
|
|
|
68a0fa |
- apr_size_t lastidx = diary->entries->nelts-1;
|
|
|
68a0fa |
+ int lastidx;
|
|
|
68a0fa |
|
|
|
68a0fa |
+ /* Move an existing entry to the last place */
|
|
|
68a0fa |
+ if (diary->entries->nelts <= 0)
|
|
|
68a0fa |
+ return;
|
|
|
68a0fa |
+
|
|
|
68a0fa |
/* move entry[idx] to the end */
|
|
|
68a0fa |
+ lastidx = diary->entries->nelts - 1;
|
|
|
68a0fa |
if (idx < lastidx) {
|
|
|
68a0fa |
e = entries[idx];
|
|
|
68a0fa |
- memmove(entries+idx, entries+idx+1, sizeof(e) * (lastidx - idx));
|
|
|
68a0fa |
+ memmove(entries+idx, entries+idx+1, sizeof(h2_push_diary_entry) * (lastidx - idx));
|
|
|
68a0fa |
entries[lastidx] = e;
|
|
|
68a0fa |
}
|
|
|
68a0fa |
- return &entries[lastidx];
|
|
|
68a0fa |
}
|
|
|
68a0fa |
|
|
|
68a0fa |
-static void h2_push_diary_append(h2_push_diary *diary, h2_push_diary_entry *e)
|
|
|
68a0fa |
+static void remove_first(h2_push_diary *diary)
|
|
|
68a0fa |
{
|
|
|
68a0fa |
- h2_push_diary_entry *ne;
|
|
|
68a0fa |
+ h2_push_diary_entry *entries = (h2_push_diary_entry*)diary->entries->elts;
|
|
|
68a0fa |
+ int lastidx;
|
|
|
68a0fa |
|
|
|
68a0fa |
- if (diary->entries->nelts < diary->N) {
|
|
|
68a0fa |
- /* append a new diary entry at the end */
|
|
|
68a0fa |
- APR_ARRAY_PUSH(diary->entries, h2_push_diary_entry) = *e;
|
|
|
68a0fa |
- ne = &APR_ARRAY_IDX(diary->entries, diary->entries->nelts-1, h2_push_diary_entry);
|
|
|
68a0fa |
+ /* move remaining entries to index 0 */
|
|
|
68a0fa |
+ lastidx = diary->entries->nelts - 1;
|
|
|
68a0fa |
+ if (lastidx > 0) {
|
|
|
68a0fa |
+ --diary->entries->nelts;
|
|
|
68a0fa |
+ memmove(entries, entries+1, sizeof(h2_push_diary_entry) * diary->entries->nelts);
|
|
|
68a0fa |
}
|
|
|
68a0fa |
- else {
|
|
|
68a0fa |
- /* replace content with new digest. keeps memory usage constant once diary is full */
|
|
|
68a0fa |
- ne = move_to_last(diary, 0);
|
|
|
68a0fa |
- *ne = *e;
|
|
|
68a0fa |
+}
|
|
|
68a0fa |
+
|
|
|
68a0fa |
+static void h2_push_diary_append(h2_push_diary *diary, h2_push_diary_entry *e)
|
|
|
68a0fa |
+{
|
|
|
68a0fa |
+ while (diary->entries->nelts >= diary->N) {
|
|
|
68a0fa |
+ remove_first(diary);
|
|
|
68a0fa |
}
|
|
|
68a0fa |
+ /* append a new diary entry at the end */
|
|
|
68a0fa |
+ APR_ARRAY_PUSH(diary->entries, h2_push_diary_entry) = *e;
|
|
|
68a0fa |
+
|
|
|
68a0fa |
/* Intentional no APLOGNO */
|
|
|
68a0fa |
ap_log_perror(APLOG_MARK, GCSLOG_LEVEL, 0, diary->entries->pool,
|
|
|
68a0fa |
- "push_diary_append: %"APR_UINT64_T_HEX_FMT, ne->hash);
|
|
|
68a0fa |
+ "push_diary_append: %"APR_UINT64_T_HEX_FMT, e->hash);
|
|
|
68a0fa |
}
|
|
|
68a0fa |
|
|
|
68a0fa |
apr_array_header_t *h2_push_diary_update(h2_session *session, apr_array_header_t *pushes)
|
|
|
68a0fa |
@@ -691,30 +675,12 @@ apr_array_header_t *h2_push_collect_update(h2_stream *stream,
|
|
|
68a0fa |
const struct h2_request *req,
|
|
|
68a0fa |
const struct h2_headers *res)
|
|
|
68a0fa |
{
|
|
|
68a0fa |
- h2_session *session = stream->session;
|
|
|
68a0fa |
- const char *cache_digest = apr_table_get(req->headers, "Cache-Digest");
|
|
|
68a0fa |
apr_array_header_t *pushes;
|
|
|
68a0fa |
- apr_status_t status;
|
|
|
68a0fa |
|
|
|
68a0fa |
- if (cache_digest && session->push_diary) {
|
|
|
68a0fa |
- status = h2_push_diary_digest64_set(session->push_diary, req->authority,
|
|
|
68a0fa |
- cache_digest, stream->pool);
|
|
|
68a0fa |
- if (status != APR_SUCCESS) {
|
|
|
68a0fa |
- ap_log_cerror(APLOG_MARK, APLOG_DEBUG, status, session->c,
|
|
|
68a0fa |
- H2_SSSN_LOG(APLOGNO(03057), session,
|
|
|
68a0fa |
- "push diary set from Cache-Digest: %s"), cache_digest);
|
|
|
68a0fa |
- }
|
|
|
68a0fa |
- }
|
|
|
68a0fa |
pushes = h2_push_collect(stream->pool, req, stream->push_policy, res);
|
|
|
68a0fa |
return h2_push_diary_update(stream->session, pushes);
|
|
|
68a0fa |
}
|
|
|
68a0fa |
|
|
|
68a0fa |
-static apr_int32_t h2_log2inv(unsigned char log2)
|
|
|
68a0fa |
-{
|
|
|
68a0fa |
- return log2? (1 << log2) : 1;
|
|
|
68a0fa |
-}
|
|
|
68a0fa |
-
|
|
|
68a0fa |
-
|
|
|
68a0fa |
typedef struct {
|
|
|
68a0fa |
h2_push_diary *diary;
|
|
|
68a0fa |
unsigned char log2p;
|
|
|
68a0fa |
@@ -830,10 +796,6 @@ apr_status_t h2_push_diary_digest_get(h2_push_diary *diary, apr_pool_t *pool,
|
|
|
68a0fa |
|
|
|
68a0fa |
nelts = diary->entries->nelts;
|
|
|
68a0fa |
|
|
|
68a0fa |
- if (nelts > APR_UINT32_MAX) {
|
|
|
68a0fa |
- /* should not happen */
|
|
|
68a0fa |
- return APR_ENOTIMPL;
|
|
|
68a0fa |
- }
|
|
|
68a0fa |
N = ceil_power_of_2(nelts);
|
|
|
68a0fa |
log2n = h2_log2(N);
|
|
|
68a0fa |
|
|
|
68a0fa |
@@ -895,166 +857,3 @@ apr_status_t h2_push_diary_digest_get(h2_push_diary *diary, apr_pool_t *pool,
|
|
|
68a0fa |
return APR_SUCCESS;
|
|
|
68a0fa |
}
|
|
|
68a0fa |
|
|
|
68a0fa |
-typedef struct {
|
|
|
68a0fa |
- h2_push_diary *diary;
|
|
|
68a0fa |
- apr_pool_t *pool;
|
|
|
68a0fa |
- unsigned char log2p;
|
|
|
68a0fa |
- const unsigned char *data;
|
|
|
68a0fa |
- apr_size_t datalen;
|
|
|
68a0fa |
- apr_size_t offset;
|
|
|
68a0fa |
- unsigned int bit;
|
|
|
68a0fa |
- apr_uint64_t last_val;
|
|
|
68a0fa |
-} gset_decoder;
|
|
|
68a0fa |
-
|
|
|
68a0fa |
-static int gset_decode_next_bit(gset_decoder *decoder)
|
|
|
68a0fa |
-{
|
|
|
68a0fa |
- if (++decoder->bit >= 8) {
|
|
|
68a0fa |
- if (++decoder->offset >= decoder->datalen) {
|
|
|
68a0fa |
- return -1;
|
|
|
68a0fa |
- }
|
|
|
68a0fa |
- decoder->bit = 0;
|
|
|
68a0fa |
- }
|
|
|
68a0fa |
- return (decoder->data[decoder->offset] & cbit_mask[decoder->bit])? 1 : 0;
|
|
|
68a0fa |
-}
|
|
|
68a0fa |
-
|
|
|
68a0fa |
-static apr_status_t gset_decode_next(gset_decoder *decoder, apr_uint64_t *phash)
|
|
|
68a0fa |
-{
|
|
|
68a0fa |
- apr_uint64_t flex = 0, fixed = 0, delta;
|
|
|
68a0fa |
- int i;
|
|
|
68a0fa |
-
|
|
|
68a0fa |
- /* read 1 bits until we encounter 0, then read log2n(diary-P) bits.
|
|
|
68a0fa |
- * On a malformed bit-string, this will not fail, but produce results
|
|
|
68a0fa |
- * which are pbly too large. Luckily, the diary will modulo the hash.
|
|
|
68a0fa |
- */
|
|
|
68a0fa |
- while (1) {
|
|
|
68a0fa |
- int bit = gset_decode_next_bit(decoder);
|
|
|
68a0fa |
- if (bit == -1) {
|
|
|
68a0fa |
- return APR_EINVAL;
|
|
|
68a0fa |
- }
|
|
|
68a0fa |
- if (!bit) {
|
|
|
68a0fa |
- break;
|
|
|
68a0fa |
- }
|
|
|
68a0fa |
- ++flex;
|
|
|
68a0fa |
- }
|
|
|
68a0fa |
-
|
|
|
68a0fa |
- for (i = 0; i < decoder->log2p; ++i) {
|
|
|
68a0fa |
- int bit = gset_decode_next_bit(decoder);
|
|
|
68a0fa |
- if (bit == -1) {
|
|
|
68a0fa |
- return APR_EINVAL;
|
|
|
68a0fa |
- }
|
|
|
68a0fa |
- fixed = (fixed << 1) | bit;
|
|
|
68a0fa |
- }
|
|
|
68a0fa |
-
|
|
|
68a0fa |
- delta = (flex << decoder->log2p) | fixed;
|
|
|
68a0fa |
- *phash = delta + decoder->last_val;
|
|
|
68a0fa |
- decoder->last_val = *phash;
|
|
|
68a0fa |
-
|
|
|
68a0fa |
- /* Intentional no APLOGNO */
|
|
|
68a0fa |
- ap_log_perror(APLOG_MARK, GCSLOG_LEVEL, 0, decoder->pool,
|
|
|
68a0fa |
- "h2_push_diary_digest_dec: val=%"APR_UINT64_T_HEX_FMT", delta=%"
|
|
|
68a0fa |
- APR_UINT64_T_HEX_FMT", flex=%d, fixed=%"APR_UINT64_T_HEX_FMT,
|
|
|
68a0fa |
- *phash, delta, (int)flex, fixed);
|
|
|
68a0fa |
-
|
|
|
68a0fa |
- return APR_SUCCESS;
|
|
|
68a0fa |
-}
|
|
|
68a0fa |
-
|
|
|
68a0fa |
-/**
|
|
|
68a0fa |
- * Initialize the push diary by a cache digest as described in
|
|
|
68a0fa |
- * https://datatracker.ietf.org/doc/draft-kazuho-h2-cache-digest/
|
|
|
68a0fa |
- * .
|
|
|
68a0fa |
- * @param diary the diary to set the digest into
|
|
|
68a0fa |
- * @param data the binary cache digest
|
|
|
68a0fa |
- * @param len the length of the cache digest
|
|
|
68a0fa |
- * @return APR_EINVAL if digest was not successfully parsed
|
|
|
68a0fa |
- */
|
|
|
68a0fa |
-apr_status_t h2_push_diary_digest_set(h2_push_diary *diary, const char *authority,
|
|
|
68a0fa |
- const char *data, apr_size_t len)
|
|
|
68a0fa |
-{
|
|
|
68a0fa |
- gset_decoder decoder;
|
|
|
68a0fa |
- unsigned char log2n, log2p;
|
|
|
68a0fa |
- int N, i;
|
|
|
68a0fa |
- apr_pool_t *pool = diary->entries->pool;
|
|
|
68a0fa |
- h2_push_diary_entry e;
|
|
|
68a0fa |
- apr_status_t status = APR_SUCCESS;
|
|
|
68a0fa |
-
|
|
|
68a0fa |
- if (len < 2) {
|
|
|
68a0fa |
- /* at least this should be there */
|
|
|
68a0fa |
- return APR_EINVAL;
|
|
|
68a0fa |
- }
|
|
|
68a0fa |
- log2n = data[0];
|
|
|
68a0fa |
- log2p = data[1];
|
|
|
68a0fa |
- diary->mask_bits = log2n + log2p;
|
|
|
68a0fa |
- if (diary->mask_bits > 64) {
|
|
|
68a0fa |
- /* cannot handle */
|
|
|
68a0fa |
- return APR_ENOTIMPL;
|
|
|
68a0fa |
- }
|
|
|
68a0fa |
-
|
|
|
68a0fa |
- /* whatever is in the digest, it replaces the diary entries */
|
|
|
68a0fa |
- apr_array_clear(diary->entries);
|
|
|
68a0fa |
- if (!authority || !strcmp("*", authority)) {
|
|
|
68a0fa |
- diary->authority = NULL;
|
|
|
68a0fa |
- }
|
|
|
68a0fa |
- else if (!diary->authority || strcmp(diary->authority, authority)) {
|
|
|
68a0fa |
- diary->authority = apr_pstrdup(diary->entries->pool, authority);
|
|
|
68a0fa |
- }
|
|
|
68a0fa |
-
|
|
|
68a0fa |
- N = h2_log2inv(log2n + log2p);
|
|
|
68a0fa |
-
|
|
|
68a0fa |
- decoder.diary = diary;
|
|
|
68a0fa |
- decoder.pool = pool;
|
|
|
68a0fa |
- decoder.log2p = log2p;
|
|
|
68a0fa |
- decoder.data = (const unsigned char*)data;
|
|
|
68a0fa |
- decoder.datalen = len;
|
|
|
68a0fa |
- decoder.offset = 1;
|
|
|
68a0fa |
- decoder.bit = 8;
|
|
|
68a0fa |
- decoder.last_val = 0;
|
|
|
68a0fa |
-
|
|
|
68a0fa |
- diary->N = N;
|
|
|
68a0fa |
- /* Determine effective N we use for storage */
|
|
|
68a0fa |
- if (!N) {
|
|
|
68a0fa |
- /* a totally empty cache digest. someone tells us that she has no
|
|
|
68a0fa |
- * entries in the cache at all. Use our own preferences for N+mask
|
|
|
68a0fa |
- */
|
|
|
68a0fa |
- diary->N = diary->NMax;
|
|
|
68a0fa |
- return APR_SUCCESS;
|
|
|
68a0fa |
- }
|
|
|
68a0fa |
- else if (N > diary->NMax) {
|
|
|
68a0fa |
- /* Store not more than diary is configured to hold. We open us up
|
|
|
68a0fa |
- * to DOS attacks otherwise. */
|
|
|
68a0fa |
- diary->N = diary->NMax;
|
|
|
68a0fa |
- }
|
|
|
68a0fa |
-
|
|
|
68a0fa |
- /* Intentional no APLOGNO */
|
|
|
68a0fa |
- ap_log_perror(APLOG_MARK, GCSLOG_LEVEL, 0, pool,
|
|
|
68a0fa |
- "h2_push_diary_digest_set: N=%d, log2n=%d, "
|
|
|
68a0fa |
- "diary->mask_bits=%d, dec.log2p=%d",
|
|
|
68a0fa |
- (int)diary->N, (int)log2n, diary->mask_bits,
|
|
|
68a0fa |
- (int)decoder.log2p);
|
|
|
68a0fa |
-
|
|
|
68a0fa |
- for (i = 0; i < diary->N; ++i) {
|
|
|
68a0fa |
- if (gset_decode_next(&decoder, &e.hash) != APR_SUCCESS) {
|
|
|
68a0fa |
- /* the data may have less than N values */
|
|
|
68a0fa |
- break;
|
|
|
68a0fa |
- }
|
|
|
68a0fa |
- h2_push_diary_append(diary, &e);
|
|
|
68a0fa |
- }
|
|
|
68a0fa |
-
|
|
|
68a0fa |
- /* Intentional no APLOGNO */
|
|
|
68a0fa |
- ap_log_perror(APLOG_MARK, GCSLOG_LEVEL, 0, pool,
|
|
|
68a0fa |
- "h2_push_diary_digest_set: diary now with %d entries, mask_bits=%d",
|
|
|
68a0fa |
- (int)diary->entries->nelts, diary->mask_bits);
|
|
|
68a0fa |
- return status;
|
|
|
68a0fa |
-}
|
|
|
68a0fa |
-
|
|
|
68a0fa |
-apr_status_t h2_push_diary_digest64_set(h2_push_diary *diary, const char *authority,
|
|
|
68a0fa |
- const char *data64url, apr_pool_t *pool)
|
|
|
68a0fa |
-{
|
|
|
68a0fa |
- const char *data;
|
|
|
68a0fa |
- apr_size_t len = h2_util_base64url_decode(&data, data64url, pool);
|
|
|
68a0fa |
- /* Intentional no APLOGNO */
|
|
|
68a0fa |
- ap_log_perror(APLOG_MARK, GCSLOG_LEVEL, 0, pool,
|
|
|
68a0fa |
- "h2_push_diary_digest64_set: digest=%s, dlen=%d",
|
|
|
68a0fa |
- data64url, (int)len);
|
|
|
68a0fa |
- return h2_push_diary_digest_set(diary, authority, data, len);
|
|
|
68a0fa |
-}
|
|
|
68a0fa |
-
|
|
|
68a0fa |
diff --git a/modules/http2/h2_push.h b/modules/http2/h2_push.h
|
|
|
68a0fa |
index bc24e68..d061dd8 100644
|
|
|
68a0fa |
--- a/modules/http2/h2_push.h
|
|
|
68a0fa |
+++ b/modules/http2/h2_push.h
|
|
|
68a0fa |
@@ -35,6 +35,44 @@ typedef enum {
|
|
|
68a0fa |
H2_PUSH_DIGEST_SHA256
|
|
|
68a0fa |
} h2_push_digest_type;
|
|
|
68a0fa |
|
|
|
68a0fa |
+/*******************************************************************************
|
|
|
68a0fa |
+ * push diary
|
|
|
68a0fa |
+ *
|
|
|
68a0fa |
+ * - The push diary keeps track of resources already PUSHed via HTTP/2 on this
|
|
|
68a0fa |
+ * connection. It records a hash value from the absolute URL of the resource
|
|
|
68a0fa |
+ * pushed.
|
|
|
68a0fa |
+ * - Lacking openssl,
|
|
|
68a0fa |
+ * - with openssl, it uses SHA256 to calculate the hash value, otherwise it
|
|
|
68a0fa |
+ * falls back to apr_hashfunc_default()
|
|
|
68a0fa |
+ * - whatever the method to generate the hash, the diary keeps a maximum of 64
|
|
|
68a0fa |
+ * bits per hash, limiting the memory consumption to about
|
|
|
68a0fa |
+ * H2PushDiarySize * 8
|
|
|
68a0fa |
+ * bytes. Entries are sorted by most recently used and oldest entries are
|
|
|
68a0fa |
+ * forgotten first.
|
|
|
68a0fa |
+ * - While useful by itself to avoid duplicated PUSHes on the same connection,
|
|
|
68a0fa |
+ * the original idea was that clients provided a 'Cache-Digest' header with
|
|
|
68a0fa |
+ * the values of *their own* cached resources. This was described in
|
|
|
68a0fa |
+ * <https://datatracker.ietf.org/doc/draft-kazuho-h2-cache-digest/>
|
|
|
68a0fa |
+ * and some subsequent revisions that tweaked values but kept the overall idea.
|
|
|
68a0fa |
+ * - The draft was abandoned by the IETF http-wg, as support from major clients,
|
|
|
68a0fa |
+ * e.g. browsers, was lacking for various reasons.
|
|
|
68a0fa |
+ * - For these reasons, mod_h2 abandoned its support for client supplied values
|
|
|
68a0fa |
+ * but keeps the diary. It seems to provide value for applications using PUSH,
|
|
|
68a0fa |
+ * is configurable in size and defaults to a very moderate amount of memory
|
|
|
68a0fa |
+ * used.
|
|
|
68a0fa |
+ * - The cache digest header is a Golomb Coded Set of hash values, but it may
|
|
|
68a0fa |
+ * limit the amount of bits per hash value even further. For a good description
|
|
|
68a0fa |
+ * of GCS, read here:
|
|
|
68a0fa |
+ * <http://giovanni.bajo.it/post/47119962313/golomb-coded-sets-smaller-than-bloom-filters>
|
|
|
68a0fa |
+ ******************************************************************************/
|
|
|
68a0fa |
+
|
|
|
68a0fa |
+
|
|
|
68a0fa |
+/*
|
|
|
68a0fa |
+ * The push diary is based on the abandoned draft
|
|
|
68a0fa |
+ * <https://datatracker.ietf.org/doc/draft-kazuho-h2-cache-digest/>
|
|
|
68a0fa |
+ * that describes how to use golomb filters.
|
|
|
68a0fa |
+ */
|
|
|
68a0fa |
+
|
|
|
68a0fa |
typedef struct h2_push_diary h2_push_diary;
|
|
|
68a0fa |
|
|
|
68a0fa |
typedef void h2_push_digest_calc(h2_push_diary *diary, apr_uint64_t *phash, h2_push *push);
|
|
|
68a0fa |
@@ -101,20 +139,4 @@ apr_status_t h2_push_diary_digest_get(h2_push_diary *diary, apr_pool_t *p,
|
|
|
68a0fa |
int maxP, const char *authority,
|
|
|
68a0fa |
const char **pdata, apr_size_t *plen);
|
|
|
68a0fa |
|
|
|
68a0fa |
-/**
|
|
|
68a0fa |
- * Initialize the push diary by a cache digest as described in
|
|
|
68a0fa |
- * https://datatracker.ietf.org/doc/draft-kazuho-h2-cache-digest/
|
|
|
68a0fa |
- * .
|
|
|
68a0fa |
- * @param diary the diary to set the digest into
|
|
|
68a0fa |
- * @param authority the authority to set the data for
|
|
|
68a0fa |
- * @param data the binary cache digest
|
|
|
68a0fa |
- * @param len the length of the cache digest
|
|
|
68a0fa |
- * @return APR_EINVAL if digest was not successfully parsed
|
|
|
68a0fa |
- */
|
|
|
68a0fa |
-apr_status_t h2_push_diary_digest_set(h2_push_diary *diary, const char *authority,
|
|
|
68a0fa |
- const char *data, apr_size_t len);
|
|
|
68a0fa |
-
|
|
|
68a0fa |
-apr_status_t h2_push_diary_digest64_set(h2_push_diary *diary, const char *authority,
|
|
|
68a0fa |
- const char *data64url, apr_pool_t *pool);
|
|
|
68a0fa |
-
|
|
|
68a0fa |
#endif /* defined(__mod_h2__h2_push__) */
|