+RETSIGTYPE
+sigalrm_handler(int a)
+{
+ config_t const *cfg;
+cp
+ cfg = get_config_val(upstreamip);
+
+ if(!setup_outgoing_connection(cfg->data.ip->ip))
+ {
+ signal(SIGALRM, SIG_IGN);
+ }
+ else
+ {
+ signal(SIGALRM, sigalrm_handler);
+ seconds_till_retry += 5;
+ if(seconds_till_retry>300) /* Don't wait more than 5 minutes. */
+ seconds_till_retry = 300;
+ alarm(seconds_till_retry);
+ syslog(LOG_ERR, _("Still failed to connect to other. Will retry in %d seconds."),
+ seconds_till_retry);
+ }
+cp
+}
+