Import Upstream version 1.0.11

This commit is contained in:
Guus Sliepen 2019-08-26 13:44:38 +02:00
parent fa871d431d
commit 23bd9e9d53
28 changed files with 343 additions and 107 deletions

View file

@ -303,7 +303,7 @@ static void check_network_activity(fd_set * readset, fd_set * writeset) {
else {
ifdebug(CONNECTIONS) logger(LOG_DEBUG,
"Error while connecting to %s (%s): %s",
c->name, c->hostname, strerror(result));
c->name, c->hostname, sockstrerror(result));
closesocket(c->socket);
do_outgoing_connection(c);
continue;
@ -369,9 +369,8 @@ int main_loop(void) {
#endif
if(r < 0) {
if(errno != EINTR && errno != EAGAIN) {
logger(LOG_ERR, "Error while waiting for input: %s",
strerror(errno));
if(!sockwouldblock(sockerrno)) {
logger(LOG_ERR, "Error while waiting for input: %s", sockstrerror(sockerrno));
dump_connections();
return 1;
}
@ -431,7 +430,7 @@ int main_loop(void) {
if(sighup) {
connection_t *c;
avl_node_t *node;
avl_node_t *node, *next;
char *fname;
struct stat s;
@ -447,6 +446,31 @@ int main_loop(void) {
return 1;
}
/* Cancel non-active outgoing connections */
for(node = connection_tree->head; node; node = next) {
next = node->next;
c = node->data;
c->outgoing = NULL;
if(c->status.connecting) {
terminate_connection(c, false);
connection_del(c);
}
}
/* Wipe list of outgoing connections */
for(list_node_t *node = outgoing_list->head; node; node = node->next) {
outgoing_t *outgoing = node->data;
if(outgoing->event)
event_del(outgoing->event);
}
list_delete_list(outgoing_list);
/* Close connections to hosts that have a changed or deleted host config file */
for(node = connection_tree->head; node; node = node->next) {