Apache HTTPD
Classes | Macros | Typedefs | Enumerations | Functions | Variables
mod_ratelimit.c File Reference
#include "httpd.h"
#include "http_config.h"
#include "http_log.h"
#include "util_filter.h"
#include "mod_ratelimit.h"

Go to the source code of this file.

Classes

struct  rl_ctx_t
 

Macros

#define RATE_LIMIT_FILTER_NAME   "RATE_LIMIT"
 
#define RATE_INTERVAL_MS   (200)
 

Typedefs

typedef enum rl_state_e rl_state_e
 
typedef struct rl_ctx_t rl_ctx_t
 

Enumerations

enum  rl_state_e { RATE_LIMIT , RATE_FULLSPEED }
 

Functions

static apr_status_t rate_limit_filter (ap_filter_t *f, apr_bucket_brigade *bb)
 
static apr_status_t rl_bucket_read (apr_bucket *b, const char **str, apr_size_t *len, apr_read_type_e block)
 
apr_bucketap_rl_end_create (apr_bucket_alloc_t *list)
 
apr_bucketap_rl_start_create (apr_bucket_alloc_t *list)
 
static void register_hooks (apr_pool_t *p)
 

Variables

const apr_bucket_type_t ap_rl_bucket_type_end
 
const apr_bucket_type_t ap_rl_bucket_type_start
 
static int *const aplog_module_index = &( ratelimit_module.module_index)
 

Macro Definition Documentation

◆ RATE_INTERVAL_MS

#define RATE_INTERVAL_MS   (200)

Definition at line 25 of file mod_ratelimit.c.

◆ RATE_LIMIT_FILTER_NAME

#define RATE_LIMIT_FILTER_NAME   "RATE_LIMIT"

Definition at line 24 of file mod_ratelimit.c.

Typedef Documentation

◆ rl_ctx_t

◆ rl_state_e

Enumeration Type Documentation

◆ rl_state_e

Enumerator
RATE_LIMIT 
RATE_FULLSPEED 

Definition at line 27 of file mod_ratelimit.c.

Function Documentation

◆ ap_rl_end_create()

apr_bucket * ap_rl_end_create ( apr_bucket_alloc_t list)

Definition at line 270 of file mod_ratelimit.c.

◆ ap_rl_start_create()

apr_bucket * ap_rl_start_create ( apr_bucket_alloc_t list)

Definition at line 286 of file mod_ratelimit.c.

◆ rate_limit_filter()

static apr_status_t rate_limit_filter ( ap_filter_t f,
apr_bucket_brigade bb 
)
static

Definition at line 60 of file mod_ratelimit.c.

◆ register_hooks()

static void register_hooks ( apr_pool_t p)
static

Definition at line 325 of file mod_ratelimit.c.

◆ rl_bucket_read()

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

Definition at line 261 of file mod_ratelimit.c.

Variable Documentation

◆ ap_rl_bucket_type_end

const apr_bucket_type_t ap_rl_bucket_type_end
Initial value:
= {
"RL_END", 5, APR_BUCKET_METADATA,
}
apr_size_t size
static apr_status_t rl_bucket_read(apr_bucket *b, const char **str, apr_size_t *len, apr_read_type_e block)

Definition at line 303 of file mod_ratelimit.c.

◆ ap_rl_bucket_type_start

const apr_bucket_type_t ap_rl_bucket_type_start
Initial value:

Definition at line 313 of file mod_ratelimit.c.

◆ aplog_module_index

int* const aplog_module_index = &( ratelimit_module.module_index)
static

Definition at line 332 of file mod_ratelimit.c.