Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
civetweb.c File Reference
#include "civetweb.h"
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <stdint.h>
#include <inttypes.h>
#include <arpa/inet.h>
#include <ctype.h>
#include <dirent.h>
#include <grp.h>
#include <limits.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <poll.h>
#include <pthread.h>
#include <pwd.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/utsname.h>
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
#include <dlfcn.h>
#include "md5.inl"
#include "openssl_dl.inl"
#include "sort.inl"
#include "match.inl"
#include "response.inl"
#include "handle_form.inl"
Include dependency graph for civetweb.c:

Classes

struct  auth_header
 
struct  cgi_environment
 
struct  de
 
struct  dir_scan_data
 
struct  mg_connection
 
struct  mg_context
 
struct  mg_domain_context
 
struct  mg_file
 
struct  mg_file_access
 
struct  mg_file_stat
 
struct  mg_handler_info
 
struct  mg_http_method_info
 
struct  mg_workerTLS
 
struct  process_control_data
 
struct  read_auth_file_struct
 
struct  socket
 
struct  twebdav_lock
 
union  usa
 
struct  vec
 
struct  websocket_client_thread_data
 

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 _GNU_SOURCE   /* for setgroups(), pthread_setname_np() */
 
#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) /* in bytes */
 
#define closesocket(a)   (close(a))
 
#define CRYPTO_LIB   "libcrypto.so"
 
#define DEBUG_ASSERT(cond)
 
#define DEBUG_TRACE(fmt, ...)
 
#define ERRNO   (errno)
 
#define ERROR_TRY_AGAIN(err)    (((err) == EAGAIN) || ((err) == EWOULDBLOCK) || ((err) == EINTR))
 
#define free   DO_NOT_USE_THIS_FUNCTION__USE_mg_free
 
#define FUNCTION_MAY_BE_UNUSED
 
#define HAVE_SOCKETPAIR   1
 
#define HEXTOI(x)   (isdigit(x) ? (x - '0') : (x - 'W'))
 
#define HTTP1_only
 
#define IGNORE_UNUSED_RESULT(a)   ((void)((a) && 1))
 
#define INITIAL_DEPTH   9
 
#define INT64_FMT   PRId64
 
#define INT64_MAX   (9223372036854775807)
 
#define INVALID_SOCKET   (-1)
 
#define IP_ADDR_STR_LEN   (50) /* IPv6 hex string is 46 chars */
 
#define LOCK_DURATION_S   60
 
#define malloc   DO_NOT_USE_THIS_FUNCTION__USE_mg_malloc
 
#define MAX_CGI_ENVIR_VARS   (256) /* in variables (count) */
 
#define MAX_WORKER_THREADS   (1024 * 64) /* in threads (count) */
 
#define MD5_STATIC   static
 
#define MG_BUF_LEN   (1024 * 8)
 
#define mg_calloc_ctx(a, b, c)   mg_calloc(a, b)
 
#define mg_closedir(x)   (closedir(x))
 
#define mg_cry   DO_NOT_USE_THIS_FUNCTION__USE_mg_cry_internal
 
#define mg_cry_ctx_internal(ctx, fmt, ...)    mg_cry_internal_wrap(NULL, ctx, __func__, __LINE__, fmt, __VA_ARGS__)
 
#define mg_cry_internal(conn, fmt, ...)    mg_cry_internal_wrap(conn, NULL, __func__, __LINE__, fmt, __VA_ARGS__)
 
#define MG_FILE_COMPRESSION_SIZE_LIMIT   (1024) /* in bytes */
 
#define MG_FOPEN_MODE_APPEND   (4)
 
#define MG_FOPEN_MODE_NONE   (0)
 
#define MG_FOPEN_MODE_READ   (1)
 
#define MG_FOPEN_MODE_WRITE   (2)
 
#define mg_free_ctx(a, c)   mg_free(a)
 
#define mg_get_option   DO_NOT_USE_THIS_FUNCTION_INTERNALLY__access_directly
 
#define mg_malloc_ctx(a, c)   mg_malloc(a)
 
#define mg_mkdir(conn, path, mode)   (mkdir(path, mode))
 
#define mg_opendir(conn, x)   (opendir(x))
 
#define mg_pollfd   pollfd
 
#define mg_readdir(x)   (readdir(x))
 
#define mg_realloc_ctx(a, b, c)   mg_realloc(a, b)
 
#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 MSG_NOSIGNAL   (0)
 
#define NO_ALTERNATIVE_QUEUE
 
#define NUM_WEBDAV_LOCKS   10
 
#define O_BINARY   (0)
 
#define PASSWORDS_FILE_NAME   ".htpasswd"
 
#define realloc   DO_NOT_USE_THIS_FUNCTION__USE_mg_realloc
 
#define SHUTDOWN_BOTH   (2)
 
#define SHUTDOWN_RD   (0)
 
#define SHUTDOWN_WR   (1)
 
#define snprintf   DO_NOT_USE_THIS_FUNCTION__USE_mg_snprintf
 
#define SOCKET_TIMEOUT_QUANTUM   (2000) /* in ms */
 
#define SSL_LIB   "libssl.so"
 
#define STOP_FLAG_ASSIGN(f, v)   ((*(f)) = (v))
 
#define STOP_FLAG_IS_TWO(f)   ((*(f)) == 2)
 
#define STOP_FLAG_IS_ZERO(f)   ((*(f)) == 0)
 
#define STRUCT_FILE_INITIALIZER
 
#define UINT64_FMT   PRIu64
 
#define USA_IN_PORT_UNSAFE(s)   ((s)->sin.sin_port)
 
#define UTF8_PATH_MAX   (PATH_MAX)
 
#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 int volatile stop_flag_t
 

Enumerations

enum  {
  LISTENING_PORTS , NUM_THREADS , PRESPAWN_THREADS , RUN_AS_USER ,
  CONFIG_TCP_NODELAY , MAX_REQUEST_SIZE , LINGER_TIMEOUT , CONNECTION_QUEUE_SIZE ,
  LISTEN_BACKLOG_SIZE , THROTTLE , ENABLE_KEEP_ALIVE , REQUEST_TIMEOUT ,
  KEEP_ALIVE_TIMEOUT , DECODE_URL , DECODE_QUERY_STRING , DOCUMENT_ROOT ,
  FALLBACK_DOCUMENT_ROOT , ACCESS_LOG_FILE , ERROR_LOG_FILE , CGI_EXTENSIONS ,
  CGI_ENVIRONMENT , CGI_INTERPRETER , CGI_INTERPRETER_ARGS , CGI_BUFFERING ,
  CGI2_EXTENSIONS , CGI2_ENVIRONMENT , CGI2_INTERPRETER , CGI2_INTERPRETER_ARGS ,
  CGI2_BUFFERING , PUT_DELETE_PASSWORDS_FILE , PROTECT_URI , AUTHENTICATION_DOMAIN ,
  ENABLE_AUTH_DOMAIN_CHECK , SSI_EXTENSIONS , ENABLE_DIRECTORY_LISTING , ENABLE_WEBDAV ,
  GLOBAL_PASSWORDS_FILE , INDEX_FILES , ACCESS_CONTROL_LIST , EXTRA_MIME_TYPES ,
  SSL_CERTIFICATE , SSL_CERTIFICATE_CHAIN , URL_REWRITE_PATTERN , HIDE_FILES ,
  SSL_DO_VERIFY_PEER , SSL_CACHE_TIMEOUT , SSL_CA_PATH , SSL_CA_FILE ,
  SSL_VERIFY_DEPTH , SSL_DEFAULT_VERIFY_PATHS , SSL_CIPHER_LIST , SSL_PROTOCOL_VERSION ,
  SSL_SHORT_TRUST , ACCESS_CONTROL_ALLOW_ORIGIN , ACCESS_CONTROL_ALLOW_METHODS , ACCESS_CONTROL_ALLOW_HEADERS ,
  ACCESS_CONTROL_EXPOSE_HEADERS , ACCESS_CONTROL_ALLOW_CREDENTIALS , ERROR_PAGES , STATIC_FILE_MAX_AGE ,
  STATIC_FILE_CACHE_CONTROL , STRICT_HTTPS_MAX_AGE , ADDITIONAL_HEADER , ALLOW_INDEX_SCRIPT_SUB_RES ,
  NUM_OPTIONS
}
 
enum  { REQUEST_HANDLER , WEBSOCKET_HANDLER , AUTH_HANDLER }
 
enum  { CONTEXT_INVALID , CONTEXT_SERVER , CONTEXT_HTTP_CLIENT , CONTEXT_WS_CLIENT }
 
enum  { CONNECTION_TYPE_INVALID = 0 , CONNECTION_TYPE_REQUEST = 1 , CONNECTION_TYPE_RESPONSE = 2 }
 
enum  { PROTOCOL_TYPE_HTTP1 = 0 , PROTOCOL_TYPE_WEBSOCKET = 1 , PROTOCOL_TYPE_HTTP2 = 2 }
 

Functions

static int abort_cgi_process (void *data)
 
static void accept_new_connection (const struct socket *listener, struct mg_context *ctx)
 
static void addenv (struct cgi_environment *env, const char *fmt,...)
 
static int alloc_printf (char **out_buf, 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 mg_file *filep, const char *realm)
 
static unsigned char b64reverse (char letter)
 
static void bin2str (char *to, const unsigned char *p, size_t len)
 
static int check_acl (struct mg_context *phys_ctx, const union usa *sa)
 
static int check_authorization (struct mg_connection *conn, const char *path)
 
static int check_password_digest (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 compare_dir_entries (const void *p1, const void *p2, void *arg)
 
static int connect_socket (struct mg_context *ctx, const char *host, int port, int use_ssl, struct mg_error_data *error, SOCKET *sock, union usa *sa)
 
static void construct_etag (char *buf, size_t buf_len, const struct mg_file_stat *filestat)
 
static int consume_socket (struct mg_context *ctx, struct socket *sp, int thread_index, int counter_was_preincremented)
 
static void dav_lock_file (struct mg_connection *conn, const char *path)
 
static void dav_mkcol (struct mg_connection *conn, const char *path)
 
static void dav_move_file (struct mg_connection *conn, const char *path, int do_copy)
 
static void dav_proppatch (struct mg_connection *conn, const char *path)
 
static void dav_unlock_file (struct mg_connection *conn, const char *path)
 
static void delete_file (struct mg_connection *conn, const char *path)
 
static int 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 int extention_matches_script (struct mg_connection *conn, const char *filename)
 
static int extention_matches_template_text (struct mg_connection *conn, const char *filename)
 
static struct mg_connectionfake_connection (struct mg_connection *fc, struct mg_context *ctx)
 
static void fclose_on_exec (struct mg_file_access *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_header *hdr, int num_hdr, const char *name)
 
static void get_host_from_request_info (struct vec *host, const struct mg_request_info *ri)
 
static int get_http_header_len (const char *buf, int buflen)
 
static const struct mg_http_method_infoget_http_method_info (const char *method)
 
static const char * get_http_version (const struct mg_connection *conn)
 
static int get_message (struct mg_connection *conn, char *ebuf, size_t ebuf_len, int *err)
 
static void get_mime_type (struct mg_connection *conn, const char *path, struct vec *vec)
 
static int get_month_index (const char *s)
 
static int get_option_index (const char *name)
 
static const char * get_proto_name (const struct mg_connection *conn)
 
static uint64_t get_random (void)
 
static const char * get_rel_url_at_current_server (const char *uri, const struct mg_connection *conn)
 
static int get_req_headers (const struct mg_request_info *ri, const char *name, const char **output, int output_max_size)
 
static int get_request (struct mg_connection *conn, char *ebuf, size_t ebuf_len, int *err)
 
static int get_request_handler (struct mg_connection *conn, int handler_type, mg_request_handler *handler, struct mg_websocket_subprotocols **subprotocols, 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, struct mg_handler_info **handler_info)
 
static int get_response (struct mg_connection *conn, char *ebuf, size_t ebuf_len, int *err)
 
static void get_system_name (char **sysName)
 
static int get_uri_type (const char *uri)
 
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, int cgi_config_idx)
 
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 mg_file *filep)
 
static void handle_not_modified_static_file_request (struct mg_connection *conn, struct mg_file *filep)
 
static void handle_propfind (struct mg_connection *conn, const char *path, struct mg_file_stat *filep)
 
static void handle_request (struct mg_connection *)
 
static void handle_request_stat_log (struct mg_connection *conn)
 
static void handle_ssi_file_request (struct mg_connection *conn, const char *path, struct mg_file *filep)
 
static void handle_static_file_request (struct mg_connection *conn, const char *path, struct mg_file *filep, const char *mime_type, const char *additional_headers)
 
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 hexdump2string (void *mem, int memlen, char *buf, int buflen)
 
static void init_connection (struct mg_connection *conn)
 
static int init_ssl_ctx (struct mg_context *phys_ctx, struct mg_domain_context *dom_ctx)
 
static int init_ssl_ctx_impl (struct mg_context *phys_ctx, struct mg_domain_context *dom_ctx, const char *pem, const char *chain)
 
static int initialize_openssl (char *ebuf, size_t ebuf_len)
 
static void interpret_uri (struct mg_connection *conn, char *filename, size_t filename_buf_len, struct mg_file_stat *filestat, int *is_found, int *is_script_resource, int *is_websocket_request, int *is_put_or_delete_request, int *is_webdav_request, int *is_template_text)
 
static int is_authorized_for_put (struct mg_connection *conn)
 
static int is_civetweb_webdav_method (const struct mg_connection *conn)
 
static int is_file_opened (const struct mg_file_access *fileacc)
 
static int is_in_script_path (const struct mg_connection *conn, const char *path)
 
static int is_not_modified (const struct mg_connection *conn, const struct mg_file_stat *filestat)
 
static int is_put_or_delete_method (const struct mg_connection *conn)
 
static int is_ssl_port_used (const char *ports)
 
static int is_valid_http_method (const char *method)
 
static int is_valid_port (unsigned long port)
 
static void legacy_init (const char **options)
 
static void * load_tls_dll (char *ebuf, size_t ebuf_len, const char *dll_name, struct ssl_func *sw, int *feature_missing)
 
static void log_access (const struct mg_connection *)
 
static int lowercase (const char *s)
 
static void * master_thread (void *thread_func_param)
 
static void master_thread_run (struct mg_context *ctx)
 
static ptrdiff_t mg_atomic_dec (volatile ptrdiff_t *addr)
 
static ptrdiff_t mg_atomic_inc (volatile ptrdiff_t *addr)
 
int mg_base64_decode (const char *src, size_t src_len, unsigned char *dst, size_t *dst_len)
 
int mg_base64_encode (const unsigned char *src, size_t src_len, char *dst, size_t *dst_len)
 
static __inline void * mg_calloc (size_t a, size_t b)
 
int mg_check_digest_access_authentication (struct mg_connection *conn, const char *realm, const char *filename)
 
unsigned mg_check_feature (unsigned feature)
 
void mg_close_connection (struct mg_connection *conn)
 
struct mg_connectionmg_connect_client (const char *host, int port, int use_ssl, char *error_buffer, size_t error_buffer_size)
 
static struct mg_connectionmg_connect_client_impl (const struct mg_client_options *client_options, int use_ssl, struct mg_init_data *init, struct mg_error_data *error)
 
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_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)
 
struct mg_connectionmg_connect_websocket_client_extensions (const char *host, int port, int use_ssl, char *error_buffer, size_t error_buffer_size, const char *path, const char *origin, const char *extensions, mg_websocket_data_handler data_func, mg_websocket_close_handler close_func, void *user_data)
 
static struct mg_connectionmg_connect_websocket_client_impl (const struct mg_client_options *client_options, int use_ssl, char *error_buffer, size_t error_buffer_size, const char *path, const char *origin, const char *extensions, mg_websocket_data_handler data_func, mg_websocket_close_handler close_func, void *user_data)
 
struct mg_connectionmg_connect_websocket_client_secure (const struct mg_client_options *client_options, 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)
 
struct mg_connectionmg_connect_websocket_client_secure_extensions (const struct mg_client_options *client_options, char *error_buffer, size_t error_buffer_size, const char *path, const char *origin, const char *extensions, mg_websocket_data_handler data_func, mg_websocket_close_handler close_func, void *user_data)
 
static int mg_construct_local_link (const struct mg_connection *conn, char *buf, size_t buflen, const char *define_proto, int define_port, const char *define_uri)
 
void mg_cry (const struct mg_connection *conn, const char *fmt,...)
 
static void mg_cry_internal_impl (const struct mg_connection *conn, const char *func, unsigned line, const char *fmt, va_list ap)
 
static void mg_cry_internal_wrap (const struct mg_connection *conn, struct mg_context *ctx, const char *func, unsigned line, const char *fmt,...)
 
static unsigned long mg_current_thread_id (void)
 
static double mg_difftimespec (const struct timespec *ts_now, const struct timespec *ts_before)
 
void mg_disable_connection_keep_alive (struct mg_connection *conn)
 
struct mg_connectionmg_download (const char *host, int port, int use_ssl, char *ebuf, size_t ebuf_len, const char *fmt,...)
 
unsigned mg_exit_library (void)
 
static int mg_fclose (struct mg_file_access *fileacc)
 
static int mg_fgetc (struct mg_file *filep)
 
static const char * mg_fgets (char *buf, size_t size, struct mg_file *filep)
 
static int mg_fopen (const struct mg_connection *conn, const char *path, int mode, struct mg_file *filep)
 
static __inline void mg_free (void *a)
 
const char * mg_get_builtin_mime_type (const char *path)
 
struct mg_contextmg_get_context (const struct mg_connection *conn)
 
int mg_get_context_info (const struct mg_context *ctx, char *buffer, int buflen)
 
int mg_get_cookie (const char *cookie_header, const char *var_name, char *dst, size_t dst_size)
 
static uint64_t mg_get_current_time_ns (void)
 
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)
 
const struct mg_request_infomg_get_request_info (const struct mg_connection *conn)
 
int mg_get_request_link (const struct mg_connection *conn, char *buf, size_t buflen)
 
int mg_get_response (struct mg_connection *conn, char *ebuf, size_t ebuf_len, int timeout)
 
const char * mg_get_response_code_text (const struct mg_connection *conn, int response_code)
 
const struct mg_response_infomg_get_response_info (const struct mg_connection *conn)
 
int mg_get_server_ports (const struct mg_context *ctx, int size, struct mg_server_port *ports)
 
int mg_get_system_info (char *buffer, int buflen)
 
void * mg_get_thread_pointer (const struct mg_connection *conn)
 
void * mg_get_user_connection_data (const struct mg_connection *conn)
 
void * mg_get_user_context_data (const struct mg_connection *conn)
 
void * mg_get_user_data (const struct mg_context *ctx)
 
const struct mg_optionmg_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 void mg_global_lock (void)
 
static void mg_global_unlock (void)
 
static int mg_inet_pton (int af, const char *src, void *dst, size_t dstlen, int resolve_src)
 
unsigned mg_init_library (unsigned features)
 
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_modify_passwords_file_ha1 (const char *fname, const char *domain, const char *user, const char *ha1)
 
static int mg_path_suspicious (const struct mg_connection *conn, const char *path)
 
static int mg_poll (struct pollfd *pfd, unsigned int n, int milliseconds, const stop_flag_t *stop_flag)
 
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)
 
int mg_send_chunk (struct mg_connection *conn, const char *chunk, unsigned int chunk_len)
 
int mg_send_digest_access_authentication_request (struct mg_connection *conn, const char *realm)
 
void mg_send_file (struct mg_connection *conn, const char *path)
 
int mg_send_file_body (struct mg_connection *conn, const char *path)
 
int mg_send_http_error (struct mg_connection *conn, int status, const char *fmt,...)
 
static int mg_send_http_error_impl (struct mg_connection *conn, int status, const char *fmt, va_list args)
 
int mg_send_http_ok (struct mg_connection *conn, const char *mime_type, long long content_length)
 
int mg_send_http_redirect (struct mg_connection *conn, const char *target_url, int redirect_code)
 
void mg_send_mime_file (struct mg_connection *conn, const char *path, const char *mime_type)
 
void mg_send_mime_file2 (struct mg_connection *conn, const char *path, const char *mime_type, const char *additional_headers)
 
void mg_set_auth_handler (struct mg_context *ctx, const char *uri, mg_authorization_handler handler, void *cbdata)
 
static void mg_set_handler_type (struct mg_context *phys_ctx, struct mg_domain_context *dom_ctx, const char *uri, int handler_type, int is_delete_request, mg_request_handler handler, struct mg_websocket_subprotocols *subprotocols, 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 (const struct mg_connection *const_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)
 
void mg_set_websocket_handler_with_subprotocols (struct mg_context *ctx, const char *uri, struct mg_websocket_subprotocols *subprotocols, 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, const char *fmt,...)
 
static int mg_socketpair (int *sockA, int *sockB)
 
int mg_split_form_urlencoded (char *data, struct mg_header *form_fields, unsigned num_form_fields)
 
struct mg_contextmg_start (const struct mg_callbacks *callbacks, void *user_data, const char **options)
 
struct mg_contextmg_start2 (struct mg_init_data *init, struct mg_error_data *error)
 
int mg_start_domain (struct mg_context *ctx, const char **options)
 
int mg_start_domain2 (struct mg_context *ctx, const char **options, struct mg_error_data *error)
 
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_start_worker_thread (struct mg_context *ctx, int only_if_no_idle_threads)
 
static int mg_stat (const struct mg_connection *conn, const char *path, struct mg_file_stat *filep)
 
void mg_stop (struct mg_context *ctx)
 
long long mg_store_body (struct mg_connection *conn, const char *path)
 
static size_t mg_str_append (char **dst, char *end, const char *src)
 
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 char * mg_strdup_ctx (const char *str, struct mg_context *ctx)
 
static void mg_strlcpy (char *dst, const char *src, size_t n)
 
int mg_strncasecmp (const char *s1, const char *s2, size_t len)
 
static char * mg_strndup_ctx (const char *ptr, size_t len, struct mg_context *ctx)
 
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 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 mg_file *filep)
 
static int parse_auth_header (struct mg_connection *conn, char *buf, size_t buf_size, struct auth_header *auth_header)
 
static time_t parse_date_string (const char *datetime)
 
static int parse_http_headers (char **buf, struct mg_header hdr[(64)])
 
static int parse_http_request (char *buf, int len, struct mg_request_info *ri)
 
static int parse_http_response (char *buf, int len, struct mg_response_info *ri)
 
static int parse_match_net (const struct vec *vec, const union usa *sa, int no_strict)
 
static int parse_port_string (const struct vec *vec, struct socket *so, int *ip_version)
 
static int parse_range_header (const char *header, int64_t *a, int64_t *b)
 
static int prepare_cgi_environment (struct mg_connection *conn, const char *prog, struct cgi_environment *env, int cgi_config_idx)
 
static int print_dav_dir_entry (struct de *de, void *data)
 
static int print_dir_entry (struct mg_connection *conn, struct de *de)
 
static int print_props (struct mg_connection *conn, const char *uri, const char *name, struct mg_file_stat *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_all (FILE *fp, struct mg_connection *conn, char *buf, int len)
 
static int pull_inner (FILE *fp, struct mg_connection *conn, char *buf, int len, double timeout)
 
static int push_all (struct mg_context *ctx, FILE *fp, SOCKET sock, SSL *ssl, const char *buf, int len)
 
static int push_inner (struct mg_context *ctx, FILE *fp, SOCKET sock, SSL *ssl, const char *buf, int len, double timeout)
 
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 mg_file *filep, struct read_auth_file_struct *workdata, int depth)
 
static int read_message (FILE *fp, struct mg_connection *conn, char *buf, int bufsiz, int *nread)
 
static void redirect_to_https_port (struct mg_connection *conn, int port)
 
static int refresh_trust (struct mg_connection *conn)
 
static void release_handler_ref (struct mg_connection *conn, struct mg_handler_info *handler_info)
 
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_dot_segments (char *inout)
 
static void reset_per_request_attributes (struct mg_connection *conn)
 
static int scan_directory (struct mg_connection *conn, const char *dir, void *data, int(*cb)(struct de *, void *))
 
static void send_additional_header (struct mg_connection *conn)
 
static void send_authorization_request (struct mg_connection *conn, const char *realm)
 
static void send_cors_header (struct mg_connection *conn)
 
static void send_file_data (struct mg_connection *conn, struct mg_file *filep, int64_t offset, int64_t len, int no_buffering)
 
static void 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 mg_file *, int)
 
static void send_static_cache_header (struct mg_connection *conn)
 
static int set_acl_option (struct mg_context *phys_ctx)
 
static int set_blocking_mode (SOCKET sock)
 
static void set_close_on_exec (int fd, const struct mg_connection *conn, struct mg_context *ctx)
 
static int set_gpass_option (struct mg_context *phys_ctx, struct mg_domain_context *dom_ctx)
 
static int set_non_blocking_mode (SOCKET sock)
 
static int set_ports_option (struct mg_context *phys_ctx)
 
static int set_tcp_nodelay (const struct socket *so, int nodelay_on)
 
static int set_throttle (const char *spec, const union usa *rsa, const char *uri)
 
static int set_uid_option (struct mg_context *phys_ctx)
 
static int should_decode_query_string (const struct mg_connection *conn)
 
static int should_decode_url (const struct mg_connection *conn)
 
static int should_keep_alive (const struct mg_connection *conn)
 
static int should_switch_to_protocol (const struct mg_connection *conn)
 
static char * skip_quoted (char **buf, const char *delimiters, const char *whitespace, char quotechar)
 
static int skip_to_end_of_word_and_terminate (char **ppw, int eol)
 
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, int cgi_config_idx)
 
static const char * ssl_error (void)
 
static int ssl_get_client_cert_info (const struct mg_connection *conn, struct mg_client_cert *client_cert)
 
static long ssl_get_protocol (int version_id)
 
static void ssl_info_callback (const SSL *ssl, int what, int ret)
 
static void ssl_locking_callback (int mode, int mutex_num, const char *file, int line)
 
static int ssl_servername_callback (SSL *ssl, int *ad, void *arg)
 
static int ssl_use_pem_file (struct mg_context *phys_ctx, struct mg_domain_context *dom_ctx, const char *pem, const char *chain)
 
static int sslize (struct mg_connection *conn, int(*func)(SSL *), const struct mg_client_options *client_options)
 
static int substitute_index_file (struct mg_connection *conn, char *path, size_t path_len, struct mg_file_stat *filestat)
 
static int substitute_index_file_aux (struct mg_connection *conn, char *path, size_t path_len, struct mg_file_stat *filestat)
 
static const char * suggest_connection_header (const struct mg_connection *conn)
 
static int switch_domain_context (struct mg_connection *conn)
 
static void tls_dtor (void *key)
 
static void uninitialize_openssl (void)
 
static void url_decode_in_place (char *buf)
 
static void * worker_thread (void *thread_func_param)
 
static void worker_thread_run (struct mg_connection *conn)
 

Variables

struct { 
 
   unsigned   default_port 
 
   const char *   proto 
 
   size_t   proto_len 
 
abs_uri_protocols [] 
 
static char * all_methods = NULL
 
struct { 
 
   size_t   ext_len 
 
   const char *   extension 
 
   const char *   mime_type 
 
builtin_mime_types [] 
 
static const struct mg_option config_options []
 
static void * cryptolib_dll_handle
 
static volatile ptrdiff_t cryptolib_users
 
static pthread_mutex_t global_lock_mutex
 
static const struct mg_http_method_info http_methods []
 
static int mg_init_library_called = 0
 
static const char month_names [][4]
 
static pthread_mutexattr_t pthread_mutex_attr
 
static pthread_mutex_t * ssl_mutexes
 
static void * ssllib_dll_handle
 
char static_assert_replacement [1]
 
static pthread_key_t sTlsKey
 
static volatile ptrdiff_t thread_idx_max = 0
 

Macro Definition Documentation

◆ __STDC_FORMAT_MACROS

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

Definition at line 75 of file civetweb.c.

◆ __STDC_LIMIT_MACROS

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

Definition at line 78 of file civetweb.c.

◆ _DARWIN_UNLIMITED_SELECT

#define _DARWIN_UNLIMITED_SELECT

Definition at line 81 of file civetweb.c.

◆ _FILE_OFFSET_BITS

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

Definition at line 72 of file civetweb.c.

◆ _GNU_SOURCE

#define _GNU_SOURCE   /* for setgroups(), pthread_setname_np() */

Definition at line 59 of file civetweb.c.

◆ _LARGEFILE_SOURCE

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

Definition at line 69 of file civetweb.c.

◆ ARRAY_SIZE

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

Definition at line 510 of file civetweb.c.

◆ calloc

Definition at line 1576 of file civetweb.c.

◆ CGI_ENVIRONMENT_SIZE

#define CGI_ENVIRONMENT_SIZE   (4096) /* in bytes */

Definition at line 492 of file civetweb.c.

◆ closesocket

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

Definition at line 937 of file civetweb.c.

◆ CRYPTO_LIB

#define CRYPTO_LIB   "libcrypto.so"

Definition at line 931 of file civetweb.c.

◆ DEBUG_ASSERT

#define DEBUG_ASSERT ( cond)

Definition at line 264 of file civetweb.c.

◆ DEBUG_TRACE

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

Definition at line 246 of file civetweb.c.

◆ ERRNO

#define ERRNO   (errno)

Definition at line 944 of file civetweb.c.

◆ ERROR_TRY_AGAIN

#define ERROR_TRY_AGAIN ( err)     (((err) == EAGAIN) || ((err) == EWOULDBLOCK) || ((err) == EINTR))

Definition at line 451 of file civetweb.c.

◆ free

Definition at line 1578 of file civetweb.c.

◆ FUNCTION_MAY_BE_UNUSED

#define FUNCTION_MAY_BE_UNUSED

Definition at line 320 of file civetweb.c.

◆ HAVE_SOCKETPAIR

#define HAVE_SOCKETPAIR   1

Definition at line 21016 of file civetweb.c.

◆ HEXTOI

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

◆ HTTP1_only

#define HTTP1_only

Definition at line 6830 of file civetweb.c.

◆ IGNORE_UNUSED_RESULT

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

Definition at line 295 of file civetweb.c.

◆ INITIAL_DEPTH

#define INITIAL_DEPTH   9

Definition at line 9014 of file civetweb.c.

◆ INT64_FMT

#define INT64_FMT   PRId64

Definition at line 946 of file civetweb.c.

◆ INT64_MAX

#define INT64_MAX   (9223372036854775807)

Definition at line 517 of file civetweb.c.

◆ INVALID_SOCKET

#define INVALID_SOCKET   (-1)

Definition at line 945 of file civetweb.c.

◆ IP_ADDR_STR_LEN

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

Definition at line 1773 of file civetweb.c.

◆ LOCK_DURATION_S

#define LOCK_DURATION_S   60

Definition at line 2393 of file civetweb.c.

◆ malloc

Definition at line 1575 of file civetweb.c.

◆ MAX_CGI_ENVIR_VARS

#define MAX_CGI_ENVIR_VARS   (256) /* in variables (count) */

Definition at line 497 of file civetweb.c.

◆ MAX_WORKER_THREADS

#define MAX_WORKER_THREADS   (1024 * 64) /* in threads (count) */

Definition at line 469 of file civetweb.c.

◆ MD5_STATIC

#define MD5_STATIC   static

Definition at line 1765 of file civetweb.c.

◆ MG_BUF_LEN

#define MG_BUF_LEN   (1024 * 8)

Definition at line 502 of file civetweb.c.

◆ mg_calloc_ctx

#define mg_calloc_ctx ( a,
b,
c )   mg_calloc(a, b)

Definition at line 1533 of file civetweb.c.

◆ mg_closedir

#define mg_closedir ( x)    (closedir(x))

Definition at line 942 of file civetweb.c.

◆ mg_cry

Definition at line 3584 of file civetweb.c.

◆ mg_cry_ctx_internal

#define mg_cry_ctx_internal ( ctx,
fmt,
... )    mg_cry_internal_wrap(NULL, ctx, __func__, __LINE__, fmt, __VA_ARGS__)

Definition at line 2658 of file civetweb.c.

◆ mg_cry_internal

#define mg_cry_internal ( conn,
fmt,
... )    mg_cry_internal_wrap(conn, NULL, __func__, __LINE__, fmt, __VA_ARGS__)

Definition at line 2655 of file civetweb.c.

◆ MG_FILE_COMPRESSION_SIZE_LIMIT

#define MG_FILE_COMPRESSION_SIZE_LIMIT   (1024) /* in bytes */

Definition at line 482 of file civetweb.c.

◆ MG_FOPEN_MODE_APPEND

#define MG_FOPEN_MODE_APPEND   (4)

Definition at line 2921 of file civetweb.c.

◆ MG_FOPEN_MODE_NONE

#define MG_FOPEN_MODE_NONE   (0)

Definition at line 2912 of file civetweb.c.

◆ MG_FOPEN_MODE_READ

#define MG_FOPEN_MODE_READ   (1)

Definition at line 2915 of file civetweb.c.

◆ MG_FOPEN_MODE_WRITE

#define MG_FOPEN_MODE_WRITE   (2)

Definition at line 2918 of file civetweb.c.

◆ mg_free_ctx

#define mg_free_ctx ( a,
c )   mg_free(a)

Definition at line 1535 of file civetweb.c.

◆ mg_get_option

Definition at line 3257 of file civetweb.c.

◆ mg_malloc_ctx

#define mg_malloc_ctx ( a,
c )   mg_malloc(a)

Definition at line 1532 of file civetweb.c.

◆ mg_mkdir

#define mg_mkdir ( conn,
path,
mode )   (mkdir(path, mode))

Definition at line 938 of file civetweb.c.

◆ mg_opendir

#define mg_opendir ( conn,
x )   (opendir(x))

Definition at line 941 of file civetweb.c.

◆ mg_pollfd

#define mg_pollfd   pollfd

Definition at line 968 of file civetweb.c.

◆ mg_readdir

#define mg_readdir ( x)    (readdir(x))

Definition at line 943 of file civetweb.c.

◆ mg_realloc_ctx

#define mg_realloc_ctx ( a,
b,
c )   mg_realloc(a, b)

Definition at line 1534 of file civetweb.c.

◆ mg_remove

#define mg_remove ( conn,
x )   (remove(x))

Definition at line 939 of file civetweb.c.

◆ mg_sleep

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

Definition at line 940 of file civetweb.c.

◆ mg_static_assert

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

Definition at line 126 of file civetweb.c.

◆ MSG_NOSIGNAL

#define MSG_NOSIGNAL   (0)

Definition at line 1776 of file civetweb.c.

◆ NO_ALTERNATIVE_QUEUE

#define NO_ALTERNATIVE_QUEUE

Definition at line 152 of file civetweb.c.

◆ NUM_WEBDAV_LOCKS

#define NUM_WEBDAV_LOCKS   10

Definition at line 2390 of file civetweb.c.

◆ O_BINARY

#define O_BINARY   (0)

Definition at line 935 of file civetweb.c.

◆ PASSWORDS_FILE_NAME

#define PASSWORDS_FILE_NAME   ".htpasswd"

Definition at line 486 of file civetweb.c.

◆ realloc

Definition at line 1577 of file civetweb.c.

◆ SHUTDOWN_BOTH

#define SHUTDOWN_BOTH   (2)

Definition at line 522 of file civetweb.c.

◆ SHUTDOWN_RD

#define SHUTDOWN_RD   (0)

Definition at line 520 of file civetweb.c.

◆ SHUTDOWN_WR

#define SHUTDOWN_WR   (1)

Definition at line 521 of file civetweb.c.

◆ snprintf

Definition at line 1579 of file civetweb.c.

◆ SOCKET_TIMEOUT_QUANTUM

#define SOCKET_TIMEOUT_QUANTUM   (2000) /* in ms */

Definition at line 477 of file civetweb.c.

◆ SSL_LIB

#define SSL_LIB   "libssl.so"

Definition at line 928 of file civetweb.c.

◆ STOP_FLAG_ASSIGN

#define STOP_FLAG_ASSIGN ( f,
v )   ((*(f)) = (v))

Definition at line 2384 of file civetweb.c.

◆ STOP_FLAG_IS_TWO

#define STOP_FLAG_IS_TWO ( f)    ((*(f)) == 2)

Definition at line 2383 of file civetweb.c.

◆ STOP_FLAG_IS_ZERO

#define STOP_FLAG_IS_ZERO ( f)    ((*(f)) == 0)

Definition at line 2382 of file civetweb.c.

◆ STRUCT_FILE_INITIALIZER

#define STRUCT_FILE_INITIALIZER
Value:
{ \
{(uint64_t)0, (time_t)0, 0, 0, 0}, \
{ \
(FILE *)NULL \
} \
}

Definition at line 1937 of file civetweb.c.

◆ UINT64_FMT

#define UINT64_FMT   PRIu64

Definition at line 947 of file civetweb.c.

◆ USA_IN_PORT_UNSAFE

#define USA_IN_PORT_UNSAFE ( s)    ((s)->sin.sin_port)

Definition at line 1906 of file civetweb.c.

◆ UTF8_PATH_MAX

#define UTF8_PATH_MAX   (PATH_MAX)

Definition at line 865 of file civetweb.c.

◆ va_copy

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

Definition at line 1023 of file civetweb.c.

◆ vsnprintf_impl

#define vsnprintf_impl   vsnprintf

Definition at line 903 of file civetweb.c.

◆ WIN32_LEAN_AND_MEAN

#define WIN32_LEAN_AND_MEAN

Definition at line 175 of file civetweb.c.

◆ WINCDECL

#define WINCDECL

Definition at line 949 of file civetweb.c.

Typedef Documentation

◆ SOCK_OPT_TYPE

Definition at line 867 of file civetweb.c.

◆ SOCKET

Definition at line 948 of file civetweb.c.

◆ stop_flag_t

Definition at line 2381 of file civetweb.c.

Enumeration Type Documentation

◆ anonymous enum

Enumerator
LISTENING_PORTS 
NUM_THREADS 
PRESPAWN_THREADS 
RUN_AS_USER 
CONFIG_TCP_NODELAY 
MAX_REQUEST_SIZE 
LINGER_TIMEOUT 
CONNECTION_QUEUE_SIZE 
LISTEN_BACKLOG_SIZE 
THROTTLE 
ENABLE_KEEP_ALIVE 
REQUEST_TIMEOUT 
KEEP_ALIVE_TIMEOUT 
DECODE_URL 
DECODE_QUERY_STRING 
DOCUMENT_ROOT 
FALLBACK_DOCUMENT_ROOT 
ACCESS_LOG_FILE 
ERROR_LOG_FILE 
CGI_EXTENSIONS 
CGI_ENVIRONMENT 
CGI_INTERPRETER 
CGI_INTERPRETER_ARGS 
CGI_BUFFERING 
CGI2_EXTENSIONS 
CGI2_ENVIRONMENT 
CGI2_INTERPRETER 
CGI2_INTERPRETER_ARGS 
CGI2_BUFFERING 
PUT_DELETE_PASSWORDS_FILE 
PROTECT_URI 
AUTHENTICATION_DOMAIN 
ENABLE_AUTH_DOMAIN_CHECK 
SSI_EXTENSIONS 
ENABLE_DIRECTORY_LISTING 
ENABLE_WEBDAV 
GLOBAL_PASSWORDS_FILE 
INDEX_FILES 
ACCESS_CONTROL_LIST 
EXTRA_MIME_TYPES 
SSL_CERTIFICATE 
SSL_CERTIFICATE_CHAIN 
URL_REWRITE_PATTERN 
HIDE_FILES 
SSL_DO_VERIFY_PEER 
SSL_CACHE_TIMEOUT 
SSL_CA_PATH 
SSL_CA_FILE 
SSL_VERIFY_DEPTH 
SSL_DEFAULT_VERIFY_PATHS 
SSL_CIPHER_LIST 
SSL_PROTOCOL_VERSION 
SSL_SHORT_TRUST 
ACCESS_CONTROL_ALLOW_ORIGIN 
ACCESS_CONTROL_ALLOW_METHODS 
ACCESS_CONTROL_ALLOW_HEADERS 
ACCESS_CONTROL_EXPOSE_HEADERS 
ACCESS_CONTROL_ALLOW_CREDENTIALS 
ERROR_PAGES 
STATIC_FILE_MAX_AGE 
STATIC_FILE_CACHE_CONTROL 
STRICT_HTTPS_MAX_AGE 
ADDITIONAL_HEADER 
ALLOW_INDEX_SCRIPT_SUB_RES 
NUM_OPTIONS 

Definition at line 1966 of file civetweb.c.

◆ anonymous enum

Enumerator
REQUEST_HANDLER 
WEBSOCKET_HANDLER 
AUTH_HANDLER 

Definition at line 2283 of file civetweb.c.

◆ anonymous enum

Enumerator
CONTEXT_INVALID 
CONTEXT_SERVER 
CONTEXT_HTTP_CLIENT 
CONTEXT_WS_CLIENT 

Definition at line 2319 of file civetweb.c.

◆ anonymous enum

Enumerator
CONNECTION_TYPE_INVALID 
CONNECTION_TYPE_REQUEST 
CONNECTION_TYPE_RESPONSE 

Definition at line 2532 of file civetweb.c.

◆ anonymous enum

Enumerator
PROTOCOL_TYPE_HTTP1 
PROTOCOL_TYPE_WEBSOCKET 
PROTOCOL_TYPE_HTTP2 

Definition at line 2538 of file civetweb.c.

Function Documentation

◆ abort_cgi_process()

static int abort_cgi_process ( void * data)
static

Definition at line 11871 of file civetweb.c.

◆ accept_new_connection()

static void accept_new_connection ( const struct socket * listener,
struct mg_context * ctx )
static

Definition at line 20476 of file civetweb.c.

◆ addenv()

static void addenv ( struct cgi_environment * env,
const char * fmt,
... )
static

Definition at line 11598 of file civetweb.c.

◆ alloc_printf()

static int alloc_printf ( char ** out_buf,
const char * fmt,
... )
static

Definition at line 7217 of file civetweb.c.

◆ alloc_vprintf()

static int alloc_vprintf ( char ** out_buf,
char * prealloc_buf,
size_t prealloc_size,
const char * fmt,
va_list ap )
static

Definition at line 7160 of file civetweb.c.

◆ alloc_vprintf2()

static int alloc_vprintf2 ( char ** buf,
const char * fmt,
va_list ap )
static

Definition at line 7127 of file civetweb.c.

◆ authorize()

static int authorize ( struct mg_connection * conn,
struct mg_file * filep,
const char * realm )
static

Definition at line 9160 of file civetweb.c.

◆ b64reverse()

static unsigned char b64reverse ( char letter)
static

Definition at line 7579 of file civetweb.c.

◆ bin2str()

static void bin2str ( char * to,
const unsigned char * p,
size_t len )
static

Definition at line 8688 of file civetweb.c.

◆ check_acl()

static int check_acl ( struct mg_context * phys_ctx,
const union usa * sa )
static

Definition at line 16622 of file civetweb.c.

◆ check_authorization()

static int check_authorization ( struct mg_connection * conn,
const char * path )
static

Definition at line 9217 of file civetweb.c.

◆ check_password_digest()

static int check_password_digest ( 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

Definition at line 8726 of file civetweb.c.

◆ close_all_listening_sockets()

static void close_all_listening_sockets ( struct mg_context * ctx)
static

Definition at line 15794 of file civetweb.c.

◆ close_connection()

static void close_connection ( struct mg_connection * conn)
static

Definition at line 18299 of file civetweb.c.

◆ close_socket_gracefully()

static void close_socket_gracefully ( struct mg_connection * conn)
static

Definition at line 18175 of file civetweb.c.

◆ compare_dir_entries()

static int compare_dir_entries ( const void * p1,
const void * p2,
void * arg )
static

Definition at line 10024 of file civetweb.c.

◆ connect_socket()

static int connect_socket ( struct mg_context * ctx,
const char * host,
int port,
int use_ssl,
struct mg_error_data * error,
SOCKET * sock,
union usa * sa )
static

Definition at line 9586 of file civetweb.c.

◆ construct_etag()

static void construct_etag ( char * buf,
size_t buf_len,
const struct mg_file_stat * filestat )
static

Definition at line 10492 of file civetweb.c.

◆ consume_socket()

static int consume_socket ( struct mg_context * ctx,
struct socket * sp,
int thread_index,
int counter_was_preincremented )
static

Definition at line 20108 of file civetweb.c.

◆ dav_lock_file()

static void dav_lock_file ( struct mg_connection * conn,
const char * path )
static

Definition at line 13121 of file civetweb.c.

◆ dav_mkcol()

static void dav_mkcol ( struct mg_connection * conn,
const char * path )
static

Definition at line 12234 of file civetweb.c.

◆ dav_move_file()

static void dav_move_file ( struct mg_connection * conn,
const char * path,
int do_copy )
static

Definition at line 12313 of file civetweb.c.

◆ dav_proppatch()

static void dav_proppatch ( struct mg_connection * conn,
const char * path )
static

Definition at line 13286 of file civetweb.c.

◆ dav_unlock_file()

static void dav_unlock_file ( struct mg_connection * conn,
const char * path )
static

Definition at line 13253 of file civetweb.c.

◆ delete_file()

static void delete_file ( struct mg_connection * conn,
const char * path )
static

Definition at line 12612 of file civetweb.c.

◆ dir_scan_callback()

static int dir_scan_callback ( struct de * de,
void * data )
static

Definition at line 10219 of file civetweb.c.

◆ discard_unread_request_data()

static void discard_unread_request_data ( struct mg_connection * conn)
static

Definition at line 6705 of file civetweb.c.

◆ do_ssi_exec()

static void do_ssi_exec ( struct mg_connection * conn,
char * tag )
static

Definition at line 12762 of file civetweb.c.

◆ do_ssi_include()

static void do_ssi_include ( struct mg_connection * conn,
const char * ssi,
char * tag,
int include_level )
static

Definition at line 12677 of file civetweb.c.

◆ extention_matches_script()

static int extention_matches_script ( struct mg_connection * conn,
const char * filename )
static

Definition at line 7725 of file civetweb.c.

◆ extention_matches_template_text()

static int extention_matches_template_text ( struct mg_connection * conn,
const char * filename )
static

Definition at line 7771 of file civetweb.c.

◆ fake_connection()

static struct mg_connection * fake_connection ( struct mg_connection * fc,
struct mg_context * ctx )
static

Definition at line 3544 of file civetweb.c.

◆ fclose_on_exec()

static void fclose_on_exec ( struct mg_file_access * filep,
struct mg_connection * conn )
static

Definition at line 10507 of file civetweb.c.

◆ forward_body_data()

static int forward_body_data ( struct mg_connection * conn,
FILE * fp,
SOCKET sock,
SSL * ssl )
static

Definition at line 11498 of file civetweb.c.

◆ free_context()

static void free_context ( struct mg_context * ctx)
static

Definition at line 20778 of file civetweb.c.

◆ get_first_ssl_listener_index()

static int get_first_ssl_listener_index ( const struct mg_context * ctx)
static

Definition at line 14443 of file civetweb.c.

◆ get_header()

static const char * get_header ( const struct mg_header * hdr,
int num_hdr,
const char * name )
static

Definition at line 3894 of file civetweb.c.

◆ get_host_from_request_info()

static void get_host_from_request_info ( struct vec * host,
const struct mg_request_info * ri )
static

Definition at line 14458 of file civetweb.c.

◆ get_http_header_len()

static int get_http_header_len ( const char * buf,
int buflen )
static

Definition at line 8245 of file civetweb.c.

◆ get_http_method_info()

static const struct mg_http_method_info * get_http_method_info ( const char * method)
static

Definition at line 11194 of file civetweb.c.

◆ get_http_version()

static const char * get_http_version ( const struct mg_connection * conn)
static

Definition at line 3950 of file civetweb.c.

◆ get_message()

static int get_message ( struct mg_connection * conn,
char * ebuf,
size_t ebuf_len,
int * err )
static

Definition at line 19013 of file civetweb.c.

◆ get_mime_type()

static void get_mime_type ( struct mg_connection * conn,
const char * path,
struct vec * vec )
static

Definition at line 8653 of file civetweb.c.

◆ get_month_index()

static int get_month_index ( const char * s)
static

Definition at line 8282 of file civetweb.c.

◆ get_option_index()

static int get_option_index ( const char * name)
static

Definition at line 3231 of file civetweb.c.

◆ get_proto_name()

static const char * get_proto_name ( const struct mg_connection * conn)
static

Definition at line 3648 of file civetweb.c.

◆ get_random()

static uint64_t get_random ( void )
static

Definition at line 6024 of file civetweb.c.

◆ get_rel_url_at_current_server()

static const char * get_rel_url_at_current_server ( const char * uri,
const struct mg_connection * conn )
static

Definition at line 18909 of file civetweb.c.

◆ get_req_headers()

static int get_req_headers ( const struct mg_request_info * ri,
const char * name,
const char ** output,
int output_max_size )
static

Definition at line 3910 of file civetweb.c.

◆ get_request()

static int get_request ( struct mg_connection * conn,
char * ebuf,
size_t ebuf_len,
int * err )
static

Definition at line 19090 of file civetweb.c.

◆ get_request_handler()

static int get_request_handler ( struct mg_connection * conn,
int handler_type,
mg_request_handler * handler,
struct mg_websocket_subprotocols ** subprotocols,
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,
struct mg_handler_info ** handler_info )
static

Definition at line 14882 of file civetweb.c.

◆ get_response()

static int get_response ( struct mg_connection * conn,
char * ebuf,
size_t ebuf_len,
int * err )
static

Definition at line 19182 of file civetweb.c.

◆ get_system_name()

static void get_system_name ( char ** sysName)
static

Definition at line 20939 of file civetweb.c.

◆ get_uri_type()

static int get_uri_type ( const char * uri)
static

Definition at line 18839 of file civetweb.c.

◆ gmt_time_string()

static void gmt_time_string ( char * buf,
size_t buf_len,
time_t * t )
static

Definition at line 3415 of file civetweb.c.

◆ handle_cgi_request()

static void handle_cgi_request ( struct mg_connection * conn,
const char * prog,
int cgi_config_idx )
static

Definition at line 11906 of file civetweb.c.

◆ handle_directory_request()

static void handle_directory_request ( struct mg_connection * conn,
const char * dir )
static

Definition at line 10250 of file civetweb.c.

◆ handle_file_based_request()

static void handle_file_based_request ( struct mg_connection * conn,
const char * path,
struct mg_file * filep )
static

Definition at line 15692 of file civetweb.c.

◆ handle_not_modified_static_file_request()

static void handle_not_modified_static_file_request ( struct mg_connection * conn,
struct mg_file * filep )
static

Definition at line 10794 of file civetweb.c.

◆ handle_propfind()

static void handle_propfind ( struct mg_connection * conn,
const char * path,
struct mg_file_stat * filep )
static

Definition at line 13078 of file civetweb.c.

◆ handle_request()

static void handle_request ( struct mg_connection * conn)
static

Definition at line 15026 of file civetweb.c.

◆ handle_request_stat_log()

static void handle_request_stat_log ( struct mg_connection * conn)
static

Definition at line 6783 of file civetweb.c.

◆ handle_ssi_file_request()

static void handle_ssi_file_request ( struct mg_connection * conn,
const char * path,
struct mg_file * filep )
static

Definition at line 12907 of file civetweb.c.

◆ handle_static_file_request()

static void handle_static_file_request ( struct mg_connection * conn,
const char * path,
struct mg_file * filep,
const char * mime_type,
const char * additional_headers )
static

Definition at line 10531 of file civetweb.c.

◆ header_has_option()

static int header_has_option ( const char * header,
const char * option )
static

Definition at line 4030 of file civetweb.c.

◆ header_val()

static const char * header_val ( const struct mg_connection * conn,
const char * header )
static

Definition at line 16439 of file civetweb.c.

◆ hexdump2string()

static int hexdump2string ( void * mem,
int memlen,
char * buf,
int buflen )
static

Definition at line 17029 of file civetweb.c.

◆ init_connection()

static void init_connection ( struct mg_connection * conn)
static

Definition at line 19797 of file civetweb.c.

◆ init_ssl_ctx()

static int init_ssl_ctx ( struct mg_context * phys_ctx,
struct mg_domain_context * dom_ctx )
static

Definition at line 17920 of file civetweb.c.

◆ init_ssl_ctx_impl()

static int init_ssl_ctx_impl ( struct mg_context * phys_ctx,
struct mg_domain_context * dom_ctx,
const char * pem,
const char * chain )
static

Definition at line 17674 of file civetweb.c.

◆ initialize_openssl()

static int initialize_openssl ( char * ebuf,
size_t ebuf_len )
static

Definition at line 17256 of file civetweb.c.

◆ interpret_uri()

static void interpret_uri ( struct mg_connection * conn,
char * filename,
size_t filename_buf_len,
struct mg_file_stat * filestat,
int * is_found,
int * is_script_resource,
int * is_websocket_request,
int * is_put_or_delete_request,
int * is_webdav_request,
int * is_template_text )
static

Definition at line 7898 of file civetweb.c.

◆ is_authorized_for_put()

static int is_authorized_for_put ( struct mg_connection * conn)
static

Definition at line 9334 of file civetweb.c.

◆ is_civetweb_webdav_method()

static int is_civetweb_webdav_method ( const struct mg_connection * conn)
static

Definition at line 7703 of file civetweb.c.

◆ is_file_opened()

static int is_file_opened ( const struct mg_file_access * fileacc)
static

Definition at line 2925 of file civetweb.c.

◆ is_in_script_path()

static int is_in_script_path ( const struct mg_connection * conn,
const char * path )
static

Definition at line 14967 of file civetweb.c.

◆ is_not_modified()

static int is_not_modified ( const struct mg_connection * conn,
const struct mg_file_stat * filestat )
static

Definition at line 10779 of file civetweb.c.

◆ is_put_or_delete_method()

static int is_put_or_delete_method ( const struct mg_connection * conn)
static

Definition at line 7685 of file civetweb.c.

◆ is_ssl_port_used()

static int is_ssl_port_used ( const char * ports)
static

Definition at line 16041 of file civetweb.c.

◆ is_valid_http_method()

static int is_valid_http_method ( const char * method)
static

Definition at line 11213 of file civetweb.c.

◆ is_valid_port()

static int is_valid_port ( unsigned long port)
static

Definition at line 9538 of file civetweb.c.

◆ legacy_init()

static void legacy_init ( const char ** options)
static

Definition at line 20988 of file civetweb.c.

◆ load_tls_dll()

static void * load_tls_dll ( char * ebuf,
size_t ebuf_len,
const char * dll_name,
struct ssl_func * sw,
int * feature_missing )
static

Definition at line 17150 of file civetweb.c.

◆ log_access()

static void log_access ( const struct mg_connection * conn)
static

Definition at line 16456 of file civetweb.c.

◆ lowercase()

static int lowercase ( const char * s)
static

Definition at line 3084 of file civetweb.c.

◆ master_thread()

static void * master_thread ( void * thread_func_param)
static

Definition at line 20760 of file civetweb.c.

◆ master_thread_run()

static void master_thread_run ( struct mg_context * ctx)
static

Definition at line 20564 of file civetweb.c.

◆ mg_atomic_dec()

static ptrdiff_t mg_atomic_dec ( volatile ptrdiff_t * addr)
static

Definition at line 1172 of file civetweb.c.

◆ mg_atomic_inc()

static ptrdiff_t mg_atomic_inc ( volatile ptrdiff_t * addr)
static

Definition at line 1141 of file civetweb.c.

◆ mg_base64_decode()

int mg_base64_decode ( const char * src,
size_t src_len,
unsigned char * dst,
size_t * dst_len )

Definition at line 7604 of file civetweb.c.

◆ mg_base64_encode()

int mg_base64_encode ( const unsigned char * src,
size_t src_len,
char * dst,
size_t * dst_len )

Definition at line 7526 of file civetweb.c.

◆ mg_calloc()

static __inline void * mg_calloc ( size_t a,
size_t b )
static

Definition at line 1515 of file civetweb.c.

◆ mg_check_digest_access_authentication()

int mg_check_digest_access_authentication ( struct mg_connection * conn,
const char * realm,
const char * filename )

Definition at line 9192 of file civetweb.c.

◆ mg_check_feature()

unsigned mg_check_feature ( unsigned feature)

Definition at line 22103 of file civetweb.c.

◆ mg_close_connection()

void mg_close_connection ( struct mg_connection * conn)

Definition at line 18378 of file civetweb.c.

◆ 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 )

Definition at line 18697 of file civetweb.c.

◆ mg_connect_client_impl()

static struct mg_connection * mg_connect_client_impl ( const struct mg_client_options * client_options,
int use_ssl,
struct mg_init_data * init,
struct mg_error_data * error )
static

Definition at line 18442 of file civetweb.c.

◆ mg_connect_client_secure()

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 18681 of file civetweb.c.

◆ 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 )

Definition at line 19677 of file civetweb.c.

◆ mg_connect_websocket_client_extensions()

struct mg_connection * mg_connect_websocket_client_extensions ( const char * host,
int port,
int use_ssl,
char * error_buffer,
size_t error_buffer_size,
const char * path,
const char * origin,
const char * extensions,
mg_websocket_data_handler data_func,
mg_websocket_close_handler close_func,
void * user_data )

Definition at line 19737 of file civetweb.c.

◆ mg_connect_websocket_client_impl()

static struct mg_connection * mg_connect_websocket_client_impl ( const struct mg_client_options * client_options,
int use_ssl,
char * error_buffer,
size_t error_buffer_size,
const char * path,
const char * origin,
const char * extensions,
mg_websocket_data_handler data_func,
mg_websocket_close_handler close_func,
void * user_data )
static

Definition at line 19460 of file civetweb.c.

◆ mg_connect_websocket_client_secure()

struct mg_connection * mg_connect_websocket_client_secure ( const struct mg_client_options * client_options,
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 19710 of file civetweb.c.

◆ mg_connect_websocket_client_secure_extensions()

struct mg_connection * mg_connect_websocket_client_secure_extensions ( const struct mg_client_options * client_options,
char * error_buffer,
size_t error_buffer_size,
const char * path,
const char * origin,
const char * extensions,
mg_websocket_data_handler data_func,
mg_websocket_close_handler close_func,
void * user_data )

Definition at line 19768 of file civetweb.c.

◆ mg_construct_local_link()

static int mg_construct_local_link ( const struct mg_connection * conn,
char * buf,
size_t buflen,
const char * define_proto,
int define_port,
const char * define_uri )
static

Definition at line 3675 of file civetweb.c.

◆ mg_cry()

void mg_cry ( const struct mg_connection * conn,
const char * fmt,
... )

Definition at line 3575 of file civetweb.c.

◆ mg_cry_internal_impl()

static void mg_cry_internal_impl ( const struct mg_connection * conn,
const char * func,
unsigned line,
const char * fmt,
va_list ap )
static

Definition at line 3456 of file civetweb.c.

◆ mg_cry_internal_wrap()

static void mg_cry_internal_wrap ( const struct mg_connection * conn,
struct mg_context * ctx,
const char * func,
unsigned line,
const char * fmt,
... )
static

Definition at line 3555 of file civetweb.c.

◆ mg_current_thread_id()

static unsigned long mg_current_thread_id ( void )
static

Definition at line 1667 of file civetweb.c.

◆ mg_difftimespec()

static double mg_difftimespec ( const struct timespec * ts_now,
const struct timespec * ts_before )
static

Definition at line 3438 of file civetweb.c.

◆ mg_disable_connection_keep_alive()

void mg_disable_connection_keep_alive ( struct mg_connection * conn)

Definition at line 22725 of file civetweb.c.

◆ mg_download()

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 19319 of file civetweb.c.

◆ mg_exit_library()

unsigned mg_exit_library ( void )

Definition at line 23160 of file civetweb.c.

◆ mg_fclose()

static int mg_fclose ( struct mg_file_access * fileacc)
static

Definition at line 3058 of file civetweb.c.

◆ mg_fgetc()

static int mg_fgetc ( struct mg_file * filep)
static

Definition at line 12786 of file civetweb.c.

◆ mg_fgets()

static const char * mg_fgets ( char * buf,
size_t size,
struct mg_file * filep )
static

Definition at line 8995 of file civetweb.c.

◆ mg_fopen()

static int mg_fopen ( const struct mg_connection * conn,
const char * path,
int mode,
struct mg_file * filep )
static

Definition at line 2987 of file civetweb.c.

◆ mg_free()

static __inline void mg_free ( void * a)
static

Definition at line 1527 of file civetweb.c.

◆ mg_get_builtin_mime_type()

const char * mg_get_builtin_mime_type ( const char * path)

Definition at line 8631 of file civetweb.c.

◆ mg_get_context()

struct mg_context * mg_get_context ( const struct mg_connection * conn)

Definition at line 3260 of file civetweb.c.

◆ mg_get_context_info()

int mg_get_context_info ( const struct mg_context * ctx,
char * buffer,
int buflen )

Definition at line 22526 of file civetweb.c.

◆ mg_get_cookie()

int mg_get_cookie ( const char * cookie_header,
const char * var_name,
char * dst,
size_t dst_size )

Definition at line 7477 of file civetweb.c.

◆ mg_get_current_time_ns()

static uint64_t mg_get_current_time_ns ( void )
static

Definition at line 1717 of file civetweb.c.

◆ mg_get_header()

const char * mg_get_header ( const struct mg_connection * conn,
const char * name )

Definition at line 3929 of file civetweb.c.

◆ mg_get_option()

const char * mg_get_option ( const struct mg_context * ctx,
const char * name )

Definition at line 3245 of file civetweb.c.

◆ mg_get_request_info()

const struct mg_request_info * mg_get_request_info ( const struct mg_connection * conn)

Definition at line 3595 of file civetweb.c.

◆ mg_get_request_link()

int mg_get_request_link ( const struct mg_connection * conn,
char * buf,
size_t buflen )

Definition at line 3819 of file civetweb.c.

◆ mg_get_response()

int mg_get_response ( struct mg_connection * conn,
char * ebuf,
size_t ebuf_len,
int timeout )

Definition at line 19267 of file civetweb.c.

◆ mg_get_response_code_text()

const char * mg_get_response_code_text ( const struct mg_connection * conn,
int response_code )

Definition at line 4291 of file civetweb.c.

◆ mg_get_response_info()

const struct mg_response_info * mg_get_response_info ( const struct mg_connection * conn)

Definition at line 3635 of file civetweb.c.

◆ mg_get_server_ports()

int mg_get_server_ports ( const struct mg_context * ctx,
int size,
struct mg_server_port * ports )

Definition at line 3320 of file civetweb.c.

◆ mg_get_system_info()

int mg_get_system_info ( char * buffer,
int buflen )

Definition at line 22185 of file civetweb.c.

◆ mg_get_thread_pointer()

void * mg_get_thread_pointer ( const struct mg_connection * conn)

Definition at line 3281 of file civetweb.c.

◆ mg_get_user_connection_data()

void * mg_get_user_connection_data ( const struct mg_connection * conn)

Definition at line 3310 of file civetweb.c.

◆ mg_get_user_context_data()

void * mg_get_user_context_data ( const struct mg_connection * conn)

Definition at line 3274 of file civetweb.c.

◆ mg_get_user_data()

void * mg_get_user_data ( const struct mg_context * ctx)

Definition at line 3267 of file civetweb.c.

◆ mg_get_valid_options()

const struct mg_option * mg_get_valid_options ( void )

Definition at line 2905 of file civetweb.c.

◆ mg_get_var()

int mg_get_var ( const char * data,
size_t data_len,
const char * name,
char * dst,
size_t dst_len )

Definition at line 7309 of file civetweb.c.

◆ 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 )

Definition at line 7320 of file civetweb.c.

◆ mg_global_lock()

static void mg_global_lock ( void )
static

Definition at line 1114 of file civetweb.c.

◆ mg_global_unlock()

static void mg_global_unlock ( void )
static

Definition at line 1122 of file civetweb.c.

◆ mg_inet_pton()

static int mg_inet_pton ( int af,
const char * src,
void * dst,
size_t dstlen,
int resolve_src )
static

Definition at line 9545 of file civetweb.c.

◆ mg_init_library()

unsigned mg_init_library ( unsigned features)

Definition at line 23030 of file civetweb.c.

◆ mg_join_thread()

static int mg_join_thread ( pthread_t threadid)
static

Definition at line 5872 of file civetweb.c.

◆ mg_lock_connection()

void mg_lock_connection ( struct mg_connection * conn)

Definition at line 13322 of file civetweb.c.

◆ mg_lock_context()

void mg_lock_context ( struct mg_context * ctx)

Definition at line 13340 of file civetweb.c.

◆ mg_malloc()

static __inline void * mg_malloc ( size_t a)
static

Definition at line 1509 of file civetweb.c.

◆ mg_md5()

char * mg_md5 ( char buf[33],
... )

Definition at line 8703 of file civetweb.c.

◆ mg_modify_passwords_file()

int mg_modify_passwords_file ( const char * fname,
const char * domain,
const char * user,
const char * pass )

Definition at line 9519 of file civetweb.c.

◆ mg_modify_passwords_file_ha1()

int mg_modify_passwords_file_ha1 ( const char * fname,
const char * domain,
const char * user,
const char * ha1 )

Definition at line 9356 of file civetweb.c.

◆ mg_path_suspicious()

static int mg_path_suspicious ( const struct mg_connection * conn,
const char * path )
static

Definition at line 2943 of file civetweb.c.

◆ mg_poll()

static int mg_poll ( struct pollfd * pfd,
unsigned int n,
int milliseconds,
const stop_flag_t * stop_flag )
static

Definition at line 6053 of file civetweb.c.

◆ mg_printf()

int mg_printf ( struct mg_connection * conn,
const char * fmt,
... )

Definition at line 7255 of file civetweb.c.

◆ mg_read()

int mg_read ( struct mg_connection * conn,
void * buf,
size_t len )

Definition at line 6835 of file civetweb.c.

◆ mg_read_inner()

static int mg_read_inner ( struct mg_connection * conn,
void * buf,
size_t len )
static

Definition at line 6715 of file civetweb.c.

◆ mg_realloc()

static __inline void * mg_realloc ( void * a,
size_t b )
static

Definition at line 1521 of file civetweb.c.

◆ mg_send_chunk()

int mg_send_chunk ( struct mg_connection * conn,
const char * chunk,
unsigned int chunk_len )

Definition at line 7081 of file civetweb.c.

◆ mg_send_digest_access_authentication_request()

int mg_send_digest_access_authentication_request ( struct mg_connection * conn,
const char * realm )

Definition at line 9321 of file civetweb.c.

◆ mg_send_file()

void mg_send_file ( struct mg_connection * conn,
const char * path )

Definition at line 10821 of file civetweb.c.

◆ mg_send_file_body()

int mg_send_file_body ( struct mg_connection * conn,
const char * path )

Definition at line 10762 of file civetweb.c.

◆ mg_send_http_error()

int mg_send_http_error ( struct mg_connection * conn,
int status,
const char * fmt,
... )

Definition at line 4677 of file civetweb.c.

◆ mg_send_http_error_impl()

static int mg_send_http_error_impl ( struct mg_connection * conn,
int status,
const char * fmt,
va_list args )
static

Definition at line 4490 of file civetweb.c.

◆ mg_send_http_ok()

int mg_send_http_ok ( struct mg_connection * conn,
const char * mime_type,
long long content_length )

Definition at line 4691 of file civetweb.c.

◆ mg_send_http_redirect()

int mg_send_http_redirect ( struct mg_connection * conn,
const char * target_url,
int redirect_code )

Definition at line 4733 of file civetweb.c.

◆ mg_send_mime_file()

void mg_send_mime_file ( struct mg_connection * conn,
const char * path,
const char * mime_type )

Definition at line 10828 of file civetweb.c.

◆ mg_send_mime_file2()

void mg_send_mime_file2 ( struct mg_connection * conn,
const char * path,
const char * mime_type,
const char * additional_headers )

Definition at line 10837 of file civetweb.c.

◆ mg_set_auth_handler()

void mg_set_auth_handler ( struct mg_context * ctx,
const char * uri,
mg_authorization_handler handler,
void * cbdata )

Definition at line 14860 of file civetweb.c.

◆ mg_set_handler_type()

static void mg_set_handler_type ( struct mg_context * phys_ctx,
struct mg_domain_context * dom_ctx,
const char * uri,
int handler_type,
int is_delete_request,
mg_request_handler handler,
struct mg_websocket_subprotocols * subprotocols,
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

Definition at line 14602 of file civetweb.c.

◆ mg_set_request_handler()

void mg_set_request_handler ( struct mg_context * ctx,
const char * uri,
mg_request_handler handler,
void * cbdata )

Definition at line 14788 of file civetweb.c.

◆ mg_set_thread_name()

static void mg_set_thread_name ( const char * name)
static

Definition at line 2852 of file civetweb.c.

◆ mg_set_user_connection_data()

void mg_set_user_connection_data ( const struct mg_connection * const_conn,
void * data )

Definition at line 3297 of file civetweb.c.

◆ 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 )

Definition at line 14810 of file civetweb.c.

◆ mg_set_websocket_handler_with_subprotocols()

void mg_set_websocket_handler_with_subprotocols ( struct mg_context * ctx,
const char * uri,
struct mg_websocket_subprotocols * subprotocols,
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 14830 of file civetweb.c.

◆ mg_snprintf()

static void mg_snprintf ( const struct mg_connection * conn,
int * truncated,
char * buf,
size_t buflen,
const char * fmt,
... )
static

Definition at line 3215 of file civetweb.c.

◆ mg_socketpair()

static int mg_socketpair ( int * sockA,
int * sockB )
static

Definition at line 21020 of file civetweb.c.

◆ mg_split_form_urlencoded()

int mg_split_form_urlencoded ( char * data,
struct mg_header * form_fields,
unsigned num_form_fields )

Definition at line 7378 of file civetweb.c.

◆ mg_start()

struct mg_context * mg_start ( const struct mg_callbacks * callbacks,
void * user_data,
const char ** options )

Definition at line 21878 of file civetweb.c.

◆ mg_start2()

struct mg_context * mg_start2 ( struct mg_init_data * init,
struct mg_error_data * error )

Definition at line 21125 of file civetweb.c.

◆ mg_start_domain()

int mg_start_domain ( struct mg_context * ctx,
const char ** options )

Definition at line 22095 of file civetweb.c.

◆ mg_start_domain2()

int mg_start_domain2 ( struct mg_context * ctx,
const char ** options,
struct mg_error_data * error )

Definition at line 21893 of file civetweb.c.

◆ mg_start_thread()

int mg_start_thread ( mg_thread_func_t func,
void * param )

Definition at line 5815 of file civetweb.c.

◆ mg_start_thread_with_id()

static int mg_start_thread_with_id ( mg_thread_func_t func,
void * param,
pthread_t * threadidptr )
static

Definition at line 5841 of file civetweb.c.

◆ mg_start_worker_thread()

static int mg_start_worker_thread ( struct mg_context * ctx,
int only_if_no_idle_threads )
static

Definition at line 21083 of file civetweb.c.

◆ mg_stat()

static int mg_stat ( const struct mg_connection * conn,
const char * path,
struct mg_file_stat * filep )
static

Definition at line 5765 of file civetweb.c.

◆ mg_stop()

void mg_stop ( struct mg_context * ctx)

Definition at line 20890 of file civetweb.c.

◆ mg_store_body()

long long mg_store_body ( struct mg_connection * conn,
const char * path )

Definition at line 10933 of file civetweb.c.

◆ mg_str_append()

static size_t mg_str_append ( char ** dst,
char * end,
const char * src )
static

Definition at line 22166 of file civetweb.c.

◆ mg_strcasecmp()

int mg_strcasecmp ( const char * s1,
const char * s2 )

Definition at line 3106 of file civetweb.c.

◆ mg_strcasestr()

static const char * mg_strcasestr ( const char * big_str,
const char * small_str )
static

Definition at line 3147 of file civetweb.c.

◆ mg_strdup()

static char * mg_strdup ( const char * str)
static

Definition at line 3140 of file civetweb.c.

◆ mg_strdup_ctx()

static char * mg_strdup_ctx ( const char * str,
struct mg_context * ctx )
static

Definition at line 3134 of file civetweb.c.

◆ mg_strlcpy()

static void mg_strlcpy ( char * dst,
const char * src,
size_t n )
static

Definition at line 3074 of file civetweb.c.

◆ mg_strncasecmp()

int mg_strncasecmp ( const char * s1,
const char * s2,
size_t len )

Definition at line 3091 of file civetweb.c.

◆ mg_strndup_ctx()

static char * mg_strndup_ctx ( const char * ptr,
size_t len,
struct mg_context * ctx )
static

Definition at line 3119 of file civetweb.c.

◆ mg_unlock_connection()

void mg_unlock_connection ( struct mg_connection * conn)

Definition at line 13331 of file civetweb.c.

◆ mg_unlock_context()

void mg_unlock_context ( struct mg_context * ctx)

Definition at line 13349 of file civetweb.c.

◆ mg_url_decode()

int mg_url_decode ( const char * src,
int src_len,
char * dst,
int dst_len,
int is_form_url_encoded )

Definition at line 7269 of file civetweb.c.

◆ mg_url_encode()

int mg_url_encode ( const char * src,
char * dst,
size_t dst_len )

Definition at line 9889 of file civetweb.c.

◆ mg_version()

const char * mg_version ( void )

Definition at line 3588 of file civetweb.c.

◆ mg_vprintf()

static int mg_vprintf ( struct mg_connection * conn,
const char * fmt,
va_list ap )
static

Definition at line 7237 of file civetweb.c.

◆ 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

Definition at line 3166 of file civetweb.c.

◆ mg_write()

int mg_write ( struct mg_connection * conn,
const void * buf,
size_t len )

Definition at line 7000 of file civetweb.c.

◆ must_hide_file()

static int must_hide_file ( struct mg_connection * conn,
const char * path )
static

Definition at line 10071 of file civetweb.c.

◆ next_option()

static const char * next_option ( const char * list,
struct vec * val,
struct vec * eq_val )
static

Definition at line 3973 of file civetweb.c.

◆ open_auth_file()

static void open_auth_file ( struct mg_connection * conn,
const char * path,
struct mg_file * filep )
static

Definition at line 8771 of file civetweb.c.

◆ parse_auth_header()

static int parse_auth_header ( struct mg_connection * conn,
char * buf,
size_t buf_size,
struct auth_header * auth_header )
static

Definition at line 8854 of file civetweb.c.

◆ parse_date_string()

static time_t parse_date_string ( const char * datetime)
static

Definition at line 8298 of file civetweb.c.

◆ parse_http_headers()

static int parse_http_headers ( char ** buf,
struct mg_header hdr[(64)] )
static

Definition at line 11037 of file civetweb.c.

◆ parse_http_request()

static int parse_http_request ( char * buf,
int len,
struct mg_request_info * ri )
static

Definition at line 11229 of file civetweb.c.

◆ parse_http_response()

static int parse_http_response ( char * buf,
int len,
struct mg_response_info * ri )
static

Definition at line 11315 of file civetweb.c.

◆ parse_match_net()

static int parse_match_net ( const struct vec * vec,
const union usa * sa,
int no_strict )
static

Definition at line 14288 of file civetweb.c.

◆ parse_port_string()

static int parse_port_string ( const struct vec * vec,
struct socket * so,
int * ip_version )
static

Definition at line 15839 of file civetweb.c.

◆ parse_range_header()

static int parse_range_header ( const char * header,
int64_t * a,
int64_t * b )
static

Definition at line 10480 of file civetweb.c.

◆ prepare_cgi_environment()

static int prepare_cgi_environment ( struct mg_connection * conn,
const char * prog,
struct cgi_environment * env,
int cgi_config_idx )
static

Definition at line 11668 of file civetweb.c.

◆ print_dav_dir_entry()

static int print_dav_dir_entry ( struct de * de,
void * data )
static

Definition at line 13064 of file civetweb.c.

◆ print_dir_entry()

static int print_dir_entry ( struct mg_connection * conn,
struct de * de )
static

Definition at line 9917 of file civetweb.c.

◆ print_props()

static int print_props ( struct mg_connection * conn,
const char * uri,
const char * name,
struct mg_file_stat * filep )
static

Definition at line 12979 of file civetweb.c.

◆ process_new_connection()

static void process_new_connection ( struct mg_connection * conn)
static

Definition at line 19836 of file civetweb.c.

◆ produce_socket()

static void produce_socket ( struct mg_context * ctx,
const struct socket * sp )
static

Definition at line 20155 of file civetweb.c.

◆ pull_all()

static int pull_all ( FILE * fp,
struct mg_connection * conn,
char * buf,
int len )
static

Definition at line 6660 of file civetweb.c.

◆ pull_inner()

static int pull_inner ( FILE * fp,
struct mg_connection * conn,
char * buf,
int len,
double timeout )
static

Definition at line 6346 of file civetweb.c.

◆ push_all()

static int push_all ( struct mg_context * ctx,
FILE * fp,
SOCKET sock,
SSL * ssl,
const char * buf,
int len )
static

Definition at line 6298 of file civetweb.c.

◆ push_inner()

static int push_inner ( struct mg_context * ctx,
FILE * fp,
SOCKET sock,
SSL * ssl,
const char * buf,
int len,
double timeout )
static

Definition at line 6118 of file civetweb.c.

◆ put_dir()

static int put_dir ( struct mg_connection * conn,
const char * path )
static

Definition at line 10883 of file civetweb.c.

◆ put_file()

static void put_file ( struct mg_connection * conn,
const char * path )
static

Definition at line 12477 of file civetweb.c.

◆ read_auth_file()

static int read_auth_file ( struct mg_file * filep,
struct read_auth_file_struct * workdata,
int depth )
static

Definition at line 9032 of file civetweb.c.

◆ read_message()

static int read_message ( FILE * fp,
struct mg_connection * conn,
char * buf,
int bufsiz,
int * nread )
static

Definition at line 11421 of file civetweb.c.

◆ redirect_to_https_port()

static void redirect_to_https_port ( struct mg_connection * conn,
int port )
static

Definition at line 14557 of file civetweb.c.

◆ refresh_trust()

static int refresh_trust ( struct mg_connection * conn)
static

Definition at line 16801 of file civetweb.c.

◆ release_handler_ref()

static void release_handler_ref ( struct mg_connection * conn,
struct mg_handler_info * handler_info )
static

Definition at line 15009 of file civetweb.c.

◆ remove_bad_file()

static void remove_bad_file ( const struct mg_connection * conn,
const char * path )
static

Definition at line 10920 of file civetweb.c.

◆ remove_directory()

static int remove_directory ( struct mg_connection * conn,
const char * dir )
static

Definition at line 10144 of file civetweb.c.

◆ remove_dot_segments()

static void remove_dot_segments ( char * inout)
static

Definition at line 8362 of file civetweb.c.

◆ reset_per_request_attributes()

static void reset_per_request_attributes ( struct mg_connection * conn)
static

Definition at line 18111 of file civetweb.c.

◆ scan_directory()

static int scan_directory ( struct mg_connection * conn,
const char * dir,
void * data,
int(*)(struct de *, void *) cb )
static

Definition at line 10085 of file civetweb.c.

◆ send_additional_header()

static void send_additional_header ( struct mg_connection * conn)
static

Definition at line 4196 of file civetweb.c.

◆ send_authorization_request()

static void send_authorization_request ( struct mg_connection * conn,
const char * realm )
static

Definition at line 9273 of file civetweb.c.

◆ send_cors_header()

static void send_cors_header ( struct mg_connection * conn)
static

Definition at line 4225 of file civetweb.c.

◆ send_file_data()

static void send_file_data ( struct mg_connection * conn,
struct mg_file * filep,
int64_t offset,
int64_t len,
int no_buffering )
static

Definition at line 10363 of file civetweb.c.

◆ send_no_cache_header()

static void send_no_cache_header ( struct mg_connection * conn)
static

Definition at line 4130 of file civetweb.c.

◆ send_options()

static void send_options ( struct mg_connection * conn)
static

Definition at line 12951 of file civetweb.c.

◆ send_ssi_file()

static void send_ssi_file ( struct mg_connection * conn,
const char * path,
struct mg_file * filep,
int include_level )
static

Definition at line 12801 of file civetweb.c.

◆ send_static_cache_header()

static void send_static_cache_header ( struct mg_connection * conn)
static

Definition at line 4148 of file civetweb.c.

◆ set_acl_option()

static int set_acl_option ( struct mg_context * phys_ctx)
static

Definition at line 18097 of file civetweb.c.

◆ set_blocking_mode()

static int set_blocking_mode ( SOCKET sock)
static

Definition at line 6005 of file civetweb.c.

◆ set_close_on_exec()

static void set_close_on_exec ( int fd,
const struct mg_connection * conn,
struct mg_context * ctx )
static

Definition at line 5792 of file civetweb.c.

◆ set_gpass_option()

static int set_gpass_option ( struct mg_context * phys_ctx,
struct mg_domain_context * dom_ctx )
static

Definition at line 18071 of file civetweb.c.

◆ set_non_blocking_mode()

static int set_non_blocking_mode ( SOCKET sock)
static

Definition at line 5991 of file civetweb.c.

◆ set_ports_option()

static int set_ports_option ( struct mg_context * phys_ctx)
static

Definition at line 16104 of file civetweb.c.

◆ set_tcp_nodelay()

static int set_tcp_nodelay ( const struct socket * so,
int nodelay_on )
static

Definition at line 18153 of file civetweb.c.

◆ set_throttle()

static int set_throttle ( const char * spec,
const union usa * rsa,
const char * uri )
static

Definition at line 14397 of file civetweb.c.

◆ set_uid_option()

static int set_uid_option ( struct mg_context * phys_ctx)
static

Definition at line 16660 of file civetweb.c.

◆ should_decode_query_string()

static int should_decode_query_string ( const struct mg_connection * conn)
static

Definition at line 4108 of file civetweb.c.

◆ should_decode_url()

static int should_decode_url ( const struct mg_connection * conn)
static

Definition at line 4097 of file civetweb.c.

◆ should_keep_alive()

static int should_keep_alive ( const struct mg_connection * conn)
static

Definition at line 4058 of file civetweb.c.

◆ should_switch_to_protocol()

static int should_switch_to_protocol ( const struct mg_connection * conn)
static

Definition at line 14234 of file civetweb.c.

◆ skip_quoted()

static char * skip_quoted ( char ** buf,
const char * delimiters,
const char * whitespace,
char quotechar )
static

Definition at line 3831 of file civetweb.c.

◆ skip_to_end_of_word_and_terminate()

static int skip_to_end_of_word_and_terminate ( char ** ppw,
int eol )
static

Definition at line 10991 of file civetweb.c.

◆ sockaddr_to_string()

static void sockaddr_to_string ( char * buf,
size_t len,
const union usa * usa )
static

Definition at line 3366 of file civetweb.c.

◆ spawn_process()

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,
int cgi_config_idx )
static

Definition at line 5883 of file civetweb.c.

◆ ssl_error()

static const char * ssl_error ( void )
static

Definition at line 17020 of file civetweb.c.

◆ ssl_get_client_cert_info()

static int ssl_get_client_cert_info ( const struct mg_connection * conn,
struct mg_client_cert * client_cert )
static

Definition at line 17055 of file civetweb.c.

◆ ssl_get_protocol()

static long ssl_get_protocol ( int version_id)
static

Definition at line 17452 of file civetweb.c.

◆ ssl_info_callback()

static void ssl_info_callback ( const SSL * ssl,
int what,
int ret )
static

Definition at line 17485 of file civetweb.c.

◆ ssl_locking_callback()

static void ssl_locking_callback ( int mode,
int mutex_num,
const char * file,
int line )
static

Definition at line 17132 of file civetweb.c.

◆ ssl_servername_callback()

static int ssl_servername_callback ( SSL * ssl,
int * ad,
void * arg )
static

Definition at line 17501 of file civetweb.c.

◆ ssl_use_pem_file()

static int ssl_use_pem_file ( struct mg_context * phys_ctx,
struct mg_domain_context * dom_ctx,
const char * pem,
const char * chain )
static

Definition at line 17375 of file civetweb.c.

◆ sslize()

static int sslize ( struct mg_connection * conn,
int(*)(SSL *) func,
const struct mg_client_options * client_options )
static

Definition at line 16879 of file civetweb.c.

◆ substitute_index_file()

static int substitute_index_file ( struct mg_connection * conn,
char * path,
size_t path_len,
struct mg_file_stat * filestat )
static

Definition at line 7843 of file civetweb.c.

◆ substitute_index_file_aux()

static int substitute_index_file_aux ( struct mg_connection * conn,
char * path,
size_t path_len,
struct mg_file_stat * filestat )
static

Definition at line 7795 of file civetweb.c.

◆ suggest_connection_header()

static const char * suggest_connection_header ( const struct mg_connection * conn)
static

Definition at line 4120 of file civetweb.c.

◆ switch_domain_context()

static int switch_domain_context ( struct mg_connection * conn)
static

Definition at line 14496 of file civetweb.c.

◆ tls_dtor()

static void tls_dtor ( void * key)
static

Definition at line 16714 of file civetweb.c.

◆ uninitialize_openssl()

static void uninitialize_openssl ( void )
static

Definition at line 18029 of file civetweb.c.

◆ url_decode_in_place()

static void url_decode_in_place ( char * buf)
static

Definition at line 7301 of file civetweb.c.

◆ worker_thread()

static void * worker_thread ( void * thread_func_param)
static

Definition at line 20456 of file civetweb.c.

◆ worker_thread_run()

static void worker_thread_run ( struct mg_connection * conn)
static

Definition at line 20202 of file civetweb.c.

Variable Documentation

◆ [struct]

const struct { ... } abs_uri_protocols[]
Initial value:
= {{"http://", 7, 80},
{"https://", 8, 443},
{"ws://", 5, 80},
{"wss://", 6, 443},
{NULL, 0, 0}}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.

◆ all_methods

char* all_methods = NULL
static

Definition at line 11190 of file civetweb.c.

◆ [struct]

const struct { ... } builtin_mime_types[]

◆ config_options

const struct mg_option config_options[]
static

Definition at line 2115 of file civetweb.c.

◆ cryptolib_dll_handle

void* cryptolib_dll_handle
static

Definition at line 17241 of file civetweb.c.

◆ cryptolib_users

volatile ptrdiff_t cryptolib_users
static
Initial value:
=
0

Definition at line 17250 of file civetweb.c.

◆ default_port

unsigned default_port

Definition at line 18824 of file civetweb.c.

◆ ext_len

size_t ext_len

Definition at line 8516 of file civetweb.c.

◆ extension

const char* extension

Definition at line 8515 of file civetweb.c.

◆ global_lock_mutex

pthread_mutex_t global_lock_mutex
static

Definition at line 1109 of file civetweb.c.

◆ http_methods

const struct mg_http_method_info http_methods[]
static

Definition at line 11127 of file civetweb.c.

◆ mg_init_library_called

int mg_init_library_called = 0
static

Definition at line 1589 of file civetweb.c.

◆ mime_type

const char* mime_type

Definition at line 8517 of file civetweb.c.

◆ month_names

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

Definition at line 1861 of file civetweb.c.

◆ proto

const char* proto

Definition at line 18822 of file civetweb.c.

◆ proto_len

size_t proto_len

Definition at line 18823 of file civetweb.c.

◆ pthread_mutex_attr

pthread_mutexattr_t pthread_mutex_attr
static

Definition at line 1094 of file civetweb.c.

◆ ssl_mutexes

pthread_mutex_t* ssl_mutexes
static

Definition at line 16875 of file civetweb.c.

◆ ssllib_dll_handle

void* ssllib_dll_handle
static

Definition at line 17240 of file civetweb.c.

◆ static_assert_replacement

char static_assert_replacement

Definition at line 125 of file civetweb.c.

◆ sTlsKey

pthread_key_t sTlsKey
static

Definition at line 1621 of file civetweb.c.

◆ thread_idx_max

volatile ptrdiff_t thread_idx_max = 0
static

Definition at line 1622 of file civetweb.c.