ROOT 6.08/07 Reference Guide |
#include "civetweb.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <signal.h>
#include <fcntl.h>
#include <time.h>
#include <stdlib.h>
#include <stdarg.h>
#include <assert.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
#include <stddef.h>
#include <stdio.h>
#include <sys/wait.h>
#include <sys/socket.h>
#include <sys/poll.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/time.h>
#include <sys/utsname.h>
#include <stdint.h>
#include <inttypes.h>
#include <netdb.h>
#include <netinet/tcp.h>
#include <pwd.h>
#include <unistd.h>
#include <grp.h>
#include <dirent.h>
#include <dlfcn.h>
#include <pthread.h>
#include "md5.inl"
#include "handle_form.inl"
Macros | |
#define | __STDC_FORMAT_MACROS /* <inttypes.h> wants this for C++ */ |
#define | __STDC_LIMIT_MACROS /* C++ wants that for INT64_MAX */ |
#define | _DARWIN_UNLIMITED_SELECT |
#define | _FILE_OFFSET_BITS 64 /* Use 64-bit file offsets by default */ |
#define | _LARGEFILE_SOURCE /* For fseeko(), ftello() */ |
#define | ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) |
#define | calloc DO_NOT_USE_THIS_FUNCTION__USE_mg_calloc |
#define | CGI_ENVIRONMENT_SIZE (4096) |
#define | closesocket(a) (close(a)) |
#define | CONF_modules_unload (*(void (*)(int))crypto_sw[8].ptr) |
#define | CRYPTO_cleanup_all_ex_data (*(void (*)(void))crypto_sw[9].ptr) |
#define | CRYPTO_LIB "libcrypto.so" |
#define | CRYPTO_num_locks (*(int (*)(void))crypto_sw[0].ptr) |
#define | CRYPTO_set_id_callback (*(void (*)(unsigned long (*)(void)))crypto_sw[2].ptr) |
#define | CRYPTO_set_locking_callback (*(void (*)(void (*)(int, int, const char *, int)))crypto_sw[1].ptr) |
#define | DEBUG_TRACE(fmt, ...) |
#define | ENGINE_cleanup (*(void (*)(void))crypto_sw[7].ptr) |
#define | ERR_error_string (*(char *(*)(unsigned long, char *))crypto_sw[4].ptr) |
#define | ERR_free_strings (*(void (*)(void))crypto_sw[6].ptr) |
#define | ERR_get_error (*(unsigned long (*)(void))crypto_sw[3].ptr) |
#define | ERR_remove_state (*(void (*)(unsigned long))crypto_sw[5].ptr) |
#define | ERRNO (errno) |
#define | EVP_cleanup (*(void (*)(void))crypto_sw[10].ptr) |
#define | free DO_NOT_USE_THIS_FUNCTION__USE_mg_free |
#define | HEXTOI(x) (isdigit(x) ? x - '0' : x - 'W') |
#define | IGNORE_UNUSED_RESULT(a) ((void)((a) && 1)) |
#define | INT64_FMT PRId64 |
#define | INVALID_SOCKET (-1) |
#define | IP_ADDR_STR_LEN (50) /* IPv6 hex string is 46 chars */ |
#define | is_websocket_protocol(conn) (0) |
#define | malloc DO_NOT_USE_THIS_FUNCTION__USE_mg_malloc |
#define | MAX_CGI_ENVIR_VARS (256) |
#define | MAX_REQUEST_SIZE (16384) |
#define | MAX_WORKER_THREADS (1024 * 64) |
#define | MD5_STATIC static |
#define | MG_BUF_LEN (8192) |
#define | mg_closedir(x) (closedir(x)) |
#define | mg_mkdir(conn, path, mode) (mkdir(path, mode)) |
#define | mg_opendir(conn, x) (opendir(x)) |
#define | mg_readdir(x) (readdir(x)) |
#define | mg_remove(conn, x) (remove(x)) |
#define | mg_sleep(x) (usleep((x)*1000)) |
#define | mg_static_assert(cond, txt) extern char static_assert_replacement[(cond) ? 1 : -1] |
#define | MGSQLEN (20) |
#define | MSG_NOSIGNAL (0) |
#define | O_BINARY (0) |
#define | PASSWORDS_FILE_NAME ".htpasswd" |
#define | QUEUE_SIZE(ctx) ((int)(ARRAY_SIZE(ctx->queue))) |
#define | QUEUE_SIZE(ctx) ((int)(ARRAY_SIZE(ctx->queue))) |
#define | realloc DO_NOT_USE_THIS_FUNCTION__USE_mg_realloc |
#define | snprintf DO_NOT_USE_THIS_FUNCTION__USE_mg_snprintf |
#define | SOCKET_TIMEOUT_QUANTUM (10000) |
#define | SOMAXCONN (100) |
#define | SSL_accept (*(int (*)(SSL *))ssl_sw[1].ptr) |
#define | SSL_CIPHER_get_name (*(const char *(*)(const SSL_CIPHER *))ssl_sw[27].ptr) |
#define | SSL_connect (*(int (*)(SSL *))ssl_sw[2].ptr) |
#define | SSL_CTRL_CLEAR_OPTIONS (77) |
#define | SSL_CTRL_OPTIONS (32) |
#define | SSL_CTRL_SET_ECDH_AUTO (94) |
#define | SSL_CTX_check_private_key (*(int (*)(SSL_CTX *))ssl_sw[28].ptr) |
#define | SSL_CTX_clear_options(ctx, op) SSL_CTX_ctrl((ctx), SSL_CTRL_CLEAR_OPTIONS, (op), NULL) |
#define | SSL_CTX_ctrl (*(long (*)(SSL_CTX *, int, long, void *))ssl_sw[30].ptr) |
#define | SSL_CTX_free (*(void (*)(SSL_CTX *))ssl_sw[14].ptr) |
#define | SSL_CTX_load_verify_locations (*(int (*)(SSL_CTX *, const char *, const char *))ssl_sw[21].ptr) |
#define | SSL_CTX_new (*(SSL_CTX * (*)(SSL_METHOD *))ssl_sw[8].ptr) |
#define | SSL_CTX_set_cipher_list (*(int (*)(SSL_CTX *, const char *))ssl_sw[31].ptr) |
#define | SSL_CTX_set_default_passwd_cb (*(void (*)(SSL_CTX *, mg_callback_t))ssl_sw[13].ptr) |
#define | SSL_CTX_set_default_verify_paths (*(int (*)(SSL_CTX *))ssl_sw[22].ptr) |
#define | SSL_CTX_set_ecdh_auto(ctx, onoff) SSL_CTX_ctrl(ctx, SSL_CTRL_SET_ECDH_AUTO, onoff, NULL) |
#define | SSL_CTX_set_options(ctx, op) SSL_CTX_ctrl((ctx), SSL_CTRL_OPTIONS, (op), NULL) |
#define | SSL_CTX_set_session_id_context (*(int (*)(SSL_CTX *, const unsigned char *, unsigned int))ssl_sw[29].ptr) |
#define | SSL_CTX_set_verify |
#define | SSL_CTX_set_verify_depth (*(void (*)(SSL_CTX *, int))ssl_sw[23].ptr) |
#define | SSL_CTX_use_certificate_chain_file (*(int (*)(SSL_CTX *, const char *))ssl_sw[16].ptr) |
#define | SSL_CTX_use_certificate_file (*(int (*)(SSL_CTX *, const char *, int))ssl_sw[12].ptr) |
#define | SSL_CTX_use_PrivateKey_file (*(int (*)(SSL_CTX *, const char *, int))ssl_sw[11].ptr) |
#define | SSL_free (*(void (*)(SSL *))ssl_sw[0].ptr) |
#define | SSL_get_current_cipher (*(SSL_CIPHER * (*)(SSL *))ssl_sw[26].ptr) |
#define | SSL_get_error (*(int (*)(SSL *, int))ssl_sw[5].ptr) |
#define | SSL_get_peer_certificate (*(X509 * (*)(SSL *))ssl_sw[24].ptr) |
#define | SSL_get_version (*(const char *(*)(SSL *))ssl_sw[25].ptr) |
#define | SSL_LIB "libssl.so" |
#define | SSL_library_init (*(int (*)(void))ssl_sw[10].ptr) |
#define | SSL_load_error_strings (*(void (*)(void))ssl_sw[15].ptr) |
#define | SSL_new (*(SSL * (*)(SSL_CTX *))ssl_sw[7].ptr) |
#define | SSL_OP_ALL ((long)(0x80000BFFUL)) |
#define | SSL_OP_NO_SSLv2 (0x01000000L) |
#define | SSL_OP_NO_SSLv3 (0x02000000L) |
#define | SSL_OP_NO_TLSv1 (0x04000000L) |
#define | SSL_OP_NO_TLSv1_1 (0x10000000L) |
#define | SSL_OP_NO_TLSv1_2 (0x08000000L) |
#define | SSL_OP_SINGLE_DH_USE (0x00100000L) |
#define | SSL_pending (*(int (*)(SSL *))ssl_sw[18].ptr) |
#define | SSL_read (*(int (*)(SSL *, void *, int))ssl_sw[3].ptr) |
#define | SSL_set_fd (*(int (*)(SSL *, SOCKET))ssl_sw[6].ptr) |
#define | SSL_shutdown (*(int (*)(SSL *))ssl_sw[20].ptr) |
#define | SSL_VERIFY_CLIENT_ONCE (4) |
#define | SSL_VERIFY_FAIL_IF_NO_PEER_CERT (2) |
#define | SSL_VERIFY_NONE (0) |
#define | SSL_VERIFY_PEER (1) |
#define | SSL_write (*(int (*)(SSL *, const void *, int))ssl_sw[4].ptr) |
#define | SSLv23_client_method (*(SSL_METHOD * (*)(void))ssl_sw[17].ptr) |
#define | SSLv23_server_method (*(SSL_METHOD * (*)(void))ssl_sw[9].ptr) |
#define | STRUCT_FILE_INITIALIZER |
#define | UINT64_FMT PRIu64 |
#define | va_copy(x, y) ((x) = (y)) |
#define | vsnprintf_impl vsnprintf |
#define | WIN32_LEAN_AND_MEAN |
#define | WINCDECL |
Typedefs | |
typedef const void * | SOCK_OPT_TYPE |
typedef int | SOCKET |
typedef struct ssl_st | SSL |
typedef struct ssl_ctx_st | SSL_CTX |
typedef struct ssl_method_st | SSL_METHOD |
typedef struct x509_store_ctx_st | X509_STORE_CTX |
Functions | |
static void | accept_new_connection (const struct socket *listener, struct mg_context *ctx) |
static void | addenv (struct cgi_environment *env, PRINTF_FORMAT_STRING(const char *fmt),...) PRINTF_ARGS(2 |
static void static void | addenv (struct cgi_environment *env, const char *fmt,...) |
static int | alloc_vprintf (char **out_buf, char *prealloc_buf, size_t prealloc_size, const char *fmt, va_list ap) |
static int | alloc_vprintf2 (char **buf, const char *fmt, va_list ap) |
static int | authorize (struct mg_connection *conn, struct file *filep) |
static void | bin2str (char *to, const unsigned char *p, size_t len) |
static int | check_acl (struct mg_context *ctx, uint32_t remote_ip) |
static int | check_authorization (struct mg_connection *conn, const char *path) |
static int | check_password (const char *method, const char *ha1, const char *uri, const char *nonce, const char *nc, const char *cnonce, const char *qop, const char *response) |
static void | close_all_listening_sockets (struct mg_context *ctx) |
static void | close_connection (struct mg_connection *conn) |
static void | close_socket_gracefully (struct mg_connection *conn) |
static int WINCDECL | compare_dir_entries (const void *p1, const void *p2) |
static int | connect_socket (struct mg_context *ctx, const char *host, int port, int use_ssl, char *ebuf, size_t ebuf_len, SOCKET *sock, union usa *sa) |
static void | construct_etag (char *buf, size_t buf_len, const struct file *filep) |
static int | consume_socket (struct mg_context *ctx, struct socket *sp) |
static void | delete_file (struct mg_connection *conn, const char *path) |
static void | dir_scan_callback (struct de *de, void *data) |
static void | discard_unread_request_data (struct mg_connection *conn) |
static void | do_ssi_exec (struct mg_connection *conn, char *tag) |
static void | do_ssi_include (struct mg_connection *conn, const char *ssi, char *tag, int include_level) |
static struct mg_connection * | fc (struct mg_context *ctx) |
static void | fclose_on_exec (struct file *filep, struct mg_connection *conn) |
static int | forward_body_data (struct mg_connection *conn, FILE *fp, SOCKET sock, SSL *ssl) |
static void | free_context (struct mg_context *ctx) |
static int | get_first_ssl_listener_index (const struct mg_context *ctx) |
static const char * | get_header (const struct mg_request_info *ri, const char *name) |
static void | get_mime_type (struct mg_context *ctx, const char *path, struct vec *vec) |
static int | get_month_index (const char *s) |
static int | get_option_index (const char *name) |
static uint64_t | get_random (void) |
static const char * | get_rel_url_at_current_server (const char *uri, const struct mg_connection *conn) |
static uint32_t | get_remote_ip (const struct mg_connection *conn) |
static int | get_request_handler (struct mg_connection *conn, int handler_type, mg_request_handler *handler, mg_websocket_connect_handler *connect_handler, mg_websocket_ready_handler *ready_handler, mg_websocket_data_handler *data_handler, mg_websocket_close_handler *close_handler, mg_authorization_handler *auth_handler, void **cbdata) |
static int | get_request_len (const char *buf, int buflen) |
static void | get_system_name (char **sysName) |
static int | get_uri_type (const char *uri) |
static int | getreq (struct mg_connection *conn, char *ebuf, size_t ebuf_len, int *err) |
static void | gmt_time_string (char *buf, size_t buf_len, time_t *t) |
static void | handle_cgi_request (struct mg_connection *conn, const char *prog) |
static void | handle_directory_request (struct mg_connection *conn, const char *dir) |
static void | handle_file_based_request (struct mg_connection *conn, const char *path, struct file *filep) |
static void | handle_propfind (struct mg_connection *conn, const char *path, struct file *filep) |
static void | handle_request (struct mg_connection *conn) |
static void | handle_ssi_file_request (struct mg_connection *conn, const char *path, struct file *filep) |
static void | handle_static_file_request (struct mg_connection *conn, const char *path, struct file *filep, const char *mime_type) |
static int | header_has_option (const char *header, const char *option) |
static const char * | header_val (const struct mg_connection *conn, const char *header) |
static int | initialize_ssl (struct mg_context *ctx) |
static void | interpret_uri (struct mg_connection *conn, char *filename, size_t filename_buf_len, struct file *filep, int *is_found, int *is_script_resource, int *is_websocket_request, int *is_put_or_delete_request) |
static int | is_authorized_for_put (struct mg_connection *conn) |
static int | is_file_in_memory (const struct mg_connection *conn, const char *path, struct file *filep) |
static int | is_file_opened (const struct file *filep) |
static int | is_not_modified (const struct mg_connection *conn, const struct file *filep) |
static int | is_put_or_delete_method (const struct mg_connection *conn) |
static int | is_valid_http_method (const char *method) |
static int | is_valid_port (unsigned long port) |
static int | isbyte (int n) |
static void * | load_dll (struct mg_context *ctx, const char *dll_name, struct ssl_func *sw) |
static void | log_access (const struct mg_connection *conn) |
static int | lowercase (const char *s) |
static void * | master_thread (void *thread_func_param) |
static void | master_thread_run (void *thread_func_param) |
static int | match_prefix (const char *pattern, size_t pattern_len, const char *str) |
static int | mg_atomic_dec (volatile int *addr) |
static int | mg_atomic_inc (volatile int *addr) |
static __inline void * | mg_calloc (size_t a, size_t b) |
unsigned | mg_check_feature (unsigned feature) |
void | mg_close_connection (struct mg_connection *conn) |
struct mg_connection * | mg_connect_client (const char *host, int port, int use_ssl, char *error_buffer, size_t error_buffer_size) |
static struct mg_connection * | mg_connect_client_impl (const struct mg_client_options *client_options, int use_ssl, char *ebuf, size_t ebuf_len) |
CIVETWEB_API struct mg_connection * | mg_connect_client_secure (const struct mg_client_options *client_options, char *error_buffer, size_t error_buffer_size) |
struct mg_connection * | mg_connect_websocket_client (const char *host, int port, int use_ssl, char *error_buffer, size_t error_buffer_size, const char *path, const char *origin, mg_websocket_data_handler data_func, mg_websocket_close_handler close_func, void *user_data) |
void | mg_cry (const struct mg_connection *conn, const char *fmt,...) |
static double | mg_difftimespec (const struct timespec *ts_now, const struct timespec *ts_before) |
struct mg_connection * | mg_download (const char *host, int port, int use_ssl, char *ebuf, size_t ebuf_len, const char *fmt,...) |
static void | mg_fclose (struct file *filep) |
static int | mg_fgetc (struct file *filep, int offset) |
static const char * | mg_fgets (char *buf, size_t size, struct file *filep, char **p) |
static int | mg_fopen (const struct mg_connection *conn, const char *path, const char *mode, struct file *filep) |
static __inline void | mg_free (void *a) |
const char * | mg_get_builtin_mime_type (const char *path) |
struct mg_context * | mg_get_context (const struct mg_connection *conn) |
int | mg_get_cookie (const char *cookie_header, const char *var_name, char *dst, size_t dst_size) |
const char * | mg_get_header (const struct mg_connection *conn, const char *name) |
const char * | mg_get_option (const struct mg_context *ctx, const char *name) |
size_t | mg_get_ports (const struct mg_context *ctx, size_t size, int *ports, int *ssl) |
const struct mg_request_info * | mg_get_request_info (const struct mg_connection *conn) |
int | mg_get_response (struct mg_connection *conn, char *ebuf, size_t ebuf_len, int timeout) |
const char * | mg_get_response_code_text (struct mg_connection *conn, int response_code) |
int | mg_get_server_ports (const struct mg_context *ctx, int size, struct mg_server_ports *ports) |
void * | mg_get_user_connection_data (const struct mg_connection *conn) |
void * | mg_get_user_data (const struct mg_context *ctx) |
const struct mg_option * | mg_get_valid_options (void) |
int | mg_get_var (const char *data, size_t data_len, const char *name, char *dst, size_t dst_len) |
int | mg_get_var2 (const char *data, size_t data_len, const char *name, char *dst, size_t dst_len, size_t occurrence) |
static char | mg_getc (struct mg_connection *conn) |
static int | mg_inet_pton (int af, const char *src, void *dst, size_t dstlen) |
static int | mg_join_thread (pthread_t threadid) |
void | mg_lock_connection (struct mg_connection *conn) |
void | mg_lock_context (struct mg_context *ctx) |
static __inline void * | mg_malloc (size_t a) |
char * | mg_md5 (char buf[33],...) |
int | mg_modify_passwords_file (const char *fname, const char *domain, const char *user, const char *pass) |
int | mg_printf (struct mg_connection *conn, const char *fmt,...) |
int | mg_read (struct mg_connection *conn, void *buf, size_t len) |
static int | mg_read_inner (struct mg_connection *conn, void *buf, size_t len) |
static __inline void * | mg_realloc (void *a, size_t b) |
void | mg_send_file (struct mg_connection *conn, const char *path) |
void | mg_send_mime_file (struct mg_connection *conn, const char *path, const char *mime_type) |
void | mg_set_auth_handler (struct mg_context *ctx, const char *uri, mg_request_handler handler, void *cbdata) |
static void | mg_set_handler_type (struct mg_context *ctx, const char *uri, int handler_type, int is_delete_request, mg_request_handler handler, mg_websocket_connect_handler connect_handler, mg_websocket_ready_handler ready_handler, mg_websocket_data_handler data_handler, mg_websocket_close_handler close_handler, mg_authorization_handler auth_handler, void *cbdata) |
void | mg_set_request_handler (struct mg_context *ctx, const char *uri, mg_request_handler handler, void *cbdata) |
static void | mg_set_thread_name (const char *name) |
void | mg_set_user_connection_data (struct mg_connection *conn, void *data) |
void | mg_set_websocket_handler (struct mg_context *ctx, const char *uri, mg_websocket_connect_handler connect_handler, mg_websocket_ready_handler ready_handler, mg_websocket_data_handler data_handler, mg_websocket_close_handler close_handler, void *cbdata) |
static void | mg_snprintf (const struct mg_connection *conn, int *truncated, char *buf, size_t buflen, PRINTF_FORMAT_STRING(const char *fmt),...) PRINTF_ARGS(5 |
static void | mg_snprintf (const struct mg_connection *conn, int *truncated, char *buf, size_t buflen, const char *fmt,...) |
struct mg_context * | mg_start (const struct mg_callbacks *callbacks, void *user_data, const char **options) |
int | mg_start_thread (mg_thread_func_t func, void *param) |
static int | mg_start_thread_with_id (mg_thread_func_t func, void *param, pthread_t *threadidptr) |
static int | mg_stat (struct mg_connection *conn, const char *path, struct file *filep) |
mg_static_assert (sizeof(int)==4||sizeof(int)==8, "int data type size check") | |
mg_static_assert (sizeof(void *)==4||sizeof(void *)==8, "pointer data type size check") | |
mg_static_assert (sizeof(void *) >=sizeof(int), "data type size check") | |
mg_static_assert (MAX_WORKER_THREADS >=1, "worker threads must be a positive number") | |
mg_static_assert (MAX_REQUEST_SIZE >=256, "request size length must be a positive number") | |
mg_static_assert ((sizeof(config_options)/sizeof(config_options[0]))==(NUM_OPTIONS+1), "config_options and enum not sync") | |
void | mg_stop (struct mg_context *ctx) |
long long | mg_store_body (struct mg_connection *conn, const char *path) |
int | mg_strcasecmp (const char *s1, const char *s2) |
static const char * | mg_strcasestr (const char *big_str, const char *small_str) |
static char * | mg_strdup (const char *str) |
static void | mg_strlcpy (register char *dst, register const char *src, size_t n) |
int | mg_strncasecmp (const char *s1, const char *s2, size_t len) |
static char * | mg_strndup (const char *ptr, size_t len) |
void | mg_unlock_connection (struct mg_connection *conn) |
void | mg_unlock_context (struct mg_context *ctx) |
int | mg_url_decode (const char *src, int src_len, char *dst, int dst_len, int is_form_url_encoded) |
int | mg_url_encode (const char *src, char *dst, size_t dst_len) |
const char * | mg_version (void) |
static int | mg_vprintf (struct mg_connection *conn, const char *fmt, va_list ap) |
static void | mg_vsnprintf (const struct mg_connection *conn, int *truncated, char *buf, size_t buflen, const char *fmt, va_list ap) |
int | mg_write (struct mg_connection *conn, const void *buf, size_t len) |
static void | mkcol (struct mg_connection *conn, const char *path) |
static int | must_hide_file (struct mg_connection *conn, const char *path) |
static const char * | next_option (const char *list, struct vec *val, struct vec *eq_val) |
static void | open_auth_file (struct mg_connection *conn, const char *path, struct file *filep) |
static int | parse_auth_header (struct mg_connection *conn, char *buf, size_t buf_size, struct ah *ah) |
static time_t | parse_date_string (const char *datetime) |
static void | parse_http_headers (char **buf, struct mg_request_info *ri) |
static int | parse_http_message (char *buf, int len, struct mg_request_info *ri) |
static int | parse_net (const char *spec, uint32_t *net, uint32_t *mask) |
static int | parse_port_string (const struct vec *vec, struct socket *so) |
static int | parse_range_header (const char *header, int64_t *a, int64_t *b) |
static void | prepare_cgi_environment (struct mg_connection *conn, const char *prog, struct cgi_environment *env) |
static void | print_dav_dir_entry (struct de *de, void *data) |
static void | print_dir_entry (struct de *de) |
static void | print_props (struct mg_connection *conn, const char *uri, struct file *filep) |
static void | process_new_connection (struct mg_connection *conn) |
static void | produce_socket (struct mg_context *ctx, const struct socket *sp) |
static int | pull (FILE *fp, struct mg_connection *conn, char *buf, int len, double timeout) |
static int | pull_all (FILE *fp, struct mg_connection *conn, char *buf, int len) |
static int | push (struct mg_context *ctx, FILE *fp, SOCKET sock, SSL *ssl, const char *buf, int len, double timeout) |
static int64_t | push_all (struct mg_context *ctx, FILE *fp, SOCKET sock, SSL *ssl, const char *buf, int64_t len) |
static int | put_dir (struct mg_connection *conn, const char *path) |
static void | put_file (struct mg_connection *conn, const char *path) |
static int | read_auth_file (struct file *filep, struct read_auth_file_struct *workdata) |
static int | read_request (FILE *fp, struct mg_connection *conn, char *buf, int bufsiz, int *nread) |
static void * | realloc2 (void *ptr, size_t size) |
static void | redirect_to_https_port (struct mg_connection *conn, int ssl_index) |
static int | refresh_trust (struct mg_connection *conn) |
static void | remove_bad_file (const struct mg_connection *conn, const char *path) |
static int | remove_directory (struct mg_connection *conn, const char *dir) |
static void | remove_double_dots_and_double_slashes (char *s) |
static void | reset_per_request_attributes (struct mg_connection *conn) |
static int | scan_directory (struct mg_connection *conn, const char *dir, void *data, void(*cb)(struct de *, void *)) |
static void | send_authorization_request (struct mg_connection *conn) |
static void | send_file_data (struct mg_connection *conn, struct file *filep, int64_t offset, int64_t len) |
static void | send_http_error (struct mg_connection *, int, PRINTF_FORMAT_STRING(const char *fmt),...) |
static int | send_no_cache_header (struct mg_connection *conn) |
static void | send_options (struct mg_connection *conn) |
static void | send_ssi_file (struct mg_connection *, const char *, struct file *, int) |
static int | send_static_cache_header (struct mg_connection *conn) |
static int | set_acl_option (struct mg_context *ctx) |
static void | set_close_on_exec (SOCKET fd, struct mg_connection *conn) |
static int | set_gpass_option (struct mg_context *ctx) |
static int | set_non_blocking_mode (SOCKET sock) |
static int | set_ports_option (struct mg_context *ctx) |
static int | set_sock_timeout (SOCKET sock, int milliseconds) |
static int | set_ssl_option (struct mg_context *ctx) |
static int | set_tcp_nodelay (SOCKET sock, int nodelay_on) |
static int | set_throttle (const char *spec, uint32_t remote_ip, const char *uri) |
static int | set_uid_option (struct mg_context *ctx) |
static int | should_decode_url (const struct mg_connection *conn) |
static int | should_keep_alive (const struct mg_connection *conn) |
static char * | skip (char **buf, const char *delimiters) |
static char * | skip_quoted (char **buf, const char *delimiters, const char *whitespace, char quotechar) |
static void | sockaddr_to_string (char *buf, size_t len, const union usa *usa) |
static pid_t | spawn_process (struct mg_connection *conn, const char *prog, char *envblk, char *envp[], int fdin[2], int fdout[2], int fderr[2], const char *dir) |
static const char * | ssl_error (void) |
static long | ssl_get_protocol (int version_id) |
static unsigned long | ssl_id_callback (void) |
static void | ssl_locking_callback (int mode, int mutex_num, const char *file, int line) |
static int | ssl_use_pem_file (struct mg_context *ctx, const char *pem) |
static int | sslize (struct mg_connection *conn, SSL_CTX *s, int(*func)(SSL *)) |
static int | substitute_index_file (struct mg_connection *conn, char *path, size_t path_len, struct file *filep) |
static const char * | suggest_connection_header (const struct mg_connection *conn) |
static void | tls_dtor (void *key) |
static void | uninitialize_ssl (struct mg_context *ctx) |
static void * | worker_thread (void *thread_func_param) |
static void * | worker_thread_run (void *thread_func_param) |
Variables | |
struct { | |
unsigned default_port | |
const char * proto | |
size_t proto_len | |
} | abs_uri_protocols [] |
struct { | |
size_t ext_len | |
const char * extension | |
const char * mime_type | |
} | builtin_mime_types [] |
static struct mg_option | config_options [] |
static struct ssl_func | crypto_sw [] |
static void * | cryptolib_dll_handle |
static int | cryptolib_users = 0 |
static const char * | month_names [] |
static pthread_mutexattr_t | pthread_mutex_attr |
static pthread_mutex_t * | ssl_mutexes |
static struct ssl_func | ssl_sw [] |
static void * | ssllib_dll_handle |
char | static_assert_replacement [1] |
static int | sTlsInit = 0 |
static pthread_key_t | sTlsKey |
static int | thread_idx_max = 0 |
#define __STDC_FORMAT_MACROS /* <inttypes.h> wants this for C++ */ |
Definition at line 45 of file civetweb.c.
#define __STDC_LIMIT_MACROS /* C++ wants that for INT64_MAX */ |
Definition at line 48 of file civetweb.c.
#define _DARWIN_UNLIMITED_SELECT |
Definition at line 835 of file civetweb.c.
#define _FILE_OFFSET_BITS 64 /* Use 64-bit file offsets by default */ |
Definition at line 42 of file civetweb.c.
#define _LARGEFILE_SOURCE /* For fseeko(), ftello() */ |
Definition at line 39 of file civetweb.c.
#define ARRAY_SIZE | ( | array | ) | (sizeof(array) / sizeof(array[0])) |
Definition at line 569 of file civetweb.c.
#define calloc DO_NOT_USE_THIS_FUNCTION__USE_mg_calloc |
Definition at line 819 of file civetweb.c.
#define CGI_ENVIRONMENT_SIZE (4096) |
Definition at line 558 of file civetweb.c.
Definition at line 453 of file civetweb.c.
Definition at line 949 of file civetweb.c.
Definition at line 950 of file civetweb.c.
#define CRYPTO_LIB "libcrypto.so" |
Definition at line 447 of file civetweb.c.
Definition at line 939 of file civetweb.c.
Definition at line 942 of file civetweb.c.
#define CRYPTO_set_locking_callback (*(void (*)(void (*)(int, int, const char *, int)))crypto_sw[1].ptr) |
Definition at line 940 of file civetweb.c.
#define DEBUG_TRACE | ( | fmt, | |
... | |||
) |
Definition at line 602 of file civetweb.c.
Definition at line 948 of file civetweb.c.
#define ERR_error_string (*(char *(*)(unsigned long, char *))crypto_sw[4].ptr) |
Definition at line 945 of file civetweb.c.
Definition at line 947 of file civetweb.c.
Definition at line 944 of file civetweb.c.
Definition at line 946 of file civetweb.c.
#define ERRNO (errno) |
Definition at line 460 of file civetweb.c.
Definition at line 951 of file civetweb.c.
#define free DO_NOT_USE_THIS_FUNCTION__USE_mg_free |
Definition at line 821 of file civetweb.c.
Definition at line 119 of file civetweb.c.
#define INT64_FMT PRId64 |
Definition at line 462 of file civetweb.c.
#define INVALID_SOCKET (-1) |
Definition at line 461 of file civetweb.c.
#define IP_ADDR_STR_LEN (50) /* IPv6 hex string is 46 chars */ |
Definition at line 837 of file civetweb.c.
#define is_websocket_protocol | ( | conn | ) | (0) |
Definition at line 1355 of file civetweb.c.
#define malloc DO_NOT_USE_THIS_FUNCTION__USE_mg_malloc |
Definition at line 818 of file civetweb.c.
#define MAX_CGI_ENVIR_VARS (256) |
Definition at line 559 of file civetweb.c.
#define MAX_REQUEST_SIZE (16384) |
Definition at line 563 of file civetweb.c.
#define MAX_WORKER_THREADS (1024 * 64) |
Definition at line 205 of file civetweb.c.
#define MD5_STATIC static |
Definition at line 828 of file civetweb.c.
#define MG_BUF_LEN (8192) |
Definition at line 560 of file civetweb.c.
Definition at line 458 of file civetweb.c.
#define mg_mkdir | ( | conn, | |
path, | |||
mode | |||
) | (mkdir(path, mode)) |
Definition at line 454 of file civetweb.c.
Definition at line 457 of file civetweb.c.
Definition at line 459 of file civetweb.c.
Definition at line 455 of file civetweb.c.
Definition at line 456 of file civetweb.c.
#define mg_static_assert | ( | cond, | |
txt | |||
) | extern char static_assert_replacement[(cond) ? 1 : -1] |
Definition at line 89 of file civetweb.c.
#define MGSQLEN (20) |
Definition at line 849 of file civetweb.c.
#define MSG_NOSIGNAL (0) |
Definition at line 840 of file civetweb.c.
#define O_BINARY (0) |
Definition at line 451 of file civetweb.c.
#define PASSWORDS_FILE_NAME ".htpasswd" |
Definition at line 557 of file civetweb.c.
#define QUEUE_SIZE | ( | ctx | ) | ((int)(ARRAY_SIZE(ctx->queue))) |
#define QUEUE_SIZE | ( | ctx | ) | ((int)(ARRAY_SIZE(ctx->queue))) |
#define realloc DO_NOT_USE_THIS_FUNCTION__USE_mg_realloc |
Definition at line 820 of file civetweb.c.
#define snprintf DO_NOT_USE_THIS_FUNCTION__USE_mg_snprintf |
Definition at line 822 of file civetweb.c.
#define SOCKET_TIMEOUT_QUANTUM (10000) |
Definition at line 208 of file civetweb.c.
#define SOMAXCONN (100) |
Definition at line 844 of file civetweb.c.
Definition at line 890 of file civetweb.c.
#define SSL_CIPHER_get_name (*(const char *(*)(const SSL_CIPHER *))ssl_sw[27].ptr) |
Definition at line 924 of file civetweb.c.
Definition at line 891 of file civetweb.c.
#define SSL_CTRL_CLEAR_OPTIONS (77) |
Definition at line 869 of file civetweb.c.
#define SSL_CTRL_OPTIONS (32) |
Definition at line 868 of file civetweb.c.
#define SSL_CTRL_SET_ECDH_AUTO (94) |
Definition at line 870 of file civetweb.c.
Definition at line 926 of file civetweb.c.
#define SSL_CTX_clear_options | ( | ctx, | |
op | |||
) | SSL_CTX_ctrl((ctx), SSL_CTRL_CLEAR_OPTIONS, (op), NULL) |
Definition at line 934 of file civetweb.c.
Definition at line 929 of file civetweb.c.
Definition at line 906 of file civetweb.c.
#define SSL_CTX_load_verify_locations (*(int (*)(SSL_CTX *, const char *, const char *))ssl_sw[21].ptr) |
Definition at line 917 of file civetweb.c.
#define SSL_CTX_new (*(SSL_CTX * (*)(SSL_METHOD *))ssl_sw[8].ptr) |
Definition at line 897 of file civetweb.c.
Definition at line 930 of file civetweb.c.
Definition at line 904 of file civetweb.c.
Definition at line 919 of file civetweb.c.
#define SSL_CTX_set_ecdh_auto | ( | ctx, | |
onoff | |||
) | SSL_CTX_ctrl(ctx, SSL_CTRL_SET_ECDH_AUTO, onoff, NULL) |
Definition at line 936 of file civetweb.c.
#define SSL_CTX_set_options | ( | ctx, | |
op | |||
) | SSL_CTX_ctrl((ctx), SSL_CTRL_OPTIONS, (op), NULL) |
Definition at line 932 of file civetweb.c.
#define SSL_CTX_set_session_id_context (*(int (*)(SSL_CTX *, const unsigned char *, unsigned int))ssl_sw[29].ptr) |
Definition at line 927 of file civetweb.c.
#define SSL_CTX_set_verify |
Definition at line 912 of file civetweb.c.
Definition at line 920 of file civetweb.c.
Definition at line 908 of file civetweb.c.
Definition at line 902 of file civetweb.c.
Definition at line 900 of file civetweb.c.
Definition at line 889 of file civetweb.c.
Definition at line 923 of file civetweb.c.
Definition at line 894 of file civetweb.c.
Definition at line 921 of file civetweb.c.
Definition at line 922 of file civetweb.c.
#define SSL_LIB "libssl.so" |
Definition at line 444 of file civetweb.c.
Definition at line 899 of file civetweb.c.
Definition at line 907 of file civetweb.c.
Definition at line 896 of file civetweb.c.
#define SSL_OP_ALL ((long)(0x80000BFFUL)) |
Definition at line 876 of file civetweb.c.
#define SSL_OP_NO_SSLv2 (0x01000000L) |
Definition at line 877 of file civetweb.c.
#define SSL_OP_NO_SSLv3 (0x02000000L) |
Definition at line 878 of file civetweb.c.
#define SSL_OP_NO_TLSv1 (0x04000000L) |
Definition at line 879 of file civetweb.c.
#define SSL_OP_NO_TLSv1_1 (0x10000000L) |
Definition at line 881 of file civetweb.c.
#define SSL_OP_NO_TLSv1_2 (0x08000000L) |
Definition at line 880 of file civetweb.c.
#define SSL_OP_SINGLE_DH_USE (0x00100000L) |
Definition at line 882 of file civetweb.c.
Definition at line 911 of file civetweb.c.
Definition at line 892 of file civetweb.c.
Definition at line 895 of file civetweb.c.
Definition at line 916 of file civetweb.c.
#define SSL_VERIFY_CLIENT_ONCE (4) |
Definition at line 875 of file civetweb.c.
#define SSL_VERIFY_FAIL_IF_NO_PEER_CERT (2) |
Definition at line 874 of file civetweb.c.
#define SSL_VERIFY_NONE (0) |
Definition at line 872 of file civetweb.c.
#define SSL_VERIFY_PEER (1) |
Definition at line 873 of file civetweb.c.
Definition at line 893 of file civetweb.c.
#define SSLv23_client_method (*(SSL_METHOD * (*)(void))ssl_sw[17].ptr) |
Definition at line 910 of file civetweb.c.
#define SSLv23_server_method (*(SSL_METHOD * (*)(void))ssl_sw[9].ptr) |
Definition at line 898 of file civetweb.c.
#define STRUCT_FILE_INITIALIZER |
Definition at line 1053 of file civetweb.c.
#define UINT64_FMT PRIu64 |
Definition at line 463 of file civetweb.c.
#define vsnprintf_impl vsnprintf |
Definition at line 433 of file civetweb.c.
#define WIN32_LEAN_AND_MEAN |
Definition at line 103 of file civetweb.c.
#define WINCDECL |
Definition at line 465 of file civetweb.c.
typedef const void* SOCK_OPT_TYPE |
Definition at line 423 of file civetweb.c.
typedef int SOCKET |
Definition at line 464 of file civetweb.c.
typedef struct ssl_st SSL |
Definition at line 863 of file civetweb.c.
typedef struct ssl_ctx_st SSL_CTX |
Definition at line 865 of file civetweb.c.
typedef struct ssl_method_st SSL_METHOD |
Definition at line 864 of file civetweb.c.
typedef struct x509_store_ctx_st X509_STORE_CTX |
Definition at line 866 of file civetweb.c.
anonymous enum |
Definition at line 1070 of file civetweb.c.
anonymous enum |
Enumerator | |
---|---|
REQUEST_HANDLER | |
WEBSOCKET_HANDLER | |
AUTH_HANDLER |
Definition at line 1213 of file civetweb.c.
|
static |
Definition at line 12503 of file civetweb.c.
|
static |
Definition at line 7205 of file civetweb.c.
|
static |
Definition at line 4326 of file civetweb.c.
|
static |
Definition at line 4294 of file civetweb.c.
|
static |
Definition at line 5556 of file civetweb.c.
|
static |
Definition at line 5160 of file civetweb.c.
|
static |
Definition at line 10616 of file civetweb.c.
|
static |
Definition at line 5579 of file civetweb.c.
|
static |
Definition at line 5197 of file civetweb.c.
|
static |
Definition at line 10234 of file civetweb.c.
|
static |
Definition at line 11413 of file civetweb.c.
|
static |
Definition at line 11360 of file civetweb.c.
Definition at line 6076 of file civetweb.c.
|
static |
Definition at line 5839 of file civetweb.c.
|
static |
Definition at line 6491 of file civetweb.c.
|
static |
Definition at line 12314 of file civetweb.c.
|
static |
Definition at line 7935 of file civetweb.c.
Definition at line 6273 of file civetweb.c.
|
static |
Definition at line 4032 of file civetweb.c.
|
static |
Definition at line 8088 of file civetweb.c.
|
static |
Definition at line 8002 of file civetweb.c.
|
static |
Definition at line 1956 of file civetweb.c.
|
static |
Definition at line 6506 of file civetweb.c.
|
static |
Definition at line 7082 of file civetweb.c.
|
static |
Definition at line 12721 of file civetweb.c.
|
static |
Definition at line 9362 of file civetweb.c.
|
static |
Definition at line 2047 of file civetweb.c.
|
static |
Definition at line 5128 of file civetweb.c.
|
static |
Definition at line 4907 of file civetweb.c.
|
static |
Definition at line 1720 of file civetweb.c.
|
static |
Definition at line 3720 of file civetweb.c.
|
static |
Definition at line 11721 of file civetweb.c.
|
static |
Definition at line 9250 of file civetweb.c.
|
static |
Definition at line 9632 of file civetweb.c.
|
static |
Definition at line 4881 of file civetweb.c.
|
static |
Definition at line 12832 of file civetweb.c.
|
static |
Definition at line 11669 of file civetweb.c.
|
static |
Definition at line 11801 of file civetweb.c.
|
static |
Definition at line 1869 of file civetweb.c.
|
static |
Definition at line 7437 of file civetweb.c.
|
static |
Definition at line 6296 of file civetweb.c.
|
static |
Definition at line 10177 of file civetweb.c.
|
static |
Definition at line 8338 of file civetweb.c.
|
static |
Definition at line 9773 of file civetweb.c.
|
static |
Definition at line 8201 of file civetweb.c.
|
static |
Definition at line 6524 of file civetweb.c.
|
static |
Definition at line 2135 of file civetweb.c.
|
static |
Definition at line 10524 of file civetweb.c.
|
static |
Definition at line 10968 of file civetweb.c.
|
static |
Definition at line 4669 of file civetweb.c.
|
static |
Definition at line 5664 of file civetweb.c.
|
static |
Definition at line 1489 of file civetweb.c.
|
static |
Definition at line 1512 of file civetweb.c.
|
static |
Definition at line 7065 of file civetweb.c.
|
static |
Definition at line 4657 of file civetweb.c.
|
static |
Definition at line 6875 of file civetweb.c.
|
static |
Definition at line 5795 of file civetweb.c.
|
static |
Definition at line 9191 of file civetweb.c.
|
static |
Definition at line 10913 of file civetweb.c.
|
static |
Definition at line 10537 of file civetweb.c.
|
static |
Definition at line 1584 of file civetweb.c.
Definition at line 12712 of file civetweb.c.
Definition at line 12594 of file civetweb.c.
|
static |
Definition at line 2153 of file civetweb.c.
|
static |
Definition at line 1379 of file civetweb.c.
|
static |
Definition at line 1360 of file civetweb.c.
|
static |
Definition at line 764 of file civetweb.c.
unsigned mg_check_feature | ( | unsigned | feature | ) |
Definition at line 13099 of file civetweb.c.
void mg_close_connection | ( | struct mg_connection * | conn | ) |
Definition at line 11458 of file civetweb.c.
struct mg_connection* mg_connect_client | ( | const char * | host, |
int | port, | ||
int | use_ssl, | ||
char * | error_buffer, | ||
size_t | error_buffer_size | ||
) |
Definition at line 11634 of file civetweb.c.
|
static |
Definition at line 11495 of file civetweb.c.
CIVETWEB_API struct mg_connection* mg_connect_client_secure | ( | const struct mg_client_options * | client_options, |
char * | error_buffer, | ||
size_t | error_buffer_size | ||
) |
Definition at line 11622 of file civetweb.c.
struct mg_connection* mg_connect_websocket_client | ( | const char * | host, |
int | port, | ||
int | use_ssl, | ||
char * | error_buffer, | ||
size_t | error_buffer_size, | ||
const char * | path, | ||
const char * | origin, | ||
mg_websocket_data_handler | data_func, | ||
mg_websocket_close_handler | close_func, | ||
void * | user_data | ||
) |
Definition at line 12058 of file civetweb.c.
void mg_cry | ( | const struct mg_connection * | conn, |
const char * | fmt, | ||
... | |||
) |
Definition at line 1894 of file civetweb.c.
|
static |
Definition at line 1885 of file civetweb.c.
struct mg_connection* mg_download | ( | const char * | host, |
int | port, | ||
int | use_ssl, | ||
char * | ebuf, | ||
size_t | ebuf_len, | ||
const char * | fmt, | ||
... | |||
) |
Definition at line 11961 of file civetweb.c.
|
static |
Definition at line 1565 of file civetweb.c.
|
static |
Definition at line 8109 of file civetweb.c.
|
static |
Definition at line 5416 of file civetweb.c.
|
static |
Definition at line 1528 of file civetweb.c.
Definition at line 776 of file civetweb.c.
const char* mg_get_builtin_mime_type | ( | const char * | path | ) |
Definition at line 5106 of file civetweb.c.
struct mg_context* mg_get_context | ( | const struct mg_connection * | conn | ) |
Definition at line 1748 of file civetweb.c.
int mg_get_cookie | ( | const char * | cookie_header, |
const char * | var_name, | ||
char * | dst, | ||
size_t | dst_size | ||
) |
Definition at line 4513 of file civetweb.c.
const char* mg_get_header | ( | const struct mg_connection * | conn, |
const char * | name | ||
) |
Definition at line 2063 of file civetweb.c.
const char* mg_get_option | ( | const struct mg_context * | ctx, |
const char * | name | ||
) |
Definition at line 1734 of file civetweb.c.
size_t mg_get_ports | ( | const struct mg_context * | ctx, |
size_t | size, | ||
int * | ports, | ||
int * | ssl | ||
) |
Definition at line 1781 of file civetweb.c.
const struct mg_request_info* mg_get_request_info | ( | const struct mg_connection * | conn | ) |
Definition at line 1972 of file civetweb.c.
int mg_get_response | ( | struct mg_connection * | conn, |
char * | ebuf, | ||
size_t | ebuf_len, | ||
int | timeout | ||
) |
Definition at line 11924 of file civetweb.c.
const char* mg_get_response_code_text | ( | struct mg_connection * | conn, |
int | response_code | ||
) |
Definition at line 2286 of file civetweb.c.
int mg_get_server_ports | ( | const struct mg_context * | ctx, |
int | size, | ||
struct mg_server_ports * | ports | ||
) |
Definition at line 1796 of file civetweb.c.
void* mg_get_user_connection_data | ( | const struct mg_connection * | conn | ) |
Definition at line 1771 of file civetweb.c.
void* mg_get_user_data | ( | const struct mg_context * | ctx | ) |
Definition at line 1755 of file civetweb.c.
Definition at line 1482 of file civetweb.c.
int mg_get_var | ( | const char * | data, |
size_t | data_len, | ||
const char * | name, | ||
char * | dst, | ||
size_t | dst_len | ||
) |
Definition at line 4445 of file civetweb.c.
int mg_get_var2 | ( | const char * | data, |
size_t | data_len, | ||
const char * | name, | ||
char * | dst, | ||
size_t | dst_len, | ||
size_t | occurrence | ||
) |
Definition at line 4456 of file civetweb.c.
|
static |
Definition at line 4131 of file civetweb.c.
|
static |
Definition at line 5802 of file civetweb.c.
|
static |
Definition at line 3601 of file civetweb.c.
void mg_lock_connection | ( | struct mg_connection * | conn | ) |
Definition at line 8384 of file civetweb.c.
void mg_lock_context | ( | struct mg_context * | ctx | ) |
Definition at line 8400 of file civetweb.c.
|
static |
Definition at line 758 of file civetweb.c.
char* mg_md5 | ( | char | buf[33], |
... | |||
) |
Definition at line 5174 of file civetweb.c.
int mg_modify_passwords_file | ( | const char * | fname, |
const char * | domain, | ||
const char * | user, | ||
const char * | pass | ||
) |
Definition at line 5684 of file civetweb.c.
int mg_printf | ( | struct mg_connection * | conn, |
const char * | fmt, | ||
... | |||
) |
Definition at line 4400 of file civetweb.c.
int mg_read | ( | struct mg_connection * | conn, |
void * | buf, | ||
size_t | len | ||
) |
Definition at line 4146 of file civetweb.c.
|
static |
Definition at line 4072 of file civetweb.c.
Definition at line 770 of file civetweb.c.
void mg_send_file | ( | struct mg_connection * | conn, |
const char * | path | ||
) |
Definition at line 6674 of file civetweb.c.
void mg_send_mime_file | ( | struct mg_connection * | conn, |
const char * | path, | ||
const char * | mime_type | ||
) |
Definition at line 6681 of file civetweb.c.
void mg_set_auth_handler | ( | struct mg_context * | ctx, |
const char * | uri, | ||
mg_request_handler | handler, | ||
void * | cbdata | ||
) |
Definition at line 9612 of file civetweb.c.
|
static |
Definition at line 9418 of file civetweb.c.
void mg_set_request_handler | ( | struct mg_context * | ctx, |
const char * | uri, | ||
mg_request_handler | handler, | ||
void * | cbdata | ||
) |
Definition at line 9566 of file civetweb.c.
|
static |
Definition at line 1416 of file civetweb.c.
Definition at line 1762 of file civetweb.c.
void mg_set_websocket_handler | ( | struct mg_context * | ctx, |
const char * | uri, | ||
mg_websocket_connect_handler | connect_handler, | ||
mg_websocket_ready_handler | ready_handler, | ||
mg_websocket_data_handler | data_handler, | ||
mg_websocket_close_handler | close_handler, | ||
void * | cbdata | ||
) |
Definition at line 9586 of file civetweb.c.
|
static |
|
static |
Definition at line 1704 of file civetweb.c.
struct mg_context* mg_start | ( | const struct mg_callbacks * | callbacks, |
void * | user_data, | ||
const char ** | options | ||
) |
Definition at line 12875 of file civetweb.c.
int mg_start_thread | ( | mg_thread_func_t | func, |
void * | param | ||
) |
Definition at line 3550 of file civetweb.c.
|
static |
Definition at line 3574 of file civetweb.c.
|
static |
Definition at line 3512 of file civetweb.c.
mg_static_assert | ( | sizeof(int) | = =4||sizeof(int)==8 , |
"int data type size check" | |||
) |
mg_static_assert | ( | MAX_WORKER_THREADS >= | 1, |
"worker threads must be a positive number" | |||
) |
mg_static_assert | ( | MAX_REQUEST_SIZE >= | 256, |
"request size length must be a positive number" | |||
) |
mg_static_assert | ( | (sizeof(config_options)/sizeof(config_options[0])) | = =(NUM_OPTIONS+1) , |
"config_options and enum not sync" | |||
) |
void mg_stop | ( | struct mg_context * | ctx | ) |
Definition at line 12800 of file civetweb.c.
long long mg_store_body | ( | struct mg_connection * | conn, |
const char * | path | ||
) |
Definition at line 6763 of file civetweb.c.
int mg_strcasecmp | ( | const char * | s1, |
const char * | s2 | ||
) |
Definition at line 1606 of file civetweb.c.
|
static |
Definition at line 1639 of file civetweb.c.
|
static |
Definition at line 1632 of file civetweb.c.
|
static |
Definition at line 1574 of file civetweb.c.
int mg_strncasecmp | ( | const char * | s1, |
const char * | s2, | ||
size_t | len | ||
) |
Definition at line 1591 of file civetweb.c.
|
static |
Definition at line 1619 of file civetweb.c.
void mg_unlock_connection | ( | struct mg_connection * | conn | ) |
Definition at line 8392 of file civetweb.c.
void mg_unlock_context | ( | struct mg_context * | ctx | ) |
Definition at line 8408 of file civetweb.c.
int mg_url_decode | ( | const char * | src, |
int | src_len, | ||
char * | dst, | ||
int | dst_len, | ||
int | is_form_url_encoded | ||
) |
Definition at line 4414 of file civetweb.c.
int mg_url_encode | ( | const char * | src, |
char * | dst, | ||
size_t | dst_len | ||
) |
Definition at line 5973 of file civetweb.c.
const char* mg_version | ( | void | ) |
Definition at line 1965 of file civetweb.c.
|
static |
Definition at line 4382 of file civetweb.c.
|
static |
Definition at line 1658 of file civetweb.c.
int mg_write | ( | struct mg_connection * | conn, |
const void * | buf, | ||
size_t | len | ||
) |
Definition at line 4235 of file civetweb.c.
|
static |
Definition at line 7725 of file civetweb.c.
|
static |
Definition at line 6112 of file civetweb.c.
|
static |
Definition at line 2080 of file civetweb.c.
|
static |
Definition at line 5242 of file civetweb.c.
|
static |
Definition at line 5308 of file civetweb.c.
|
static |
Definition at line 4923 of file civetweb.c.
|
static |
Definition at line 6815 of file civetweb.c.
|
static |
Definition at line 6907 of file civetweb.c.
|
static |
Definition at line 9198 of file civetweb.c.
|
static |
Definition at line 10258 of file civetweb.c.
|
static |
Definition at line 6484 of file civetweb.c.
|
static |
Definition at line 7273 of file civetweb.c.
Definition at line 8312 of file civetweb.c.
|
static |
Definition at line 6000 of file civetweb.c.
|
static |
Definition at line 8282 of file civetweb.c.
|
static |
Definition at line 12177 of file civetweb.c.
|
static |
Definition at line 12475 of file civetweb.c.
|
static |
Definition at line 3897 of file civetweb.c.
|
static |
Definition at line 4002 of file civetweb.c.
|
static |
Definition at line 3754 of file civetweb.c.
|
static |
Definition at line 3857 of file civetweb.c.
|
static |
Definition at line 6716 of file civetweb.c.
|
static |
Definition at line 7794 of file civetweb.c.
|
static |
Definition at line 5459 of file civetweb.c.
|
static |
Definition at line 6957 of file civetweb.c.
Definition at line 6262 of file civetweb.c.
|
static |
Definition at line 9376 of file civetweb.c.
|
static |
Definition at line 10765 of file civetweb.c.
|
static |
Definition at line 6753 of file civetweb.c.
|
static |
Definition at line 6182 of file civetweb.c.
|
static |
Definition at line 4981 of file civetweb.c.
|
static |
Definition at line 11276 of file civetweb.c.
|
static |
Definition at line 6126 of file civetweb.c.
|
static |
Definition at line 5627 of file civetweb.c.
|
static |
Definition at line 6379 of file civetweb.c.
|
static |
Definition at line 2479 of file civetweb.c.
|
static |
Definition at line 2236 of file civetweb.c.
|
static |
Definition at line 8254 of file civetweb.c.
|
static |
Definition at line 8126 of file civetweb.c.
|
static |
Definition at line 2248 of file civetweb.c.
|
static |
Definition at line 11269 of file civetweb.c.
Definition at line 3536 of file civetweb.c.
|
static |
Definition at line 11253 of file civetweb.c.
|
static |
Definition at line 3705 of file civetweb.c.
|
static |
Definition at line 10312 of file civetweb.c.
|
static |
Definition at line 11302 of file civetweb.c.
|
static |
Definition at line 11073 of file civetweb.c.
|
static |
Definition at line 11344 of file civetweb.c.
|
static |
Definition at line 9217 of file civetweb.c.
|
static |
Definition at line 10651 of file civetweb.c.
|
static |
Definition at line 2218 of file civetweb.c.
|
static |
Definition at line 2199 of file civetweb.c.
|
static |
Definition at line 2039 of file civetweb.c.
|
static |
Definition at line 1986 of file civetweb.c.
|
static |
Definition at line 1835 of file civetweb.c.
|
static |
Definition at line 3612 of file civetweb.c.
|
static |
Definition at line 10888 of file civetweb.c.
|
static |
Definition at line 11056 of file civetweb.c.
|
static |
Definition at line 10712 of file civetweb.c.
|
static |
Definition at line 10897 of file civetweb.c.
|
static |
Definition at line 11014 of file civetweb.c.
Definition at line 10831 of file civetweb.c.
|
static |
Definition at line 7010 of file civetweb.c.
|
static |
Definition at line 2229 of file civetweb.c.
Definition at line 10693 of file civetweb.c.
|
static |
Definition at line 11222 of file civetweb.c.
Definition at line 12465 of file civetweb.c.
Definition at line 12353 of file civetweb.c.
const { ... } abs_uri_protocols[] |
const { ... } builtin_mime_types[] |
|
static |
Definition at line 1136 of file civetweb.c.
|
static |
Definition at line 996 of file civetweb.c.
|
static |
Definition at line 10955 of file civetweb.c.
|
static |
Definition at line 10963 of file civetweb.c.
unsigned default_port |
Definition at line 11654 of file civetweb.c.
size_t ext_len |
Definition at line 5006 of file civetweb.c.
const char* extension |
Definition at line 5005 of file civetweb.c.
const char* mime_type |
Definition at line 5007 of file civetweb.c.
|
static |
Definition at line 1013 of file civetweb.c.
const char* proto |
Definition at line 11652 of file civetweb.c.
size_t proto_len |
Definition at line 11653 of file civetweb.c.
|
static |
Definition at line 553 of file civetweb.c.
|
static |
Definition at line 10827 of file civetweb.c.
|
static |
Definition at line 958 of file civetweb.c.
|
static |
Definition at line 10954 of file civetweb.c.
char static_assert_replacement[1] |
Definition at line 88 of file civetweb.c.
|
static |
Definition at line 1332 of file civetweb.c.
|
static |
Definition at line 1331 of file civetweb.c.
|
static |
Definition at line 1333 of file civetweb.c.