Apache HTTPD
Functions | Variables
h2_protocol.c File Reference
#include <assert.h>
#include <apr_strings.h>
#include <apr_optional.h>
#include <apr_optional_hooks.h>
#include <httpd.h>
#include <http_core.h>
#include <http_config.h>
#include <http_connection.h>
#include <http_protocol.h>
#include <http_request.h>
#include <http_ssl.h>
#include <http_log.h>
#include "mod_http2.h"
#include "h2_private.h"
#include "h2_bucket_beam.h"
#include "h2_stream.h"
#include "h2_c2.h"
#include "h2_config.h"
#include "h2_conn_ctx.h"
#include "h2_c1.h"
#include "h2_request.h"
#include "h2_headers.h"
#include "h2_session.h"
#include "h2_util.h"
#include "h2_protocol.h"

Go to the source code of this file.

Functions

const charh2_protocol_err_description (unsigned int h2_error)
 
static void cipher_init (apr_pool_t *pool)
 
static int cipher_is_blacklisted (const char *cipher, const char **psource)
 
apr_status_t h2_protocol_init (apr_pool_t *pool, server_rec *s)
 
int h2_protocol_is_acceptable_c1 (conn_rec *c, request_rec *r, int require_all)
 

Variables

const charh2_protocol_ids_tls []
 
const charh2_protocol_ids_clear []
 
const charH2_MAGIC_TOKEN = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
 
static const charh2_err_descr []
 
static const charRFC7540_names []
 
static size_t RFC7540_names_LEN = sizeof(RFC7540_names)/sizeof(RFC7540_names[0])
 
static apr_hash_tBLCNames
 

Function Documentation

◆ cipher_init()

static void cipher_init ( apr_pool_t pool)
static

Definition at line 403 of file h2_protocol.c.

◆ cipher_is_blacklisted()

static int cipher_is_blacklisted ( const char cipher,
const char **  psource 
)
static

Definition at line 417 of file h2_protocol.c.

◆ h2_protocol_err_description()

const char * h2_protocol_err_description ( unsigned int  h2_error)

Provide a user readable description of the HTTP/2 error code-

Parameters
h2_errorhttp/2 error code, as in rfc 7540, ch. 7
Returns
textual description of code or that it is unknown.

Definition at line 78 of file h2_protocol.c.

◆ h2_protocol_init()

apr_status_t h2_protocol_init ( apr_pool_t pool,
server_rec s 
)

Definition at line 423 of file h2_protocol.c.

◆ h2_protocol_is_acceptable_c1()

int h2_protocol_is_acceptable_c1 ( conn_rec c,
request_rec r,
int  require_all 
)

Check if the given primary connection fulfills the protocol requirements for HTTP/2.

Parameters
cthe connection
require_all!= 0 iff any missing connection properties make the test fail. For example, a cipher might not have been selected while the handshake is still ongoing.
Returns
!= 0 iff protocol requirements are met

Definition at line 432 of file h2_protocol.c.

Variable Documentation

◆ BLCNames

apr_hash_t* BLCNames
static

Definition at line 401 of file h2_protocol.c.

◆ h2_err_descr

const char* h2_err_descr[]
static
Initial value:
= {
"no error",
"protocol error",
"internal error",
"flow control error",
"settings timeout",
"stream closed",
"frame size error",
"refused stream",
"cancel",
"compression error",
"connect error",
"enhance your calm",
"inadequate security",
"http/1.1 required",
}

Definition at line 61 of file h2_protocol.c.

◆ H2_MAGIC_TOKEN

const char* H2_MAGIC_TOKEN = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"

The magic PRIamble of RFC 7540 that is always sent when starting a h2 communication.

Definition at line 56 of file h2_protocol.c.

◆ h2_protocol_ids_clear

const char* h2_protocol_ids_clear[]
Initial value:
= {
"h2c", NULL
}
return NULL
Definition mod_so.c:359

List of protocol identifiers that we support in cleartext negotiations. NULL terminated.

Definition at line 52 of file h2_protocol.c.

◆ h2_protocol_ids_tls

const char* h2_protocol_ids_tls[]
Initial value:
= {
"h2", NULL
}

List of protocol identifiers that we support in TLS encrypted negotiations (ALPN). NULL terminated.

Definition at line 48 of file h2_protocol.c.

◆ RFC7540_names

const char* RFC7540_names[]
static

Definition at line 94 of file h2_protocol.c.

◆ RFC7540_names_LEN

size_t RFC7540_names_LEN = sizeof(RFC7540_names)/sizeof(RFC7540_names[0])
static

Definition at line 398 of file h2_protocol.c.