139 struct MHD_IPCount *key)
153 sizeof(
addr4->sin_addr));
166 sizeof(
addr6->sin6_addr));
192 struct MHD_IPCount *key;
202 if (
NULL == (key = malloc (
sizeof(*key))))
224 _ (
"Failed to add IP connection count node.\n"));
234 key = (
struct MHD_IPCount *) node;
282 MHD_PANIC (
_ (
"Failed to find previously-added IP address.\n"));
288 MHD_PANIC (
_ (
"Previously-added IP address had counter of zero.\n"));
static struct MHD_Daemon * get_master(struct MHD_Daemon *daemon)
static void MHD_ip_count_unlock(struct MHD_Daemon *daemon)
static int MHD_ip_addr_compare(const void *a1, const void *a2)
static int MHD_ip_addr_to_key(const struct sockaddr *addr, socklen_t addrlen, struct MHD_IPCount *key)
static void MHD_ip_count_lock(struct MHD_Daemon *daemon)
int MHD_ip_limit_add(struct MHD_Daemon *daemon, const struct sockaddr *addr, socklen_t addrlen)
void MHD_ip_limit_del(struct MHD_Daemon *daemon, const struct sockaddr *addr, socklen_t addrlen)
counting of connections per IP
#define MHD_mutex_unlock_chk_(pmutex)
#define MHD_mutex_lock_chk_(pmutex)
void * tfind(const void *vkey, void *const *vrootp, int(*compar)(const void *, const void *))
void * tdelete(const void *__restrict vkey, void **__restrict vrootp, int(*compar)(const void *, const void *))
void * tsearch(const void *vkey, void **vrootp, int(*compar)(const void *, const void *))
MHD internal shared structures.
MHD_mutex_ per_ip_connection_mutex
void * per_ip_connection_count
unsigned int ip_connection_limit
struct MHD_Daemon * master