Apache HTTPD
Classes | Functions | Variables
h2_headers.c File Reference
#include <assert.h>
#include <stdio.h>
#include <apr_strings.h>
#include <httpd.h>
#include <http_core.h>
#include <http_log.h>
#include <util_time.h>
#include <nghttp2/nghttp2.h>
#include "h2_private.h"
#include "h2_protocol.h"
#include "h2_config.h"
#include "h2_util.h"
#include "h2_request.h"
#include "h2_headers.h"

Go to the source code of this file.

Classes

struct  h2_bucket_headers
 

Functions

static int is_unsafe (server_rec *s)
 
static apr_status_t bucket_read (apr_bucket *b, const char **str, apr_size_t *len, apr_read_type_e block)
 
apr_bucketh2_bucket_headers_make (apr_bucket *b, h2_headers *r)
 
apr_bucketh2_bucket_headers_create (apr_bucket_alloc_t *list, h2_headers *r)
 
h2_headersh2_bucket_headers_get (apr_bucket *b)
 
static void bucket_destroy (void *data)
 
apr_bucketh2_bucket_headers_clone (apr_bucket *b, apr_pool_t *pool, apr_bucket_alloc_t *list)
 
h2_headersh2_headers_create (int status, const apr_table_t *headers_in, const apr_table_t *notes, apr_off_t raw_bytes, apr_pool_t *pool)
 
static int add_header_lengths (void *ctx, const char *name, const char *value)
 
apr_size_t h2_headers_length (h2_headers *headers)
 
apr_size_t h2_bucket_headers_headers_length (apr_bucket *b)
 
h2_headersh2_headers_rcreate (request_rec *r, int status, const apr_table_t *header, apr_pool_t *pool)
 
h2_headersh2_headers_copy (apr_pool_t *pool, h2_headers *h)
 
h2_headersh2_headers_clone (apr_pool_t *pool, h2_headers *h)
 
h2_headersh2_headers_die (apr_status_t type, const h2_request *req, apr_pool_t *pool)
 
int h2_headers_are_final_response (h2_headers *headers)
 

Variables

const apr_bucket_type_t h2_bucket_type_headers
 

Function Documentation

◆ add_header_lengths()

static int add_header_lengths ( void *  ctx,
const char name,
const char value 
)
static

Definition at line 132 of file h2_headers.c.

◆ bucket_destroy()

static void bucket_destroy ( void *  data)
static

Definition at line 93 of file h2_headers.c.

◆ bucket_read()

static apr_status_t bucket_read ( apr_bucket b,
const char **  str,
apr_size_t len,
apr_read_type_e  block 
)
static

Definition at line 49 of file h2_headers.c.

◆ h2_bucket_headers_clone()

apr_bucket * h2_bucket_headers_clone ( apr_bucket b,
apr_pool_t pool,
apr_bucket_alloc_t list 
)

Definition at line 111 of file h2_headers.c.

◆ h2_bucket_headers_create()

apr_bucket * h2_bucket_headers_create ( apr_bucket_alloc_t list,
h2_headers r 
)

Definition at line 73 of file h2_headers.c.

◆ h2_bucket_headers_get()

h2_headers * h2_bucket_headers_get ( apr_bucket b)

Definition at line 85 of file h2_headers.c.

◆ h2_bucket_headers_headers_length()

apr_size_t h2_bucket_headers_headers_length ( apr_bucket b)

For H2HEADER buckets, return the length of all contained header strings. For all other buckets, return 0.

Definition at line 146 of file h2_headers.c.

◆ h2_bucket_headers_make()

apr_bucket * h2_bucket_headers_make ( apr_bucket b,
h2_headers r 
)

Definition at line 59 of file h2_headers.c.

◆ h2_headers_are_final_response()

int h2_headers_are_final_response ( h2_headers headers)

Definition at line 214 of file h2_headers.c.

◆ h2_headers_clone()

h2_headers * h2_headers_clone ( apr_pool_t pool,
h2_headers h 
)

Clone the headers into another pool. This will also clone any header strings.

Definition at line 190 of file h2_headers.c.

◆ h2_headers_copy()

h2_headers * h2_headers_copy ( apr_pool_t pool,
h2_headers h 
)

Copy the headers into another pool. This will not copy any header strings.

Definition at line 185 of file h2_headers.c.

◆ h2_headers_create()

h2_headers * h2_headers_create ( int  status,
const apr_table_t header,
const apr_table_t notes,
apr_off_t  raw_bytes,
apr_pool_t pool 
)

Create the headers from the given status and headers

Parameters
statusthe headers status
headerthe headers of the headers
notesthe notes carried by the headers
raw_bytesthe raw network bytes (if known) used to transmit these
poolthe memory pool to use

Definition at line 119 of file h2_headers.c.

◆ h2_headers_die()

h2_headers * h2_headers_die ( apr_status_t  type,
const h2_request req,
apr_pool_t pool 
)

Definition at line 195 of file h2_headers.c.

◆ h2_headers_length()

apr_size_t h2_headers_length ( h2_headers headers)

Give the number of bytes of all contained header strings.

Definition at line 139 of file h2_headers.c.

◆ h2_headers_rcreate()

h2_headers * h2_headers_rcreate ( request_rec r,
int  status,
const apr_table_t header,
apr_pool_t pool 
)

Create the headers from the given request_rec.

Parameters
rthe request record which was processed
statusthe headers status
headerthe headers of the headers
poolthe memory pool to use

Definition at line 152 of file h2_headers.c.

◆ is_unsafe()

static int is_unsafe ( server_rec s)
static

Definition at line 38 of file h2_headers.c.

Variable Documentation

◆ h2_bucket_type_headers

const apr_bucket_type_t h2_bucket_type_headers
Initial value:
= {
"H2HEADERS", 5, APR_BUCKET_METADATA,
}
apr_size_t size
static void bucket_destroy(void *data)
Definition h2_headers.c:93
static apr_status_t bucket_read(apr_bucket *b, const char **str, apr_size_t *len, apr_read_type_e block)
Definition h2_headers.c:49

Definition at line 102 of file h2_headers.c.