33 #include <gnutls/gnutls.h>
34 #if GNUTLS_VERSION_MAJOR >= 3
35 #include <gnutls/abstract.h>
39 #include <sys/epoll.h>
47 #define EXTRA_CHECKS MHD_NO
49 #define MHD_MAX(a,b) ((a)<(b)) ? (b) : (a)
50 #define MHD_MIN(a,b) ((a)<(b)) ? (a) : (b)
60 #define MHD_BUF_INC_SIZE 1024
79 #define MHD_PANIC(msg) mhd_panic (mhd_panic_cls, __FILE__, __LINE__, msg)
86 #define MHD_PANIC(msg) mhd_panic (mhd_panic_cls, __FILE__, __LINE__, NULL)
164 #define MAX_NONCE_LENGTH 129
178 unsigned long int nc;
194 const char *format, ...);
469 #define DEBUG_STATES MHD_NO
488 void *write_to,
size_t max_bytes);
500 const void *write_to,
size_t max_bytes);
822 gnutls_session_t tls_session;
860 typedef void * (*LogCallback)(
void * cls,
1024 void (*custom_error_log) (
void *cls,
const char *fmt, va_list va);
1029 void *custom_error_log_cls;
1097 int listen_socket_in_epoll;
1149 gnutls_priority_t priority_cache;
1155 gnutls_credentials_type_t cred_type;
1160 gnutls_certificate_credentials_t x509_cred;
1165 gnutls_dh_params_t dh_params;
1167 #if GNUTLS_VERSION_MAJOR >= 3
1172 gnutls_certificate_retrieve_function2 *cert_callback;
1178 const char *https_mem_key;
1183 const char *https_mem_cert;
1188 const char *https_mem_trust;
1196 unsigned int num_tls_read_ready;
1200 #ifdef DAUTH_SUPPORT
1205 const char *digest_auth_random;
1215 pthread_mutex_t nnc_lock;
1220 unsigned int digest_auth_rand_size;
1225 unsigned int nonce_nc_size;
1233 #define EXTRA_CHECK(a) if (!(a)) abort();
1235 #define EXTRA_CHECK(a)
1247 #define DLL_insert(head,tail,element) do { \
1248 (element)->next = (head); \
1249 (element)->prev = NULL; \
1250 if ((tail) == NULL) \
1253 (head)->prev = element; \
1254 (head) = (element); } while (0)
1266 #define DLL_remove(head,tail,element) do { \
1267 if ((element)->prev == NULL) \
1268 (head) = (element)->next; \
1270 (element)->prev->next = (element)->next; \
1271 if ((element)->next == NULL) \
1272 (tail) = (element)->prev; \
1274 (element)->next->prev = (element)->prev; \
1275 (element)->next = NULL; \
1276 (element)->prev = NULL; } while (0)
1288 #define XDLL_insert(head,tail,element) do { \
1289 (element)->nextX = (head); \
1290 (element)->prevX = NULL; \
1291 if ((tail) == NULL) \
1294 (head)->prevX = element; \
1295 (head) = (element); } while (0)
1307 #define XDLL_remove(head,tail,element) do { \
1308 if ((element)->prevX == NULL) \
1309 (head) = (element)->nextX; \
1311 (element)->prevX->nextX = (element)->nextX; \
1312 if ((element)->nextX == NULL) \
1313 (tail) = (element)->prevX; \
1315 (element)->nextX->prevX = (element)->prevX; \
1316 (element)->nextX = NULL; \
1317 (element)->prevX = NULL; } while (0)
1328 #define EDLL_insert(head,tail,element) do { \
1329 (element)->nextE = (head); \
1330 (element)->prevE = NULL; \
1331 if ((tail) == NULL) \
1334 (head)->prevE = element; \
1335 (head) = (element); } while (0)
1347 #define EDLL_remove(head,tail,element) do { \
1348 if ((element)->prevE == NULL) \
1349 (head) = (element)->nextE; \
1351 (element)->prevE->nextE = (element)->nextE; \
1352 if ((element)->nextE == NULL) \
1353 (tail) = (element)->prevE; \
1355 (element)->nextE->prevE = (element)->prevE; \
1356 (element)->nextE = NULL; \
1357 (element)->prevE = NULL; } while (0)
unsigned int per_ip_connection_limit
void * unescape_callback_cls
pthread_mutex_t per_ip_connection_mutex
ssize_t(* TransmitCallback)(struct MHD_Connection *conn, const void *write_to, size_t max_bytes)
pthread_mutex_t cleanup_connection_mutex
int(* write_handler)(struct MHD_Connection *connection)
enum MHD_CONNECTION_STATE state
int(* idle_handler)(struct MHD_Connection *connection)
uint64_t response_write_position
public interface to libmicrohttpd
enum MHD_ConnectionEventLoopInfo event_loop_info
MHD_ContentReaderFreeCallback crfc
void(* MHD_ContentReaderFreeCallback)(void *cls)
struct MHD_Response * response
void(* MHD_RequestCompletedCallback)(void *cls, struct MHD_Connection *connection, void **con_cls, enum MHD_RequestTerminationCode toe)
struct MHD_Connection * normal_timeout_tail
void *(* LogCallback)(void *cls, const char *uri, struct MHD_Connection *con)
struct MHD_HTTP_Header * first_header
MHD_AccessHandlerCallback default_handler
uint64_t remaining_upload_size
unsigned int responseCode
void * uri_log_callback_cls
unsigned int current_chunk_offset
int(* read_handler)(struct MHD_Connection *connection)
struct MHD_Daemon * daemon
struct MHD_Connection * manual_timeout_head
struct MHD_Connection * cleanup_head
struct MHD_Connection * cleanup_tail
struct MHD_Connection * prev
size_t write_buffer_send_offset
struct MHD_Daemon * worker_pool
struct MHD_Connection * nextX
struct MHD_Connection * manual_timeout_tail
size_t continue_message_write_offset
char nonce[MAX_NONCE_LENGTH]
unsigned int worker_pool_size
time_t MHD_monotonic_time(void)
LogCallback uri_log_callback
unsigned int reference_count
int(* MHD_AcceptPolicyCallback)(void *cls, const struct sockaddr *addr, socklen_t addrlen)
ssize_t(* MHD_ContentReaderCallback)(void *cls, uint64_t pos, char *buf, size_t max)
size_t(* UnescapeCallback)(void *cls, struct MHD_Connection *conn, char *uri)
ssize_t(* ReceiveCallback)(struct MHD_Connection *conn, void *write_to, size_t max_bytes)
struct MHD_Connection * normal_timeout_head
UnescapeCallback unescape_callback
struct MHD_Connection * connections_head
struct MHD_Daemon * master
struct MHD_Connection * next
MHD_AcceptPolicyCallback apc
unsigned int connection_timeout
size_t MHD_http_unescape(void *cls, struct MHD_Connection *connection, char *val)
size_t write_buffer_append_offset
unsigned int current_chunk_size
MHD_RequestCompletedCallback notify_completed
struct MHD_Connection * prevX
void * notify_completed_cls
TransmitCallback send_cls
MHD_ContentReaderCallback crc
struct MHD_Connection * suspended_connections_tail
MHD_PanicCallback mhd_panic
MHD_ConnectionEventLoopInfo
void * per_ip_connection_count
int(* MHD_AccessHandlerCallback)(void *cls, struct MHD_Connection *connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls)
size_t read_buffer_offset
void * default_handler_cls
unsigned int connection_timeout
struct MHD_HTTP_Header * headers_received
struct MHD_Connection * connections_tail
struct MHD_HTTP_Header * headers_received_tail
unsigned int max_connections
struct MHD_Connection * suspended_connections_head
void(* MHD_PanicCallback)(void *cls, const char *file, unsigned int line, const char *reason)