bool debug = false;
pthread_key_t worker_id;
+static struct ps *ps_list = NULL;
+
+void ps_register(struct ps *ps)
+{
+ ps->next = ps_list;
+ ps_list = ps;
+}
static void
check_ipv4_reputation(struct worker *w, struct in_addr *ipv4)
struct sockaddr_in client;
int *info = (int *)data;
int csock, lsock = info[0];
+ struct ps *ps;
signal(SIGPIPE, SIG_IGN);
pthread_setspecific(worker_id, &info[1]);
+ /* Init registered processors */
+ for (ps = ps_list; ps != NULL; ps = ps->next)
+ ps->init_worker(&w);
+
while (1) {
socklen_t sz = sizeof(client);
union spoe_value u; /* spoe data value */
};
+struct spoe_kv {
+ struct chunk name;
+ struct spoe_data value;
+};
+
+struct ps {
+ struct ps *next;
+ char *ext;
+ int (*init_worker)(struct worker *w);
+};
+
extern bool debug;
extern pthread_key_t worker_id;
+void ps_register(struct ps *ps);
+
#define LOG(fmt, args...) \
do { \
struct timeval now; \