Use a global list to track outgoing connections.
Previously an outgoing_t was maintained for each outgoing connection, but the pointer to it was either stored in a connection_t or in an event_t. This made it very hard to keep track of and to clean up. Now a list is created when tinc starts and reads all the ConnectTo variables, and which is recreated when tinc receives a HUP signal.
This commit is contained in:
parent
a7e793c94e
commit
503c32eb0e
6 changed files with 36 additions and 24 deletions
|
|
@ -103,6 +103,7 @@ typedef struct listen_socket_t {
|
|||
} listen_socket_t;
|
||||
|
||||
#include "conf.h"
|
||||
#include "list.h"
|
||||
|
||||
typedef struct outgoing_t {
|
||||
char *name;
|
||||
|
|
@ -112,6 +113,8 @@ typedef struct outgoing_t {
|
|||
struct addrinfo *aip;
|
||||
} outgoing_t;
|
||||
|
||||
extern list_t *outgoing_list;
|
||||
|
||||
extern int maxoutbufsize;
|
||||
extern int seconds_till_retry;
|
||||
extern int addressfamily;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue