|
Apache HTTPD
|
#include <assert.h>#include <apr_strings.h>#include <apr_thread_mutex.h>#include <apr_thread_cond.h>#include <httpd.h>#include <http_core.h>#include <http_log.h>#include <http_protocol.h>#include <http_request.h>#include <nghttp2/nghttp2.h>#include "h2.h"#include "h2_headers.h"#include "h2_util.h"Go to the source code of this file.
Classes | |
| struct | h2_ihash_t |
| struct | iter_ctx |
| struct | collect_ctx |
| struct | h2_fifo |
| struct | h2_ififo |
| struct | table_bytes_ctx |
| struct | ngh_ctx |
| struct | literal |
Macros | |
| #define | N6 (unsigned int)-1 |
| #define | BASE64URL_CHAR(x) BASE64URL_CHARS[ (unsigned int)(x) & 0x3fu ] |
| #define | H2_DEF_LITERAL(n) { (n), (sizeof(n)-1) } |
| #define | H2_LIT_ARGS(a) (a),H2_ALEN(a) |
Typedefs | |
| typedef struct ngh_ctx | ngh_ctx |
| #define BASE64URL_CHAR | ( | x | ) | BASE64URL_CHARS[ (unsigned int)(x) & 0x3fu ] |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| 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 | ||
| ) |
Transfer buckets from one brigade to another with a limit on the maximum amount of bytes transferred. Does no setaside magic, lifetime of brigades must fit.
| to | brigade to transfer buckets to |
| from | brigades to remove buckets from |
| plen | maximum bytes to transfer, actual bytes transferred |
| peos | if an EOS bucket was transferred |
| apr_status_t h2_brigade_concat_length | ( | apr_bucket_brigade * | dest, |
| apr_bucket_brigade * | src, | ||
| apr_off_t | length | ||
| ) |
| apr_status_t h2_brigade_copy_length | ( | apr_bucket_brigade * | dest, |
| apr_bucket_brigade * | src, | ||
| apr_off_t | length | ||
| ) |
| apr_off_t h2_brigade_mem_size | ( | apr_bucket_brigade * | bb | ) |
| apr_status_t h2_fifo_create | ( | h2_fifo ** | pfifo, |
| apr_pool_t * | pool, | ||
| int | capacity | ||
| ) |
| apr_status_t h2_fifo_peek | ( | h2_fifo * | fifo, |
| h2_fifo_peek_fn * | fn, | ||
| void * | ctx | ||
| ) |
Call given function on the head of the queue, once it exists, and perform the returned operation on it. The queue will hold its lock during this time, so no other operations on the queue are possible.
| fifo | the queue to peek at |
| fn | the function to call on the head, once available |
| ctx | context to pass in call to function |
| apr_status_t h2_fifo_pull | ( | h2_fifo * | fifo, |
| void ** | pelem | ||
| ) |
| apr_status_t h2_fifo_push | ( | h2_fifo * | fifo, |
| void * | elem | ||
| ) |
| apr_status_t h2_fifo_remove | ( | h2_fifo * | fifo, |
| void * | elem | ||
| ) |
| apr_status_t h2_fifo_set_create | ( | h2_fifo ** | pfifo, |
| apr_pool_t * | pool, | ||
| int | capacity | ||
| ) |
| apr_status_t h2_fifo_term | ( | h2_fifo * | fifo | ) |
| apr_status_t h2_fifo_try_peek | ( | h2_fifo * | fifo, |
| h2_fifo_peek_fn * | fn, | ||
| void * | ctx | ||
| ) |
| apr_status_t h2_fifo_try_pull | ( | h2_fifo * | fifo, |
| void ** | pelem | ||
| ) |
| apr_status_t h2_fifo_try_push | ( | h2_fifo * | fifo, |
| void * | elem | ||
| ) |
| apr_status_t h2_ififo_create | ( | h2_ififo ** | pfifo, |
| apr_pool_t * | pool, | ||
| int | capacity | ||
| ) |
| apr_status_t h2_ififo_peek | ( | h2_ififo * | fifo, |
| h2_ififo_peek_fn * | fn, | ||
| void * | ctx | ||
| ) |
Call given function on the head of the queue, once it exists, and perform the returned operation on it. The queue will hold its lock during this time, so no other operations on the queue are possible.
| fifo | the queue to peek at |
| fn | the function to call on the head, once available |
| ctx | context to pass in call to function |
| apr_status_t h2_ififo_pull | ( | h2_ififo * | fifo, |
| int * | pi | ||
| ) |
| apr_status_t h2_ififo_push | ( | h2_ififo * | fifo, |
| int | id | ||
| ) |
| apr_status_t h2_ififo_remove | ( | h2_ififo * | fifo, |
| int | id | ||
| ) |
| apr_status_t h2_ififo_set_create | ( | h2_ififo ** | pfifo, |
| apr_pool_t * | pool, | ||
| int | capacity | ||
| ) |
| apr_status_t h2_ififo_term | ( | h2_ififo * | fifo | ) |
| apr_status_t h2_ififo_try_peek | ( | h2_ififo * | fifo, |
| h2_ififo_peek_fn * | fn, | ||
| void * | ctx | ||
| ) |
| apr_status_t h2_ififo_try_pull | ( | h2_ififo * | fifo, |
| int * | pi | ||
| ) |
| apr_status_t h2_ififo_try_push | ( | h2_ififo * | fifo, |
| int | id | ||
| ) |
| void h2_ihash_add | ( | h2_ihash_t * | ih, |
| void * | val | ||
| ) |
| void h2_ihash_clear | ( | h2_ihash_t * | ih | ) |
| unsigned int h2_ihash_count | ( | h2_ihash_t * | ih | ) |
| h2_ihash_t * h2_ihash_create | ( | apr_pool_t * | pool, |
| size_t | offset_of_int | ||
| ) |
Create a hash for structures that have an identifying int member.
| pool | the pool to use |
| offset_of_int | the offsetof() the int member in the struct |
| int h2_ihash_empty | ( | h2_ihash_t * | ih | ) |
| void * h2_ihash_get | ( | h2_ihash_t * | ih, |
| int | id | ||
| ) |
| int h2_ihash_iter | ( | h2_ihash_t * | ih, |
| h2_ihash_iter_t * | fn, | ||
| void * | ctx | ||
| ) |
Iterate over the hash members (without defined order) and invoke fn for each member until 0 is returned.
| ih | the hash to iterate over |
| fn | the function to invoke on each member |
| ctx | user supplied data passed into each iteration call |
| void h2_ihash_remove | ( | h2_ihash_t * | ih, |
| int | id | ||
| ) |
| void h2_ihash_remove_val | ( | h2_ihash_t * | ih, |
| void * | val | ||
| ) |
| size_t h2_ihash_shift | ( | h2_ihash_t * | ih, |
| void ** | buffer, | ||
| size_t | max | ||
| ) |
| void h2_iq_clear | ( | h2_iqueue * | q | ) |
| h2_iqueue * h2_iq_create | ( | apr_pool_t * | pool, |
| int | capacity | ||
| ) |
| int h2_push_policy_determine | ( | apr_table_t * | headers, |
| apr_pool_t * | p, | ||
| int | push_enabled | ||
| ) |
Set the push policy for the given request. Takes request headers into account, see draft https://tools.ietf.org/html/draft-ruellan-http-accept-push-policy-00 for details.
| headers | the http headers to inspect |
| p | the pool to use |
| push_enabled | if HTTP/2 server push is generally enabled for this request |
| 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 | ||
| ) |
| apr_status_t h2_req_create_ngheader | ( | h2_ngheader ** | ph, |
| apr_pool_t * | p, | ||
| const struct h2_request * | req | ||
| ) |
|
static |
| apr_status_t h2_res_create_ngheader | ( | h2_ngheader ** | ph, |
| apr_pool_t * | p, | ||
| h2_headers * | headers | ||
| ) |
| apr_status_t h2_res_create_ngtrailer | ( | h2_ngheader ** | ph, |
| apr_pool_t * | p, | ||
| h2_headers * | headers | ||
| ) |
| apr_size_t h2_util_base64url_decode | ( | const char ** | decoded, |
| const char * | encoded, | ||
| apr_pool_t * | pool | ||
| ) |
I always wanted to write my own base64url decoder...not. See https://tools.ietf.org/html/rfc4648#section-5 for description.
| const char * h2_util_base64url_encode | ( | const char * | data, |
| apr_size_t | dlen, | ||
| apr_pool_t * | pool | ||
| ) |
| apr_size_t h2_util_bb_print | ( | char * | buffer, |
| apr_size_t | bmax, | ||
| const char * | tag, | ||
| const char * | sep, | ||
| apr_bucket_brigade * | bb | ||
| ) |
| apr_size_t h2_util_bucket_print | ( | char * | buffer, |
| apr_size_t | bmax, | ||
| apr_bucket * | b, | ||
| const char * | sep | ||
| ) |
| void h2_util_drain_pipe | ( | apr_file_t * | pipe | ) |
| int h2_util_frame_print | ( | const nghttp2_frame * | frame, |
| char * | buffer, | ||
| size_t | maxlen | ||
| ) |
| apr_size_t h2_util_table_bytes | ( | apr_table_t * | t, |
| apr_size_t | pair_extra | ||
| ) |
| apr_status_t h2_util_wait_on_pipe | ( | apr_file_t * | pipe | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |