All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
h2_push.h File Reference
#include "h2.h"
Include dependency graph for h2_push.h:

Go to the source code of this file.

Data Structures

struct  h2_push
struct  h2_push_diary


typedef struct h2_push h2_push
typedef struct h2_push_diary h2_push_diary
typedef void h2_push_digest_calc (h2_push_diary *diary, apr_uint64_t *phash, h2_push *push)


enum  h2_push_digest_type { H2_PUSH_DIGEST_APR_HASH, H2_PUSH_DIGEST_SHA256 }


apr_array_header_th2_push_collect (apr_pool_t *p, const struct h2_request *req, int push_policy, const struct h2_headers *res)
h2_push_diaryh2_push_diary_create (apr_pool_t *p, int N)
apr_array_header_th2_push_diary_update (struct h2_session *session, apr_array_header_t *pushes)
apr_array_header_th2_push_collect_update (struct h2_stream *stream, const struct h2_request *req, const struct h2_headers *res)
apr_status_t h2_push_diary_digest_get (h2_push_diary *diary, apr_pool_t *p, int maxP, const char *authority, const char **pdata, apr_size_t *plen)
apr_status_t h2_push_diary_digest_set (h2_push_diary *diary, const char *authority, const char *data, apr_size_t len)
apr_status_t h2_push_diary_digest64_set (h2_push_diary *diary, const char *authority, const char *data64url, apr_pool_t *pool)

Typedef Documentation

typedef struct h2_push h2_push
typedef struct h2_push_diary h2_push_diary
typedef void h2_push_digest_calc(h2_push_diary *diary, apr_uint64_t *phash, h2_push *push)

Enumeration Type Documentation


Function Documentation

apr_array_header_t* h2_push_collect ( apr_pool_t p,
const struct h2_request req,
int  push_policy,
const struct h2_headers res 

Determine the list of h2_push'es to send to the client on behalf of the given request/response pair.

pthe pool to use
reqthe requst from the client
resthe response from the server
array of h2_push addresses or NULL
apr_array_header_t* h2_push_collect_update ( struct h2_stream stream,
const struct h2_request req,
const struct h2_headers res 

Collect pushes for the given request/response pair, enter them into the diary and return those pushes newly entered.

h2_push_diary* h2_push_diary_create ( apr_pool_t p,
int  N 

Create a new push diary for the given maximum number of entries.

pthe pool to use
Nthe max number of entries, rounded up to 2^x
the created diary, might be NULL of max_entries is 0
apr_status_t h2_push_diary_digest64_set ( h2_push_diary diary,
const char *  authority,
const char *  data64url,
apr_pool_t pool 
apr_status_t h2_push_diary_digest_get ( h2_push_diary diary,
apr_pool_t p,
int  maxP,
const char *  authority,
const char **  pdata,
apr_size_t plen 

Get a cache digest as described in https://datatracker.ietf.org/doc/draft-kazuho-h2-cache-digest/ from the contents of the push diary.

diarythe diary to calculdate the digest from
pthe pool to use
authoritythe authority to get the data for, use NULL/"*" for all
pdataon successful return, the binary cache digest
plenon successful return, the length of the binary data
apr_status_t h2_push_diary_digest_set ( h2_push_diary diary,
const char *  authority,
const char *  data,
apr_size_t  len 

Initialize the push diary by a cache digest as described in https://datatracker.ietf.org/doc/draft-kazuho-h2-cache-digest/

diarythe diary to set the digest into
authoritythe authority to set the data for
datathe binary cache digest
lenthe length of the cache digest
APR_EINVAL if digest was not successfully parsed
apr_array_header_t* h2_push_diary_update ( struct h2_session session,
apr_array_header_t pushes 

Filters the given pushes against the diary and returns only those pushes that were newly entered in the diary.