Refactor of SLPD - moved most of the SLPD related code into slpd.{c,h}

This commit is contained in:
thorkill 2016-05-25 18:23:42 +02:00
parent 299b223bba
commit 11b8eb81b9
6 changed files with 239 additions and 177 deletions

View file

@ -33,6 +33,7 @@
#include "net.h"
#include "netutl.h"
#include "protocol.h"
#include "slpd.h"
#include "subnet.h"
#include "xalloc.h"
@ -250,7 +251,6 @@ static void periodic_handler(void *data) {
nc++;
}
if(nc < 3) {
/* Not enough active connections, try to add one.
Choose a random node, if we don't have a connection to it,
@ -344,6 +344,9 @@ static void periodic_handler(void *data) {
}
}
// call SLPD periodic handler
periodic_slpd_handler();
end:
timeout_set(data, &(struct timeval){5, rand() % 100000});
}