GNU libmicrohttpd 0.9.77
Loading...
Searching...
No Matches
daemon_ip_limit.h File Reference

counting of connections per IP More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int MHD_ip_limit_add (struct MHD_Daemon *daemon, const struct sockaddr *addr, socklen_t addrlen) MHD_NONNULL(1
 
int void MHD_ip_limit_del (struct MHD_Daemon *daemon, const struct sockaddr *addr, socklen_t addrlen) MHD_NONNULL(1
 

Detailed Description

counting of connections per IP

Author
Christian Grothoff

Definition in file daemon_ip_limit.h.

Function Documentation

◆ MHD_ip_limit_add()

int MHD_ip_limit_add ( struct MHD_Daemon daemon,
const struct sockaddr *  addr,
socklen_t  addrlen 
)

Check if IP address is over its limit in terms of the number of allowed concurrent connections. If the IP is still allowed, increments the connection counter.

Parameters
daemonhandle to daemon where connection counts are tracked
addraddress to add (or increment counter)
addrlennumber of bytes in addr
Returns
Return MHD_YES if IP below limit, MHD_NO if IP has surpassed limit. Also returns MHD_NO if fails to allocate memory.

◆ MHD_ip_limit_del()

int void MHD_ip_limit_del ( struct MHD_Daemon daemon,
const struct sockaddr *  addr,
socklen_t  addrlen 
)

Decrement connection count for IP address, removing from table count reaches 0.

Parameters
daemonhandle to daemon where connection counts are tracked
addraddress to remove (or decrement counter)
addrlennumber of bytes in addr