RetroArch
Classes | Macros | Typedefs | Enumerations | Functions | Variables
civetweb.c File Reference
#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 "civetweb.h"
#include <rhash.h>
#include "handle_form.inl"
Include dependency graph for civetweb.c:

Classes

struct  ssl_func
 
union  usa
 
struct  vec
 
struct  file
 
struct  socket
 
struct  mg_handler_info
 
struct  mg_context
 
struct  mg_connection
 
struct  mg_workerTLS
 
struct  de
 
struct  ah
 
struct  read_auth_file_struct
 
struct  dir_scan_data
 
struct  mg_upload_user_data
 
struct  websocket_client_thread_data
 

Macros

#define _LARGEFILE_SOURCE   /* For fseeko(), ftello() */
 
#define _FILE_OFFSET_BITS   64 /* Use 64-bit file offsets by default */
 
#define __STDC_FORMAT_MACROS   /* <inttypes.h> wants this for C++ */
 
#define __STDC_LIMIT_MACROS   /* C++ wants that for INT64_MAX */
 
#define mg_static_assert(cond, txt)   extern char static_assert_replacement[(cond) ? 1 : -1]
 
#define WIN32_LEAN_AND_MEAN
 
#define IGNORE_UNUSED_RESULT(a)   ((void)((a) && 1))
 
#define MAX_WORKER_THREADS   (1024 * 64)
 
#define SOCKET_TIMEOUT_QUANTUM   (10000)
 
#define vsnprintf_impl   vsnprintf
 
#define SSL_LIB   "libssl.so"
 
#define CRYPTO_LIB   "libcrypto.so"
 
#define O_BINARY   (0)
 
#define closesocket(a)   (close(a))
 
#define mg_mkdir(x, y)   (mkdir(x, y))
 
#define mg_remove(x)   (remove(x))
 
#define mg_sleep(x)   (usleep((x)*1000))
 
#define ERRNO   (errno)
 
#define INVALID_SOCKET   (-1)
 
#define INT64_FMT   PRId64
 
#define UINT64_FMT   PRIu64
 
#define WINCDECL
 
#define va_copy(x, y)   ((x) = (y))
 
#define PASSWORDS_FILE_NAME   ".htpasswd"
 
#define CGI_ENVIRONMENT_SIZE   (4096)
 
#define MAX_CGI_ENVIR_VARS   (256)
 
#define MG_BUF_LEN   (8192)
 
#define MAX_REQUEST_SIZE   (16384)
 
#define ARRAY_SIZE(array)   (sizeof(array) / sizeof(array[0]))
 
#define DEBUG_TRACE(fmt, ...)
 
#define _DARWIN_UNLIMITED_SELECT
 
#define IP_ADDR_STR_LEN   (50) /* IPv6 hex string is 46 chars */
 
#define MSG_NOSIGNAL   (0)
 
#define SOMAXCONN   (100)
 
#define MGSQLEN   (20)
 
#define SSL_CTRL_OPTIONS   (32)
 
#define SSL_CTRL_CLEAR_OPTIONS   (77)
 
#define SSL_CTRL_SET_ECDH_AUTO   (94)
 
#define SSL_VERIFY_NONE   (0)
 
#define SSL_VERIFY_PEER   (1)
 
#define SSL_VERIFY_FAIL_IF_NO_PEER_CERT   (2)
 
#define SSL_VERIFY_CLIENT_ONCE   (4)
 
#define SSL_OP_ALL   (0x80000BFFL)
 
#define SSL_OP_NO_SSLv2   (0x01000000L)
 
#define SSL_OP_NO_SSLv3   (0x02000000L)
 
#define SSL_OP_NO_TLSv1   (0x04000000L)
 
#define SSL_OP_NO_TLSv1_2   (0x08000000L)
 
#define SSL_OP_NO_TLSv1_1   (0x10000000L)
 
#define SSL_OP_SINGLE_DH_USE   (0x00100000L)
 
#define SSL_free   (*(void (*)(SSL *))ssl_sw[0].ptr)
 
#define SSL_accept   (*(int (*)(SSL *))ssl_sw[1].ptr)
 
#define SSL_connect   (*(int (*)(SSL *))ssl_sw[2].ptr)
 
#define SSL_read   (*(int (*)(SSL *, void *, int))ssl_sw[3].ptr)
 
#define SSL_write   (*(int (*)(SSL *, const void *, int))ssl_sw[4].ptr)
 
#define SSL_get_error   (*(int (*)(SSL *, int))ssl_sw[5].ptr)
 
#define SSL_set_fd   (*(int (*)(SSL *, SOCKET))ssl_sw[6].ptr)
 
#define SSL_new   (*(SSL * (*)(SSL_CTX *))ssl_sw[7].ptr)
 
#define SSL_CTX_new   (*(SSL_CTX * (*)(SSL_METHOD *))ssl_sw[8].ptr)
 
#define SSLv23_server_method   (*(SSL_METHOD * (*)(void))ssl_sw[9].ptr)
 
#define SSL_library_init   (*(int (*)(void))ssl_sw[10].ptr)
 
#define SSL_CTX_use_PrivateKey_file   (*(int (*)(SSL_CTX *, const char *, int))ssl_sw[11].ptr)
 
#define SSL_CTX_use_certificate_file   (*(int (*)(SSL_CTX *, const char *, int))ssl_sw[12].ptr)
 
#define SSL_CTX_set_default_passwd_cb   (*(void (*)(SSL_CTX *, mg_callback_t))ssl_sw[13].ptr)
 
#define SSL_CTX_free   (*(void (*)(SSL_CTX *))ssl_sw[14].ptr)
 
#define SSL_load_error_strings   (*(void (*)(void))ssl_sw[15].ptr)
 
#define SSL_CTX_use_certificate_chain_file   (*(int (*)(SSL_CTX *, const char *))ssl_sw[16].ptr)
 
#define SSLv23_client_method   (*(SSL_METHOD * (*)(void))ssl_sw[17].ptr)
 
#define SSL_pending   (*(int (*)(SSL *))ssl_sw[18].ptr)
 
#define SSL_CTX_set_verify
 
#define SSL_shutdown   (*(int (*)(SSL *))ssl_sw[20].ptr)
 
#define SSL_CTX_load_verify_locations   (*(int (*)(SSL_CTX *, const char *, const char *))ssl_sw[21].ptr)
 
#define SSL_CTX_set_default_verify_paths   (*(int (*)(SSL_CTX *))ssl_sw[22].ptr)
 
#define SSL_CTX_set_verify_depth   (*(void (*)(SSL_CTX *, int))ssl_sw[23].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_get_current_cipher   (*(SSL_CIPHER * (*)(SSL *))ssl_sw[26].ptr)
 
#define SSL_CIPHER_get_name   (*(const char *(*)(const SSL_CIPHER *))ssl_sw[27].ptr)
 
#define SSL_CTX_check_private_key   (*(int (*)(SSL_CTX *))ssl_sw[28].ptr)
 
#define SSL_CTX_set_session_id_context   (*(int (*)(SSL_CTX *, const unsigned char *, unsigned int))ssl_sw[29].ptr)
 
#define SSL_CTX_ctrl   (*(long (*)(SSL_CTX *, int, long, void *))ssl_sw[30].ptr)
 
#define SSL_CTX_set_cipher_list   (*(int (*)(SSL_CTX *, const char *))ssl_sw[31].ptr)
 
#define SSL_CTX_set_options(ctx, op)   SSL_CTX_ctrl((ctx), SSL_CTRL_OPTIONS, (op), NULL)
 
#define SSL_CTX_clear_options(ctx, op)   SSL_CTX_ctrl((ctx), SSL_CTRL_CLEAR_OPTIONS, (op), NULL)
 
#define SSL_CTX_set_ecdh_auto(ctx, onoff)   SSL_CTX_ctrl(ctx, SSL_CTRL_SET_ECDH_AUTO, onoff, NULL)
 
#define CRYPTO_num_locks   (*(int (*)(void))crypto_sw[0].ptr)
 
#define CRYPTO_set_locking_callback   (*(void (*)(void (*)(int, int, const char *, int)))crypto_sw[1].ptr)
 
#define CRYPTO_set_id_callback   (*(void (*)(unsigned long (*)(void)))crypto_sw[2].ptr)
 
#define ERR_get_error   (*(unsigned long (*)(void))crypto_sw[3].ptr)
 
#define ERR_error_string   (*(char *(*)(unsigned long, char *))crypto_sw[4].ptr)
 
#define ERR_remove_state   (*(void (*)(unsigned long))crypto_sw[5].ptr)
 
#define ERR_free_strings   (*(void (*)(void))crypto_sw[6].ptr)
 
#define ENGINE_cleanup   (*(void (*)(void))crypto_sw[7].ptr)
 
#define CONF_modules_unload   (*(void (*)(int))crypto_sw[8].ptr)
 
#define CRYPTO_cleanup_all_ex_data   (*(void (*)(void))crypto_sw[9].ptr)
 
#define EVP_cleanup   (*(void (*)(void))crypto_sw[10].ptr)
 
#define STRUCT_FILE_INITIALIZER
 
#define is_websocket_protocol(conn)   (0)
 
#define HEXTOI(x)   (isdigit(x) ? x - '0' : x - 'W')
 
#define QUEUE_SIZE(ctx)   ((int)(ARRAY_SIZE(ctx->queue)))
 
#define QUEUE_SIZE(ctx)   ((int)(ARRAY_SIZE(ctx->queue)))
 

Typedefs

typedef const voidSOCK_OPT_TYPE
 
typedef int SOCKET
 
typedef struct ssl_st SSL
 
typedef struct ssl_method_st SSL_METHOD
 
typedef struct ssl_ctx_st SSL_CTX
 
typedef struct x509_store_ctx_st X509_STORE_CTX
 

Enumerations

enum  {
  CGI_EXTENSIONS, CGI_ENVIRONMENT, PUT_DELETE_PASSWORDS_FILE, CGI_INTERPRETER,
  PROTECT_URI, AUTHENTICATION_DOMAIN, SSI_EXTENSIONS, THROTTLE,
  ACCESS_LOG_FILE, ENABLE_DIRECTORY_LISTING, ERROR_LOG_FILE, GLOBAL_PASSWORDS_FILE,
  INDEX_FILES, ENABLE_KEEP_ALIVE, ACCESS_CONTROL_LIST, EXTRA_MIME_TYPES,
  LISTENING_PORTS, DOCUMENT_ROOT, SSL_CERTIFICATE, NUM_THREADS,
  RUN_AS_USER, REWRITE, HIDE_FILES, REQUEST_TIMEOUT,
  SSL_DO_VERIFY_PEER, SSL_CA_PATH, SSL_CA_FILE, SSL_VERIFY_DEPTH,
  SSL_DEFAULT_VERIFY_PATHS, SSL_CIPHER_LIST, SSL_PROTOCOL_VERSION, DECODE_URL,
  ACCESS_CONTROL_ALLOW_ORIGIN, ERROR_PAGES, CONFIG_TCP_NODELAY, STATIC_FILE_MAX_AGE,
  NUM_OPTIONS
}
 
enum  { REQUEST_HANDLER, WEBSOCKET_HANDLER, AUTH_HANDLER }
 

Functions

 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")
 
static __inline voidmg_malloc (size_t a)
 
static __inline voidmg_calloc (size_t a, size_t b)
 
static __inline voidmg_realloc (void *a, size_t b)
 
static __inline void mg_free (void *a)
 
static void mg_vsnprintf (const struct mg_connection *conn, int *truncated, char *buf, size_t buflen, const char *fmt, va_list ap)
 
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
 
 mg_static_assert ((sizeof(config_options)/sizeof(config_options[0]))==(NUM_OPTIONS+1), "config_options and enum not sync")
 
static int mg_atomic_inc (volatile int *addr)
 
static int mg_atomic_dec (volatile int *addr)
 
static void mg_set_thread_name (const char *name)
 
const struct mg_optionmg_get_valid_options (void)
 
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 mg_fopen (const struct mg_connection *conn, const char *path, const char *mode, struct file *filep)
 
static void mg_fclose (struct file *filep)
 
static void mg_strlcpy (register char *dst, register const char *src, size_t n)
 
static int lowercase (const char *s)
 
int mg_strncasecmp (const char *s1, const char *s2, size_t len)
 
static int mg_strcasecmp (const char *s1, const char *s2)
 
static char * mg_strndup (const char *ptr, size_t len)
 
static char * mg_strdup (const char *str)
 
static const char * mg_strcasestr (const char *big_str, const char *small_str)
 
static void mg_snprintf (const struct mg_connection *conn, int *truncated, char *buf, size_t buflen, const char *fmt,...)
 
static int get_option_index (const char *name)
 
const char * mg_get_option (const struct mg_context *ctx, const char *name)
 
struct mg_contextmg_get_context (const struct mg_connection *conn)
 
voidmg_get_user_data (const struct mg_context *ctx)
 
void mg_set_user_connection_data (const struct mg_connection *conn, void *data)
 
voidmg_get_user_connection_data (const struct mg_connection *conn)
 
size_t mg_get_ports (const struct mg_context *ctx, size_t size, int *ports, int *ssl)
 
int mg_get_server_ports (const struct mg_context *ctx, int size, struct mg_server_ports *ports)
 
static void sockaddr_to_string (char *buf, size_t len, const union usa *usa)
 
static void gmt_time_string (char *buf, size_t buf_len, time_t *t)
 
static double mg_difftimespec (const struct timespec *ts_now, const struct timespec *ts_before)
 
void mg_cry (const struct mg_connection *conn, const char *fmt,...)
 
static struct mg_connectionfc (struct mg_context *ctx)
 
const char * mg_version (void)
 
const struct mg_request_infomg_get_request_info (const struct mg_connection *conn)
 
static char * skip_quoted (char **buf, const char *delimiters, const char *whitespace, char quotechar)
 
static char * skip (char **buf, const char *delimiters)
 
static const char * get_header (const struct mg_request_info *ri, const char *name)
 
const char * mg_get_header (const struct mg_connection *conn, const char *name)
 
static const char * next_option (const char *list, struct vec *val, struct vec *eq_val)
 
static int match_prefix (const char *pattern, size_t pattern_len, const char *str)
 
static int should_keep_alive (const struct mg_connection *conn)
 
static int should_decode_url (const struct mg_connection *conn)
 
static const char * suggest_connection_header (const struct mg_connection *conn)
 
static int send_no_cache_header (struct mg_connection *conn)
 
static int send_static_cache_header (struct mg_connection *conn)
 
static void handle_file_based_request (struct mg_connection *conn, const char *path, struct file *filep)
 
static int mg_stat (struct mg_connection *conn, const char *path, struct file *filep)
 
static const char * mg_get_response_code_text (int response_code, struct mg_connection *conn)
 
static void send_http_error (struct mg_connection *, int, PRINTF_FORMAT_STRING(const char *fmt),...)
 
static void set_close_on_exec (SOCKET fd, struct mg_connection *conn)
 
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_join_thread (pthread_t threadid)
 
static int set_non_blocking_mode (SOCKET sock)
 
static uint64_t get_random (void)
 
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 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 void discard_unread_request_data (struct mg_connection *conn)
 
static int mg_read_inner (struct mg_connection *conn, void *buf, size_t len)
 
static char mg_getc (struct mg_connection *conn)
 
int mg_read (struct mg_connection *conn, void *buf, size_t len)
 
int mg_write (struct mg_connection *conn, const void *buf, size_t len)
 
static int alloc_vprintf2 (char **buf, const char *fmt, va_list ap)
 
static int alloc_vprintf (char **out_buf, char *prealloc_buf, size_t prealloc_size, const char *fmt, va_list ap)
 
static int mg_vprintf (struct mg_connection *conn, const char *fmt, va_list ap)
 
int mg_printf (struct mg_connection *conn, const char *fmt,...)
 
int mg_url_decode (const char *src, int src_len, char *dst, int dst_len, int is_form_url_encoded)
 
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)
 
int mg_get_cookie (const char *cookie_header, const char *var_name, char *dst, size_t dst_size)
 
static int is_put_or_delete_method (const struct mg_connection *conn)
 
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 get_request_len (const char *buf, int buflen)
 
static int get_month_index (const char *s)
 
static time_t parse_date_string (const char *datetime)
 
static void remove_double_dots_and_double_slashes (char *s)
 
const char * mg_get_builtin_mime_type (const char *path)
 
static void get_mime_type (struct mg_context *ctx, const char *path, struct vec *vec)
 
static void bin2str (char *to, const unsigned char *p, size_t len)
 
char * mg_md5 (char buf[33],...)
 
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 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 char * mg_fgets (char *buf, size_t size, struct file *filep, char **p)
 
static int read_auth_file (struct file *filep, struct read_auth_file_struct *workdata)
 
static int authorize (struct mg_connection *conn, struct file *filep)
 
static int check_authorization (struct mg_connection *conn, const char *path)
 
static void send_authorization_request (struct mg_connection *conn)
 
int mg_modify_passwords_file (const char *fname, const char *domain, const char *user, const char *pass)
 
static int is_valid_port (unsigned long port)
 
static int mg_inet_pton (int af, const char *src, void *dst, size_t dstlen)
 
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)
 
int mg_url_encode (const char *src, char *dst, size_t dst_len)
 
static void print_dir_entry (struct de *de)
 
static int WINCDECL compare_dir_entries (const void *p1, const void *p2)
 
static int must_hide_file (struct mg_connection *conn, const char *path)
 
static int scan_directory (struct mg_connection *conn, const char *dir, void *data, void(*cb)(struct de *, void *))
 
static voidrealloc2 (void *ptr, size_t size)
 
static void dir_scan_callback (struct de *de, void *data)
 
static void handle_directory_request (struct mg_connection *conn, const char *dir)
 
static void send_file_data (struct mg_connection *conn, struct file *filep, int64_t offset, int64_t len)
 
static int parse_range_header (const char *header, int64_t *a, int64_t *b)
 
static void construct_etag (char *buf, size_t buf_len, const struct file *filep)
 
static void fclose_on_exec (struct file *filep, struct mg_connection *conn)
 
static void handle_static_file_request (struct mg_connection *conn, const char *path, struct file *filep, const char *mime_type)
 
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)
 
static int put_dir (struct mg_connection *conn, const char *path)
 
static void remove_bad_file (const struct mg_connection *conn, const char *path)
 
long long mg_store_body (struct mg_connection *conn, const char *path)
 
static void parse_http_headers (char **buf, struct mg_request_info *ri)
 
static int is_valid_http_method (const char *method)
 
static int parse_http_message (char *buf, int len, struct mg_request_info *ri)
 
static int read_request (FILE *fp, struct mg_connection *conn, char *buf, int bufsiz, int *nread)
 
static int is_not_modified (const struct mg_connection *conn, const struct file *filep)
 
static void send_ssi_file (struct mg_connection *, const char *, struct file *, int)
 
static void do_ssi_include (struct mg_connection *conn, const char *ssi, char *tag, int include_level)
 
static int mg_fgetc (struct file *filep, int offset)
 
static void handle_ssi_file_request (struct mg_connection *conn, const char *path, struct file *filep)
 
void mg_lock_connection (struct mg_connection *conn)
 
void mg_unlock_connection (struct mg_connection *conn)
 
void mg_lock_context (struct mg_context *ctx)
 
void mg_unlock_context (struct mg_context *ctx)
 
static int isbyte (int n)
 
static int parse_net (const char *spec, uint32_t *net, uint32_t *mask)
 
static int set_throttle (const char *spec, uint32_t remote_ip, const char *uri)
 
static uint32_t get_remote_ip (const struct mg_connection *conn)
 
static int mg_upload_field_found (const char *key, const char *filename, char *path, size_t pathlen, void *user_data)
 
static int mg_upload_field_get (const char *key, const char *value, size_t value_size, void *user_data)
 
static int mg_upload_field_stored (const char *path, size_t file_size, void *user_data)
 
int mg_upload (struct mg_connection *conn, const char *destination_dir)
 
static int get_first_ssl_listener_index (const struct mg_context *ctx)
 
static void redirect_to_https_port (struct mg_connection *conn, int ssl_index)
 
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)
 
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)
 
void mg_set_auth_handler (struct mg_context *ctx, const char *uri, mg_request_handler handler, void *cbdata)
 
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 void handle_request (struct mg_connection *conn)
 
static void close_all_listening_sockets (struct mg_context *ctx)
 
static int parse_port_string (const struct vec *vec, struct socket *so)
 
static int set_ports_option (struct mg_context *ctx)
 
static const char * header_val (const struct mg_connection *conn, const char *header)
 
static void log_access (const struct mg_connection *conn)
 
static int check_acl (struct mg_context *ctx, uint32_t remote_ip)
 
static int set_uid_option (struct mg_context *ctx)
 
static void tls_dtor (void *key)
 
static int set_gpass_option (struct mg_context *ctx)
 
static int set_acl_option (struct mg_context *ctx)
 
static void reset_per_request_attributes (struct mg_connection *conn)
 
static int set_sock_timeout (SOCKET sock, int milliseconds)
 
static int set_tcp_nodelay (SOCKET sock, int nodelay_on)
 
static void close_socket_gracefully (struct mg_connection *conn)
 
static void close_connection (struct mg_connection *conn)
 
void mg_close_connection (struct mg_connection *conn)
 
static struct mg_connectionmg_connect_client_impl (const struct mg_client_options *client_options, int use_ssl, char *ebuf, size_t ebuf_len)
 
CIVETWEB_API struct mg_connectionmg_connect_client_secure (const struct mg_client_options *client_options, char *error_buffer, size_t error_buffer_size)
 
struct mg_connectionmg_connect_client (const char *host, int port, int use_ssl, char *error_buffer, size_t error_buffer_size)
 
static int get_uri_type (const char *uri)
 
static const char * get_rel_url_at_current_server (const char *uri, const struct mg_connection *conn)
 
static int getreq (struct mg_connection *conn, char *ebuf, size_t ebuf_len, int *err)
 
int mg_get_response (struct mg_connection *conn, char *ebuf, size_t ebuf_len, int timeout)
 
struct mg_connectionmg_download (const char *host, int port, int use_ssl, char *ebuf, size_t ebuf_len, const char *fmt,...)
 
struct mg_connectionmg_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)
 
static void process_new_connection (struct mg_connection *conn)
 
static int consume_socket (struct mg_context *ctx, struct socket *sp)
 
static voidworker_thread_run (void *thread_func_param)
 
static voidmg_worker_thread (void *thread_func_param)
 
static void produce_socket (struct mg_context *ctx, const struct socket *sp)
 
static void accept_new_connection (const struct socket *listener, struct mg_context *ctx)
 
static void master_thread_run (void *thread_func_param)
 
static voidmaster_thread (void *thread_func_param)
 
static void free_context (struct mg_context *ctx)
 
void mg_stop (struct mg_context *ctx)
 
static void get_system_name (char **sysName)
 
struct mg_contextmg_start (const struct mg_callbacks *callbacks, void *user_data, const char **options)
 
unsigned mg_check_feature (unsigned feature)
 

Variables

char static_assert_replacement [1]
 
static pthread_mutexattr_t pthread_mutex_attr
 
static struct ssl_func ssl_sw []
 
static const char * month_names []
 
static struct mg_option config_options []
 
static pthread_key_t sTlsKey
 
static int sTlsInit = 0
 
static int thread_idx_max = 0
 
struct {
   const char *   extension
 
   size_t   ext_len
 
   const char *   mime_type
 
builtin_mime_types []
 
struct {
   const char *   proto
 
   size_t   proto_len
 
   unsigned   default_port
 
abs_uri_protocols []
 

Macro Definition Documentation

◆ __STDC_FORMAT_MACROS

#define __STDC_FORMAT_MACROS   /* <inttypes.h> wants this for C++ */

◆ __STDC_LIMIT_MACROS

#define __STDC_LIMIT_MACROS   /* C++ wants that for INT64_MAX */

◆ _DARWIN_UNLIMITED_SELECT

#define _DARWIN_UNLIMITED_SELECT

◆ _FILE_OFFSET_BITS

#define _FILE_OFFSET_BITS   64 /* Use 64-bit file offsets by default */

◆ _LARGEFILE_SOURCE

#define _LARGEFILE_SOURCE   /* For fseeko(), ftello() */

◆ ARRAY_SIZE

#define ARRAY_SIZE (   array)    (sizeof(array) / sizeof(array[0]))

◆ CGI_ENVIRONMENT_SIZE

#define CGI_ENVIRONMENT_SIZE   (4096)

◆ closesocket

#define closesocket (   a)    (close(a))

◆ CONF_modules_unload

#define CONF_modules_unload   (*(void (*)(int))crypto_sw[8].ptr)

◆ CRYPTO_cleanup_all_ex_data

#define CRYPTO_cleanup_all_ex_data   (*(void (*)(void))crypto_sw[9].ptr)

◆ CRYPTO_LIB

#define CRYPTO_LIB   "libcrypto.so"

◆ CRYPTO_num_locks

#define CRYPTO_num_locks   (*(int (*)(void))crypto_sw[0].ptr)

◆ CRYPTO_set_id_callback

#define CRYPTO_set_id_callback   (*(void (*)(unsigned long (*)(void)))crypto_sw[2].ptr)

◆ CRYPTO_set_locking_callback

#define CRYPTO_set_locking_callback   (*(void (*)(void (*)(int, int, const char *, int)))crypto_sw[1].ptr)

◆ DEBUG_TRACE

#define DEBUG_TRACE (   fmt,
  ... 
)
Value:
do { \
} while (0)

◆ ENGINE_cleanup

#define ENGINE_cleanup   (*(void (*)(void))crypto_sw[7].ptr)

◆ ERR_error_string

#define ERR_error_string   (*(char *(*)(unsigned long, char *))crypto_sw[4].ptr)

◆ ERR_free_strings

#define ERR_free_strings   (*(void (*)(void))crypto_sw[6].ptr)

◆ ERR_get_error

#define ERR_get_error   (*(unsigned long (*)(void))crypto_sw[3].ptr)

◆ ERR_remove_state

#define ERR_remove_state   (*(void (*)(unsigned long))crypto_sw[5].ptr)

◆ ERRNO

#define ERRNO   (errno)

◆ EVP_cleanup

#define EVP_cleanup   (*(void (*)(void))crypto_sw[10].ptr)

◆ HEXTOI

#define HEXTOI (   x)    (isdigit(x) ? x - '0' : x - 'W')

◆ IGNORE_UNUSED_RESULT

#define IGNORE_UNUSED_RESULT (   a)    ((void)((a) && 1))

◆ INT64_FMT

#define INT64_FMT   PRId64

◆ INVALID_SOCKET

#define INVALID_SOCKET   (-1)

◆ IP_ADDR_STR_LEN

#define IP_ADDR_STR_LEN   (50) /* IPv6 hex string is 46 chars */

◆ is_websocket_protocol

#define is_websocket_protocol (   conn)    (0)

◆ MAX_CGI_ENVIR_VARS

#define MAX_CGI_ENVIR_VARS   (256)

◆ MAX_REQUEST_SIZE

#define MAX_REQUEST_SIZE   (16384)

◆ MAX_WORKER_THREADS

#define MAX_WORKER_THREADS   (1024 * 64)

◆ MG_BUF_LEN

#define MG_BUF_LEN   (8192)

◆ mg_mkdir

#define mg_mkdir (   x,
  y 
)    (mkdir(x, y))

◆ mg_remove

#define mg_remove (   x)    (remove(x))

◆ mg_sleep

#define mg_sleep (   x)    (usleep((x)*1000))

◆ mg_static_assert

#define mg_static_assert (   cond,
  txt 
)    extern char static_assert_replacement[(cond) ? 1 : -1]

◆ MGSQLEN

#define MGSQLEN   (20)

◆ MSG_NOSIGNAL

#define MSG_NOSIGNAL   (0)

◆ O_BINARY

#define O_BINARY   (0)

◆ PASSWORDS_FILE_NAME

#define PASSWORDS_FILE_NAME   ".htpasswd"

◆ QUEUE_SIZE [1/2]

#define QUEUE_SIZE (   ctx)    ((int)(ARRAY_SIZE(ctx->queue)))

◆ QUEUE_SIZE [2/2]

#define QUEUE_SIZE (   ctx)    ((int)(ARRAY_SIZE(ctx->queue)))

◆ SOCKET_TIMEOUT_QUANTUM

#define SOCKET_TIMEOUT_QUANTUM   (10000)

◆ SOMAXCONN

#define SOMAXCONN   (100)

◆ SSL_accept

#define SSL_accept   (*(int (*)(SSL *))ssl_sw[1].ptr)

◆ SSL_CIPHER_get_name

#define SSL_CIPHER_get_name   (*(const char *(*)(const SSL_CIPHER *))ssl_sw[27].ptr)

◆ SSL_connect

#define SSL_connect   (*(int (*)(SSL *))ssl_sw[2].ptr)

◆ SSL_CTRL_CLEAR_OPTIONS

#define SSL_CTRL_CLEAR_OPTIONS   (77)

◆ SSL_CTRL_OPTIONS

#define SSL_CTRL_OPTIONS   (32)

◆ SSL_CTRL_SET_ECDH_AUTO

#define SSL_CTRL_SET_ECDH_AUTO   (94)

◆ SSL_CTX_check_private_key

#define SSL_CTX_check_private_key   (*(int (*)(SSL_CTX *))ssl_sw[28].ptr)

◆ SSL_CTX_clear_options

#define SSL_CTX_clear_options (   ctx,
  op 
)    SSL_CTX_ctrl((ctx), SSL_CTRL_CLEAR_OPTIONS, (op), NULL)

◆ SSL_CTX_ctrl

#define SSL_CTX_ctrl   (*(long (*)(SSL_CTX *, int, long, void *))ssl_sw[30].ptr)

◆ SSL_CTX_free

#define SSL_CTX_free   (*(void (*)(SSL_CTX *))ssl_sw[14].ptr)

◆ SSL_CTX_load_verify_locations

#define SSL_CTX_load_verify_locations   (*(int (*)(SSL_CTX *, const char *, const char *))ssl_sw[21].ptr)

◆ SSL_CTX_new

#define SSL_CTX_new   (*(SSL_CTX * (*)(SSL_METHOD *))ssl_sw[8].ptr)

◆ SSL_CTX_set_cipher_list

#define SSL_CTX_set_cipher_list   (*(int (*)(SSL_CTX *, const char *))ssl_sw[31].ptr)

◆ SSL_CTX_set_default_passwd_cb

#define SSL_CTX_set_default_passwd_cb   (*(void (*)(SSL_CTX *, mg_callback_t))ssl_sw[13].ptr)

◆ SSL_CTX_set_default_verify_paths

#define SSL_CTX_set_default_verify_paths   (*(int (*)(SSL_CTX *))ssl_sw[22].ptr)

◆ SSL_CTX_set_ecdh_auto

#define SSL_CTX_set_ecdh_auto (   ctx,
  onoff 
)    SSL_CTX_ctrl(ctx, SSL_CTRL_SET_ECDH_AUTO, onoff, NULL)

◆ SSL_CTX_set_options

#define SSL_CTX_set_options (   ctx,
  op 
)    SSL_CTX_ctrl((ctx), SSL_CTRL_OPTIONS, (op), NULL)

◆ SSL_CTX_set_session_id_context

#define SSL_CTX_set_session_id_context   (*(int (*)(SSL_CTX *, const unsigned char *, unsigned int))ssl_sw[29].ptr)

◆ SSL_CTX_set_verify

#define SSL_CTX_set_verify
Value:
(*(void (*)(SSL_CTX *, \
int, \
int (*verify_callback)(int, X509_STORE_CTX *)))ssl_sw[19].ptr)
const GLvoid * ptr
Definition: nx_glsym.h:242
static struct ssl_func ssl_sw[]
Definition: civetweb.c:941
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
struct ssl_ctx_st SSL_CTX
Definition: civetweb.c:848
struct x509_store_ctx_st X509_STORE_CTX
Definition: civetweb.c:849

◆ SSL_CTX_set_verify_depth

#define SSL_CTX_set_verify_depth   (*(void (*)(SSL_CTX *, int))ssl_sw[23].ptr)

◆ SSL_CTX_use_certificate_chain_file

#define SSL_CTX_use_certificate_chain_file   (*(int (*)(SSL_CTX *, const char *))ssl_sw[16].ptr)

◆ SSL_CTX_use_certificate_file

#define SSL_CTX_use_certificate_file   (*(int (*)(SSL_CTX *, const char *, int))ssl_sw[12].ptr)

◆ SSL_CTX_use_PrivateKey_file

#define SSL_CTX_use_PrivateKey_file   (*(int (*)(SSL_CTX *, const char *, int))ssl_sw[11].ptr)

◆ SSL_free

#define SSL_free   (*(void (*)(SSL *))ssl_sw[0].ptr)

◆ SSL_get_current_cipher

#define SSL_get_current_cipher   (*(SSL_CIPHER * (*)(SSL *))ssl_sw[26].ptr)

◆ SSL_get_error

#define SSL_get_error   (*(int (*)(SSL *, int))ssl_sw[5].ptr)

◆ SSL_get_peer_certificate

#define SSL_get_peer_certificate   (*(X509 * (*)(SSL *))ssl_sw[24].ptr)

◆ SSL_get_version

#define SSL_get_version   (*(const char *(*)(SSL *))ssl_sw[25].ptr)

◆ SSL_LIB

#define SSL_LIB   "libssl.so"

◆ SSL_library_init

#define SSL_library_init   (*(int (*)(void))ssl_sw[10].ptr)

◆ SSL_load_error_strings

#define SSL_load_error_strings   (*(void (*)(void))ssl_sw[15].ptr)

◆ SSL_new

#define SSL_new   (*(SSL * (*)(SSL_CTX *))ssl_sw[7].ptr)

◆ SSL_OP_ALL

#define SSL_OP_ALL   (0x80000BFFL)

◆ SSL_OP_NO_SSLv2

#define SSL_OP_NO_SSLv2   (0x01000000L)

◆ SSL_OP_NO_SSLv3

#define SSL_OP_NO_SSLv3   (0x02000000L)

◆ SSL_OP_NO_TLSv1

#define SSL_OP_NO_TLSv1   (0x04000000L)

◆ SSL_OP_NO_TLSv1_1

#define SSL_OP_NO_TLSv1_1   (0x10000000L)

◆ SSL_OP_NO_TLSv1_2

#define SSL_OP_NO_TLSv1_2   (0x08000000L)

◆ SSL_OP_SINGLE_DH_USE

#define SSL_OP_SINGLE_DH_USE   (0x00100000L)

◆ SSL_pending

#define SSL_pending   (*(int (*)(SSL *))ssl_sw[18].ptr)

◆ SSL_read

#define SSL_read   (*(int (*)(SSL *, void *, int))ssl_sw[3].ptr)

◆ SSL_set_fd

#define SSL_set_fd   (*(int (*)(SSL *, SOCKET))ssl_sw[6].ptr)

◆ SSL_shutdown

#define SSL_shutdown   (*(int (*)(SSL *))ssl_sw[20].ptr)

◆ SSL_VERIFY_CLIENT_ONCE

#define SSL_VERIFY_CLIENT_ONCE   (4)

◆ SSL_VERIFY_FAIL_IF_NO_PEER_CERT

#define SSL_VERIFY_FAIL_IF_NO_PEER_CERT   (2)

◆ SSL_VERIFY_NONE

#define SSL_VERIFY_NONE   (0)

◆ SSL_VERIFY_PEER

#define SSL_VERIFY_PEER   (1)

◆ SSL_write

#define SSL_write   (*(int (*)(SSL *, const void *, int))ssl_sw[4].ptr)

◆ SSLv23_client_method

#define SSLv23_client_method   (*(SSL_METHOD * (*)(void))ssl_sw[17].ptr)

◆ SSLv23_server_method

#define SSLv23_server_method   (*(SSL_METHOD * (*)(void))ssl_sw[9].ptr)

◆ STRUCT_FILE_INITIALIZER

#define STRUCT_FILE_INITIALIZER
Value:
{ \
(uint64_t)0, (time_t)0, (FILE *)NULL, (const char *)NULL, 0, 0 \
}
#define NULL
Pointer to 0.
Definition: gctypes.h:65
#define FILE
Definition: file_stream_transforms.h:35
unsigned __int64 uint64_t
Definition: stdint.h:136

◆ UINT64_FMT

#define UINT64_FMT   PRIu64

◆ va_copy

#define va_copy (   x,
  y 
)    ((x) = (y))

◆ vsnprintf_impl

#define vsnprintf_impl   vsnprintf

◆ WIN32_LEAN_AND_MEAN

#define WIN32_LEAN_AND_MEAN

◆ WINCDECL

#define WINCDECL

Typedef Documentation

◆ SOCK_OPT_TYPE

◆ SOCKET

typedef int SOCKET

◆ SSL

typedef struct ssl_st SSL

◆ SSL_CTX

typedef struct ssl_ctx_st SSL_CTX

◆ SSL_METHOD

typedef struct ssl_method_st SSL_METHOD

◆ X509_STORE_CTX

typedef struct x509_store_ctx_st X509_STORE_CTX

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
CGI_EXTENSIONS 
CGI_ENVIRONMENT 
PUT_DELETE_PASSWORDS_FILE 
CGI_INTERPRETER 
PROTECT_URI 
AUTHENTICATION_DOMAIN 
SSI_EXTENSIONS 
THROTTLE 
ACCESS_LOG_FILE 
ENABLE_DIRECTORY_LISTING 
ERROR_LOG_FILE 
GLOBAL_PASSWORDS_FILE 
INDEX_FILES 
ENABLE_KEEP_ALIVE 
ACCESS_CONTROL_LIST 
EXTRA_MIME_TYPES 
LISTENING_PORTS 
DOCUMENT_ROOT 
SSL_CERTIFICATE 
NUM_THREADS 
RUN_AS_USER 
REWRITE 
HIDE_FILES 
REQUEST_TIMEOUT 
SSL_DO_VERIFY_PEER 
SSL_CA_PATH 
SSL_CA_FILE 
SSL_VERIFY_DEPTH 
SSL_DEFAULT_VERIFY_PATHS 
SSL_CIPHER_LIST 
SSL_PROTOCOL_VERSION 
DECODE_URL 
ACCESS_CONTROL_ALLOW_ORIGIN 
ERROR_PAGES 
CONFIG_TCP_NODELAY 
STATIC_FILE_MAX_AGE 
NUM_OPTIONS 

◆ anonymous enum

anonymous enum
Enumerator
REQUEST_HANDLER 
WEBSOCKET_HANDLER 
AUTH_HANDLER 

Function Documentation

◆ accept_new_connection()

static void accept_new_connection ( const struct socket listener,
struct mg_context ctx 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ alloc_vprintf()

static int alloc_vprintf ( char **  out_buf,
char *  prealloc_buf,
size_t  prealloc_size,
const char *  fmt,
va_list  ap 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ alloc_vprintf2()

static int alloc_vprintf2 ( char **  buf,
const char *  fmt,
va_list  ap 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ authorize()

static int authorize ( struct mg_connection conn,
struct file filep 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bin2str()

static void bin2str ( char *  to,
const unsigned char *  p,
size_t  len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_acl()

static int check_acl ( struct mg_context ctx,
uint32_t  remote_ip 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_authorization()

static int check_authorization ( struct mg_connection conn,
const char *  path 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_password()

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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ close_all_listening_sockets()

static void close_all_listening_sockets ( struct mg_context ctx)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ close_connection()

static void close_connection ( struct mg_connection conn)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ close_socket_gracefully()

static void close_socket_gracefully ( struct mg_connection conn)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ compare_dir_entries()

static int WINCDECL compare_dir_entries ( const void p1,
const void p2 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ connect_socket()

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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ construct_etag()

static void construct_etag ( char *  buf,
size_t  buf_len,
const struct file filep 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ consume_socket()

static int consume_socket ( struct mg_context ctx,
struct socket sp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dir_scan_callback()

static void dir_scan_callback ( struct de de,
void data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ discard_unread_request_data()

static void discard_unread_request_data ( struct mg_connection conn)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_ssi_include()

static void do_ssi_include ( struct mg_connection conn,
const char *  ssi,
char *  tag,
int  include_level 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fc()

static struct mg_connection* fc ( struct mg_context ctx)
static
Here is the caller graph for this function:

◆ fclose_on_exec()

static void fclose_on_exec ( struct file filep,
struct mg_connection conn 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ free_context()

static void free_context ( struct mg_context ctx)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_first_ssl_listener_index()

static int get_first_ssl_listener_index ( const struct mg_context ctx)
static
Here is the caller graph for this function:

◆ get_header()

static const char* get_header ( const struct mg_request_info ri,
const char *  name 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_mime_type()

static void get_mime_type ( struct mg_context ctx,
const char *  path,
struct vec vec 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_month_index()

static int get_month_index ( const char *  s)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_option_index()

static int get_option_index ( const char *  name)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_random()

static uint64_t get_random ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_rel_url_at_current_server()

static const char* get_rel_url_at_current_server ( const char *  uri,
const struct mg_connection conn 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_remote_ip()

static uint32_t get_remote_ip ( const struct mg_connection conn)
static
Here is the caller graph for this function:

◆ get_request_handler()

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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_request_len()

static int get_request_len ( const char *  buf,
int  buflen 
)
static
Here is the caller graph for this function:

◆ get_system_name()

static void get_system_name ( char **  sysName)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_uri_type()

static int get_uri_type ( const char *  uri)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getreq()

static int getreq ( struct mg_connection conn,
char *  ebuf,
size_t  ebuf_len,
int *  err 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gmt_time_string()

static void gmt_time_string ( char *  buf,
size_t  buf_len,
time_t *  t 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_directory_request()

static void handle_directory_request ( struct mg_connection conn,
const char *  dir 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_file_based_request()

static void handle_file_based_request ( struct mg_connection conn,
const char *  path,
struct file filep 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_request()

static void handle_request ( struct mg_connection conn)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_ssi_file_request()

static void handle_ssi_file_request ( struct mg_connection conn,
const char *  path,
struct file filep 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_static_file_request()

static void handle_static_file_request ( struct mg_connection conn,
const char *  path,
struct file filep,
const char *  mime_type 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ header_val()

static const char* header_val ( const struct mg_connection conn,
const char *  header 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ interpret_uri()

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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_file_in_memory()

static int is_file_in_memory ( const struct mg_connection conn,
const char *  path,
struct file filep 
)
static
Here is the caller graph for this function:

◆ is_file_opened()

static int is_file_opened ( const struct file filep)
static
Here is the caller graph for this function:

◆ is_not_modified()

static int is_not_modified ( const struct mg_connection conn,
const struct file filep 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_put_or_delete_method()

static int is_put_or_delete_method ( const struct mg_connection conn)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_valid_http_method()

static int is_valid_http_method ( const char *  method)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_valid_port()

static int is_valid_port ( unsigned long  port)
static
Here is the caller graph for this function:

◆ isbyte()

static int isbyte ( int  n)
static
Here is the caller graph for this function:

◆ log_access()

static void log_access ( const struct mg_connection conn)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lowercase()

static int lowercase ( const char *  s)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ master_thread()

static void* master_thread ( void thread_func_param)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ master_thread_run()

static void master_thread_run ( void thread_func_param)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ match_prefix()

static int match_prefix ( const char *  pattern,
size_t  pattern_len,
const char *  str 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_atomic_dec()

static int mg_atomic_dec ( volatile int *  addr)
static
Here is the caller graph for this function:

◆ mg_atomic_inc()

static int mg_atomic_inc ( volatile int *  addr)
static
Here is the caller graph for this function:

◆ mg_calloc()

static __inline void* mg_calloc ( size_t  a,
size_t  b 
)
static
Here is the caller graph for this function:

◆ mg_check_feature()

unsigned mg_check_feature ( unsigned  feature)

◆ mg_close_connection()

void mg_close_connection ( struct mg_connection conn)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_connect_client()

struct mg_connection* mg_connect_client ( const char *  host,
int  port,
int  use_ssl,
char *  error_buffer,
size_t  error_buffer_size 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_connect_client_impl()

static struct mg_connection* mg_connect_client_impl ( const struct mg_client_options client_options,
int  use_ssl,
char *  ebuf,
size_t  ebuf_len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_connect_client_secure()

CIVETWEB_API struct mg_connection* mg_connect_client_secure ( const struct mg_client_options client_options,
char *  error_buffer,
size_t  error_buffer_size 
)
Here is the call graph for this function:

◆ mg_connect_websocket_client()

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 
)
Here is the call graph for this function:

◆ mg_cry()

void mg_cry ( const struct mg_connection conn,
const char *  fmt,
  ... 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_difftimespec()

static double mg_difftimespec ( const struct timespec *  ts_now,
const struct timespec *  ts_before 
)
static
Here is the caller graph for this function:

◆ mg_download()

struct mg_connection* mg_download ( const char *  host,
int  port,
int  use_ssl,
char *  ebuf,
size_t  ebuf_len,
const char *  fmt,
  ... 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_fclose()

static void mg_fclose ( struct file filep)
static
Here is the caller graph for this function:

◆ mg_fgetc()

static int mg_fgetc ( struct file filep,
int  offset 
)
static
Here is the caller graph for this function:

◆ mg_fgets()

static char* mg_fgets ( char *  buf,
size_t  size,
struct file filep,
char **  p 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_fopen()

static int mg_fopen ( const struct mg_connection conn,
const char *  path,
const char *  mode,
struct file filep 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_free()

static __inline void mg_free ( void a)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_get_builtin_mime_type()

const char* mg_get_builtin_mime_type ( const char *  path)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_get_context()

struct mg_context* mg_get_context ( const struct mg_connection conn)

◆ mg_get_cookie()

int mg_get_cookie ( const char *  cookie_header,
const char *  var_name,
char *  dst,
size_t  dst_size 
)
Here is the call graph for this function:

◆ mg_get_header()

const char* mg_get_header ( const struct mg_connection conn,
const char *  name 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_get_option()

const char* mg_get_option ( const struct mg_context ctx,
const char *  name 
)
Here is the call graph for this function:

◆ mg_get_ports()

size_t mg_get_ports ( const struct mg_context ctx,
size_t  size,
int *  ports,
int *  ssl 
)

◆ mg_get_request_info()

const struct mg_request_info* mg_get_request_info ( const struct mg_connection conn)
Here is the caller graph for this function:

◆ mg_get_response()

int mg_get_response ( struct mg_connection conn,
char *  ebuf,
size_t  ebuf_len,
int  timeout 
)
Here is the call graph for this function:

◆ mg_get_response_code_text()

static const char* mg_get_response_code_text ( int  response_code,
struct mg_connection conn 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_get_server_ports()

int mg_get_server_ports ( const struct mg_context ctx,
int  size,
struct mg_server_ports ports 
)
Here is the call graph for this function:

◆ mg_get_user_connection_data()

void* mg_get_user_connection_data ( const struct mg_connection conn)

◆ mg_get_user_data()

void* mg_get_user_data ( const struct mg_context ctx)

◆ mg_get_valid_options()

const struct mg_option* mg_get_valid_options ( void  )

◆ mg_get_var()

int mg_get_var ( const char *  data,
size_t  data_len,
const char *  name,
char *  dst,
size_t  dst_len 
)
Here is the call graph for this function:

◆ mg_get_var2()

int mg_get_var2 ( const char *  data,
size_t  data_len,
const char *  name,
char *  dst,
size_t  dst_len,
size_t  occurrence 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_getc()

static char mg_getc ( struct mg_connection conn)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_inet_pton()

static int mg_inet_pton ( int  af,
const char *  src,
void dst,
size_t  dstlen 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_join_thread()

static int mg_join_thread ( pthread_t  threadid)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_lock_connection()

void mg_lock_connection ( struct mg_connection conn)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_lock_context()

void mg_lock_context ( struct mg_context ctx)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_malloc()

static __inline void* mg_malloc ( size_t  a)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_md5()

char* mg_md5 ( char  buf[33],
  ... 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_modify_passwords_file()

int mg_modify_passwords_file ( const char *  fname,
const char *  domain,
const char *  user,
const char *  pass 
)
Here is the call graph for this function:

◆ mg_printf()

int mg_printf ( struct mg_connection conn,
const char *  fmt,
  ... 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_read()

int mg_read ( struct mg_connection conn,
void buf,
size_t  len 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_read_inner()

static int mg_read_inner ( struct mg_connection conn,
void buf,
size_t  len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_realloc()

static __inline void* mg_realloc ( void a,
size_t  b 
)
static
Here is the caller graph for this function:

◆ mg_send_file()

void mg_send_file ( struct mg_connection conn,
const char *  path 
)
Here is the call graph for this function:

◆ mg_send_mime_file()

void mg_send_mime_file ( struct mg_connection conn,
const char *  path,
const char *  mime_type 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_set_auth_handler()

void mg_set_auth_handler ( struct mg_context ctx,
const char *  uri,
mg_request_handler  handler,
void cbdata 
)
Here is the call graph for this function:

◆ mg_set_handler_type()

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 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_set_request_handler()

void mg_set_request_handler ( struct mg_context ctx,
const char *  uri,
mg_request_handler  handler,
void cbdata 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_set_thread_name()

static void mg_set_thread_name ( const char *  name)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_set_user_connection_data()

void mg_set_user_connection_data ( const struct mg_connection conn,
void data 
)

◆ mg_set_websocket_handler()

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 
)
Here is the call graph for this function:

◆ mg_snprintf() [1/2]

static void mg_snprintf ( const struct mg_connection conn,
int *  truncated,
char *  buf,
size_t  buflen,
PRINTF_FORMAT_STRING(const char *fmt)  ,
  ... 
)
static
Here is the caller graph for this function:

◆ mg_snprintf() [2/2]

static void mg_snprintf ( const struct mg_connection conn,
int *  truncated,
char *  buf,
size_t  buflen,
const char *  fmt,
  ... 
)
static
Here is the call graph for this function:

◆ mg_start()

struct mg_context* mg_start ( const struct mg_callbacks callbacks,
void user_data,
const char **  options 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_start_thread()

int mg_start_thread ( mg_thread_func_t  func,
void param 
)
Here is the call graph for this function:

◆ mg_start_thread_with_id()

static int mg_start_thread_with_id ( mg_thread_func_t  func,
void param,
pthread_t threadidptr 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_stat()

static int mg_stat ( struct mg_connection conn,
const char *  path,
struct file filep 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_static_assert() [1/6]

mg_static_assert ( sizeof(int)  = =4||sizeof(int)==8,
"int data type size check  
)

◆ mg_static_assert() [2/6]

mg_static_assert ( sizeof(void *)  = =4||sizeof(void *)==8,
"pointer data type size check  
)

◆ mg_static_assert() [3/6]

mg_static_assert ( sizeof(void *) >=sizeof(int)  ,
"data type size check  
)

◆ mg_static_assert() [4/6]

mg_static_assert ( MAX_WORKER_THREADS >=  1,
"worker threads must be a positive number  
)

◆ mg_static_assert() [5/6]

mg_static_assert ( MAX_REQUEST_SIZE >=  256,
"request size length must be a positive number  
)

◆ mg_static_assert() [6/6]

mg_static_assert ( (sizeof(config_options)/sizeof(config_options[0]))  = =(NUM_OPTIONS+1),
"config_options and enum not sync  
)

◆ mg_stop()

void mg_stop ( struct mg_context ctx)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_store_body()

long long mg_store_body ( struct mg_connection conn,
const char *  path 
)
Here is the call graph for this function:

◆ mg_strcasecmp()

static int mg_strcasecmp ( const char *  s1,
const char *  s2 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_strcasestr()

static const char* mg_strcasestr ( const char *  big_str,
const char *  small_str 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_strdup()

static char* mg_strdup ( const char *  str)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_strlcpy()

static void mg_strlcpy ( register char *  dst,
register const char *  src,
size_t  n 
)
static
Here is the caller graph for this function:

◆ mg_strncasecmp()

int mg_strncasecmp ( const char *  s1,
const char *  s2,
size_t  len 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_strndup()

static char* mg_strndup ( const char *  ptr,
size_t  len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_unlock_connection()

void mg_unlock_connection ( struct mg_connection conn)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_unlock_context()

void mg_unlock_context ( struct mg_context ctx)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_upload()

int mg_upload ( struct mg_connection conn,
const char *  destination_dir 
)
Here is the call graph for this function:

◆ mg_upload_field_found()

static int mg_upload_field_found ( const char *  key,
const char *  filename,
char *  path,
size_t  pathlen,
void user_data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_upload_field_get()

static int mg_upload_field_get ( const char *  key,
const char *  value,
size_t  value_size,
void user_data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_upload_field_stored()

static int mg_upload_field_stored ( const char *  path,
size_t  file_size,
void user_data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_url_decode()

int mg_url_decode ( const char *  src,
int  src_len,
char *  dst,
int  dst_len,
int  is_form_url_encoded 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_url_encode()

int mg_url_encode ( const char *  src,
char *  dst,
size_t  dst_len 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_version()

const char* mg_version ( void  )

◆ mg_vprintf()

static int mg_vprintf ( struct mg_connection conn,
const char *  fmt,
va_list  ap 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_vsnprintf()

static void mg_vsnprintf ( const struct mg_connection conn,
int *  truncated,
char *  buf,
size_t  buflen,
const char *  fmt,
va_list  ap 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_worker_thread()

static void* mg_worker_thread ( void thread_func_param)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mg_write()

int mg_write ( struct mg_connection conn,
const void buf,
size_t  len 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ must_hide_file()

static int must_hide_file ( struct mg_connection conn,
const char *  path 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ next_option()

static const char* next_option ( const char *  list,
struct vec val,
struct vec eq_val 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ open_auth_file()

static void open_auth_file ( struct mg_connection conn,
const char *  path,
struct file filep 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_auth_header()

static int parse_auth_header ( struct mg_connection conn,
char *  buf,
size_t  buf_size,
struct ah ah 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_date_string()

static time_t parse_date_string ( const char *  datetime)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_http_headers()

static void parse_http_headers ( char **  buf,
struct mg_request_info ri 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_http_message()

static int parse_http_message ( char *  buf,
int  len,
struct mg_request_info ri 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_net()

static int parse_net ( const char *  spec,
uint32_t net,
uint32_t mask 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_port_string()

static int parse_port_string ( const struct vec vec,
struct socket so 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_range_header()

static int parse_range_header ( const char *  header,
int64_t a,
int64_t b 
)
static
Here is the caller graph for this function:

◆ print_dir_entry()

static void print_dir_entry ( struct de de)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ process_new_connection()

static void process_new_connection ( struct mg_connection conn)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ produce_socket()

static void produce_socket ( struct mg_context ctx,
const struct socket sp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pull()

static int pull ( FILE fp,
struct mg_connection conn,
char *  buf,
int  len,
double  timeout 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pull_all()

static int pull_all ( FILE fp,
struct mg_connection conn,
char *  buf,
int  len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ push()

static int push ( struct mg_context ctx,
FILE fp,
SOCKET  sock,
SSL ssl,
const char *  buf,
int  len,
double  timeout 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ push_all()

static int64_t push_all ( struct mg_context ctx,
FILE fp,
SOCKET  sock,
SSL ssl,
const char *  buf,
int64_t  len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ put_dir()

static int put_dir ( struct mg_connection conn,
const char *  path 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_auth_file()

static int read_auth_file ( struct file filep,
struct read_auth_file_struct workdata 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_request()

static int read_request ( FILE fp,
struct mg_connection conn,
char *  buf,
int  bufsiz,
int *  nread 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ realloc2()

static void* realloc2 ( void ptr,
size_t  size 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ redirect_to_https_port()

static void redirect_to_https_port ( struct mg_connection conn,
int  ssl_index 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove_bad_file()

static void remove_bad_file ( const struct mg_connection conn,
const char *  path 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove_double_dots_and_double_slashes()

static void remove_double_dots_and_double_slashes ( char *  s)
static
Here is the caller graph for this function:

◆ reset_per_request_attributes()

static void reset_per_request_attributes ( struct mg_connection conn)
static
Here is the caller graph for this function:

◆ scan_directory()

static int scan_directory ( struct mg_connection conn,
const char *  dir,
void data,
void(*)(struct de *, void *)  cb 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_authorization_request()

static void send_authorization_request ( struct mg_connection conn)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_file_data()

static void send_file_data ( struct mg_connection conn,
struct file filep,
int64_t  offset,
int64_t  len 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_http_error()

static void send_http_error ( struct mg_connection ,
int  ,
PRINTF_FORMAT_STRING(const char *fmt)  ,
  ... 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_no_cache_header()

static int send_no_cache_header ( struct mg_connection conn)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_ssi_file()

static void send_ssi_file ( struct mg_connection conn,
const char *  path,
struct file filep,
int  include_level 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_static_cache_header()

static int send_static_cache_header ( struct mg_connection conn)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_acl_option()

static int set_acl_option ( struct mg_context ctx)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_close_on_exec()

static void set_close_on_exec ( SOCKET  fd,
struct mg_connection conn 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_gpass_option()

static int set_gpass_option ( struct mg_context ctx)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_non_blocking_mode()

static int set_non_blocking_mode ( SOCKET  sock)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_ports_option()

static int set_ports_option ( struct mg_context ctx)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_sock_timeout()

static int set_sock_timeout ( SOCKET  sock,
int  milliseconds 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_tcp_nodelay()

static int set_tcp_nodelay ( SOCKET  sock,
int  nodelay_on 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_throttle()

static int set_throttle ( const char *  spec,
uint32_t  remote_ip,
const char *  uri 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_uid_option()

static int set_uid_option ( struct mg_context ctx)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ should_decode_url()

static int should_decode_url ( const struct mg_connection conn)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ should_keep_alive()

static int should_keep_alive ( const struct mg_connection conn)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ skip()

static char* skip ( char **  buf,
const char *  delimiters 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ skip_quoted()

static char* skip_quoted ( char **  buf,
const char *  delimiters,
const char *  whitespace,
char  quotechar 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sockaddr_to_string()

static void sockaddr_to_string ( char *  buf,
size_t  len,
const union usa usa 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ suggest_connection_header()

static const char* suggest_connection_header ( const struct mg_connection conn)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tls_dtor()

static void tls_dtor ( void key)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ worker_thread_run()

static void* worker_thread_run ( void thread_func_param)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ abs_uri_protocols

const { ... } abs_uri_protocols[]
Initial value:
= { { "http://", 7, 80 },
{ "https://", 8, 443 },
{ "ws://", 5, 80 },
{ "wss://", 6, 443 },
{ NULL, 0, 0 } }
#define NULL
Pointer to 0.
Definition: gctypes.h:65

◆ builtin_mime_types

const { ... } builtin_mime_types[]

◆ config_options

struct mg_option config_options[]
static

◆ default_port

unsigned default_port

◆ ext_len

size_t ext_len

◆ extension

const char* extension

◆ mime_type

const char* mime_type

◆ month_names

const char* month_names[]
static
Initial value:
= { "Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec" }

◆ proto

const char* proto

◆ proto_len

size_t proto_len

◆ pthread_mutex_attr

pthread_mutexattr_t pthread_mutex_attr
static

◆ ssl_sw

struct ssl_func ssl_sw[]
static

◆ static_assert_replacement

char static_assert_replacement[1]

◆ sTlsInit

int sTlsInit = 0
static

◆ sTlsKey

pthread_key_t sTlsKey
static

◆ thread_idx_max

int thread_idx_max = 0
static