|
#define | __STDC_LIMIT_MACROS |
|
#define | NO_CGI |
|
#define | NO_SSL |
|
#define | _XOPEN_SOURCE 600 |
|
#define | _LARGEFILE_SOURCE |
|
#define | __STDC_FORMAT_MACROS |
|
#define | SSL_LIB "libssl.so" |
|
#define | CRYPTO_LIB "libcrypto.so" |
|
#define | DIRSEP '/' |
|
#define | IS_DIRSEP_CHAR(c) ((c) == '/') |
|
#define | O_BINARY 0 |
|
#define | closesocket(a) close(a) |
|
#define | mg_fopen(x, y) fopen(x, y) |
|
#define | mg_mkdir(x, y) mkdir(x, y) |
|
#define | mg_remove(x) remove(x) |
|
#define | mg_rename(x, y) rename(x, y) |
|
#define | ERRNO errno |
|
#define | INVALID_SOCKET (-1) |
|
#define | INT64_FMT PRId64 |
|
#define | WINCDECL |
|
#define | MONGOOSE_VERSION "3.1" |
|
#define | PASSWORDS_FILE_NAME ".htpasswd" |
|
#define | CGI_ENVIRONMENT_SIZE 4096 |
|
#define | MAX_CGI_ENVIR_VARS 64 |
|
#define | ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) |
|
#define | DEBUG_TRACE(x) |
|
#define | SSL_ERROR_WANT_READ 2 |
|
#define | SSL_ERROR_WANT_WRITE 3 |
|
#define | SSL_FILETYPE_PEM 1 |
|
#define | CRYPTO_LOCK 1 |
|
#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 |
|
#define | SSL_CTX_use_certificate_file |
|
#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 | 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 | ENTRIES_PER_CONFIG_OPTION 3 |
|
#define | HEXTOI(x) (isdigit(x) ? x - '0' : x - 'W') |
|
#define | F1(x, y, z) (z ^ (x & (y ^ z))) |
|
#define | F2(x, y, z) F1(z, x, y) |
|
#define | F3(x, y, z) (x ^ y ^ z) |
|
#define | F4(x, y, z) (y ^ (x | ~z)) |
|
#define | MD5STEP(f, w, x, y, z, data, s) ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x ) |
|
|
const char ** | mg_get_valid_option_names (void) |
|
static void * | call_user (struct mg_connection *conn, enum mg_event event) |
|
static int | get_option_index (const char *name) |
|
const char * | mg_get_option (const struct mg_context *ctx, const char *name) |
|
static void | cry (struct mg_connection *conn, const char *fmt,...) |
|
static const char * | ssl_error (void) |
|
static struct mg_connection * | fc (struct mg_context *ctx) |
|
const char * | mg_version (void) |
|
static void | mg_strlcpy (char *dst, const char *src, size_t n) |
|
static int | lowercase (const char *s) |
|
static 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 int | mg_vsnprintf (struct mg_connection *conn, char *buf, size_t buflen, const char *fmt, va_list ap) |
|
static int | mg_snprintf (struct mg_connection *conn, char *buf, size_t buflen, const char *fmt,...) |
|
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_extension (const char *path, const char *ext_list) |
|
static int | should_keep_alive (const struct mg_connection *conn) |
|
static const char * | suggest_connection_header (const struct mg_connection *conn) |
|
static void | send_http_error (struct mg_connection *conn, int status, const char *reason, const char *fmt,...) |
|
static int | mg_stat (const char *path, struct mgstat *stp) |
|
static void | set_close_on_exec (int fd) |
|
static int | start_thread (struct mg_context *ctx, mg_thread_func_t func, void *param) |
|
static int | set_non_blocking_mode (SOCKET sock) |
|
static int64_t | push (FILE *fp, SOCKET sock, SSL *ssl, const char *buf, int64_t len) |
|
static int | pull (FILE *fp, SOCKET sock, SSL *ssl, char *buf, int len) |
|
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) |
|
int | mg_printf (struct mg_connection *conn, const char *fmt,...) |
|
static size_t | url_decode (const char *src, size_t src_len, char *dst, size_t dst_len, int is_form_url_encoded) |
|
int | mg_get_var (const char *buf, size_t buf_len, const char *name, char *dst, size_t dst_len) |
|
int | mg_get_cookie (const struct mg_connection *conn, const char *cookie_name, char *dst, size_t dst_size) |
|
static int | get_document_root (const struct mg_connection *conn, struct vec *document_root) |
|
static void | convert_uri_to_file_name (struct mg_connection *conn, const char *uri, char *buf, size_t buf_len) |
|
static int | sslize (struct mg_connection *conn, int(*func)(SSL *)) |
|
static struct mg_connection * | mg_connect (struct mg_connection *conn, const char *host, int port, int use_ssl) |
|
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) |
|
static void | get_mime_type (struct mg_context *ctx, const char *path, struct vec *vec) |
|
static void | byteReverse (unsigned char *buf, unsigned longs) |
|
static void | MD5Init (MD5_CTX *ctx) |
|
static void | MD5Transform (uint32_t buf[4], uint32_t const in[16]) |
|
static void | MD5Update (MD5_CTX *ctx, unsigned char const *buf, unsigned len) |
|
static void | MD5Final (unsigned char digest[16], MD5_CTX *ctx) |
|
static void | bin2str (char *to, const unsigned char *p, size_t len) |
|
void | mg_md5 (char *buf,...) |
|
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 FILE * | open_auth_file (struct mg_connection *conn, const char *path) |
|
static int | parse_auth_header (struct mg_connection *conn, char *buf, size_t buf_size, struct ah *ah) |
|
static int | authorize (struct mg_connection *conn, FILE *fp) |
|
static int | check_authorization (struct mg_connection *conn, const char *path) |
|
static void | send_authorization_request (struct mg_connection *conn) |
|
static int | is_authorized_for_put (struct mg_connection *conn) |
|
int | mg_modify_passwords_file (const char *fname, const char *domain, const char *user, const char *pass) |
|
static void | 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 | scan_directory (struct mg_connection *conn, const char *dir, void *data, void(*cb)(struct de *, void *)) |
|
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, FILE *fp, int64_t len) |
|
static int | parse_range_header (const char *header, int64_t *a, int64_t *b) |
|
static void | gmt_time_string (char *buf, size_t buf_len, time_t *t) |
|
static void | handle_file_request (struct mg_connection *conn, const char *path, struct mgstat *stp) |
|
void | mg_send_file (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_request (char *buf, struct mg_request_info *ri) |
|
static int | read_request (FILE *fp, SOCKET sock, SSL *ssl, char *buf, int bufsiz, int *nread) |
|
static int | substitute_index_file (struct mg_connection *conn, char *path, size_t path_len, struct mgstat *stp) |
|
static int | is_not_modified (const struct mg_connection *conn, const struct mgstat *stp) |
|
static int | forward_body_data (struct mg_connection *conn, FILE *fp, SOCKET sock, SSL *ssl) |
|
static int | put_dir (const char *path) |
|
static void | put_file (struct mg_connection *conn, const char *path) |
|
static void | send_ssi_file (struct mg_connection *, const char *, FILE *, int) |
|
static void | do_ssi_include (struct mg_connection *conn, const char *ssi, char *tag, int include_level) |
|
static void | do_ssi_exec (struct mg_connection *conn, char *tag) |
|
static void | handle_ssi_file_request (struct mg_connection *conn, const char *path) |
|
static void | send_options (struct mg_connection *conn) |
|
static void | print_props (struct mg_connection *conn, const char *uri, struct mgstat *st) |
|
static void | print_dav_dir_entry (struct de *de, void *data) |
|
static void | handle_propfind (struct mg_connection *conn, const char *path, struct mgstat *st) |
|
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 void | log_header (const struct mg_connection *conn, const char *header, FILE *fp) |
|
static void | log_access (const struct mg_connection *conn) |
|
static int | isbyte (int n) |
|
static int | check_acl (struct mg_context *ctx, const struct usa *usa) |
|
static void | add_to_set (SOCKET fd, fd_set *set, int *max_fd) |
|
static int | set_uid_option (struct mg_context *ctx) |
|
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 void | close_socket_gracefully (SOCKET sock) |
|
static void | close_connection (struct mg_connection *conn) |
|
static void | discard_current_request_from_buffer (struct mg_connection *conn) |
|
static int | parse_url (const char *url, char *host, int *port) |
|
static void | handle_proxy_request (struct mg_connection *conn) |
|
static int | is_valid_uri (const char *uri) |
|
static void | process_new_connection (struct mg_connection *conn) |
|
static int | consume_socket (struct mg_context *ctx, struct socket *sp) |
|
static void | worker_thread (struct mg_context *ctx) |
|
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 (struct mg_context *ctx) |
|
static void | free_context (struct mg_context *ctx) |
|
void | mg_stop (struct mg_context *ctx) |
|
struct mg_context * | mg_start (mg_callback_t user_callback, void *user_data, const char **options) |
|