blob: f195f040fc6fa3f0861adc1f5432eca1a710f0e1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
/* This file is part of Ping903
Copyright (C) 2020 Sergey Poznyakoff
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
*/
#include <tcpd.h>
#include <microhttpd.h>
#include "defs.h"
int
p903_httpd_acl(void *cls, const struct sockaddr *addr, socklen_t addrlen)
{
struct request_info req;
request_init(&req,
RQ_DAEMON, progname,
RQ_CLIENT_SIN, addr,
RQ_SERVER_SIN, cls,
NULL);
sock_methods(&req);
return hosts_access(&req) ? MHD_YES : MHD_NO;
}
|