projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use splay trees instead of AVL trees.
[tinc]
/
src
/
net.c
diff --git
a/src/net.c
b/src/net.c
index
33d90da
..
469f10f
100644
(file)
--- a/
src/net.c
+++ b/
src/net.c
@@
-25,7
+25,7
@@
#include <openssl/rand.h>
#include "utils.h"
#include <openssl/rand.h>
#include "utils.h"
-#include "
avl
_tree.h"
+#include "
splay
_tree.h"
#include "conf.h"
#include "connection.h"
#include "device.h"
#include "conf.h"
#include "connection.h"
#include "device.h"
@@
-42,7
+42,7
@@
/* Purge edges and subnets of unreachable nodes. Use carefully. */
static void purge(void) {
/* Purge edges and subnets of unreachable nodes. Use carefully. */
static void purge(void) {
-
avl
_node_t *nnode, *nnext, *enode, *enext, *snode, *snext;
+
splay
_node_t *nnode, *nnext, *enode, *enext, *snode, *snext;
node_t *n;
edge_t *e;
subnet_t *s;
node_t *n;
edge_t *e;
subnet_t *s;
@@
-105,7
+105,7
@@
static void purge(void) {
While we're at it, purge stuf that needs to be removed.
*/
static int build_fdset(void) {
While we're at it, purge stuf that needs to be removed.
*/
static int build_fdset(void) {
-
avl
_node_t *node, *next;
+
splay
_node_t *node, *next;
connection_t *c;
int i, max = 0;
connection_t *c;
int i, max = 0;
@@
-198,7
+198,7
@@
void terminate_connection(connection_t *c, bool report) {
and close the connection.
*/
static void timeout_handler(int fd, short events, void *event) {
and close the connection.
*/
static void timeout_handler(int fd, short events, void *event) {
-
avl
_node_t *node, *next;
+
splay
_node_t *node, *next;
connection_t *c;
time_t now = time(NULL);
connection_t *c;
time_t now = time(NULL);
@@
-315,7
+315,7
@@
static void sigwinch_handler(int signal, short events, void *data) {
static void sighup_handler(int signal, short events, void *data) {
connection_t *c;
static void sighup_handler(int signal, short events, void *data) {
connection_t *c;
-
avl
_node_t *node;
+
splay
_node_t *node;
char *fname;
struct stat s;
static time_t last_config_check = 0;
char *fname;
struct stat s;
static time_t last_config_check = 0;
@@
-363,7
+363,7
@@
static void sigalrm_handler(int signal, short events, void *data) {
logger(LOG_NOTICE, _("Got %s signal"), strsignal(signal));
connection_t *c;
logger(LOG_NOTICE, _("Got %s signal"), strsignal(signal));
connection_t *c;
-
avl
_node_t *node;
+
splay
_node_t *node;
for(node = connection_tree->head; node; node = node->next) {
c = node->data;
for(node = connection_tree->head; node; node = node->next) {
c = node->data;