Refactor outgoing connection handling.

Struct outgoing_ts and connection_ts were depending too much on each other,
causing lots of problems, especially the reuse of a connection_t. Now, whenever
a connection is closed it is immediately removed from the list of connections
and destroyed.
This commit is contained in:
Guus Sliepen 2012-10-07 21:02:40 +02:00
parent d93a37928b
commit ce059e36fd
8 changed files with 116 additions and 171 deletions

View file

@ -212,9 +212,8 @@ bool id_h(connection_t *c, const char *request) {
if(!c->config_tree) {
init_configuration(&c->config_tree);
if(!read_connection_config(c)) {
logger(DEBUG_ALWAYS, LOG_ERR, "Peer %s had unknown identity (%s)", c->hostname,
c->name);
if(!read_host_config(c->config_tree, c->name)) {
logger(DEBUG_ALWAYS, LOG_ERR, "Peer %s had unknown identity (%s)", c->hostname, c->name);
return false;
}