Revision 572abeb5 net_helper-ml.c
net_helper-ml.c | ||
---|---|---|
5 | 5 |
*/ |
6 | 6 |
|
7 | 7 |
#include <event2/event.h> |
8 |
#ifndef WIN32 |
|
8 | 9 |
#include <arpa/inet.h> |
10 |
#endif |
|
9 | 11 |
#include <unistd.h> |
10 | 12 |
#include <stdlib.h> |
11 | 13 |
#include <stdio.h> |
... | ... | |
358 | 360 |
const char *repo_address = "79.120.193.115:9832"; |
359 | 361 |
int publish_interval = 60; |
360 | 362 |
|
363 |
#ifndef WIN32 |
|
361 | 364 |
signal(SIGPIPE, SIG_IGN); // workaround for a known issue in libevent2 with SIGPIPE on TPC connections |
365 |
#endif |
|
362 | 366 |
base = event_base_new(); |
363 | 367 |
lookup_array = calloc(lookup_max,sizeof(struct nodeID *)); |
364 | 368 |
|
... | ... | |
622 | 626 |
const char *node_ip(const struct nodeID *s) { |
623 | 627 |
static char ip[64]; |
624 | 628 |
int len; |
625 |
char *start, *end; |
|
629 |
const char *start, *end;
|
|
626 | 630 |
const char *tmp = node_addr(s); |
627 | 631 |
start = strstr(tmp, "-") + 1; |
628 | 632 |
end = strstr(start, ":"); |
... | ... | |
633 | 637 |
return (const char *)ip; |
634 | 638 |
} |
635 | 639 |
|
636 |
|
|
637 | 640 |
// TODO: check why closing the connection is annoying for the ML |
638 | 641 |
void nodeid_free(struct nodeID *n) { |
639 | 642 |
if (n && (--(n->refcnt) == 1)) { |
Also available in: Unified diff