17 #ifndef __mod_h2__h2_util__
18 #define __mod_h2__h2_util__
20 #include <nghttp2/nghttp2.h>
33 const char *data,
size_t datalen);
339 #define H2_HD_MATCH_LIT(l, name, nlen) \
340 ((nlen == sizeof(l) - 1) && !ap_cstr_casecmp(l, name))
384 #if AP_HAS_RESPONSE_BUCKETS
405 const char *
name,
size_t nlen,
406 const char *value,
size_t vlen,
407 size_t max_field_len,
int *pwas_added);
445 const char *tag,
const char *sep,
456 #define h2_util_bb_log(c, sid, level, tag, bb) \
457 if (APLOG_C_IS_LEVEL(c, level)) { \
459 char buffer[4 * 1024]; \
460 const char *line = "(null)"; \
461 apr_size_t len, bmax = sizeof(buffer)/sizeof(buffer[0]); \
462 len = h2_util_bb_print(buffer, bmax, (tag), "", (bb)); \
463 ap_log_cerror(APLOG_MARK, level, 0, (c), "bb_dump(%ld): %s", \
464 ((c)->master? (c)->master->id : (c)->id), (len? buffer : line)); \
505 #if AP_HAS_RESPONSE_BUCKETS
dav_error dav_response * response
Definition: mod_dav.h:204
apr_bucket_brigade * bb
Definition: mod_dav.h:555
const char * s
Definition: mod_dav.h:1327
dav_error * src
Definition: mod_dav.h:186
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:557
const char * name
Definition: mod_dav.h:805
apr_table_t * headers
Definition: mod_proxy.h:1484
int apr_status_t
Definition: apr_errno.h:44
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
struct apr_table_t apr_table_t
Definition: apr_tables.h:56
void h2_iq_sort(h2_iqueue *q, h2_iq_cmp *cmp, void *ctx)
void h2_ihash_clear(h2_ihash_t *ih)
size_t h2_util_hex_dump(char *buffer, size_t maxlen, const char *data, size_t datalen)
void h2_ihash_add(h2_ihash_t *ih, void *val)
apr_status_t h2_res_create_ngtrailer(h2_ngheader **ph, apr_pool_t *p, struct h2_headers *headers)
h2_fifo_op_t
Definition: h2_util.h:228
@ H2_FIFO_OP_REPUSH
Definition: h2_util.h:230
@ H2_FIFO_OP_PULL
Definition: h2_util.h:229
apr_status_t h2_append_brigade(apr_bucket_brigade *to, apr_bucket_brigade *from, apr_off_t *plen, int *peos, h2_bucket_gate *should_append)
apr_status_t h2_util_wait_on_pipe(apr_file_t *pipe)
apr_status_t h2_fifo_peek(h2_fifo *fifo, h2_fifo_peek_fn *fn, void *ctx)
int h2_iq_add(h2_iqueue *q, int sid, h2_iq_cmp *cmp, void *ctx)
apr_status_t h2_ififo_try_peek(h2_ififo *fifo, h2_ififo_peek_fn *fn, void *ctx)
int h2_iq_cmp(int i1, int i2, void *ctx)
Definition: h2_util.h:95
apr_status_t h2_brigade_copy_length(apr_bucket_brigade *dest, apr_bucket_brigade *src, apr_off_t length)
struct h2_fifo h2_fifo
Definition: h2_util.h:195
int h2_ignore_req_trailer(const char *name, size_t len)
apr_status_t h2_ififo_term(h2_ififo *fifo)
void h2_util_drain_pipe(apr_file_t *pipe)
struct h2_ngheader h2_ngheader
h2_ihash_t * h2_ihash_create(apr_pool_t *pool, size_t offset_of_int)
apr_status_t h2_res_create_ngheader(h2_ngheader **ph, apr_pool_t *p, struct h2_headers *headers)
int h2_util_ignore_resp_header(const char *name)
void h2_ihash_remove_val(h2_ihash_t *ih, void *val)
size_t h2_iq_mshift(h2_iqueue *q, int *pint, size_t max)
apr_status_t h2_fifo_try_pull(h2_fifo *fifo, void **pelem)
void h2_ihash_remove(h2_ihash_t *ih, int id)
int h2_iq_contains(h2_iqueue *q, int sid)
apr_status_t h2_ififo_try_push(h2_ififo *fifo, int id)
apr_status_t h2_fifo_create(h2_fifo **pfifo, apr_pool_t *pool, int capacity)
int h2_iq_empty(h2_iqueue *q)
apr_status_t h2_ififo_peek(h2_ififo *fifo, h2_ififo_peek_fn *fn, void *ctx)
void * h2_ihash_get(h2_ihash_t *ih, int id)
int h2_iq_append(h2_iqueue *q, int sid)
apr_size_t h2_util_bucket_print(char *buffer, apr_size_t bmax, apr_bucket *b, const char *sep)
apr_status_t h2_fifo_set_create(h2_fifo **pfifo, apr_pool_t *pool, int capacity)
apr_status_t h2_brigade_concat_length(apr_bucket_brigade *dest, apr_bucket_brigade *src, apr_off_t length)
int h2_bucket_gate(apr_bucket *b)
Definition: h2_util.h:469
void h2_util_camel_case_header(char *s, size_t len)
apr_status_t h2_fifo_try_peek(h2_fifo *fifo, h2_fifo_peek_fn *fn, void *ctx)
apr_status_t h2_ififo_remove(h2_ififo *fifo, int id)
apr_status_t h2_ififo_create(h2_ififo **pfifo, apr_pool_t *pool, int capacity)
apr_status_t h2_util_pass_cb(void *ctx, const char *data, apr_off_t len)
Definition: h2_util.h:429
int h2_fifo_count(h2_fifo *fifo)
apr_status_t h2_fifo_term(h2_fifo *fifo)
int h2_util_frame_print(const nghttp2_frame *frame, char *buffer, size_t maxlen)
int h2_ignore_resp_trailer(const char *name, size_t len)
int h2_ihash_iter_t(void *ctx, void *val)
Definition: h2_util.h:43
apr_status_t h2_req_add_header(apr_table_t *headers, apr_pool_t *pool, const char *name, size_t nlen, const char *value, size_t vlen, size_t max_field_len, int *pwas_added)
int h2_ihash_iter(h2_ihash_t *ih, h2_ihash_iter_t *fn, void *ctx)
apr_status_t h2_fifo_pull(h2_fifo *fifo, void **pelem)
int h2_iq_remove(h2_iqueue *q, int sid)
size_t h2_ihash_shift(h2_ihash_t *ih, void **buffer, size_t max)
unsigned int h2_ihash_count(h2_ihash_t *ih)
apr_status_t h2_req_create_ngheader(h2_ngheader **ph, apr_pool_t *p, const struct h2_request *req)
int h2_ififo_count(h2_ififo *fifo)
int h2_push_policy_determine(apr_table_t *headers, apr_pool_t *p, int push_enabled)
apr_status_t h2_fifo_push(h2_fifo *fifo, void *elem)
apr_status_t h2_fifo_remove(h2_fifo *fifo, void *elem)
struct h2_iqueue h2_iqueue
apr_size_t h2_util_base64url_decode(const char **decoded, const char *encoded, apr_pool_t *pool)
struct h2_ififo h2_ififo
Definition: h2_util.h:265
unsigned char h2_log2(int n)
apr_off_t h2_brigade_mem_size(apr_bucket_brigade *bb)
apr_size_t h2_util_table_bytes(apr_table_t *t, apr_size_t pair_extra)
apr_status_t h2_ififo_set_create(h2_ififo **pfifo, apr_pool_t *pool, int capacity)
struct h2_ihash_t h2_ihash_t
Definition: h2_util.h:42
apr_status_t h2_ififo_push(h2_ififo *fifo, int id)
h2_iqueue * h2_iq_create(apr_pool_t *pool, int capacity)
void h2_iq_clear(h2_iqueue *q)
int h2_ihash_empty(h2_ihash_t *ih)
apr_status_t h2_ififo_try_pull(h2_ififo *fifo, int *pi)
h2_fifo_op_t h2_ififo_peek_fn(int head, void *ctx)
Definition: h2_util.h:298
int h2_iq_shift(h2_iqueue *q)
const char * h2_util_base64url_encode(const char *data, apr_size_t len, apr_pool_t *pool)
int h2_iq_count(h2_iqueue *q)
apr_status_t h2_fifo_try_push(h2_fifo *fifo, void *elem)
apr_status_t h2_ififo_pull(h2_ififo *fifo, int *pi)
apr_size_t h2_util_bb_print(char *buffer, apr_size_t bmax, const char *tag, const char *sep, apr_bucket_brigade *bb)
h2_fifo_op_t h2_fifo_peek_fn(void *head, void *ctx)
Definition: h2_util.h:233
A bucket referring to a HTTP response.
Definition: http_protocol.h:1199
Definition: apr_buckets.h:263
Definition: apr_buckets.h:229
Definition: apr_arch_file_io.h:107
int nelts
Definition: h2_util.h:79
int head
Definition: h2_util.h:78
apr_pool_t * pool
Definition: h2_util.h:81
int * elts
Definition: h2_util.h:77
int nalloc
Definition: h2_util.h:80