- if(contradicting_del_edge > 100 && contradicting_add_edge > 100) {
- logger(DEBUG_ALWAYS, LOG_WARNING, "Possible node with same Name as us! Sleeping %d seconds.", sleeptime);
- usleep(sleeptime * 1000000LL);
- sleeptime *= 2;
- if(sleeptime < 0)
- sleeptime = 3600;
- } else {
- sleeptime /= 2;
- if(sleeptime < 10)
- sleeptime = 10;
- }
-
- contradicting_add_edge = 0;
- contradicting_del_edge = 0;
-
- event_add(event, &(struct timeval){pingtimeout, 0});
-}
-
-void handle_meta_connection_data(int fd, short events, void *data) {
- connection_t *c = data;
- int result;
- socklen_t len = sizeof result;
-
- if(c->status.connecting) {
- c->status.connecting = false;
-
- getsockopt(c->socket, SOL_SOCKET, SO_ERROR, &result, &len);
-
- if(!result)
- finish_connecting(c);
- else {
- logger(DEBUG_CONNECTIONS, LOG_DEBUG,
- "Error while connecting to %s (%s): %s",
- c->name, c->hostname, sockstrerror(result));
- closesocket(c->socket);
- do_outgoing_connection(c);
- return;
- }
- }
-
- if (!receive_meta(c)) {
- terminate_connection(c, c->status.active);
- return;
- }
-}
-
-static void sigterm_handler(int signal, short events, void *data) {
- logger(DEBUG_ALWAYS, LOG_NOTICE, "Got %s signal", strsignal(signal));
- event_loopexit(NULL);